Timing operation control method and device, storage medium and electronic equipment

By registering multiple timer entities in the timer database and building a timer structure, the problem of excessive timer resource occupation is solved, and efficient timer management is achieved.

CN119166300APending Publication Date: 2024-12-20INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411194806.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

In the prior art, timers occupy too much resources and cannot be effectively managed, especially on devices that need to meet multiple timing functions at the same time.

Method used

By registering multiple timer entities in the timer database and building a timer structure using the target timer entity and timer requirement information, you only need to set up one timer entity to generate the corresponding timer structure for control The timing operation of the target object.

Benefits of technology

Save timer resources, realize the effect of efficient timer management, and avoid the unified management complexity of multiple timers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166300A_ABST
    Figure CN119166300A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a timing operation control method and device, a storage medium and electronic equipment, and the method comprises the steps: receiving a timer request sent by a target object, the timer request comprises timer demand information of the target object, and the target object is any one of a plurality of objects; the timer request is responded, a timer database is searched for a target timer entity matched with the target object, and the target timer entity comprises a plurality of logic control services; the target timer entity and the timer demand information are utilized to construct a timer structure body, and the timer structure body comprises control parameters of the logic control service; and controlling a timing operation on the target object by using the timer structure. Through the timer management method and device, the problem that the timer occupies too many resources and cannot be effectively managed in the related technology is solved, and the effects of saving the timer resources and realizing efficient timer management are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a method and device for controlling timed operations, a storage medium, and an electronic device. Background Art

[0002] At present, many hardware states require regular detection by software and acquisition of corresponding operation data, such as regular acquisition of chassis temperature, voltage, positioning light, warning light, firmware version information (Field Replaceable Unit, referred to as FRU), etc. When these states change, corresponding tasks and events need to be triggered. For example, the storage device positioning light needs to be automatically extinguished after a certain period of time, and the sensor regularly monitors the temperature of the chassis FRU. When the temperature exceeds the specified threshold, the corresponding data needs to be checked again after a certain period of time to decide whether to report an alarm to achieve an anti-shake effect.

[0003] Due to the diversity and complexity of scenarios, the timing monitoring of equipment requires a large number of timers, and the use of timers for various task events is also different. In the related technology, each timer needs to be enabled separately. For a device that needs to meet multiple timing functions at the same time and runs continuously, the number of timers required and the system resources occupied are very large. Moreover, since the usage method of each timer is different, with the expansion of modules and services, the maintenance of the corresponding timers will be very complicated. As a result, there is a problem that timers occupy too many resources and cannot be effectively managed. Summary of the invention

[0004] The embodiments of the present application provide a control method and device for timed operations, a storage medium, and an electronic device to at least solve the problem in the related art that the timer occupies too many resources and cannot be effectively managed.

[0005] According to one embodiment of the present application, a method for controlling timing operations is provided, which is applied to a timer control device, wherein the timer control device is connected to a timer database, the timer database includes multiple timer entities registered by multiple objects, the timer entity includes the control logic of the timer, and the method includes: receiving a timer request sent by a target object, wherein the timer request includes timer requirement information of the target object, and the target object is any one of the multiple objects; in response to the timer request, searching the timer database for a target timer entity that matches the target object, wherein the target timer entity includes multiple logical control services; constructing a timer structure using the target timer entity and the timer requirement information, wherein the timer structure includes control parameters of the logical control service; and controlling the timing operation on the target object using the timer structure.

[0006] In an exemplary embodiment, the plurality of logic control services include: a timer start service, a timer timing service, a timer determination service, a timer event service, and a timer end service.

[0007] In an exemplary embodiment, a timer structure is constructed using the target timer entity and the timer requirement information, including: sending the timer requirement information to the timer start service, wherein the timer requirement information includes: timer start duration, timer type, and timer triggered event; defining an initial timer structure through the timer start service, wherein the initial timer structure includes timer requirement parameters; defining a target function through the timer start service, and initializing an instance of the initial timer structure using the target function; and obtaining the timer structure by setting the parameter values ​​of the timer requirement parameters through the timer start service according to the timer requirement information.

[0008] In an exemplary embodiment, the timer control device also includes a status service, which is connected to the timer judgment service and uses the timer structure to control the timing operation on the target object, including: triggering the operation of the timer structure; polling the timer structure according to a preset time period through the status service to obtain the operation status information of the timer structure; in the process of polling the timer structure, starting the timer judgment service, and obtaining the parameter value of the timer type in the timer structure from the operation status information through the timer judgment service; when it is determined from the parameter value of the timer type that the type of the timer structure matches the target object through the timer judgment service, obtaining the the startup parameters in the timer structure; when the timer judgment service determines from the startup parameters that the timer structure is currently in the started state, triggering the start of the timer timing service, and obtaining the value of the polling period of the timer structure through the timer timing service; judging whether the timing time of the timer structure has arrived through the timer judgment service and based on the value of the polling period; when the timer judgment service determines that the timing time of the timer structure has arrived, triggering the start of the timer event service, and calling the function pointer of the timer entity through the timer event service to trigger the target event of the target object through the function pointer, wherein the timing operation includes triggering the target event.

[0009] In an exemplary embodiment, when the timer judgment service determines that the timing time of the timer structure has arrived, the timer event service is triggered to start, and the function pointer of the timer entity is called through the timer event service to trigger the target event of the target object through the function pointer. The method also includes: obtaining event data generated by triggering the target event; sending the event data to the target object control device of the target object to adjust the operation of the target object through the target object control device.

[0010] In an exemplary embodiment, after using the timer structure to control the timing operation on the target object, the method also includes one of the following: adjusting the control parameters in the timer structure through the timer end service, and continuing to use the adjusted control parameters to control the timer structure to perform the timing operation on the target object; deleting the timer structure through the timer end service.

[0011] In an exemplary embodiment, before receiving a timer request sent by the target object, the method also includes: receiving a registration request sent by the target object control device of the target object through the timer start service, wherein the registration request includes the object type of the target object; responding to the registration request, constructing the target timer entity, and registering the target timer entity in the timer database.

[0012] According to another embodiment of the present application, a control device for timing operations is provided, which is applied to a timer control device, wherein the timer control device is connected to a timer database, wherein the timer database includes multiple timer entities registered by multiple objects, and the timer entity includes the control logic of the timer. The device includes: a first receiving module, which is used to receive a timer request sent by a target object, wherein the timer request includes the timer requirement information of the target object, and the target object is any one of the multiple objects; a first responding module, which is used to respond to the timer request and search the timer database for a target timer entity that matches the target object, wherein the target timer entity includes multiple logical control services; a first building module, which is used to build a timer structure using the target timer entity and the timer requirement information, wherein the timer structure includes the control parameters of the logical control service; and a first control module, which is used to control the timing operation on the target object using the timer structure.

[0013] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0014] According to another embodiment of the present application, 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 of the above method embodiments when run.

[0015] According to another embodiment of the present application, an electronic device 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.

[0016] Through the present application, since the timer device can search for a target timer entity that matches the target object from a timer database based on a timer request of the target object, and construct a timer structure using the target timer entity and timer requirement information, wherein the timer structure includes control parameters of the logic control service. It is only necessary to set up a timer entity to generate a corresponding timer structure according to different timer requirements, so that the timer structure can be used to control the timing operation of the target object, and there is no need to set up multiple timers in the target object, nor is there a need to uniformly manage multiple timers. Thus, timer resources are saved. Therefore, the problem that timers occupy too many resources and cannot be effectively managed in the related art can be solved, so as to save timer resources and achieve the effect of efficiently managing timers. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a hardware structure block diagram of a server device of a method for controlling a timed operation according to an embodiment of the present application;

[0018] Figure 2 is a flow chart of a control method for timing operation according to an embodiment of the present application;

[0019] Figure 3 is a structural block diagram of multiple logical control services according to an embodiment of the present application;

[0020] Figure 4 is a schematic diagram of an implementation of a device for monitoring chassis status according to an embodiment of the present application;

[0021] Figure 5 is a schematic diagram of a timer structure according to an embodiment of the present application;

[0022] Figure 6 is a flowchart of an execution timer structure according to an embodiment of the present application;

[0023] Figure 7 is a structural block diagram of a control device for timing operation according to an embodiment of the present application. DETAILED DESCRIPTION

[0024] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

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

[0026] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 11 is a hardware structure block diagram of a server device of a method for controlling a timed operation according to an embodiment of the present application. Figure 1 As shown, the server device 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 server device 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 above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0027] 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 control method of the timing operation in the embodiment of the present application. 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 examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the server device 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.

[0028] 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 server device. 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.

[0029] In this embodiment, a control method for timing operation is provided, which is applied to a timer control device, wherein the timer control device is connected to a timer database, wherein the timer database includes a plurality of timer entities registered by a plurality of objects, wherein the timer entity includes a control logic of the timer. Figure 2 is a flow chart of a control method for timing operation according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0030] Step S202, receiving a timer request sent by a target object, wherein the timer request includes timer requirement information of the target object, and the target object is any object among multiple objects;

[0031] Optionally, this embodiment includes but is not limited to being applied to scenarios where a scheduled task needs to be triggered. The target object includes but is not limited to a hardware device or a software application. That is, the object that needs to execute a scheduled task. For example, in a scenario where it is necessary to obtain the temperature, voltage, positioning light, warning light, and FRU firmware version information of the chassis on a regular basis, the corresponding tasks and events need to be triggered when these states change. For example, the storage device positioning light needs to automatically turn off after being lit for a certain period of time, and the sensor regularly monitors the temperature of the chassis FRU. When it is found that the temperature exceeds the specified threshold, it is necessary to check the corresponding data again after a certain period of time to decide whether to report an alarm to achieve an anti-shake effect, etc. These scenarios all involve regular monitoring of the chassis status.

[0032] Optionally, the timing requirement information sent by the target object (e.g., a software module or a hardware device) includes, but is not limited to, the following information: timing duration, which is the length of time the timer needs to wait, usually expressed in units such as milliseconds, seconds, minutes, etc. Time type, which can be a one-time timing (i.e., triggered only once) or a periodic timing (e.g., triggered every second, every minute, etc., continuously). Trigger event / action, which is the specific operation to be performed when the timer expires, such as sending a signal, executing a function, changing the state, etc. Priority, in a multi-tasking environment, it may be necessary to set the priority of the timer to determine which task is executed first when multiple timers expire at the same time. Identifier / ID, which is used to uniquely identify this timer for easy management and cancellation of the timer. Parameters, in some cases, the event triggered by the timer may require some parameters, which are also specified in the timing requirement information. Cancellation condition, which specifies under what conditions the timer should be canceled, such as a certain state being reached or an event occurring. Error handling, which is how to handle errors that may occur during the timer setting or execution process, such as a retry mechanism, recording an error log, etc. Synchronous / asynchronous, which specifies whether the execution of the timer is synchronous or asynchronous. Asynchronous timers are usually used without blocking the main program flow. Callback function / handler specifies the function or handler to be called when the timer expires. These timer requirement information ensures that the timer structure can be set and executed accurately as required, and also facilitates the management and monitoring of the timer structure. In actual applications, the specific information may vary depending on the application requirements and context.

[0033] Step S204, in response to the timer request, searching a target timer entity matching the target object from a timer database, wherein the target timer entity includes a plurality of logical control services;

[0034] Optionally, the timer database stores timer entities, which include all necessary information to describe and control the timer. Figure 3 As shown, the multiple logic control services included in the controller entity in this embodiment are: timer start service, timer timing service, timer judgment service, timer event service, and timer end service.

[0035] Among them, the timer start service provides a unified interface for starting the timer. The parameters that can be passed to the interface include: the timing duration required by the functional module, the chassis serial number, the data to be recorded (if it is necessary to compare whether the data has changed after a period of time), and the timer type (different timers are distinguished according to different functions or tasks). After calling the interface, the corresponding flag bit of the timer status is set, including: whether the timer is started and whether the specified time has arrived.

[0036] The timer timing service is implemented based on a state machine with a short patrol cycle. If the cycle of the state machine is set to 10 seconds, the system will patrol all types of timers in units of chassis every 10 seconds. If a timer has been started, the timing will be based on the timing duration set when the timer is started, and the corresponding timing will be performed each time it is patrolled. By observing the remaining time of the timer, it is determined whether the timer timing time has ended and whether the timer needs to be cleared; if the timing time is up, the corresponding event logic is triggered and the timer status flag is modified to release the timer.

[0037] The judgment logic service provides two interfaces based on the timer status flag to determine whether the timer has been started and whether the current time has not reached the time set by the timer.

[0038] Event logic service registers the corresponding callback function for each timer through the structure and function pointer to trigger the corresponding event when the timing time is up.

[0039] End logic service, the provided interface can ensure that the state of the timer is reset when the timer ends.

[0040] Step S206, constructing a timer structure using the target timer entity and the timer requirement information, wherein the timer structure includes control parameters of the logic control service;

[0041] Optionally, the control parameters of the logic control service included in the timer structure in this embodiment include but are not limited to the requirements of the target object for the timer, such as the start time of the timer, the timer type, the recorded data, etc. When constructing the timer structure, different programming languages ​​and libraries can be used, for example, in C++ language.

[0042] Step S208: Use the timer structure to control the timing operation on the target object.

[0043] Optionally, the timer structure is used to implement timing functions in the program. It can perform timing operations on the target object. The specific operation depends on the timing requirements of the target object. Timing operations include but are not limited to: Delayed execution, executing a function or operation after a specified delay. This is often used to control the order of events, delayed responses of user interfaces, etc. Periodic execution, repeatedly performing an operation at a certain time interval. This can be used for continuous monitoring of status, repetitive tasks, etc. Single execution, performing an operation once at a specified time point, and then the timer stops. Timeout detection, setting a timeout period, if a specific operation is not completed or a certain condition is met within this period of time, the corresponding timeout processing is performed. Timer expiration, after the timer is executed, some cleanup or end operations can be performed, such as closing resources, releasing memory, etc. Pause and resume, during the execution of a scheduled task, the timer can be paused and resumed, which is very useful when dynamic control of scheduled tasks is required. Cancel the timer, before or during the execution of a scheduled task, the timer can be canceled to stop all subsequent timing operations. Increment or decrement count, the timer can be used to increment or decrement count, for example to implement a countdown function. Synchronous and asynchronous operations, timers can be used for synchronous or asynchronous operations to ensure that code is executed at a specific point in time. Timestamp recording, timers can be used to record the timestamp of an event, such as recording the time of a user operation.

[0044] Through the above steps, since the timer device can search for the target timer entity that matches the target object from the timer database based on the timer request of the target object, and use the target timer entity and the timer requirement information to build a timer structure, wherein the timer structure includes the control parameters of the logic control service. It is only necessary to set up a timer entity to generate a corresponding timer structure according to different timer requirements, so that the timer structure can be used to control the timing operation of the target object, and there is no need to set multiple timers in the target object, nor is there a need to uniformly manage multiple timers. Thus, the resources of the timer are saved. Therefore, the problem that the timer occupies too many resources and cannot be effectively managed in the related art can be solved, so as to save timer resources and achieve the effect of efficiently managing timers.

[0045] In an exemplary embodiment, a timer structure is constructed using the target timer entity and the timer requirement information, including: sending the timer requirement information to the timer start service, wherein the timer requirement information includes: timer start duration, timer type, and timer triggered event; defining an initial timer structure through the timer start service, wherein the initial timer structure includes timer requirement parameters; defining a target function through the timer start service, and initializing an instance of the initial timer structure using the target function; and obtaining the timer structure by setting the parameter values ​​of the timer requirement parameters through the timer start service according to the timer requirement information.

[0046] Optionally, in this embodiment, the timer requirement information may be sent by the management platform of the target object to the timer start service. Figure 4 As shown, it is a schematic diagram of the device for monitoring the chassis status in this embodiment, in which the specific functions of the management platform are abstracted into a unified function, and the specific entities of each management platform are constructed according to the template. Each management platform registers the corresponding timer in the timer database, and relies on the event logic service of the timer entity to trigger each to obtain and update the corresponding data. At the same time, each management platform is also provided with its own event logic service, and the event logic is triggered according to the updated data, for example, an abnormal temperature data is obtained to report an alarm, and the hard disk transmission rate is adjusted after obtaining abnormal SAS link related data.

[0047] Optionally, the timer requirement information may also include the data to be recorded by the timer, the timer start flag, and the timer timing completion flag. The timer start duration, timer type, data to be recorded by the timer, the event triggered by the timer, the timer start flag, and the timer timing completion flag in this embodiment are the main parameter parts that constitute the timer requirement parameters. For example, Figure 5 As shown, the defined timer structure includes the timer start duration, timer type, timer data to be recorded, timer triggered event, timer start flag, and timer timing completion flag. These parameters can be implemented in C language.

[0048] The timer start duration is the length of time that the timer structure starts to count after it is started, usually expressed in milliseconds, seconds, minutes, etc. The timer type can be a one-time timer, a periodic timer, or a real-time timer.

[0049] The data to be recorded by the timer refers to the type of data that the timer structure needs to monitor and record. For example, in performance monitoring, the timer structure may record processing time; in game development, the timer structure may record frame rate or animation update cycle.

[0050] The timer triggers an event when the timer structure reaches the set time. It can trigger specific events or actions. These events can be function calls, signal sending, UI update, etc.

[0051] The timer start flag is a status flag that indicates whether the timer structure has been started. Typically, this flag is set to true when the timer structure starts timing, and is set to false when the timer structure is completed or stopped.

[0052] The timer timing completion flag is set when the timer structure completes its scheduled time interval to indicate that the timing has been completed. This flag is usually used to control subsequent logic flows, such as resetting the timer structure, executing specific tasks, etc.

[0053] Optionally, the target function in this embodiment will be called by the timer. This function should perform all operations that the target object runs when the timer structure is triggered. The target function can be a function encoded in Python. This embodiment can also define a structure or class to save the settings of the timer. For example, use Python to define the timer structure. And use the initialized timer structure instance to start the timer.

[0054] This embodiment constructs a timer structure through the timer start service in the timer entity, which can meet the timer requirements of different target objects and improve the efficiency of timer structure construction.

[0055] In an exemplary embodiment, the timer control device further includes a state service, the state service is connected to the timer judgment service, and uses the timer structure to control the timing operation of the target object, including: triggering the operation of the timer structure; polling the timer structure according to a preset time period through the state service to obtain the operation status information of the timer structure;

[0056] In the process of polling the timer structure, the timer judgment service is started, and the parameter value of the timer type in the timer structure is obtained from the running status information through the timer judgment service; when the type of the timer structure is determined to match the target object from the parameter value of the timer type through the timer judgment service, the startup parameter in the timer structure is obtained; when the timer judgment service determines from the startup parameter that the timer structure is currently in the started state, the timer timing service is triggered to start, and the value of the polling period of the timer structure is obtained through the timer timing service; through the timer judgment service and based on the value of the polling period, it is determined whether the timing time of the timer structure has arrived; when the timer judgment service determines that the timing time of the timer structure has arrived, the timer event service is triggered to start, and the function pointer of the timer entity is called through the timer event service to trigger the target event of the target object through the function pointer, wherein the timing operation includes triggering the target event.

[0057] Optionally, the timer structures constructed in different programming languages ​​operate in different ways. For example, in Python, the time.sleep() function can be used to trigger the operation of the timer structure.

[0058] Optionally, the working principle of the timer structure of this embodiment for the timing operation of the target object includes: polling, judging the state, timing and triggering the event process. For example, in the case where the target object is a chassis, Figure 6 As shown, the following steps are included:

[0059] S601, status polling, traverses all timer structures in the chassis through the status service, and regularly queries the current status of the timer structure.

[0060] S602, the timer judgment service is started. When the state of the timer structure is polled, a judgment service is started to analyze the state. This service extracts the type parameters of the timer structure from the state information. The judgment service matches the extracted parameters with the target object. If the match is successful, it means that the timer is for the target object, and then the startup parameters in the timer structure are obtained.

[0061] S603, the judgment service uses the startup parameters to determine whether the timer structure has been started. If it is determined that it has been started, the start timer timing service will be triggered.

[0062] S604, the timer timing service starts working and obtains the polling period value of the timer structure. This period determines how often the service will update its status.

[0063] S605: The timer determination service determines whether the timing of the timer structure has reached a predetermined time according to the value of the polling period.

[0064] S606, if the timer judgment service determines that the timing time has arrived, it will trigger the start timer event service. This service will call the function pointer of the timer entity, which is associated with the target object and is used to trigger the target event of the target object. The target event triggered by the function pointer is the final result of the timing operation, which may involve the execution of certain specific actions or program flows.

[0065] S607: After completion, continue to traverse the next timer structure.

[0066] The entire process in this embodiment involves multiple service and judgment steps, which can ensure that the timer can accurately and effectively trigger the target event.

[0067] In an exemplary embodiment, when the timer judgment service determines that the timing time of the timer structure has arrived, the timer event service is triggered to start, and the function pointer of the timer entity is called through the timer event service to trigger the target event of the target object through the function pointer. The method also includes: obtaining event data generated by triggering the target event; sending the event data to the target object control device of the target object to adjust the operation of the target object through the target object control device.

[0068] Optionally, the event data may come from a sensor that monitors the target object. For example, a sensor triggered by a timer structure obtains data such as the temperature, voltage, positioning light, and warning light of the chassis. Once the target event is triggered, the relevant event data needs to be sent to the control device of the target object. This may involve transmission through a network, wireless communication, or other data transmission methods. Among them, the target object control device is a device or system that receives event data and adjusts the operation of the target object based on this data. The control device may perform a series of operations based on the received data, such as adjusting device parameters, starting or stopping a process, etc. The control device adjusts the operating state of the target object based on the event data in response to the triggered event. This may include optimizing performance, ensuring safety, meeting specific needs, etc.

[0069] For example, Figure 4 As shown, when the target object is a chassis, the data update service in the chassis management platform obtains updated chassis data through a function pointer pointing to an interface, and transmits the chassis data (for example, temperature data, abnormal reporting alarms, SAS link data) to the event logic service in the management platform. After receiving the chassis data, the event logic service adjusts the hard disk transmission rate in the chassis, etc.

[0070] This embodiment obtains event data generated by triggering a target event, sends the event data to a target object control device of the target object, and adjusts the operation of the target object through the target object control device without human intervention, thereby improving efficiency and accuracy.

[0071] In an exemplary embodiment, after using the timer structure to control the timing operation on the target object, the method also includes one of the following: adjusting the control parameters in the timer structure through the timer end service, and continuing to use the adjusted control parameters to control the timer structure to perform the timing operation on the target object; deleting the timer structure through the timer end service.

[0072] Optionally, this embodiment adjusts the control parameters in the timer structure through the timer end service: this means that after the timer completes its preset timing operation, the control parameters of the timer need to be reconfigured or adjusted. These control parameters may include the timer interval, the number of repetitions, the specific action performed, etc. After adjusting these parameters, the timer structure will continue to perform the timing operation on the target object according to the new settings, thereby achieving more flexible and dynamic timing control.

[0073] Optionally, this embodiment deletes the timer structure through the timer end service: In some cases, once the timer structure completes its predetermined operation, the timer structure may no longer be needed. In this case, deleting the timer structure can release the resources related to it and ensure the efficiency and performance of the system operation. After deleting the timer structure, the timing operation related to it will no longer be executed. Thereby saving timer resources.

[0074] This embodiment can adjust the behavior of the timer as needed and can also clean up resources in time when not needed, thereby improving the maintainability and scalability of the timer structure and better adapting to different application scenarios and requirements.

[0075] In an exemplary embodiment, before receiving a timer request sent by the target object, the method also includes: receiving a registration request sent by the target object control device of the target object through the timer start service, wherein the registration request includes the object type of the target object; responding to the registration request, constructing the target timer entity, and registering the target timer entity in the timer database.

[0076] Optionally, this embodiment receives a registration request from the target object control device through a timer startup service. The control device here is part of the target object and is responsible for sending the registration request. The registration request includes object type information of the target object. The object type can be a device type, a service type, or other attribute used to identify or classify the target object. After receiving the registration request, a response to the request is required. This usually means that the system accepts and processes the request from the target object control device. After responding to the registration request, a target timer entity will be constructed. This entity is a data structure or object used to manage timed tasks related to the target object. Finally, the constructed target timer entity is registered in the timer database. This database is used to store and manage all registered timer entities for subsequent scheduling and management. For example, Figure 4 As shown, the management platform of the chassis registers the timer entity in the database.

[0077] This embodiment can obtain necessary information to create and manage a timer entity through a registration request, and then can accurately execute a timing task when a specific timer request is received.

[0078] The present application is described below in conjunction with specific embodiments:

[0079] This specific embodiment takes the components in the chassis as an example, and provides a timer unified management method for chassis status monitoring, which specifically includes the following steps:

[0080] S701, abstract the timer used into a fixed and unified template (i.e., timer entity). According to the template, each functional module creates and constructs a structure describing the timer timer entity through the timer start logic when the timer needs to be started. The timer entity includes: timer start duration, timer type, data to be recorded, event logic, timer start flag, and timer timing completion flag.

[0081] S702, construct a state machine, which takes the chassis as a unit and patrols the status of all timer structures in the chassis at a fixed time interval. During the patrol process, the interface provided by the timer judgment service is called to traverse whether each type of timer structure in the current chassis has been started, and then the timer timing service is used to implement the timer timing function. In this way, the timer function of multiple functional modules is implemented, and the timing is essentially only based on the cycle of the state machine.

[0082] S703, after implementing the timing function of each timer, determine whether each timer structure has reached the timing time by calling the interface provided by the timer judgment service. If the timing time is reached, call the timer event service in the structure entity corresponding to the timer to trigger the event expected by the functional module that starts the timer.

[0083] S704, if the timing time of the timer structure is reached, the timer event service of the timer entity is triggered, that is, by calling the function pointer registered in the timer entity, and then the timer structure is considered to have completed the task, and the state of the timer structure is reset, such as: timer start flag, timer clear flag, and exit the entire process flow.

[0084] 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 by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, 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, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0085] In this embodiment, a control device for timing operation is also provided, which is applied to a timer control device. The timer control device is connected to a timer database, and the timer database includes multiple timer entities registered with multiple objects. The timer entity includes the control logic of the timer. The device is used to implement the above-mentioned embodiments and preferred implementation methods, 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 for 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.

[0086] Figure 7 is a structural block diagram of a control device for timing operation according to an embodiment of the present application, such as Figure 7 As shown, the device comprises:

[0087] A first receiving module 72 is configured to receive a timer request sent by a target object, wherein the timer request includes the timer requirement information of the target object, and the target object is any one of the multiple objects;

[0088] A first response module 74, configured to respond to the timer request and search the timer database for a target timer entity that matches the target object, wherein the target timer entity includes a plurality of logic control services;

[0089] A first construction module 76, configured to construct a timer structure using the target timer entity and the timer requirement information, wherein the timer structure includes control parameters of the logic control service;

[0090] The first control module 78 is used to control the timing operation on the target object by using the timer structure.

[0091] In an exemplary embodiment, the plurality of logic control services include: a timer start service, a timer timing service, a timer determination service, a timer event service, and a timer end service.

[0092] In an exemplary embodiment, the above-mentioned first building module 76 includes: a first sending unit, used to send the timer requirement information to the timer start service, wherein the timer requirement information includes: timer start duration, timer type, and timer triggered event; a first definition unit, used to define the initial timer structure through the timer start service, wherein the initial timer structure includes timer requirement parameters; a first initialization unit, used to define the target function through the timer start service, and initialize the instance of the initial timer structure using the target function; a first setting unit, used to start the service through the timer and set the parameter value of the timer requirement parameter according to the timer requirement information to obtain the timer structure.

[0093] In an exemplary embodiment, the timer control device also includes a status service, and the first control module 78 includes: a first trigger unit, which is used to trigger the operation of the timer structure; a first polling unit, which is used to poll the timer structure according to a preset time period through the status service to obtain the operation status information of the timer structure; a first starting unit, which is used to start the timer judgment service during the polling of the timer structure, and obtain the parameter value of the timer type in the timer structure from the operation status information through the timer judgment service; a first acquisition unit, which is used to obtain the startup parameter in the timer structure when it is determined from the parameter value of the timer type through the timer judgment service that the type of the timer structure matches the target object. ; A second trigger unit is used to trigger the start of the timer timing service when the timer judgment service determines from the startup parameters that the timer structure is currently in the started state, and obtain the value of the polling period of the timer structure through the timer timing service; a first judgment unit is used to judge whether the timing time of the timer structure has arrived through the timer judgment service and based on the value of the polling period; a third trigger unit is used to trigger the start of the timer event service when the timer judgment service determines that the timing time of the timer structure has arrived, and call the function pointer of the timer entity through the timer event service to trigger the target event of the target object through the function pointer, wherein the timing operation includes triggering the target event.

[0094] In an exemplary embodiment, the above-mentioned device also includes: a first acquisition module, which is used to trigger and start the timer event service when the timer judgment service determines that the timing time of the timer structure has arrived, and call the function pointer of the timer entity through the timer event service to trigger the target event of the target object through the function pointer, and then obtain the event data generated by triggering the target event; a first sending module, which is used to send the event data to the target object control device of the target object, so as to adjust the operation of the target object through the target object control device.

[0095] In an exemplary embodiment, the above-mentioned device also includes one of the following: a first adjustment module, which is used to use the timer structure to control the timing operation on the target object, adjust the control parameters in the timer structure through the timer end service, and continue to use the adjusted control parameters to control the timer structure to perform the timing operation on the target object; a first deletion module, which is used to delete the timer structure through the timer end service.

[0096] In an exemplary embodiment, the above-mentioned device also includes: a first receiving module, which is used to receive a registration request sent by the target object control device of the target object through the timer start service before receiving the timer request sent by the target object, wherein the registration request includes the object type of the target object; a first building module, which is used to respond to the registration request, build the target timer entity, and register the target timer entity in the timer database.

[0097] 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.

[0098] An embodiment of the present application 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.

[0099] 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.

[0100] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0101] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0102] An embodiment of the present application further provides a computer program product, which 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.

[0103] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0104] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the above method embodiments.

[0105] 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.

[0106] Obviously, those skilled in the art should understand that the above modules or steps of the present application 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 from that herein, 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 application is not limited to any specific combination of hardware and software.

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

Claims

1. A control method for timing operation, characterized in that: Applied to a timer control device, the timer control device is connected to a timer database, the timer database includes multiple timer entities registered by multiple objects, the timer entity includes the control logic of the timer, and the method includes: receiving a timer request sent by a target object, wherein the timer request includes timer requirement information of the target object, and the target object is any one of the multiple objects; In response to the timer request, searching the timer database for a target timer entity matching the target object, wherein the target timer entity includes a plurality of logical control services; Constructing a timer structure using the target timer entity and the timer requirement information, wherein the timer structure includes control parameters of the logic control service; The timer structure is used to control the timing operation on the target object.

2. The method according to claim 1, characterized in that: The multiple logic control services include: timer start service, timer timing service, timer judgment service, timer event service, and timer end service.

3. The method according to claim 2, characterized in that Constructing a timer structure using the target timer entity and the timer requirement information, including: Sending the timer requirement information to the timer start service, wherein the timer requirement information includes: timer start duration, timer type, and timer triggered event; Defining an initial timer structure through the timer start service, wherein the initial timer structure includes a timer requirement parameter; Starting the service through the timer defines a target function, and using the target function to initialize an instance of the initial timer structure; The timer structure is obtained by starting the service through the timer and setting the parameter value of the timer requirement parameter according to the timer requirement information.

4. The method according to claim 2, characterized in that: The timer control device also includes a state service, which is connected to the timer judgment service and uses the timer structure to control the timing operation on the target object, including: Triggering the operation of the timer structure; Poll the timer structure according to a preset time period through the status service to obtain the running status information of the timer structure; In the process of polling the timer structure, starting the timer judgment service, and obtaining the parameter value of the timer type in the timer structure from the running status information through the timer judgment service; When it is determined from the parameter value of the timer type by the timer judgment service that the type of the timer structure matches the target object, obtaining the start parameter in the timer structure; When the timer judgment service determines from the startup parameters that the timer structure is currently in the started state, triggering the start of the timer timing service, and obtaining the value of the polling period of the timer structure through the timer timing service; Determine whether the timing time of the timer structure has arrived by using the timer judgment service and based on the value of the polling period; When the timer judgment service determines that the timing time of the timer structure has arrived, the timer event service is triggered to start, and the function pointer of the timer entity is called through the timer event service to trigger the target event of the target object through the function pointer, wherein the timing operation includes triggering the target event.

5. The method according to claim 4, characterized in that When the timer judgment service determines that the timing time of the timer structure has arrived, the timer event service is triggered and started, and the function pointer of the timer entity is called through the timer event service to trigger the target event of the target object through the function pointer, the method further includes: Acquire event data that triggers the target event; The event data is sent to a target object control device of the target object so as to adjust the operation of the target object through the target object control device.

6. The method according to claim 2, characterized in that After using the timer structure to control the timing operation on the target object, the method further includes one of the following: Adjusting the control parameters in the timer structure through the timer end service, and continuing to use the adjusted control parameters to control the timer structure to perform the timing operation on the target object; The timer structure is deleted through the timer end service.

7. The method according to claim 2, characterized in that Before receiving the timer request sent by the target object, the method further includes: receiving, through the timer start service, a registration request sent by a target object control device of the target object, wherein the registration request includes an object type of the target object; In response to the registration request, the target timer entity is constructed, and the target timer entity is registered in the timer database.

8. A control device for timed operation, characterized in that: Applied to a timer control device, the timer control device is connected to a timer database, the timer database includes multiple timer entities registered by multiple objects, the timer entity includes the control logic of the timer, and the device includes: A first receiving module is configured to receive a timer request sent by a target object, wherein the timer request includes timer requirement information of the target object, and the target object is any one of the multiple objects; A first response module, configured to respond to the timer request and search the timer database for a target timer entity that matches the target object, wherein the target timer entity includes a plurality of logic control services; A first construction module, configured to construct a timer structure using the target timer entity and the timer requirement information, wherein the timer structure includes control parameters of the logic control service; The first control module is used to control the timing operation on the target object by using the timer structure.

9. 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 7 when executed by a processor.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.