Adaptive platform state management methods, systems, devices, and storage media
By using StateTransitionMap and CurrentStates to determine keywords in the adaptive platform, the simplicity of the adaptive platform state management component is achieved, the problem of customized function cluster state is solved, and the code structure is simplified.
Patent Information
- Application Number
- CN202311186082.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-12
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-09-12
AI Technical Summary
In adaptive platforms, state management components need to handle the state of customized functional clusters in projects, leading to problems of redundant development and high code complexity.
By calling the state switching interface of the arbitration logic class and passing in the event ID, multiple keywords are retrieved from the StateTransitionMap, and the target keyword is selected according to CurrentStates to determine the state to be migrated. Finally, the execution management component interface is called to perform the state migration.
It improves the code simplicity of the state management component, effectively handles the customized functional cluster states of different projects, and reduces redundant development.
Smart Images

Figure CN117290372B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of adaptive platform technology, and in particular to an adaptive platform state management method, system, device and storage medium. Background Technology
[0002] The AUTOSAR Adaptive Platform (AUTOSAR AP) is a new automotive electronic system architecture standard based on Service-Oriented Architecture (SOA), providing solutions for high-performance ECU development. AP abstracts the functions performed by one or more ECUs in a vehicle into services and provides them to users in the form of a service structure, thus shielding hardware differences and decoupling services from applications. The state management component in the AP platform maintains a state machine responsible for managing the state of the functional cluster. Upon receiving an external request, it determines the current state of the state machine and performs the corresponding state transition. Because the state of the functional clusters managed by the state management is highly customized and differs from project to project, avoiding redundant development is crucial. Therefore, how to handle the customized functional cluster states in the state management component of the adaptive platform becomes a pressing issue.
[0003] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0004] The main objective of this invention is to provide an adaptive platform state management method, system, device, and storage medium, aiming to solve the technical problem of how to handle the customized functional cluster states of a project in the state management component of an adaptive platform.
[0005] To achieve the above objectives, the present invention provides an adaptive platform state management method, the adaptive platform state management method comprising:
[0006] When an external request is received, the state switching interface of the arbitration logic class is called, and the event ID is passed in.
[0007] Retrieve multiple keywords corresponding to the event ID from the StateTransitionMap, and select the target keyword from the multiple keywords based on CurrentStates;
[0008] Determine the migration status based on the target keywords;
[0009] Call the execution management component interface to migrate the current state to the state to be migrated.
[0010] Optionally, before the step of calling the state switching interface of the arbitration logic class and passing in the event ID when receiving an external request, the method further includes:
[0011] The member variables in the arbitration logic class are initialized, including CurrentStates and StateTransitionMap.
[0012] Optionally, the step of selecting the target keyword from multiple keywords based on CurrentStates includes:
[0013] Construct a keyword set based on multiple keywords, and determine the state values corresponding to multiple keywords in the keyword set respectively;
[0014] Select target keywords from multiple keywords that correspond to the subset of the state value that satisfies the conditions of CurrentStates.
[0015] Optionally, the step of determining the migration state based on the target keyword includes:
[0016] The key value corresponding to the target keyword is determined based on the StateTransitionMap;
[0017] The migration status is determined based on the key values.
[0018] Optionally, after the step of calling the execution management component interface to migrate the current state to the state to be migrated, the method further includes:
[0019] After the state transition is successful, the CurrentStates are refreshed.
[0020] Furthermore, to achieve the above objectives, the present invention also proposes an adaptive platform state management system, which includes:
[0021] The input module is used to call the state switching interface of the arbitration logic class and pass in the event ID when an external request is received;
[0022] The selection module is used to retrieve multiple keywords corresponding to the event ID from the StateTransitionMap, and select the target keyword from the multiple keywords based on CurrentStates;
[0023] The determination module is used to determine the migration status based on the target keyword;
[0024] The migration module is used to call the execution management component interface to migrate the current state to the state to be migrated.
[0025] Furthermore, to achieve the above objectives, the present invention also proposes an adaptive platform state management device, the device comprising: a memory, a processor, and an adaptive platform state management program stored in the memory and executable on the processor, the adaptive platform state management program being configured to implement the steps of the adaptive platform state management method as described above.
[0026] Furthermore, to achieve the above objectives, the present invention also proposes a storage medium storing an adaptive platform state management program, which, when executed by a processor, implements the steps of the adaptive platform state management method described above.
[0027] When receiving an external request, this invention first calls the state switching interface of the arbitration logic class, passing in the event ID. Then, it retrieves multiple keywords corresponding to the event ID from the StateTransitionMap, selects a target keyword from these keywords based on CurrentStates, determines the state to be migrated based on the target keyword, and finally calls the execution management component interface to migrate the current state to the state to be migrated. Compared to existing technologies where the states of functional clusters managed by state management are highly customized, this application determines keywords through StateTransitionMap and CurrentStates, and calls the execution management component interface to migrate the current state to the state to be migrated based on the keyword. This solves the problem of state management components in adaptive platforms needing to handle customized functional cluster states, thereby improving the simplicity of the state management component code. Attached Figure Description
[0028] Figure 1 This is a schematic diagram of the structure of the adaptive platform state management device for the hardware operating environment involved in the embodiments of the present invention;
[0029] Figure 2 This is a flowchart illustrating the first embodiment of the adaptive platform state management method of the present invention;
[0030] Figure 3 This is a schematic diagram of the state association process in the first embodiment of the adaptive platform state management method of the present invention;
[0031] Figure 4 This is a structural block diagram of the first embodiment of the adaptive platform state management system of the present invention.
[0032] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0033] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0034] Reference Figure 1 , Figure 1 This is a schematic diagram of the adaptive platform state management device structure for the hardware operating environment involved in the embodiments of the present invention.
[0035] like Figure 1 As shown, the adaptive platform state management device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk storage device. Optionally, the memory 1005 may also be a storage system independent of the aforementioned processor 1001.
[0036] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the adaptive platform state management device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0037] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and an adaptive platform state management program.
[0038] exist Figure 1 In the adaptive platform state management device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the adaptive platform state management device of the present invention can be set in the adaptive platform state management device, and the adaptive platform state management device calls the adaptive platform state management program stored in the memory 1005 through the processor 1001 and executes the adaptive platform state management method provided in the embodiment of the present invention.
[0039] This invention provides an adaptive platform state management method, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the adaptive platform state management method of the present invention.
[0040] It should also be understood that, in order to enable the state management component of the AUTOSAR Adaptive Platform to handle customized states for different projects, the present invention adopts the following technical solution:
[0041] The state machine in the state management component is maintained by an arbitration logic class (ArbitrationLogic). ArbitrationLogic has two member variables: the current state (CurrentStates) and the state transition table (StateTransitionMap), as well as a state switching interface (SwitchState).
[0042] CurrentStates encapsulates the current functional cluster state, which is dynamic and affected by external factors.
[0043] The StateTransitionMap encapsulates a key-value matrix. The key contains two sets of data: the precondition and the event ID. The precondition contains a set of states, a subset of CurrentStates, and the event ID represents the ID of the externally input event. The value also contains a set of states, representing the state to be transitioned to.
[0044] The SwitchState interface has an input parameter eventId, and this interface is called after the state management receives an external request.
[0045] After receiving an external request (eventId), ArbitrationLogic combines the data from CurrentStates and StateTransitionMap to determine whether to perform a state transition.
[0046] In this embodiment, the adaptive platform state management method includes the following steps:
[0047] Step S10: When an external request is received, the state switching interface of the arbitration logic class is called and the event ID is passed in.
[0048] It is easy to understand that the execution subject of this embodiment can be an adaptive platform state management system with functions such as data processing, network communication and program execution, or other computer devices with similar functions. This embodiment does not limit it.
[0049] It should also be noted that the reference Figure 3 , Figure 3 This is a schematic diagram of the state association process in the first embodiment of the adaptive platform state management method of the present invention. The member variables in the arbitration logic class are initialized. The member variables include CurrentStates and StateTransitionMap. After receiving an external request, ArbitrationLogic calls the state switching interface of the arbitration logic class and passes in the event ID.
[0050] External requests include the event ID, i.e., eventId.
[0051] In this embodiment, the data of the member variable CurrentStates and the StateTransitionMap matrix are initialized in the ArbitrationLogic class. When the state management receives an external request, it calls the SwitchState interface of the ArbitrationLogic class and passes in the eventId parameter.
[0052] Step S20: Retrieve multiple keywords corresponding to the event ID from the StateTransitionMap, and select the target keyword from the multiple keywords according to CurrentStates.
[0053] Furthermore, the process of selecting target keywords from multiple keywords based on CurrentStates involves constructing a keyword set based on multiple keywords, determining the state values (states) corresponding to each keyword in the keyword set, and then filtering the target keywords from the multiple keywords whose state values satisfy the subset conditions of CurrentStates.
[0054] In the specific implementation, the eventId is retrieved in the StateTransitionMap, and keys that are equal to the eventId are selected. That is, the eventId contained in the key is the same as the search condition eventId. These keys are stored in the key set (kSet). Then, the states corresponding to multiple keys are determined. If the states of a certain key in kSet are a subset of the current states, then this key is selected as the target key.
[0055] It should also be understood that one of the values stored in the key is states, which is a subset of the current states.
[0056] The condition for a subset of CurrentStates is that the states in the key are a subset of currentstates.
[0057] Step S30: Determine the migration status based on the target keyword.
[0058] Furthermore, the process of determining the state to be migrated based on the target keyword is as follows: determine the key value corresponding to the target keyword based on the StateTransitionMap; and determine the state to be migrated based on the key value.
[0059] In this embodiment, the corresponding value in the statetransitionmap is determined based on the target keyword.
[0060] Step S40: Call the execution management component interface to migrate the current state to the state to be migrated.
[0061] In the actual implementation, the ExecutionManagement component interface is called to migrate the current state to the state to be migrated. After the state migration is successful, CurrentStates is refreshed.
[0062] In this embodiment, upon receiving an external request, the state switching interface of the arbitration logic class is first called, passing in the event ID. Then, multiple keywords corresponding to the event ID are retrieved from the StateTransitionMap, and a target keyword is selected from these keywords based on CurrentStates. Next, the state to be migrated is determined based on the target keyword. Finally, the execution management component interface is called to migrate the current state to the state to be migrated. Compared to existing technologies where the states of functional clusters managed by state management are highly customized, this embodiment determines keywords through StateTransitionMap and CurrentStates, and calls the execution management component interface to migrate the current state to the state to be migrated based on the keyword. This solves the problem of state management components in adaptive platforms needing to handle customized functional cluster states, thereby improving the simplicity of the state management component code.
[0063] Reference Figure 4 , Figure 4 This is a structural block diagram of the first embodiment of the adaptive platform state management system of the present invention.
[0064] It should also be understood that, in order to enable the state management component of the AUTOSAR Adaptive Platform to handle customized states for different projects, the present invention adopts the following technical solution:
[0065] The state machine in the state management component is maintained by an arbitration logic class (ArbitrationLogic). ArbitrationLogic has two member variables: the current state (CurrentStates) and the state transition table (StateTransitionMap), as well as a state switching interface (SwitchState).
[0066] CurrentStates encapsulates the current functional cluster state, which is dynamic and affected by external factors.
[0067] The StateTransitionMap encapsulates a key-value matrix. The key contains two sets of data: the precondition and the event ID. The precondition contains a set of states, a subset of CurrentStates, and the event ID represents the ID of the externally input event. The value also contains a set of states, representing the state to be transitioned to.
[0068] The SwitchState interface has an input parameter eventId, and this interface is called after the state management receives an external request.
[0069] After receiving an external request (eventId), ArbitrationLogic combines the data from CurrentStates and StateTransitionMap to determine whether to perform a state transition.
[0070] like Figure 4 As shown, the adaptive platform state management system proposed in this embodiment of the invention includes:
[0071] The input module 4001 is used to call the state switching interface of the arbitration logic class and pass in the event ID when an external request is received.
[0072] It should also be noted that the reference Figure 3 , Figure 3 This is a schematic diagram of the state association process in the first embodiment of the adaptive platform state management method of the present invention. The member variables in the arbitration logic class are initialized. The member variables include CurrentStates and StateTransitionMap. After receiving an external request, ArbitrationLogic calls the state switching interface of the arbitration logic class and passes in the event ID.
[0073] External requests include the event ID, i.e., eventId.
[0074] In this embodiment, the data of the member variable CurrentStates and the StateTransitionMap matrix are initialized in the ArbitrationLogic class. When the state management receives an external request, it calls the SwitchState interface of the ArbitrationLogic class and passes in the eventId parameter.
[0075] The selection module 4002 is used to retrieve multiple keywords corresponding to the event ID from the StateTransitionMap, and select the target keyword from the multiple keywords according to CurrentStates.
[0076] Furthermore, the process of selecting target keywords from multiple keywords based on CurrentStates involves constructing a keyword set based on multiple keywords, determining the state values (states) corresponding to each keyword in the keyword set, and then filtering the target keywords from the multiple keywords whose state values satisfy the subset conditions of CurrentStates.
[0077] In the specific implementation, the eventId is retrieved in the StateTransitionMap, and keys that are equal to the eventId are selected. That is, the eventId contained in the key is the same as the search condition eventId. These keys are stored in the key set (kSet). Then, the states corresponding to multiple keys are determined. If the states of a certain key in kSet are a subset of the current states, then this key is selected as the target key.
[0078] It should also be understood that one of the values stored in the key is states, which is a subset of the current states.
[0079] The condition for a subset of CurrentStates is that the states in the key are a subset of currentstates.
[0080] The determination module 4003 is used to determine the migration status based on the target keyword.
[0081] Furthermore, the process of determining the state to be migrated based on the target keyword is as follows: determine the key value corresponding to the target keyword based on the StateTransitionMap; and determine the state to be migrated based on the key value.
[0082] In this embodiment, the corresponding value in the statetransitionmap is determined based on the target keyword.
[0083] The migration module 4004 is used to call the execution management component interface to migrate the current state to the state to be migrated.
[0084] In the actual implementation, the ExecutionManagement component interface is called to migrate the current state to the state to be migrated. After the state migration is successful, CurrentStates is refreshed.
[0085] In this embodiment, upon receiving an external request, the state switching interface of the arbitration logic class is first called, passing in the event ID. Then, multiple keywords corresponding to the event ID are retrieved from the StateTransitionMap, and a target keyword is selected from these keywords based on CurrentStates. Next, the state to be migrated is determined based on the target keyword. Finally, the execution management component interface is called to migrate the current state to the state to be migrated. Compared to existing technologies where the states of functional clusters managed by state management are highly customized, this embodiment determines keywords through StateTransitionMap and CurrentStates, and calls the execution management component interface to migrate the current state to the state to be migrated based on the keyword. This solves the problem of state management components in adaptive platforms needing to handle customized functional cluster states, thereby improving the simplicity of the state management component code.
[0086] Other embodiments or specific implementations of the adaptive platform state management system of the present invention can be found in the above-described method embodiments, and will not be repeated here.
[0087] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0088] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0089] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0090] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. An adaptive platform state management method, characterized in that, The adaptive platform state management method includes the following steps: When an external request is received, the state switching interface of the arbitration logic class is called, and the event ID is passed in. Retrieve multiple keywords corresponding to the event ID from the StateTransitionMap, and select the target keyword from the multiple keywords based on CurrentStates; Determine the migration status based on the target keywords; Call the execution management component interface to migrate the current state to the state to be migrated; The step of selecting the target keyword from multiple keywords based on CurrentStates includes: Construct a keyword set based on multiple keywords, and determine the state values corresponding to multiple keywords in the keyword set respectively; Filter from multiple keywords to find target keywords that correspond to a subset of the state values that satisfy the conditions of CurrentStates; The step of determining the migration status based on the target keyword includes: The key value corresponding to the target keyword is determined based on the StateTransitionMap; The migration status is determined based on the key values.
2. The method as described in claim 1, characterized in that, Before the step of calling the state switching interface of the arbitration logic class and passing in the event ID when receiving an external request, the method further includes: The member variables in the arbitration logic class are initialized, including CurrentStates and StateTransitionMap.
3. The method as described in any one of claims 1 or 2, characterized in that, After the step of calling the execution management component interface to migrate the current state to the state to be migrated, the method further includes: After the state transition is successful, the CurrentStates are refreshed.
4. An adaptive platform state management system, characterized in that, The adaptive platform state management system includes: The input module is used to call the state switching interface of the arbitration logic class and pass in the event ID when an external request is received; The selection module is used to retrieve multiple keywords corresponding to the event ID from the StateTransitionMap, and select the target keyword from the multiple keywords based on CurrentStates; The determination module is used to determine the migration status based on the target keyword; The migration module is used to call the execution management component interface to migrate the current state to the state to be migrated; The adaptive platform state management system is the implementation of the steps of the adaptive platform state management method as described in any one of claims 1 to 3.
5. An adaptive platform state management device, characterized in that, The device includes: a memory, a processor, and an adaptive platform state management program stored in the memory and executable on the processor, the adaptive platform state management program being configured to implement the steps of the adaptive platform state management method as described in any one of claims 1 to 3.
6. A storage medium, characterized in that, The storage medium stores an adaptive platform state management program, which, when executed by a processor, implements the steps of the adaptive platform state management method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Internet-of-Things equipment switching method and device, electronic equipment and computer readable medium
CN113518100A