Program management device and method, equipment and medium

By introducing a program management device into the APAUTOSAR framework, the program is ensured to be executed according to the predetermined state and operating cycle, which solves the problem of resource waste caused by process crashes and improves the reliability and stability of the system.

CN120704838APending Publication Date: 2025-09-26IMOTION AUTOMOTIVE TECH (SUZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510875675.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

In the APAUTOSAR framework, the code written by programmers may contain defects, causing process crashes and failure to release process resources normally, wasting manpower and resources for troubleshooting, and affecting system reliability and stability.

Method used

A program management device is provided, which includes an execution management module, a state management module and a thread management process. The program state and operation cycle are defined through a configuration file to ensure that the program is executed according to the predetermined state and cycle, thereby avoiding program crashes.

Benefits of technology

It improves the reliability and stability of the system, reduces the manpower and resources wasted on troubleshooting program crashes, and ensures that processes exit normally and release resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120704838A_ABST
    Figure CN120704838A_ABST
Patent Text Reader

Abstract

The invention relates to the field of vehicle-mounted systems, in particular to a program management device and method, equipment and a medium, and the device comprises a state management module which is used for sending a state switching request to an execution management module when receiving the state switching request for the state of a target function group; the execution management module is used for determining the program state of the corresponding program based on the target function group state after receiving the state switching request; sending a switching message to a thread management process; the thread management process is used for determining a target operation cycle of the program state of the program through the configuration file after receiving the switching message, and sending a thread management command to the program, so that the program enables the corresponding thread to operate the target operation cycle in the program state according to the thread management command. According to the method and the device, a program crash phenomenon caused by a program state error can be avoided, manual troubleshooting is reduced, and the process can normally exit and release resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle-mounted systems, and in particular to a program management device, method, equipment, and medium. Background Art

[0002] In the APAUTOSAR framework, process management is a core function that ensures applications run reliably and efficiently within complex in-vehicle electronic systems. Process management involves three key components: EM (Execution Management), SM (State Management), and PHM (Process Health Monitoring). These components work together to enable process startup, shutdown, and operational monitoring.

[0003] At this stage, programmers' ability levels are inconsistent, and the codes they write may have defects, which often leads to program crashes during process startup, resulting in the process not being able to exit normally, and the process resources not being released normally. In addition, every program crash wastes a lot of manpower to troubleshoot and solve the problem. Summary of the Invention

[0004] The purpose of this application is to provide a program management device, method, equipment and medium that can ensure that each program can be executed according to the predetermined state and operation cycle, avoid program crashes caused by program state errors, thereby reducing the manpower troubleshooting resources wasted due to program crashes, improving the reliability and stability of the system, and ensuring that the process can exit normally and release resources.

[0005] In a first aspect, a program management device is provided, comprising: an execution management module, a state management module, and a thread management process;

[0006] The state management module is configured to monitor the state of the program; and when receiving a state switching request for the target functional group state, send the state switching request to the execution management module;

[0007] The execution management module is configured to start the state management module and launch the thread management process; and upon receiving the state switching request, determine the program state of at least one corresponding program based on the target function group state; and send a switching message carrying the program state of the at least one program to the thread management process;

[0008] The thread management process is used to determine the target operating cycle of the program state of the at least one program through a configuration file after receiving the switching message, and send a thread management command carrying the program state of the at least one program and the corresponding target operating cycle to the at least one program, so that the at least one program causes the corresponding thread to run the target operating cycle in the program state according to the thread management command.

[0009] In a preferred example, the present application can be further configured as follows: the state management module is also used to: when receiving a state switching request for a target functional group state, arbitrate based on the target functional group state and the current functional group state to determine whether it is possible to switch to the target functional group state; if it is possible to switch to the target functional group state, send the state switching request to the execution management module.

[0010] In a preferred example, the present application may be further configured as follows: the state management module is further configured to: if the current function group state is an upgrade state or a diagnosis state, determine that it is not possible to switch to the target function group state.

[0011] In a preferred example, the present application can be further configured as follows: the thread management process includes: executable program thread management and thread management dynamic library, the thread management dynamic library is used to realize network communication with the program and the execution management module, and provide a cycle monitoring function, the cycle monitoring function enables the at least one program to monitor the target running cycle of the at least one program when executing operations according to the thread management command.

[0012] In a preferred example, the present application may be further configured as follows: the thread management process is further configured to receive a report success message indicating that the setting cycle of the at least one program is successful after the at least one program is adjusted to the corresponding program state according to the target cycle; and send the report success message to the execution management module;

[0013] The execution management module is further configured to send a message indicating that the at least one program has reached a corresponding program state to the state management module, so that the state management module records the program state of the at least one program.

[0014] In a preferred example, the present application can be further configured as follows: the execution management module is also used to send a switching message carrying the program state of the at least one program to the thread management process if the program state of the at least one program is different from the current program state of the at least one program, and the current program state of the at least one program can be switched to the program state of the at least one program.

[0015] In a preferred example, the present application may be further configured as follows: the execution management module is further configured to read the first configuration file for initialization and send a startup status to the status management module;

[0016] The state management module is further configured to read the second configuration file to complete its own startup after receiving the startup state; and report a startup state reaching message to the execution management module;

[0017] The execution management module is further configured to send a confirmation message to the status management module after receiving a message indicating that the startup state has been reached;

[0018] The state management module is further configured to send the initial state to the execution management module;

[0019] The execution management module is further configured to determine a corresponding program according to the initial state, send the initial state to the corresponding program, enable the corresponding program to complete startup, and report a startup completion message to the execution management module;

[0020] The execution management module is further configured to send a startup completion message to the status management module so that the status management module can record the message.

[0021] In a second aspect, a program management method is provided, comprising:

[0022] Calling the state management module, receiving a state switching request for the target state, and sending the state switching request to the execution management module;

[0023] calling the execution management module, receiving the state switching request, and determining the program state of at least one corresponding program based on the target function group state; and then sending a switching message carrying the program state of the at least one program to the thread management process;

[0024] The thread management process is called to receive the switching message, determine the target operating cycle of the program state of the at least one program through the configuration file, and send a thread management command carrying the program state of the at least one program and the corresponding target operating cycle to the at least one program, so that the at least one program makes the corresponding thread run the target operating cycle in the program state according to the thread management command.

[0025] According to a third aspect, an electronic device is provided. The electronic device includes a memory and a processor. A computer program is stored in the memory. The processor executes the method according to the second aspect when running the computer program.

[0026] In a fourth aspect, a computer-readable storage medium is provided, wherein at least one program code is stored in the computer-readable storage medium, and the program code is loaded and executed by a processor to implement the method as described in the second aspect.

[0027] In a fifth aspect, a computer program product is provided, comprising a computer program or instructions, which, when executed by a processor, implements the method described in the second aspect.

[0028] In summary, the program management device provided by this application has the following beneficial technical effects:

[0029] The state management module receives a state switching request for a target state and sends the request to the execution management module; ensuring that the state switching information can be transmitted in a timely manner; after receiving the state switching request, the execution management module can accurately determine which state each related program should be in according to different target states. A switching message carrying the program state of at least one program is sent to the thread management process; after the thread management process receives the message, the configuration file can pre-define the operating cycle under different program states, and then determine the target operating cycle of these program states through the configuration file; the thread management process sends a thread management command carrying the program state of at least one program and the corresponding target operating cycle to these programs, so that they run the target operating cycle in the corresponding program state according to the thread management command; ensuring that each program can be executed according to the predetermined state and operating cycle, avoiding program crashes caused by program state errors, thereby reducing the human resources wasted due to program crashes, improving the reliability and stability of the system, and ensuring that the process can exit normally and release resources.

[0030] In addition, the present application also provides a program management method, device and medium, all of which have the above-mentioned beneficial technical effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present application or the technical solutions of the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0032] Figure 1 This is a schematic diagram of the structure of a program management device provided in an embodiment of the present application;

[0033] Figure 2 This is a flowchart of a program management method provided by an embodiment of the present application;

[0034] Figure 3It is an interactive diagram of a general program management method;

[0035] Figure 4 This is an interactive diagram of a program management method provided by an embodiment of the present application;

[0036] Figure 5 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] This specific embodiment is merely an explanation of the present application and is not a limitation of the present application. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed, but as long as they are within the scope of the present application, they are protected by patent law.

[0038] It should be noted that in the optional embodiments of the present application, the object information and other related data involved, when the embodiments in the present application are applied to specific products or technologies, need to obtain the permission or consent of the object, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. In other words, if the embodiments of the present application involve data related to the object, it needs to be obtained with the permission of the object, the permission of the relevant department, and in compliance with the relevant laws, regulations and standards of the country and region. If personal information is involved in the embodiments, the acquisition of all personal information requires the consent of the individual. If sensitive information is involved, the separate consent of the information subject needs to be obtained. The embodiments also need to be implemented with the permission of the object.

[0039] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0040] In this document, the term "and / or" simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document, unless otherwise specified, generally indicates an "or" relationship between the related objects.

[0041] The embodiment of the present application provides a program management device, such as Figure 1 As shown, it includes: an execution management module 110, a state management module 120 and a thread management process 130;

[0042] The state management module 120 is used to monitor the state of the program; and when receiving a state switching request for the target functional group state, sends the state switching request to the execution management module 110;

[0043] The execution management module 110 is configured to start the state management module 120 and launch the thread management process 130; and upon receiving a state switching request, determine the program state of at least one corresponding program based on the target function group state; and send a switching message carrying the program state of the at least one program to the thread management process 130;

[0044] The thread management process 130 is used to determine the target operating cycle of the program state of at least one program through a configuration file after receiving a switching message, and send a thread management command carrying the program state of at least one program and the corresponding target operating cycle to at least one program, so that at least one program runs the corresponding thread in the program state for the target operating cycle according to the thread management command.

[0045] The state switching request for the target functional group state can be issued by any program or MCU, and the target functional state can be parking state, driving state, etc. Different functional states correspond to the program state of at least one program, and the states of different programs may be the same or different. Program states may include: startup ready state, running state, standby state, and shutdown termination state. For example, if functional state 1 corresponds to program 1 and program 2, program 1 is required to be in the running state, while program 2 is in the termination state.

[0046] After receiving the state switching request, the execution management module 110 can determine the program state of at least one corresponding program based on the target functional group state through a mapping relationship, where the mapping relationship is a mapping relationship between the functional group state and the corresponding program and program state.

[0047] The thread management process 130 pre-stores a configuration file, which is used to record the thread running cycle of the program APP in a specific state. For example: [

[0049] {

[0050] "name": "APP1",

[0051] "id": "1",

[0052] "statuses": [

[0053] {

[0054] "status": "running",

[0055] "cycle": 500

[0056] },

[0057] {

[0058] "status": "standby",

[0059] "cycle": 3000

[0060] },

[0061] {

[0062] "status": "shutdown",

[0063] "cycle": 0

[0064] } ]

[0066] } ]

[0068] For APP1, the ID is 1, the program state is running, and the corresponding thread running cycle is 500; the program state is running, and the corresponding thread running cycle is 3000; the program state is shutdown, and the corresponding thread running cycle is 0.

[0069] The thread management process 130130 sends a thread management command containing the program state and corresponding target operating cycle of at least one program to the at least one program, causing the at least one program to execute the corresponding thread within the program state and the target operating cycle according to the thread management command. The program APP can be a process, which includes multiple threads, such as service threads and control threads. The thread management command is given to the control thread for controlling the thread.

[0070] For example, after being started by the execution management module 110EM, the thread management process 130 remains in a silent state, waiting for the execution management module 110EM to send a switch message for setting the operating cycle through the thread management dynamic library provided by the thread management process 130. The thread management process 130 has a built-in thread management dynamic library for communication. When the program APP1 is started and needs to switch to the standby state, the execution management module 110EM sends a switch message to the thread management process 130. The thread management process 130 knows the operating cycle of the program APP1 based on the configuration file through the mapping of this state. The switch message is sent to the program APP1 through the communication dynamic library to set the cycle action. After the setting is completed, the A program PP1 will call the cycle monitoring function in the thread management dynamic library provided by the thread management process 130 to monitor the operating cycle of the program APP1. When the cycle meets the expectations, the program APP1 sends a cycle setting success message to the thread management process 130 to report the success message. The thread management process 130 then forwards the message to the execution management module 110EM. Furthermore, if the domain controller needs to be powered off safely, the execution management module 110EM sends shutdown to the thread management process 130. The thread management process 130 then sets the corresponding program execution period to 0, indicating that the thread is terminated.

[0071] As can be seen, in the embodiment of the present application, the state management module 120 receives a state switching request for a target state and sends the request to the execution management module 110, ensuring that the state switching information can be transmitted in a timely manner. After receiving the state switching request, the execution management module 110 can accurately determine the state that each related program should be in based on different target states. A switching message carrying the program state of at least one program is sent to the thread management process 130. After the thread management process 130 receives the message, the configuration file can pre-define the operating cycle under different program states, and then determine the target operating cycle of these program states through the configuration file. The thread management process 130 sends a thread management command carrying the program state of at least one program and the corresponding target operating cycle to these programs, so that they run the target operating cycle in the corresponding program state according to the thread management command. The finite state machine is used to implement the switching of process function groups, realize thread-level management, and control the start and stop of processes. It ensures that each program can be executed according to the predetermined state and operating cycle, avoiding program crashes caused by program state errors, thereby reducing the human resources wasted on troubleshooting program crashes, improving the reliability and stability of the system, and ensuring that the process can exit normally and release resources.

[0072] In a possible implementation of an embodiment of the present application, the state management module 120 is also used to: when receiving a state switching request for a target functional group state, arbitrate based on the target functional group state and the current functional group state to determine whether it is possible to switch to the target functional group state; if it is possible to switch to the target functional group state, send a state switching request to the execution management module 110.

[0073] The state management module 120 pre-stores the dependencies between the various functional group states. For example, functional group state 1 can only be switched if the previous state is functional group state 2. For another example, if the current functional group state is in the upgrade state or the diagnostic state, the functional group state cannot be switched. Furthermore, arbitration is performed between the target functional group state and the current functional group state to determine whether the functional group state can be switched.

[0074] In a possible implementation of an embodiment of the present application, the thread management process 130 includes: executable program thread management and a thread management dynamic library, the thread management dynamic library is used to implement network communication with the program and the execution management module 110, and provide a cycle monitoring function, the cycle monitoring function enables at least one program to monitor the target operating cycle of at least one program when executing operations according to thread management commands.

[0075] Among them, the present application designs a thread management process 130, which provides an executable program thread management (used to determine the operating cycle) and a thread management dynamic library (used to achieve communication). The thread management dynamic library can also be loaded and used by each APP. The thread management dynamic library and the executable program thread management are based on network communication to realize the reception of thread management commands sent by the thread management module, so that the program APP can operate the thread of the program APP after receiving the thread management command.

[0076] In a possible implementation of an embodiment of the present application, the thread management process 130 is further used to receive a successful reporting message of the successful setting cycle of at least one program after at least one program is adjusted to a corresponding program state according to a target cycle; and send the successful reporting message to the execution management module 110; the execution management module 110 is also used to send a message that at least one program has reached a corresponding program state to the state management module 120, so that the state management module 120 records the program state of at least one program.

[0077] In a possible implementation of an embodiment of the present application, the execution management module 110 is further used to send a switching message carrying the program state of at least one program to the thread management process 130 if the program state of at least one program is different from the current program state of at least one program, and the current program state of at least one program can be switched to the program state of at least one program.

[0078] The execution management module 110 can check the status of the program and store information about permissible changes in the program's previous and subsequent states. For example, program a can switch from state 1 to state 2, but cannot switch from state 1 to state 3. Furthermore, after determining the program state of at least one program to be switched, it is determined whether the program state of the at least one program is the same as the current program state of the at least one program, and whether the state switch is allowed. Only when all programs meet the requirements can a switch message be sent, further reducing the occurrence of program crashes caused by incorrect program state changes.

[0079] A possible implementation method of the embodiment of the present application is that the execution management module 110 is also used to read the first configuration file for initialization and send the startup status to the status management module 120; the status management module 120 is also used to read the second configuration file to complete its own startup after receiving the startup status; and report the startup status arrival message to the execution management module 110; the execution management module 110 is also used to send a confirmation message to the status management module 120 after receiving the startup status arrival message; the status management module 120 is also used to send the initial status to the execution management module 110; the execution management module 110 is also used to determine the corresponding program according to the initial status, and send the initial status to the corresponding program, so that the corresponding program completes the startup and reports the startup completion message to the execution management module 110; the execution management module 110 is also used to send the startup completion message to the status management module 120 so that the status management module 120 can record it. The present application realizes initialization through the above process, wherein the initial status refers to the program corresponding to the platform-level functional application that is pulled up.

[0080] A program management method provided in an embodiment of the present application is introduced below. The program management method described below and the program management device described above can be referenced to each other.

[0081] As you can understand, autonomous driving programs run in a polling mode, meaning they execute all code within a single cycle, looping. This cycle length varies depending on the function. Some functions require extremely fast response times, so the cycle is set to 10ms or even 5ms, which in turn increases the CPU resource consumption of the process. Other functions that don't require such fast response times may have a longer cycle, such as 100ms or even 1s. Within this framework, if you want to allow the program to wait silently without shutting down the process, or to run at a very low cycle, you need to introduce a cycle control module and integrate it with the AP AUTOSAR framework to control the program cycle. This paper proposes a program startup method based on the AP AUTOSAR framework. For programs that do not require a complete shutdown, this method uses a silent waiting method to reduce CPU resource utilization. For programs that need to be shut down, such as during a safe power-off, the AP AUTOSAR framework is used to shut down the process.

[0082] Specifically, the present application embodiment provides a program management method, such as Figure 2 As shown, the method provided in the embodiment of the present application can be executed by an electronic device, which is a server. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smartphone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited to this. The terminal device and the electronic device can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiment of the present application. The method includes:

[0083] S101, calling the state management module, receiving a state switching request for a target state, and sending the state switching request to the execution management module;

[0084] S102: Calling the execution management module, receiving the state switching request, and determining the program state of at least one corresponding program based on the target function group state; then sending a switching message carrying the program state of the at least one program to the thread management process;

[0085] S103. The calling thread management process receives the switching message, determines the target operating cycle of the program state of at least one program through the configuration file, and sends a thread management command carrying the program state of at least one program and the corresponding target operating cycle to the at least one program, so that the at least one program causes the corresponding thread to run the target operating cycle in the program state according to the thread management command.

[0086] It can be seen that in the embodiment of the present application, the state management module receives a state switching request for the target state and sends the request to the execution management module; ensuring that the state switching information can be transmitted in a timely manner; after receiving the state switching request, the execution management module can accurately determine what state each related program should be in according to different target states. A switching message carrying the program state of at least one program is sent to the thread management process; after the thread management process receives the message, the configuration file can pre-define the operating cycle under different program states, and then determine the target operating cycle of these program states through the configuration file; the thread management process sends a thread management command carrying the program state of at least one program and the corresponding target operating cycle to these programs, so that they run the target operating cycle in the corresponding program state according to the thread management command; ensuring that each program can be executed according to the predetermined state and operating cycle, avoiding the program crash caused by program state errors, thereby reducing the human resources wasted due to program crashes, improving the reliability and stability of the system, and ensuring that the process can exit normally and release resources.

[0087] A possible implementation method of an embodiment of the present application is to call the state management module, receive a state switching request for a target state, and send the state switching request to the execution management module, including: calling the state management module, and when receiving a state switching request for a target functional group state, arbitrate based on the target functional group state and the current functional group state to determine whether it is possible to switch to the target functional group state; if it is possible to switch to the target functional group state, send the state switching request to the execution management module.

[0088] A possible implementation of the embodiment of the present application further includes: if the current function group state is an upgrade state or a diagnosis state, determining that it is impossible to switch to the target function group state.

[0089] In a possible implementation of an embodiment of the present application, the thread management process includes: executable program thread management and a thread management dynamic library, the thread management dynamic library is used to implement network communication with the program and the execution management module, and provide a cycle monitoring function, the cycle monitoring function enables at least one program to monitor the target operating cycle of at least one program when executing operations according to thread management commands.

[0090] A possible implementation of the embodiment of the present application further includes: calling a thread management process, after at least one program is adjusted to a corresponding program state according to a target period, receiving a report success message indicating that the setting period of at least one program is successful; and sending the report success message to an execution management module;

[0091] The execution management module is called to send a message that the at least one program reaches a corresponding program state to the state management module, so that the state management module records the program state of the at least one program.

[0092] A possible implementation method of an embodiment of the present application is to send a switching message carrying the program state of at least one program to a thread management process, including: calling an execution management module; if the program state of at least one program is different from the current program state of at least one program, and the current program state of at least one program can be switched to the program state of at least one program, then sending a switching message carrying the program state of at least one program to the thread management process.

[0093] A possible implementation of the embodiment of the present application further includes: calling the execution management module, reading the first configuration file for initialization, and sending the startup status to the status management module;

[0094] After receiving the startup status, the calling state management module reads the second configuration file to complete its own startup; and reports the startup status reaching message to the execution management module;

[0095] After receiving the message that the startup state has been reached, the call execution management module sends a confirmation message to the state management module;

[0096] The calling state management module sends the initial state to the execution management module;

[0097] Call the execution management module to determine the corresponding program according to the initial state, and send the initial state to the corresponding program, so that the corresponding program completes the startup, and reports the startup completion message to the execution management module;

[0098] The call execution management module sends the completion startup message to the state management module so that the state management module can record it.

[0099] See also Figure 3Generally, the interactive process of the program management method includes: the execution management module EM reads the configuration file init and sends the startup status to the state management module SM; the state management module SM reads the configuration file init and successfully starts. Similarly, the thread management process is launched by the execution management module EM; taking the state management module SM as an example, the state management module SM reports the status to the execution management module EM, and EM confirms that the state management module SM has reached the startup state; the state management module SM sends the initial state to the execution management module EM, and the execution management module EM checks the initial state and sends an execution message for APP1; APP1 successfully starts and reports the startup success message to the execution management module EM; the execution management module EM confirms that the status has reached the initial state and sends it to the state management module SM. Furthermore, during actual operation, the state management module SM receives a message from APP1 indicating that it needs to switch to state 2; the state management module SM performs arbitration and, after successful arbitration, sends state 2 to the execution management module EM; the execution management module EM checks the status and sends a message to APP2; APP2 switches state and then reports the program status to EM; the execution management module EM sends the status of reaching state 2 to the state management module SM.

[0100] Based on any of the above embodiments, see Figure 4 , Figure 4 This is an interactive diagram of a program management method provided by an embodiment of the present application, including: the execution management module EM reads the configuration file init and sends the startup status to the state management module SM; the state management module SM reads the configuration file init and starts successfully. Similarly, the thread management process is pulled up by the execution management module EM; taking the state management module SM as an example, the state management module SM reports the status to the execution management module EM, and EM confirms that the state management module SM reaches the startup state; the state management module SM sends the initial status to the execution management module EM, the execution management module EM checks the initial status, and sends an execution message of APP1; APP1 starts successfully and reports the startup success message to the execution management module EM; the execution management module EM confirms that the status has reached the initial state and gives it to the state management module SM. Furthermore, during the actual operation, the state management module SM receives the information sent by APP2 that it needs to switch to state 2; the state management module SM performs arbitration, and after successful arbitration, it sends state 2 to the execution management module EM; the execution management module EM checks the state and sends a message to the thread management process; the thread management process knows the operating cycle of the APP in this state through the configuration file, and then sends it to APP1; APP1 sets the operating cycle and then reports the success to the thread management process; the thread management process reports the success of the APP1 operating cycle setting to the execution management module EM; the execution management module EM sends the state reaching state 2 to the state management module SM.

[0101] An electronic device is provided in an embodiment of the present application, such as Figure 5 As shown, Figure 5 The electronic device 300 shown includes: at least one processor 301 ( Figure 5 301 and memory 303. The processor 301 and memory 303 are connected, for example, via a bus 302. Optionally, the electronic device 300 may further include a transceiver 304. It should be noted that in practical applications, the number of transceivers 304 is not limited to one, and the structure of the electronic device 300 does not constitute a limitation on the embodiments of the present application.

[0102] Processor 301 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 301 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0103] Bus 302 may include a path for transmitting information between the above components. Bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. Bus 302 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0104] The memory 303 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0105] The memory 303 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the content shown in the above method embodiment.

[0106] Figure 5 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0107] An embodiment of the present application provides a computer-readable storage medium, which stores at least one program code. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding content of the aforementioned method embodiment.

[0108] An embodiment of the present application provides a computer program product, including a computer program or instructions, which implements the corresponding contents of the aforementioned method embodiment when the computer program or instructions are executed by a processor.

[0109] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0110] The above are only some of the implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A program management device, characterized in that: include: Execution management module, state management module and thread management process; The state management module is used to monitor the state of the program; and, when receiving a state switching request for the target functional group state, sending the state switching request to the execution management module; The execution management module is used to start the state management module and start the thread management process; and, after receiving the state switching request, determining a program state of at least one corresponding program based on the target functional group state; Sending a switch message carrying the program state of the at least one program to the thread management process; The thread management process is used to determine the target operating cycle of the program state of the at least one program through a configuration file after receiving the switching message, and send a thread management command carrying the program state of the at least one program and the corresponding target operating cycle to the at least one program, so that the at least one program causes the corresponding thread to run the target operating cycle in the program state according to the thread management command.

2. The device according to claim 1, characterized in that The state management module is also used to: when receiving a state switching request for a target functional group state, arbitrate based on the target functional group state and the current functional group state to determine whether it is possible to switch to the target functional group state; if it is possible to switch to the target functional group state, send the state switching request to the execution management module.

3. The device according to claim 2, characterized in that The state management module is further configured to: if the current function group state is an upgrade state or a diagnosis state, determine that it is not possible to switch to the target function group state.

4. The device according to claim 1, characterized in that The thread management process includes: executable program thread management and thread management dynamic library, the thread management dynamic library is used to realize network communication with the program and the execution management module, and provide a cycle monitoring function, the cycle monitoring function enables the at least one program to monitor the target operation cycle of the at least one program when executing operations according to the thread management command.

5. The device according to claim 4, characterized in that The thread management process is further configured to receive a successful reporting message indicating that the setting cycle of the at least one program is successful after the at least one program is adjusted to a corresponding program state according to the target cycle; and send the successful reporting message to the execution management module; The execution management module is further configured to send a message indicating that the at least one program has reached a corresponding program state to the state management module, so that the state management module records the program state of the at least one program.

6. The device according to claim 1, characterized in that The execution management module is further configured to send a switching message carrying the program state of the at least one program to the thread management process if the program state of the at least one program is different from the current program state of the at least one program and the current program state of the at least one program can be switched to the program state of the at least one program.

7. The device according to claim 1, characterized in that The execution management module is further configured to read the first configuration file for initialization and send a startup status to the status management module; The state management module is further configured to read the second configuration file to complete its own startup after receiving the startup state; and report a startup state reaching message to the execution management module; The execution management module is further configured to send a confirmation message to the status management module after receiving a message indicating that the startup state has been reached; The state management module is further configured to send the initial state to the execution management module; The execution management module is further configured to determine a corresponding program according to the initial state, send the initial state to the corresponding program, enable the corresponding program to complete startup, and report a startup completion message to the execution management module; The execution management module is further configured to send a startup completion message to the status management module so that the status management module can record the message.

8. A program management method, characterized in that: include: Calling the state management module, receiving a state switching request for the target state, and sending the state switching request to the execution management module; calling the execution management module, receiving the state switching request, and determining the program state of at least one corresponding program based on the target function group state; and then sending a switching message carrying the program state of the at least one program to the thread management process; The thread management process is called to receive the switching message, determine the target operating cycle of the program state of the at least one program through the configuration file, and send a thread management command carrying the program state of the at least one program and the corresponding target operating cycle to the at least one program, so that the at least one program makes the corresponding thread run the target operating cycle in the program state according to the thread management command.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor, wherein a computer program is stored in the memory, and the processor executes the method according to claim 8 when running the computer program.

10. A computer-readable storage medium, characterized in that At least one program code is stored in the computer-readable storage medium, and the program code is loaded and executed by the processor to implement the method according to claim 8.