Lifecycle management method, device, storage medium and electronic device
The global state manager and message scheduling mechanism manage the life cycle in the autonomous driving system, solving the flexibility and real-time problems of ECU life cycle management in the AUTOSAR architecture, and achieving efficient state transformation and component state detection.
Patent Information
- Application Number
- CN202111477749.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-06
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2041-12-06
AI Technical Summary
In the existing AUTOSAR automotive open system architecture, the ECU life cycle management method cannot meet the flexibility and real-time requirements of the autonomous driving system, resulting in the inflexible operation of the ECU and the complex configuration of the state machine, which affects performance and efficiency.
The global state manager is used to manage the life cycle, and the start and stop sequence and state transformation of application components are controlled through the message scheduling mechanism, reducing the number of thread switching times, and improving the efficiency of state transformation.
It achieves stable and efficient lifecycle management, supports automatic detection of application component status, ensures normal startup, and improves state transformation efficiency and system operation flexibility.
Smart Images

Figure CN114296892B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of autonomous driving systems, and in particular to methods, devices, storage media, and electronic devices for lifecycle management. Background Art
[0002] In the existing Automotive Development System Architecture (Autosar) automotive open system architecture lifecycle management, the startup of the electronic control unit (ECU) in the computing platform is handled by the electronic control unit state manager (ECU State Manager, EcuM). EcuM is responsible for waking up and shutting down the ECU, including further sleep (SLEEP) and shutdown (SHUTDOWN) states. EcuM handles all wake-up events of the ECU. It cooperates with the communication manager (ComM) and network management (Network Management, NM) modules to shut down the ECU when needed. EcuM is divided into three working modes: flexible, configurable, and fixed. The startup logic and ECU status under these three modes are different, and the integrator needs to configure accordingly. In addition, EcuM must support independent pre-processing actions and transitions to start the ECU or convert it to a low-power state (for example, sleep state / standby state). ECU lifecycle management based on the native kernel, whether using a real-time or non-real-time operating system, involves switching between user and kernel states for cross-domain node lifecycle management, impacting performance and preventing precise scheduling and orchestration tailored to the inherent characteristics of autonomous driving. Furthermore, the EcuM state machine configuration is relatively complex, with state transitions closely tied to the underlying operating system. The fixed state transition algorithms inherent in the EcuM state machine result in limited ECU operation flexibility, requiring integrators to implement specific control flows. As a foundational software module, EcuM belongs to the system service layer, providing services to modules at all levels of the AUTOSAR software architecture and closely interoperating with other modules. EcuM is one of the primary state machines for AUTOSAR-compliant ECUs, encompassing the highest-priority states of Run, Sleep, and Stop. Due to the constraints of the AUTOSAR standard and specifications, further optimizations for lifecycle real-time performance and configuration complexity are not possible.
[0003] As autonomous driving becomes a mainstream trend in the automotive industry, a wide variety of self-driving cars are being introduced. At the core of all autonomous vehicles is a central computing platform, responsible for computing tasks such as vehicle perception, positioning, and planning. This platform often requires multiple ECUs to manage different functions. Each ECU system interacts with other systems, and the starting and stopping of processes on each ECU impacts the operation of the entire platform. Therefore, a stable and efficient lifecycle management approach is required to control the operation of each platform's functional modules. Summary of the Invention
[0004] In order to solve at least one of the above-mentioned technical problems, the present disclosure proposes a method, apparatus, storage medium, and electronic device for lifecycle management.
[0005] According to one aspect of the present disclosure, a lifecycle management method is provided, which is applied to a first state manager of a first system. The method includes:
[0006] creating application components in the first system in sequence according to an initialization sequence, and in response to completion of creation of each application component, the first state manager entering a first state;
[0007] In response to entering the first state, the first state manager sends a first startup message to the downstream application components to trigger startup of each of the application components;
[0008] In response to the fact that all the application components have been started, the first state manager enters the second state;
[0009] In response to obtaining a shutdown event triggered by any of the application components, the first state manager sends a shutdown message to the application component to trigger the shutdown of each application component;
[0010] In response to the situation that all the application components are closed, the third state is entered.
[0011] In some possible implementations, the method further includes:
[0012] Starting a first transmission component of the first system so that the first transmission component of the first system establishes a connection with a second transmission component of a second system, wherein the second system is different from the first system;
[0013] The first state manager uses the first transmission component to send a first start synchronization message to the second state manager of the second system, and receives a second start synchronization message sent by the second state manager using the second transmission component, so that the second state manager performs time synchronization operations with the first state manager.
[0014] In some possible implementations, sending the first startup message to the downstream application components to trigger startup of each of the application components includes:
[0015] In response to receiving the message scheduling information sent by the scheduling manager, the first state manager sends the first startup message to the scheduling manager and the downstream application components;
[0016] The first state manager receives a to-be-started message sent by the scheduling manager;
[0017] According to the to-be-started message, the first state manager obtains a startup parameter, where the startup parameter is the number of application components downstream of the first state manager;
[0018] In response to the situation where the number of times the second startup message is received is equal to the startup parameter, the first state manager is started, wherein the second startup message is a feedback message sent after the application component is started, so that the first state manager determines that the application component is started.
[0019] In some possible implementations, the first state manager further includes a creation callback module; after sequentially creating each application component in the first system, the creation callback module is further called to enable the first state manager to determine that each application component in the first system has been created.
[0020] In some possible implementations, the first state manager further includes a startup callback module. After sending the first startup message to the downstream application component, the first state manager further includes, in response to the completion of startup of each application component, calling the startup callback module to enable the first state manager to determine that each application component in the first system has completed startup.
[0021] In some possible implementations, the first state management further includes a shutdown callback module. After sending the shutdown message to the other application components, it also includes, after monitoring that the shutdown of each application component is completed, calling the shutdown callback module, so that the first state manager determines that all application components in the first system are closed.
[0022] According to a second aspect of the present disclosure, a lifecycle management apparatus is provided, which is applied to a first state manager of a first system, and includes:
[0023] a creation completion module, configured to sequentially create each application component in the first system according to an initialization sequence, and in response to the completion of creation of each application component, the first state manager enters a first state;
[0024] a startup module, configured for the first state manager to send a first startup message to downstream application components in response to entering the first state, so as to trigger startup of each of the application components;
[0025] A second state transition module, configured to cause the first state manager to enter a second state in response to a situation in which all the application components have been started;
[0026] a shutdown message sending module, configured to, in response to obtaining a shutdown event triggered by any of the application components, cause the first state manager to send a shutdown message to the application component to trigger the shutdown of each of the application components;
[0027] The third state transition module is configured to enter the third state in response to a situation in which all the application components are shut down.
[0028] According to a third aspect of the present disclosure, a vehicle includes the above-mentioned lifecycle management device.
[0029] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the method for lifecycle management as described in any one of the first aspects by executing the instructions stored in the memory.
[0030] According to a fifth aspect of the present disclosure, a computer-readable storage medium is provided, in which at least one instruction or at least one program is stored, and the at least one instruction or at least one program is loaded and executed by a processor to implement the lifecycle management method as described in any one of the first aspects.
[0031] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
[0032] The beneficial effects of implementing the present disclosure are as follows:
[0033] This disclosure supports automatically maintaining the start-up and shutdown order of all application components in the communication framework, as well as automatically detecting the status of each application component to determine whether it has started normally. The lifecycle state transitions of application components in the system are completed through a message scheduling mechanism. Through global state manager management, there is no need to switch states individually within multiple threads, reducing thread scheduling, the number of task context switches, and the number of queries on the current task of the application component. This improves the efficiency of state transitions, facilitates verification of the validity of the current state, and stably manages the lifecycles of various functional modules.
[0034] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions and advantages of the embodiments of this specification or the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0036] Figure 1 A flowchart illustrating a method for lifecycle management according to an embodiment of the present disclosure is shown;
[0037] Figure 2 A schematic diagram showing the structure of a state machine of a state manager according to an embodiment of the present disclosure is shown;
[0038] Figure 3 A diagram showing a startup sequence of a state manager according to an embodiment of the present disclosure;
[0039] Figure 4 A schematic diagram showing the status of an application component according to an embodiment of the present disclosure;
[0040] Figure 5 A schematic structural diagram of a lifecycle management device according to an embodiment of the present disclosure is shown;
[0041] Figure 6 A block diagram illustrating an electronic device according to an embodiment of the present disclosure is shown;
[0042] Figure 7 A block diagram of another electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the embodiments described are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this invention.
[0044] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0045] Various exemplary embodiments, features, and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.
[0046] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0047] The term "and / or" herein simply describes an association relationship between associated objects, indicating that three relationships can exist. For example, "A and / or B" can represent the existence of three situations: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" herein refers to any combination of at least two of any one or more of a plurality of items. For example, "at least one of A, B, and C" can represent any one or more elements selected from the set consisting of A, B, and C.
[0048] In addition, numerous specific details are provided in the following detailed description to better illustrate the present disclosure. Those skilled in the art will appreciate that the present disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art are not described in detail in order to highlight the main points of the present disclosure.
[0049] As autonomous driving becomes a mainstream trend in future vehicles, a variety of self-driving cars are constantly emerging. At the core of all autonomous vehicles is a central computing platform, responsible for computing tasks such as the vehicle's integrated perception, positioning, and planning. This platform often requires multiple ECUs to manage different functions. Each ECU system interacts with other systems, and the startup and shutdown of processes on each ECU impacts the operation of the entire platform. Therefore, a stable and efficient lifecycle management method is needed to control the operation of each functional module of the platform. In view of this, embodiments of the present disclosure provide a lifecycle management method that automatically maintains the startup and shutdown order of all application components in a communication framework and automatically detects the status of each application component to determine whether it has started normally. The lifecycle state transitions of application components in the system are completed through a message scheduling mechanism. A global state manager eliminates the need for separate state transitions within multiple threads, reducing thread scheduling, the number of task context switches, and the number of queries on the current task of application components. This improves the efficiency of state transitions, facilitates verification of the validity of the current state, and stably manages the lifecycles of various functional modules.
[0050] This method is implemented by a state manager for the lifecycle management of the autonomous driving heterogeneous communication framework. It manages the initialization and shutdown of the heterogeneous communication framework, including the initialization and shutdown of all functional modules within the framework, as well as the startup and shutdown of application components within the heterogeneous network. In a distributed heterogeneous system, each application component maintains its own state management and can be easily expanded to respond to additional system states, such as synchronizing the state of the autonomous driving management system (Adaptive AutosarEM Service). This allows each application component to synchronize with the system state in real time (System Lifecycle Aware), achieving global lifecycle management. All applications support startup (StartUp) and shutdown (ShutDown) states, allowing synchronization with the states of other systems managed by the autonomous driving system (Adaptive Autosar). This method automatically maintains the startup and shutdown order of all node state chains and automatically checks the state of each application to determine whether it has started normally. System lifecycle state transitions are completed through a message dispatch mechanism, improving state transition efficiency and facilitating verification of the current state validity.
[0051] First, the user creates a network topology diagram of each application node, that is, the application component, according to the scenario needs, and then connects the application nodes. According to the configured application node description file, the code generator generates the startup sequence of the application component. Then, the user writes the callback function for the corresponding state change of the application component according to the needs, including: creation function onCreated(), running function onStart(), stop process function onStopAsyncOperation(), stop function onStop(), and destruction function onDestory(). After each application component is created, the creation function onCreated() is called to initialize the application component, such as creating the application component thread and assigning the relevant parameters of the application component. After each application component processes the startup message The run function onStart() is called to perform operations in the startup phase of the application component, such as printing the startup log, creating messages to be sent, and sending messages to specified components. When an application component has multiple threads running at the same time, the stop process synchronization operation function onStopAsyncOperation() will be called when the application component is stopped. It waits for all active threads of the application component to stop running for synchronization operations and triggers the closure of related threads. When the application component does not send or receive messages in the closing phase, the stop function onStop() is called to complete the operations in the closing phase of the application component, mark the component no longer sending or receiving messages, close event listening and close timers, etc. After the application component is closed, the destruction function onDestory() is called to destroy the component and release the memory occupied by the component.
[0052] Figure 1 A flow chart showing a method for lifecycle management according to an embodiment of the present disclosure is shown as follows: Figure 1 As shown, the above method includes:
[0053] S101: Create application components in the first system in sequence according to an initialization sequence. In response to completion of creation of each application component, the first state manager enters a first state.
[0054] In the first system, after the first system context is initialized, the application component calls its own start function onStartup() before it starts to be created, indicating that the first state manager can start to create the application component. The first state manager is first created in the process started by the user. First, the first state manager is created. In the process of creating the first state manager, each application component is created in sequence according to the initialization sequence, wherein the initialization sequence includes the creation order of each application component; when all application components are created, the first state manager calls the creation callback function onCreated() of the state manager's creation callback module. The first state manager determines that all application components have been created, and the first state manager enters the first state. The first state is the creation completion state, indicating that the first state manager can start to start the application component. After the first state manager is created, it starts to start the application node, that is, the application component. On the main thread of the main function main() of the application node, the Init() function is called, and the callback functions of the creation callback module onCreated(), the startup callback function onStartup() of the startup callback module, and the shutdown callback function onCleanup() of the shutdown callback module are bound to the first state manager. These callback functions correspond to the state changes after creation, startup, and stop, respectively. Then, the messages that the state manager needs to send are created, including: Start message, StartTimeSynchronization message, InitialStop message, Stop message, and Destroy message.
[0055] S102: In response to entering the first state, the first state manager sends a first startup message to downstream application components to trigger startup of each of the application components.
[0056] After the first state manager enters the first state (i.e., the creation state), it begins startup. According to the startup sequence, the first state manager sends a first startup message to the application components downstream of the first state manager. The startup sequence occurs during the user configuration phase, where the user creates a network topology diagram of each application node based on scenario requirements and then connects the application nodes. Based on the configured node description file, a code generator generates a startup sequence for the application components, which includes the distribution of the application components. The application components downstream of the first state manager are considered the first group of application components. After the first group of application components is started, a second startup message is sent to the application components downstream of the first group. The application components downstream of the first group are considered the second group of application components. After the second group of application components is started, a second startup message is sent to the application components downstream of the second group. This continues until all application components are started. The last group of application components to have started sends a second startup message to the first state manager. Upon receiving the second startup message from the application components, the first state manager completes startup. The purpose of the startup state is to initialize various system modules. Startup behavior includes executing initialization code and performing some necessary stack setup. The startup process is then handled by the first state manager, which is divided into two parts. The application component startup process is divided into two parts. Before the first state manager transitions to the Startup state, it generates the initialization sequence, completes the creation of the scheduler manager, completes the creation of all application components, and executes related callback functions. After the first state manager transitions to the Startup state, it enters the second part, which activates the execution of the startup application component task and completes the startup of the application component. At this time, the RTE (Runtime Context Environment) is also started, and the first state manager enters the Running state.
[0057] S103: In response to the fact that all the application components have been started, the first state manager enters the second state;
[0058] When all application components are started, the application components start running, and the first state manager also enters the second state, that is, the running state, and the first state manager starts to monitor the stop event of the application components.
[0059] S104: In response to obtaining a shutdown event triggered by any of the application components, the first state manager sends a shutdown message to the application component to trigger the shutdown of each application component;
[0060] When an application component calls the Stop() function, it sends an InitialStop message to the first state manager, triggering it to send a Stop message to the application component. The application component then sends these messages to other application components according to the stop sequence, which is the inverse of the start sequence. Upon receiving the Stop message, the application component calls the onStopping() callback function in the stop callback module to perform necessary synchronization operations.
[0061] S105: In response to the situation that all the application components are closed, entering the third state.
[0062] The application component waits for unfinished messages to be processed. Once it verifies that there are no message interactions with other application components, it sends itself a ReadyForStop message, entering the shutdown state. When all application components are closed, the first state manager enters the third state, the shutdown state. The lifecycle state transitions of application components in the system are completed through a message scheduling mechanism. Managed by a global state manager, there's no need to switch states individually within multiple threads, reducing thread scheduling, the number of task context switches, and the number of queries for the application component's current task. This improves the efficiency of state transitions, facilitates verification of the validity of the current state, and stably manages the lifecycles of each functional module.
[0063] like Figure 2 As shown, the first state manager is first created in the process started by the user. After all application components are created, it enters the Created state. It then enters the Startup state before starting the application components. After all application components have been started, the first state manager enters the Running state. When all application components are closed, the first state manager enters the Cleanup state.
[0064] The first state manager defines the internal life cycle state for each application component, such as Figure 3As shown in the figure. After the application component is created, the first state manager enters the Created state. In this Created state, messages cannot be sent or received, meaning that the application component cannot interact with other application components. The first state manager transmits a Start message to the application component through the scheduling manager's message dispatching mechanism. The application component will start in an orderly manner according to the user-configured network layer. After the application component starts, it enters the Started state. In this Started state, the application component can send and receive messages, indicating that the application component has begun running. When a shutdown event is triggered by an application component, the first state manager sends a Stop message to the application component. The application component then passes the Stop message to its other connected application components, shutting down the application component in an orderly manner. The shutdown of an application component occurs in two stages. The first stage is receiving a Stop message from another component, entering the Stopping state. In this state, messages can be sent and received. After completing the necessary synchronization operations, the application component sends a ReadyForStop message to itself. After processing this message, the application component enters the Stopped state, in which messages cannot be sent or received.
[0065] like Figure 4 As shown in the example, the state manager between system components and application components starts and shuts down the entire heterogeneous system by activating the Startup network and disabling the Shutdown network, thereby achieving efficient lifecycle management. It supports automatic maintenance of the start and stop sequence in all node state chains and automatically detects the status of each application component to determine whether it has started normally. The system lifecycle state transition is completed through a message scheduling mechanism, improving the efficiency of state transitions and facilitating verification of the validity of the current state.
[0066] In one embodiment, the method further comprises:
[0067] Starting a first transmission component of the first system so that the first transmission component of the first system establishes a connection with a second transmission component of a second system, wherein the second system is different from the first system;
[0068] The first state manager uses the first transmission component to send a first start synchronization message to the second state manager of the second system, and receives a second start synchronization message sent by the second state manager using the second transmission component, so that the second state manager performs time synchronization operations with the first state manager.
[0069] If there are cross-domain systems that need to communicate, the cross-domain systems include a first system and a second system. The first system includes a first transport component, and the second system includes a second transport component. Before establishing an application component, both systems will start the transport component. The first system starts the first transport component, and the second system starts the second transport component. The first system sends a StartTimeSynchronization message to the second transport component of the second system through the first transport component to notify the second system to perform time synchronization. During this process, each application component instance has a counter to ensure the correctness of the startup sequence. Message transmission and processing are managed by a scheduler manager, which uses a first-in-first-out (FIFO) scheduling mode and can be configured with multiple schedulers for startup.
[0070] In one embodiment, sending the first startup message to the downstream application components to trigger startup of each of the application components includes:
[0071] In response to receiving the message scheduling information sent by the scheduling manager, the first state manager sends the first startup message to the scheduling manager and the downstream application components;
[0072] The first state manager receives a to-be-started message sent by the scheduling manager;
[0073] According to the to-be-started message, the first state manager obtains a startup parameter, where the startup parameter is the number of application components downstream of the first state manager;
[0074] In response to the situation where the number of times the second startup message is received is equal to the startup parameter, the first state manager is started, wherein the second startup message is a feedback message sent after the application component is started, so that the first state manager determines that the application component is started.
[0075] The first state manager will receive the message dispatch information MessageDispatcher sent by the scheduling manager after the creation is completed. After receiving this message, the first state manager will send a first startup message Start to the application components downstream of the first state manager and the scheduling manager according to the startup sequence. After receiving the first startup message sent by the first state manager, the scheduling manager sends a waiting startup message to the first state manager. The first state manager obtains startup parameters from the waiting startup message. The startup parameter is the number of application components downstream of the first state manager in the network topology diagram of the application components. If the number of application components downstream of the first state manager is 1, the startup parameter of the first state manager is 1. In this case, the downstream application components of the first state manager are regarded as the first group of application components. After the first group of application components receives the first startup message sent by the first state manager and starts, it sends a second group of startup messages to the downstream application components of the second group of application components. After all application components are started, the number of second startup messages received by the first state manager is the same as the startup parameter. At this point, the first state manager enters the startup complete state. The second startup message is the feedback message sent after the application component startup is complete. During this process, each application component instance has a counter to ensure the correctness of the startup sequence. The transmission and processing of messages are managed by the scheduler manager, which adopts the FIFO scheduling mode and can configure multiple schedulers for startup.
[0076] In one embodiment, the first state manager further includes a creation callback module; after sequentially creating each application component in the first system, the process further includes calling the creation callback module so that the first state manager determines that each application component in the first system has been created.
[0077] The first state manager also includes a creation callback module, which includes a creation callback function onCreated(). After all application components are created by the first state manager and before all application components are started by the first state manager, the first state manager calls the creation callback function onCreated(), so that the first state manager determines that all application components have been created, indicating that the first state manager can start starting the application components.
[0078] In some possible implementations, the first state manager further includes a startup callback module. After sending the first startup message to the downstream application component, the first state manager further includes, in response to the completion of startup of each application component, calling the startup callback module to enable the first state manager to determine that each application component in the first system has completed startup.
[0079] The first state manager also includes a startup callback module, which includes a startup callback function onStarted(). After all application components are started by the first state manager and before all application components are officially running, the first state manager calls the startup callback function onStarted(), so that the first state manager determines that all application components have been started, indicating that the first system can start running the application components.
[0080] In some possible implementations, the first state management further includes a shutdown callback module. After sending the shutdown message to the other application components, it also includes, after monitoring that the shutdown of each application component is completed, calling the shutdown callback module, so that the first state manager determines that all application components in the first system are closed.
[0081] The first state manager also includes a shutdown callback module, which includes a cleanup callback function onCleanup(). After all application components are closed by the first state manager, the first state manager calls the cleanup callback function onCleanup(), so that the first state manager determines that all application components have been closed and performs necessary cleanup work, such as releasing memory resources.
[0082] like Figure 5 As shown, according to a second aspect of the present disclosure, a lifecycle management apparatus is provided, which is applied to a first state manager of a first system, and the apparatus includes:
[0083] A creation completion module 10 is configured to sequentially create application components in the first system according to an initialization sequence, and in response to the completion of creation of each application component, the first state manager enters a first state;
[0084] a startup module 20 configured to, in response to the first state manager entering the first state, send a first startup message to downstream application components to trigger startup of each of the application components;
[0085] A second state transition module 30 is configured to cause the first state manager to enter a second state in response to the fact that all the application components have been started.
[0086] a shutdown message sending module 40, configured to, in response to obtaining a shutdown event triggered by any of the application components, cause the first state manager to send a shutdown message to the application component to trigger the shutdown of each application component;
[0087] The third state transition module 50 is configured to enter the third state in response to a situation in which all the application components are shut down.
[0088] According to a third aspect of the present disclosure, a vehicle includes the above-mentioned lifecycle management device.
[0089] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0090] The present disclosure also provides a computer-readable storage medium having at least one instruction or at least one program stored therein. When the at least one instruction or at least one program is loaded and executed by a processor, the computer-readable storage medium implements the aforementioned method. The computer-readable storage medium may be a non-volatile computer-readable storage medium.
[0091] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to perform the above method.
[0092] The electronic device may be provided as a terminal, a server, or other forms of devices.
[0093] Figure 6 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like.
[0094] Reference Figure 6 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0095] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 802 may include one or more modules to facilitate interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
[0096] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0097] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.
[0098] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensors may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide action. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0099] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), which is configured to receive external audio signals when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0100] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as a keyboard, click wheel, buttons, etc. These buttons may include but are not limited to: a home button, volume buttons, a start button, and a lock button.
[0101] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of components, such as the display and keypad of the electronic device 800. The sensor assembly 814 can also detect changes in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0102] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0103] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0104] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 804 including computer program instructions. The computer program instructions can be executed by the processor 820 of the electronic device 800 to perform the above method.
[0105] Figure 7 1 shows a block diagram of another electronic device according to an embodiment of the present disclosure. For example, the electronic device 1900 can be provided as a server. Figure 7The electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute the instructions to perform the above-described method.
[0106] The electronic device 1900 may further include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.
[0107] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions that can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.
[0108] The present disclosure may be a system, method and / or computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0109] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof. As used herein, a computer-readable storage medium is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through an electrical wire.
[0110] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.
[0111] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, and conventional procedural programming languages such as "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, which may be executed by the computer-readable program instructions to implement various aspects of the present disclosure.
[0112] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.
[0113] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0114] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.
[0115] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the above-mentioned module, program segment or instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions specified in the box can also occur in an order different from the order specified in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart, can be implemented by a special hardware-based system that performs the specified function or action, or can be implemented by a combination of special hardware and computer instructions.
[0116] While various embodiments of the present disclosure have been described above, the foregoing description is intended to be illustrative, non-exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or technical improvements to existing technologies, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A lifecycle management method, applied to a first state manager of a first system, the method comprising: creating application components in the first system in sequence according to an initialization sequence, and in response to completion of creation of each application component, the first state manager entering a first state; In response to entering the first state and receiving message scheduling information sent by the scheduling manager, the first state manager sends a first startup message to the scheduling manager and downstream application components according to a startup sequence, wherein the startup sequence includes distribution of application components; The first state manager receives a to-be-started message sent by the scheduling manager; According to the to-be-started message, the first state manager obtains a startup parameter, where the startup parameter is the number of application components downstream of the first state manager; In response to a situation where the number of times the second startup message is received is equal to the startup parameter, the first state manager is started up, wherein the second startup message is a feedback message sent after the application component is started up, so that the first state manager determines that the application component is started up; In response to the fact that all the application components have been started, the first state manager enters the second state; In response to obtaining a shutdown event triggered by any of the application components, the first state manager sends a shutdown message to the application component according to a stop sequence to trigger shutdown of each application component, where the stop sequence and the start sequence are opposite to each other; In response to the situation that all the application components are closed, the third state is entered.
2. The method according to claim 1, characterized in that The method further comprises: Starting a first transmission component of the first system so that the first transmission component of the first system establishes a connection with a second transmission component of a second system, wherein the second system is different from the first system; The first state manager uses the first transmission component to send a first start synchronization message to the second state manager of the second system, and receives a second start synchronization message sent by the second state manager using the second transmission component, so that the second state manager performs time synchronization operations with the first state manager.
3. The method according to claim 1, characterized in that The first state manager further includes a creation callback module; after sequentially creating each application component in the first system, the process further includes calling the creation callback module so that the first state manager determines that each application component in the first system has been created.
4. The method according to claim 1, wherein The first state manager further includes a startup callback module. The method further includes, in response to each application component being started up, calling the startup callback module, so that the first state manager determines that each application component in the first system is started up.
5. The method according to claim 1, wherein The first state management also includes a closing callback module. After sending the closing message to the other application components, it also includes, after monitoring that each application component has completed closing, calling the closing callback module, so that the first state manager determines that each application component in the first system is closed.
6. A lifecycle management device, applied to a first state manager of a first system, characterized in that: The device comprises: a creation completion module, configured to sequentially create each application component in the first system according to an initialization sequence, and in response to the completion of creation of each application component, the first state manager enters a first state; a startup message sending module, configured for the first state manager to respond to entering the first state and receiving message scheduling information sent by the scheduling manager, and for the first state manager to send a first startup message to the scheduling manager and downstream application components according to a startup sequence, wherein the startup sequence includes the distribution of application components; A startup message receiving module, configured for the first state manager to receive a to-be-started message sent by the scheduling manager; A startup parameter acquisition module, configured to acquire startup parameters by the first state manager according to the to-be-started message, where the startup parameters are the number of application components downstream of the first state manager; a startup determination module, configured to determine that the first state manager has completed startup in response to a situation where the number of times the second startup message is received is equal to the startup parameter, wherein the second startup message is a feedback message sent after the application component is successfully started, so that the first state manager determines that the application component has completed startup; A second state transition module, configured to cause the first state manager to enter a second state in response to a situation in which all the application components have been started; a shutdown message sending module, configured to, in response to obtaining a shutdown event triggered by any of the application components, cause the first state manager to send a shutdown message to the application component according to a stop sequence, thereby triggering the shutdown of each application component, wherein the stop sequence and the start sequence are opposite to each other; The third state transition module is configured to enter the third state in response to a situation in which all the application components are shut down.
7. A vehicle, characterized in that: The device comprises the lifecycle management device as claimed in claim 6.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by a processor to implement the lifecycle management method according to any one of claims 1 to 5.
9. An electronic device, characterized in that: It includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the lifecycle management method as described in any one of claims 1 to 5 by executing the instructions stored in the memory.
Citation Information
Patent Citations
Life cycle management methods of distributed applications, managers, equipment and mediums
CN108595316A
application program keep-alive method and device, computer equipment and storage medium
CN109992310A