Application execution method and system and storage medium
By breaking down the application into multiple step functions and executing them in a time-sharing manner, the problem of thread blocking in embedded systems is solved, improving execution efficiency and system stability, and achieving efficient resource management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2026-03-13
AI Technical Summary
In embedded systems, long task execution times or high computational complexity can lead to thread blocking, affecting the execution of other tasks and causing system stability and reliability issues.
The application is broken down into multiple step functions, and these step functions are executed in a time-sharing manner. Message queues and process tables are used for task scheduling to avoid thread blocking and optimize resource allocation and management.
It improves application execution efficiency, avoids system malfunctions caused by thread blocking, ensures system stability and reliability, and optimizes resource management.
Smart Images

Figure CN121658166A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and specifically relates to an application execution method, system, and storage medium. Background Technology
[0002] With the rapid development of information technology, the application demands of computer software in various industries are constantly increasing, and performance requirements are also rising. Especially in embedded systems, due to limitations in hardware resources such as memory, processor speed, and power consumption, how to effectively utilize limited resources to achieve efficient functional operations has become an important issue in embedded system design.
[0003] Embedded systems have an extremely wide range of applications, from consumer electronics and smart homes to industrial automation and automotive electronics, they are virtually ubiquitous. To cope with ever-increasing functional requirements, many embedded systems employ RTOS (Real-Time Operating System) for multitasking management. Through proper task scheduling and resource allocation, RTOS can ensure tasks complete within strict time requirements, which is crucial for many embedded applications with high real-time demands.
[0004] However, despite the convenience that RTOS provides for multitasking management, embedded systems still face many challenges. Especially in complex applications, long task execution times or high computational complexity can lead to thread blocking, which in turn affects the execution of other tasks. Blocked tasks consume system resources, causing delays or even halts in other tasks, and in severe cases, may cause the entire system to malfunction, affecting system stability and reliability. Summary of the Invention
[0005] To address the aforementioned technical problems, this application proposes an application execution method, system, and storage medium capable of optimizing the application execution process to improve application execution efficiency.
[0006] Specifically, this application proposes an application execution method, including: The application is broken down into multiple step functions by calling multiple preset functions.
[0007] Based on the aforementioned multiple step functions, a process table and an application execution table are constructed.
[0008] The corresponding message data is obtained based on the preset message queue, and the corresponding process table is obtained by traversing the application execution table through the message data.
[0009] Furthermore, the corresponding step functions are obtained based on the process table, and the step functions are executed in a time-sharing manner.
[0010] The above technical solution avoids thread blocking caused by prolonged application execution within a single scheduling cycle by splitting the application into multiple step functions and executing these functions in a time-sharing manner. This effectively prevents delays or stalls in other applications within the same thread, improving application execution efficiency and preventing system malfunctions due to application delays or stalls, thus ensuring system stability and reliability. By traversing the application execution table and process table and using time-sharing execution of the step functions, the system performance load is reduced, task coordination and resource allocation are optimized, and more efficient resource management is achieved. Splitting the application into multiple step functions reduces internal coupling, facilitating application modification and maintenance.
[0011] As one implementation, constructing a process table and an application execution table based on the plurality of step functions and the message data includes: obtaining function pointers of the plurality of step functions; arranging the function pointers and a first preset process control parameter in a first data table to construct a process table; associating the process table with preset message data; and arranging the header of the process table, the corresponding message data, and the second preset process control parameter in a second data table to construct an application execution table.
[0012] By arranging the multiple step functions and flow control parameters in the first data table, the execution order of the step functions can be managed efficiently. The execution order of the step functions can be adjusted as needed, which improves the efficiency and flexibility of task scheduling. It can also achieve a more reasonable allocation of system resources, avoid resource conflicts and excessive occupation, and thus optimize the overall performance of the system.
[0013] Furthermore, the step of traversing the application execution table through the message data also includes: The preset task execution function reads message data from the preset message queue at a preset period. If the message data is successfully read, the application execution table is traversed through the message data to obtain the corresponding process table; otherwise, the application execution table cannot be traversed.
[0014] By periodically acquiring message data, timed task scheduling is achieved, ensuring that tasks can be executed at set intervals. By traversing the application execution table through message data to obtain the corresponding process table, a message-driven task execution method is realized, improving the system's adaptability and dynamic adjustment capabilities.
[0015] Furthermore, the step of obtaining the corresponding step function based on the process table and executing the step function in a time-sharing manner includes: The preset task execution function controls the number of steps in the step function. If the number of steps in the executed step function is less than the total number of steps in the step function, the step function continues to be executed; otherwise, the function pointer of the step function is assigned to null, and the execution of the step function ends.
[0016] If the execution time of the step function reaches the pre-waiting time of the step function pointed to by the step execution pointer, then the step function pointed to by the step execution pointer is executed; otherwise, the waiting time continues until the execution time of the step function reaches the pre-waiting time of the step function pointed to by the step execution pointer.
[0017] By controlling the number of steps in a pre-defined task execution function, the step functions can be executed in a time-sharing manner. This ensures that the system can execute multiple step functions in an orderly and efficient manner without causing system response delays or overload due to excessive resource consumption. By checking whether the execution time of an already executed step function has reached the pre-wait time, the system ensures that the step functions are executed in chronological order.
[0018] Furthermore, the time-sharing execution of the step functions further includes: after the current step function calls the flow control function, if the flow control function pointer of the current step function is not null, then a flow control instruction is obtained through the flow control function, and the execution of the unexecuted step functions continues or the execution of the unexecuted step functions is exited based on the flow control instruction; if the flow control function pointer of the current step function is null, then it is determined that there is no flow control instruction, and the waiting time of the current step function is incremented based on a preset period until a flow control instruction is present, or when the waiting time reaches a preset time threshold, a result waiting timeout is triggered; if the current step function does not call the flow control function within the preset time threshold, after the current step function is executed, the execution time of the current step function is cleared, and the execution of the unexecuted step functions continues until all step functions are executed.
[0019] Flow control instructions obtained through the flow control function control whether to continue or exit the execution step function, thus ensuring the correct execution of the step function. By automatically incrementing the waiting time until a flow control instruction is received or the time reaches a preset time threshold, meaningless waiting is avoided, thereby reducing system resource waste and unnecessary delays.
[0020] Furthermore, the time-sharing execution of the step function further includes: If the flow control instruction is an exit execution instruction, then the step execution pointer is assigned to null, and the execution of the step function ends.
[0021] If the flow control instruction is a continue execution instruction, then the waiting time is cleared, the step execution pointer is set to the unexecuted step function, the unexecuted step function is executed, and the pre-execution waiting time of the unexecuted step function is assigned to the step execution time.
[0022] If the trigger result wait times out, the waiting time is cleared to zero, the step execution pointer is set to the next unexecuted step function, the next unexecuted step function is executed, and the pre-execution time of the next unexecuted step function is assigned to the step execution time.
[0023] By controlling the system to exit or continue executing step functions through flow control commands, or to execute the next unexecuted step function in the event of a timeout, the system ensures that step functions can be completed efficiently and stably even under complex conditions. This makes the execution of step functions more controllable and responsive, while also improving resource utilization.
[0024] Furthermore, the time-sharing execution of the step function further includes: determining the execution result of the current step function; if the execution result is successful, then pointing the step execution pointer to the unexecuted step function; if the execution result is failure and the number of failures does not exceed a preset threshold, then executing the current step function again; if the execution result is failure and the number of failures exceeds the preset threshold, then terminating the execution of the current step function.
[0025] The retry mechanism enhances the system's fault tolerance, preventing accidental errors from causing task failures. When the number of failures reaches a preset threshold, the execution of the step function is terminated, thus avoiding resource waste caused by excessive retries, improving resource utilization efficiency, and enhancing the system's stability and reliability.
[0026] Furthermore, the time-sharing execution of the step function further includes: modifying the step number of the unexecuted step function to the step number of the specified step function by calling the flow control function; pointing the step execution pointer to the specified step function; and executing the specified step function by combining the step execution pointer and the step number of the specified step function.
[0027] By combining the step number of the specified step function with pointing the step execution pointer to the specified step function, the system's flexibility and configurability are effectively improved.
[0028] Based on the same inventive concept, this application also proposes a system for an application execution method, the system comprising: The program splitting module is used to split an application into multiple step functions by calling multiple preset functions.
[0029] The data table construction module is used to construct process tables and application execution tables based on the multiple step functions.
[0030] The data traversal module is used to obtain corresponding message data based on a preset message queue, and then traverse the application execution table through the message data to obtain the corresponding process table.
[0031] In addition, a function execution module is used to obtain the corresponding step function based on the process table, so as to execute the step function in a time-sharing manner.
[0032] Based on the same inventive concept, this application also proposes a computer-readable storage medium storing computer-executable instructions that can be read and executed by a domain controller, thereby enabling the application execution method to be executed.
[0033] Compared with the prior art, this application has at least the following beneficial effects: This application effectively solves the technical problem of thread blocking caused by long task execution times or high computational complexity in multi-task management. Blocked tasks consume system resources, causing delays or stalls in other tasks, and even leading to system malfunctions. By splitting the application into multiple step functions and executing these step functions in a time-sharing manner, the problem of thread blocking due to prolonged application execution in a single scheduling cycle is avoided. This effectively prevents delays or stalls in other applications within the same thread, improving application execution efficiency and preventing system malfunctions caused by application delays or stalls, thus ensuring system stability and reliability. By traversing the application execution table and process table and using time-sharing execution of the step functions, the system performance load is reduced, task coordination and resource allocation are optimized, and more efficient resource management is achieved. Splitting the application into multiple step functions reduces internal coupling, facilitating application modification and maintenance. Attached Figure Description
[0034] Figure 1 This is a flowchart illustrating the application execution method in an embodiment of this application.
[0035] Figure 2 This is a flowchart illustrating the execution of a step function without calling a flow control function, as shown in an embodiment of this application.
[0036] Figure 3 This is a flowchart illustrating the execution of the function for waiting for a timeout, as shown in an embodiment of this application.
[0037] Figure 4 This is a flowchart illustrating the function execution steps of the retry mechanism in an embodiment of this application.
[0038] Figure 5This is a schematic diagram of an application execution system shown in an embodiment of this application. Detailed Implementation
[0039] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0040] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices. Example 1:
[0041] Please refer to Figure 1 The application execution method mainly includes steps S100 to S400.
[0042] Step S100 includes splitting the application into multiple step functions by calling multiple preset functions. These step functions refer to the multiple independent functions into which the original application is split. The preset functions can be set according to actual needs and are not limited here. For example, the application can be split into three step functions A1, A2, and A3 using functions a, b, and c, and then functions a, b, and c can be executed by these three step functions respectively. After splitting, local variables in the application's implementation functions also need to be changed to global variables to enable data transfer between functions.
[0043] Step S200 includes: constructing a process table and an application execution table based on the multiple step functions. This primarily involves arranging the function pointers of the multiple step functions and a first preset process control parameter in a data table to construct the process table. For example, the function pointers of three step functions, A1, A2, and A3, and their corresponding process control parameters are arranged in a data table to construct the process table. The process table and application execution table can primarily be arrays of structures, but are not limited to these. The first preset process control parameter can at least include execution time interval, result callback, and timeout, but is not limited to these. The process table can be associated with preset message data, and the process table header, corresponding message data, and second preset process control parameters are arranged in a data table to obtain the application execution table. For example, process table A is associated with a message data as the basis for triggering execution; for example, the message data corresponding to process table A is "0xA", and the message data corresponding to process table B is "0xB". The second preset process control parameter can at least include the number of steps, the number of retries, etc., but is not limited to these.
[0044] Step S300 includes: obtaining corresponding message data based on a preset message queue, and traversing the application execution table through the message data to obtain the corresponding process table. For example, when it is necessary to call process table A, the message data "0xA" is obtained through the preset message queue, and process table A is obtained by traversing the application execution table through the message data "0xA".
[0045] Furthermore, step S400 includes: obtaining the corresponding step function based on the flowchart, and executing the step function in a time-sharing manner. This time-sharing execution mainly refers to executing the step function step by step through multiple task cycles. By applying the above application execution method to embedded systems, such as RTOS systems for multi-task management, the problem of thread blocking caused by large task data volume or long running time, affecting the execution of other tasks, or even causing system malfunctions, is effectively prevented, thereby achieving optimization of the embedded system.
[0046] In some embodiments, constructing a process table and an application execution table based on the plurality of step functions and the message data includes: obtaining function pointers of the plurality of step functions; arranging the function pointers and a first preset process control parameter in a first data table to construct a process table; associating the process table with preset message data; and arranging the header of the process table, the corresponding message data, and the second preset process control parameter in a second data table to construct an application execution table.
[0047] The first preset flow control parameter may include at least the execution interval, result callback, and timeout period. The second preset flow control parameter may include at least the number of flow steps and the number of retries. Those skilled in the art can adjust the first and second preset flow control parameters as needed, without limitation. The flow table can mainly be a data list or structure array that records the corresponding application's step functions and the first flow control parameters. It can mainly include the pre-wait time of the current step function, that is, the time required to wait before executing the step; the function pointer of the current step function; the waiting timeout time of the current step function, that is, the maximum waiting time to obtain the execution result after executing the step; and the function pointer of the current step function.
[0048] The application execution table can be a data list or structure array that contains process information of each application. It can mainly include: the application identifier, the application message data, the maximum number of times the application is specified to be executed, the number of steps of the application, and the starting address of the application's process table, that is, the header of the process table.
[0049] Preferably, the step of traversing the application execution table through the message data further includes: reading message data from the preset message queue according to a preset period using a preset task execution function; if the message data is successfully read, then traversing the application execution table through the message data to obtain the corresponding process table; otherwise, the application execution table cannot be traversed.
[0050] The preset task execution function mainly includes acquiring and parsing application trigger messages, executing application step functions, and implementing flow control during the execution of application step functions. The preset period is primarily 10 milliseconds, but is not limited to this. The preset message queue is used to transmit application trigger messages, i.e., message data, and can be a FIFO (First In First Out) queue.
[0051] Preferably, the step of obtaining the corresponding step function based on the process table and executing the step function in a time-sharing manner includes: The preset task execution function controls the number of steps in the step function. If the number of steps in the executed step function is less than the total number of steps in the step function, the step function continues to be executed; otherwise, the function pointer of the step function is assigned to null, and the execution of the step function ends.
[0052] If the execution time of the step function reaches the pre-waiting time of the step function pointed to by the step execution pointer, then the step function pointed to by the step execution pointer is executed; otherwise, the waiting time continues until the execution time of the step function reaches the pre-waiting time of the step function pointed to by the step execution pointer.
[0053] During the process of controlling the step function through the preset task execution function, if the number of steps of the executed step function is less than the total number of steps of the step function, it means that the step function has not been completed. Otherwise, the step execution pointer is assigned to null, the application execution ends, and it is triggered again.
[0054] Please refer to Figure 2 If the execution time of the executed step function reaches the pre-wait time pointed to by the step execution pointer, it indicates that the pre-wait is complete, and the step function pointed to by the step execution pointer is then executed. The number of task cycles required to reach the pre-wait time can be obtained from the task cycle time.
[0055] Where n is the number of task cycles required to reach the pre-waiting time. For the task cycle time, This is the pre-waiting time.
[0056] Preferably, the step function is executed in a time-sharing manner, further comprising: After the current step function calls the flow control function, if the flow control function pointer of the current step function is not null, then the flow control instruction is obtained through the flow control function, and the execution of the unexecuted step functions continues or the execution of the unexecuted step functions is exited based on the flow control instruction; if the flow control function pointer of the current step function is null, then it is determined that there is no flow control instruction, and the waiting time of the current step function is incremented based on a preset period until a flow control instruction is present, or when the waiting time reaches a preset time threshold, a result waiting timeout is triggered; if the current step function does not call the flow control function within the preset time threshold, after the current step function is executed, the execution time of the current step function is cleared, and the execution of the unexecuted step functions continues until all step functions are executed.
[0057] This flow control function is mainly used to explicitly obtain and modify flow control information during the execution of the application. It can include: functions to obtain the maximum number of times the current application is specified to be executed, functions to obtain the number of times the current application has been executed, functions to set the number of times the current application has been executed, functions to set the next step to be executed by the current application, functions to set the execution status of the current application, and functions to obtain the execution status of the current application.
[0058] When no flow control instruction is detected, the execution wait time of the step function increments with each task processing cycle until a flow control instruction is received or a preset time threshold is reached, at which point a result wait timeout is triggered. The number of task cycles required to trigger the step function wait timeout is specified. Can be determined by waiting timeout and task cycle time This can be derived from the following formula:
[0059] Preferably, the step function is executed in a time-sharing manner, further comprising: If the flow control instruction is an exit execution instruction, then the step execution pointer is assigned to null, and the execution of the step function ends.
[0060] If the flow control instruction is a continue execution instruction, then the waiting time is cleared, the step execution pointer is set to the unexecuted step function, the unexecuted step function is executed, and the pre-execution waiting time of the unexecuted step function is assigned to the step execution time.
[0061] If the trigger result wait times out, the waiting time is cleared to zero, the step execution pointer is set to the next unexecuted step function, the next unexecuted step function is executed, and the pre-execution time of the next unexecuted step function is assigned to the step execution time.
[0062] Please refer to Figure 3 Suppose the application is divided into three step functions: Step 1, Step 2, and Step 3. During the execution of Step 2, the application waits for a result, i.e., it waits for a flow control instruction. If the flow control instruction is an exit instruction, the step execution pointer is set to null, and the current application execution process exits. If the flow control instruction is a continue instruction, the waiting time is cleared, the step execution instruction is set to Step 3, and the execution of Step 3 continues. The pre-wait time of Step 3 is then assigned to the already executed time. If a result waiting timeout occurs, the step execution instruction is set to Step 3, and Step 3 is executed.
[0063] Preferably, the step function is executed in a time-sharing manner, further comprising: Determine the execution result of the current step function. If the execution result is successful, the step execution pointer is moved to the unexecuted step function. If the execution result is unexecuted and the number of unexecuted attempts does not exceed a preset threshold, the current step function is executed again. If the execution result is unexecuted and the number of unexecuted attempts exceeds the preset threshold, the execution of the current step function is terminated.
[0064] Please refer to Figure 4During the execution of the step function, if the first step function is executed successfully, the step execution pointer is pointed to the second step function; assuming the preset number threshold is 5, that is, if the execution result is execution failure and the number of failures does not exceed 5, the first step function is executed again; if the execution result is execution failure and the number of failures exceeds 5, the execution of the first step function is terminated and the current application's step function execution is exited.
[0065] Preferably, the step function is executed in a time-sharing manner, further comprising: The process control function is called to modify the step number of the unexecuted step function to the step number of the specified step function; the step execution pointer is then pointed to the specified step function, and the specified step function is executed by combining the step execution pointer and the step number of the specified step function.
[0066] For example, by changing the step number of the second step function to the step number of the third step function, and pointing the step execution pointer to the third step function, the step number and the step execution pointer can be combined to skip the intermediate second step function and directly implement the third step function.
[0067] Example 2: Please refer to Figure 5 This application also proposes a system using the application execution method described in Embodiment 1, which mainly includes: a program splitting module, a data table construction module, a data traversal module, and a function execution module.
[0068] The program splitting module is used to break down an application into multiple step functions by calling multiple preset functions. Within this module, multiple preset functions can be used, for example, functions a, b, and c can be used to split the application into three step functions: A1, A2, and A3.
[0069] The data table construction module is used to construct a process table and an application execution table based on the multiple step functions. Specifically, the data table construction module arranges the function pointers of the multiple step functions and the first preset process control parameters into a data table to construct the process table; it then associates the process table with preset message data, arranging the process table header, the corresponding message data, and the second preset process control parameters into a data table to construct the application execution table.
[0070] The data traversal module is used to obtain corresponding message data based on a preset message queue, and then traverse the application execution table using the message data to obtain the corresponding process table. The preset message queue can primarily be a first-in-first-out queue, but is not limited to this.
[0071] Additionally, a function execution module is provided to obtain the corresponding step functions based on the process table and execute these step functions in a time-sharing manner. When this system is applied to embedded systems, such as RTOS systems for multi-task management, it effectively prevents thread blocking caused by large task data volumes or long execution times, which could affect the execution of other tasks or even lead to system malfunctions, thus achieving optimization of the embedded system.
[0072] Example 3: This application also proposes a computer-readable storage medium, the computer-readable storage medium comprising: The computer-readable storage medium stores computer-executable instructions, which, when executed by a control processor, implement the application execution method described in Embodiment 1.
[0073] The computer-readable storage medium can be implemented entirely or partially by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in the computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0074] In summary, this application effectively solves the technical problem of thread blocking caused by long task execution times or high computational complexity in multi-task management. Blocked tasks consume system resources, causing delays or stalls in other tasks, and even leading to system malfunctions. By splitting the application into multiple step functions and executing these step functions in a time-sharing manner, the problem of thread blocking due to prolonged application execution in a single scheduling cycle is avoided. This effectively prevents delays or stalls in other applications within the same thread, improving application execution efficiency and preventing system malfunctions caused by application delays or stalls, thus ensuring system stability and reliability. By traversing the application execution table and process table and using time-sharing execution of the step functions, the system performance load is reduced, task coordination and resource allocation are optimized, and more efficient resource management is achieved. Splitting the application into multiple step functions reduces internal coupling, facilitating application modification and maintenance.
[0075] In the several embodiments provided in this application, it will be understood that each block in the flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the figures. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved.
[0076] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0077] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the scope of protection of this application. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application for those skilled in the art.
Claims
1. An application execution method, characterized in that, include: The application is broken down into multiple step functions by calling multiple preset functions; A process table and an application execution table are constructed based on the aforementioned multiple step functions; Obtain the corresponding message data based on the preset message queue, and traverse the application execution table through the message data to obtain the corresponding process table; Furthermore, the corresponding step functions are obtained based on the process table, and the step functions are executed in a time-sharing manner.
2. The application execution method according to claim 1, characterized in that, The construction of the process table and application execution table based on the multiple step functions and the message data includes: Obtain function pointers for the multiple step functions, and arrange the function pointers and the first preset flow control parameters in a first data table to construct a flow table; The process table is associated with preset message data, and the header of the process table, the corresponding preset message data, and the second preset process control parameters are arranged in a second data table to construct an application execution table.
3. The application execution method according to claim 2, characterized in that, The step of traversing the application execution table through the message data further includes: The preset task execution function reads message data from the preset message queue at a preset period. If the message data is successfully read, the application execution table is traversed through the message data to obtain the corresponding process table; otherwise, the application execution table cannot be traversed.
4. The application execution method according to claim 3, characterized in that, The step of obtaining the corresponding step function based on the process table and executing the step function in a time-sharing manner includes: The number of steps in the step function is controlled by the preset task execution function. If the number of steps in the executed step function is less than the total number of steps in the step function, the execution of the step function continues; otherwise, the function pointer of the step function is assigned to null, and the execution of the step function ends. If the execution time of the step function reaches the pre-waiting time of the step function pointed to by the step execution pointer, then the step function pointed to by the step execution pointer is executed; otherwise, the waiting time continues until the execution time of the step function reaches the pre-waiting time of the step function pointed to by the step execution pointer.
5. The application execution method according to claim 4, characterized in that, The time-sharing execution of the step function further includes: After the current step function calls the flow control function, if the flow control function pointer of the current step function is not null, then the flow control instruction is obtained through the flow control function, and the execution of the unexecuted step function continues or the execution of the unexecuted step function is exited based on the flow control instruction; If the flow control function pointer of the current step function is null, it is determined that there is no flow control instruction. The waiting time of the current step function is incremented based on the preset period control until a flow control instruction is present, or when the waiting time reaches the preset time threshold, the result waiting timeout is triggered. If the current step function does not call the flow control function within the preset time threshold, after the current step function is executed, the execution time of the current step function is cleared, and the execution of unexecuted step functions continues until all step functions are completed.
6. The application execution method according to claim 5, characterized in that, The time-sharing execution of the step function further includes: If the flow control instruction is an exit execution instruction, then the step execution pointer is assigned to null, and the execution of the step function ends; If the flow control instruction is a continue execution instruction, then the waiting time is cleared, the step execution pointer is set to the unexecuted step function, the unexecuted step function is executed, and the pre-executed waiting time of the unexecuted step function is assigned to the step execution time; If the trigger result wait times out, the waiting time is cleared to zero, the step execution pointer is set to the next unexecuted step function, the next unexecuted step function is executed, and the pre-execution time of the next unexecuted step function is assigned to the step execution time.
7. The application execution method according to claim 6, characterized in that, The time-sharing execution of the step function further includes: Determine the execution result of the current step function. If the execution result is successful, then point the step execution pointer to the unexecuted step function. If the execution result is an execution failure and the number of execution failures does not exceed the preset threshold, then the current step function is executed again; if the execution result is an execution failure and the number of execution failures exceeds the preset threshold, then the execution of the current step function is terminated.
8. The application execution method according to claim 7, characterized in that, The time-sharing execution of the step function further includes: By calling the flow control function, the step number of the unexecuted step function is modified to the step number of the specified step function; The step execution pointer is set to point to the specified step function, and the specified step function is executed by combining the step execution pointer and the step number of the specified step function.
9. A system based on the application execution method according to any one of claims 1-8, characterized in that, The system includes: The program splitting module is used to split an application into multiple step functions by calling multiple preset functions; The data table construction module is used to construct a process table and an application execution table based on the multiple step functions; The data traversal module is used to obtain corresponding message data based on a preset message queue, and traverse the application execution table through the message data to obtain the corresponding process table; In addition, a function execution module is used to obtain the corresponding step function based on the process table, so as to execute the step function in a time-sharing manner.
10. A computer-readable storage medium storing computer-executable instructions, characterized in that, When the computer-executable instructions are executed by the control processor, they implement the application execution method as described in any one of claims 1-8.