Dynamic scene real-time hybrid system generation method and device, medium and equipment
By obtaining the scene topology structure and loading the meta-template, a real-time hybrid system for dynamic scenarios is built, which solves the problem that traditional methods are difficult to generate accurate models of complex hybrid systems in dynamic scenarios, and realizes efficient and flexible system model generation and security analysis.
Patent Information
- Application Number
- CN202510317409.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-06-03
- Filing Date
- 2025-03-18
- Publication Date
- 2025-06-27
AI Technical Summary
Traditional system model generation methods are difficult to provide flexible and accurate system models for complex hybrid systems in dynamic scenarios, resulting in limited system security analysis.
By obtaining the scene topology structure, loading the class element hybrid automaton template and class element jump type mapping table, building component hybrid automaton instances, and building a real-time scene hybrid system through deep priority traversal to realize flexible model generation of the system in dynamic scenarios.
It provides automation assistance support, improves the efficiency and accuracy of hybrid system generation in complex dynamic scenarios, and enhances the ability to analyze system security.
Smart Images

Figure CN120217692A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automated auxiliary construction of hybrid systems. Background Art
[0002] With the rapid development of Internet of Things, artificial intelligence, and embedded system technologies, complex cyber-physical systems are widely used in safety-critical fields such as aerospace, industrial automation, and intelligent transportation. Ensuring the safe operation of such systems is of utmost importance. To formally analyze the security of these systems, it is first necessary to formally model them and generate a mathematical model to accurately describe the system behavior. However, as such complex systems with tightly intertwined continuous and discrete behaviors are increasingly deployed in open and uncertain dynamic scenario environments, the system is often reconfigured during operation, and the system behavior is full of complexity and uncertainty, posing challenges to generating a system model for it.
[0003] Specifically, on the one hand, to meet the ever-changing runtime requirements in dynamic scenarios, the roles, functions, and internal behaviors of each component involved in the scenario may continuously evolve and update during runtime according to the scenario requirements. On the other hand, the interactions between components and even the entire system architecture may change dynamically. Some components may even be part of the system in one scenario but leave the system in another scenario. However, traditional system model generation methods lack a flexible mechanism to generate an accurate system model for such dynamic scenarios. When there are a large number of changing scenarios, according to traditional methods, the system model often needs to be frequently rebuilt and generated. Moreover, since traditional methods are difficult to generate a complete system model for the entire dynamic scenario to accurately describe the real-time reconfigurable behavior of the system, it restricts the analysis of system security in dynamic scenarios. Summary of the Invention
[0004] The problem to be solved by the present invention: Provide automated auxiliary support for the construction of complex hybrid systems in dynamic scenarios.
[0005] To solve the above problems, the following solutions are adopted in the present invention: A method for generating a real-time hybrid system in a dynamic scenario according to the present invention includes the following steps: Step S1: Obtain the scenario topology structure; the scenario topology structure includes scenario information and scenario relationships; The scenario relationships include the inclusion relationship between scenarios and the sequential relationship between sub-scenarios; The scenario information includes the components included in the atomic scenario and the synchronous communication topology information between the components; The sub-scenario is a scenario included by other scenarios; The atomic scenario is a scenario that does not contain other scenarios; The synchronous communication topology information includes components of the sender and the receiver, mode jumps of the sender and the receiver, and variables used for content communication when the sender and the receiver perform mode jumps; Step S2: According to the types of components included in the atomic scenario, load the corresponding class hybrid automaton template and class jump type mapping table for each type of component; The class hybrid automaton template includes nodes representing the component control mode, directed edges between nodes representing mode jumps, and variables representing parameters related to the control mode and mode jumps; The class jump type mapping table is used to map whether the mode jump is a local jump or a global jump; Step S3: Use the mode jumps included in the synchronous communication topology information of the components in the atomic scenario as the allowed global jumps in the atomic scenario. According to the local jumps determined by the class jump type mapping table, extract the mode nodes reachable by the allowed global jumps and local jumps in the atomic scenario from the class hybrid automaton template, and construct an instance of the component hybrid automaton in the atomic scenario for each component included in the atomic scenario; Step S4: Perform a depth-first traversal of the scenarios in the scenario topology structure according to the inclusion relationship between the scenarios, and construct a scenario real-time hybrid system for the traversed scenarios in the following manner: If the traversed scenario is an atomic scenario, based on the instance of the component hybrid automaton constructed for each component in the atomic scenario, configure synchronization tags for the mode jumps of the sender and the receiver in the synchronous communication topology information according to the synchronous communication topology information between the components in the atomic scenario, so that a synchronous mode jump connection is formed between the instances of the component hybrid automata corresponding to the sender and receiver components in the synchronous communication topology information and they are connected into a whole, thereby constructing the real-time hybrid system of the atomic scenario; If the traversed scenario is a non-atomic scenario and there is an order relationship between the sub-scenarios of this scenario, then connect the real-time hybrid systems of the sub-scenarios into the real-time hybrid system of this scenario by constructing a directed edge from the termination node of the real-time hybrid system of the previous scenario to the start node of the real-time hybrid system of the subsequent scenario; If the traversed scenario is a non-atomic scenario and there is no sequence relationship between the sub-scenarios of this scenario, then connect the real-time hybrid systems of the sub-scenarios into the real-time hybrid system of this scenario by constructing a virtual start node and a termination node, and constructing a directed edge from the virtual start node to the start nodes of the real-time hybrid systems of the sub-scenarios and a directed edge from the end nodes of the real-time hybrid systems of the sub-scenarios to the virtual termination node.
[0006] Further, according to the method for generating a dynamic scene real-time hybrid system of the present invention, step S2 further includes loading a corresponding class element variable type mapping table for each type of element, and verifying the synchronous communication topology information in the atomic scene according to the class element hybrid automaton template, the class element jump type mapping table, and the class element variable type mapping table; the class element variable type mapping table is used to map the type of the variable to a local variable, an input variable, or an output variable.
[0007] Further, according to the method for generating a dynamic scene real-time hybrid system of the present invention, when constructing a real-time hybrid system for an atomic scene, a virtual start node and a termination node are constructed for the real-time hybrid system.
[0008] A device for generating a dynamic scene real-time hybrid system according to the present invention includes the following modules: Module M1 is used to: obtain a scene topology structure; the scene topology structure includes scene information and scene relationships; The scene relationships include an inclusion relationship between scenes and an order relationship between sub-scenes; The scene information includes components included in the atomic scene and synchronous communication topology information between the components; The sub-scene is a scene included by other scenes; The atomic scene is a scene that does not include other scenes; The synchronous communication topology information includes components of the sender and the receiver, mode jumps of the sender and the receiver, and variables used for content communication when the sender and the receiver perform mode jumps; Module M2 is used to: load a corresponding class element hybrid automaton template and a class element jump type mapping table for each type of element according to the type of the component included in the atomic scene; The class element hybrid automaton template includes nodes representing the control mode of the component, directed edges between the nodes representing mode jumps, and variables representing parameters related to the control mode and mode jumps; The class element jump type mapping table is used to map the mode jump to a local jump or a global jump; Module M3 is used to: use the mode jumps included in the synchronous communication topology information of the components in the atomic scene as the allowed global jumps in the atomic scene, and extract, from the class element hybrid automaton template, the mode nodes reachable by the allowed global jumps and local jumps in the atomic scene according to the local jumps determined by the class element jump type mapping table, and construct an instance of the component hybrid automaton in the atomic scene for each component included in the atomic scene; Module M4 is used to: perform a depth-first traversal of the scenes in the scene topology structure according to the inclusion relationship between the scenes, and construct a scene real-time hybrid system for the traversed scenes in the following manner: If the traversed scenario is an atomic scenario, for the instance of the component hybrid automaton constructed based on each component in the atomic scenario, according to the synchronous communication topology information among the components in the atomic scenario, synchronize tags are configured for the mode jumps of the sender and the receiver in the synchronous communication topology information, so that a synchronous mode jump connection is formed between the instances of the component hybrid automaton corresponding to the sender and receiver components in the synchronous communication topology information to be connected into a whole, thereby constructing the real-time hybrid system of the atomic scenario; If the traversed scenario is a non-atomic scenario and there is a sequential relationship among the sub-scenarios of the scenario, a directed edge is constructed from the termination node of the real-time hybrid system of the previous scenario to the start node of the real-time hybrid system of the subsequent scenario, so that the real-time hybrid systems of the sub-scenarios are connected into the real-time hybrid system of the scenario; If the traversed scenario is a non-atomic scenario and there is no sequence relationship among the sub-scenarios of the scenario, a virtual start node and a termination node are constructed, and a directed edge is constructed from the virtual start node to the start nodes of the real-time hybrid systems of the sub-scenarios and from the end nodes of the real-time hybrid systems of the sub-scenarios to the virtual termination node, so that the real-time hybrid systems of the sub-scenarios are connected into the real-time hybrid system of the scenario.
[0009] Furthermore, according to the dynamic scenario real-time hybrid system generation device of the present invention, the module M2 further includes loading a corresponding class element variable type mapping table for each type of component and verifying the synchronous communication topology information in the atomic scenario according to the class element hybrid automaton template, the class element jump type mapping table, and the class element variable type mapping table; the class element variable type mapping table is used to map the type of the variable to a local variable, an input variable, or an output variable.
[0010] Furthermore, according to the dynamic scenario real-time hybrid system generation device of the present invention, when constructing the real-time hybrid system of the atomic scenario, a virtual start node and a termination node are constructed for the real-time hybrid system.
[0011] According to a machine-readable medium of the present invention, a program instruction set readable by a machine is stored in the medium. When the program instruction set stored in the medium is read and executed by the machine, the machine can implement the above-mentioned dynamic scenario real-time hybrid system generation method.
[0012] According to an electronic device of the present invention, the device includes a processor and a memory connected to each other; a program instruction set is stored in the memory; when the program instruction set stored in the memory is read and executed by the processor, the device can implement the above-mentioned dynamic scenario real-time hybrid system generation method.
[0013] The technical effects of the present invention are as follows: The present invention provides a general solution for generating real-time hybrid systems in complex dynamic scenarios.
[0014] The reusability of the hybrid system is realized through the automata templates pre-configured in the template library.
[0015] As long as there are enough automata templates pre-configured in the template library, users usually only need to edit the scene topology structure to realize the generation of the hybrid system, without requiring users to have targeted professional knowledge, and at the same time, the efficiency of building the hybrid system can be greatly improved. Brief Description of the Drawings
[0016] Figure 1 is a schematic flowchart of the method for generating a real-time hybrid system of dynamic scenarios of the present invention.
[0017] Figure 2 is a schematic structural diagram of the electronic device of the present invention.
[0018] Figure 3 is an example of the hybrid automata template of the UAV class element of the embodiment of the present invention.
[0019] Figure 4 is the hybrid automaton obtained by the exemplary UAV U1 of the present invention according to the synchronous communication topology information.
[0020] Figure 5 is the hybrid automaton obtained by the exemplary UAVs U2, U3, and U4 of the present invention according to the synchronous communication topology information.
[0021] Figure 6 and Figure 7 respectively are Figure 4 and Figure 5 the hybrid automata after reachability traversal of the hybrid automata in
[0022] Figure 8 is the hybrid system of the atomic scenario composed of the exemplary UAVs U1, U2, U3, and U4 of the present invention.
[0023] Figure 9 is Figure 8 the hybrid system after adding virtual start and end nodes to the hybrid system in Detailed Embodiments
[0024] The present invention will be further described in detail below with reference to the accompanying drawings.
[0025] Figure 2 illustrates an electronic device, which is a general-purpose computer device in the von Neumann form, and at least includes a processor 201 and a memory 202 connected to each other. The memory 202 is used to store computer program instruction sets and data. The processor 201 implements the dynamic scenario real-time hybrid system generation method referred to in the present invention by loading and executing the computer program instruction sets stored in the memory 202. The memory 202 is also the machine-readable medium referred to in the present invention, and is usually a sustainable storage device, including but not limited to, for example, magnetic disks, magnetic tapes, solid-state drives, etc.
[0026] Referring to Figure 1 , the dynamic scenario real-time hybrid system generation method of the present invention mainly includes a component template loading step, a component automaton instantiation step, and a scenario hybrid system generation step. The input of the present invention is a scenario topology structure. The "acquisition" in obtaining the scenario topology structure in the foregoing step S1 indicates that the scenario topology structure is the input. The scenario topology structure is generated by user editing, and can be generated by editing with graphic interface software, or by directly editing the text definition in JSON or XML format. That is to say, the input method can be directly input through the graphic interface, or a file in JSON or XML format can be used as the input.
[0027] The scenario topology structure includes scenario information and scenario relationships. The scenario relationships are divided into inclusion relationships and sequential relationships. The inclusion relationships between scenarios make the scenarios in the scenario topology structure form a tree structure, and make the scenarios have a parent-child distinction, that is, there is a relationship between a parent scenario and a child scenario. The parent scenario is the scenario that includes other scenarios and is the parent scenario of the included scenarios. The child scenario is the scenario included by other scenarios and is the child scenario of other scenarios. Each scenario can include multiple child scenarios, but the parent scenario of the child scenario is unique. The scenario information includes information such as scenario ID, scenario name, and scenario description. In particular, for an atomic scenario, the scenario information of the atomic scenario further includes the included components and the synchronous communication topology information between the included components. The atomic scenario is the leaf node of the scenario topology of the tree structure, that is, the atomic scenario does not include other scenarios. Correspondingly, if a scenario is not an atomic scenario, then the scenario must include child scenarios. If a scenario is not an atomic scenario, then the scenario does not include components and the synchronous communication topology information between the components. That is to say, only atomic scenarios include components and the synchronous communication topology information between the components. The synchronous communication topology information includes the components of the sender and the receiver, the mode jumps of the sender and the receiver, and the variables used for content communication when the sender and the receiver perform mode jumps.
[0028] Preferably, when receiving the scenario topology structure, the above-mentioned scenario relationships and the relationships between scenarios and components are also verified to determine whether the scenario topology structure conforms to the definitions specified by the above structure. In addition, when verifying components, it is also necessary to search the template library according to the type of the component to check whether there is a corresponding component template. If there is no corresponding component template in the template library, the user is prompted that a corresponding component template needs to be edited or input. The implementation of the above verification is familiar to those skilled in the art and will not be elaborated in this specification.
[0029] The component template loading step, which is the aforementioned step S2, according to the types of components included in the atomic scenario, loads the corresponding class element hybrid automaton template and class element jump type mapping table for each type of component. Preferably, in this embodiment, the component template further includes a class element variable type mapping table in addition to the above-mentioned class element hybrid automaton template and class element jump type mapping table. Here, the class element represents a component of a certain type. That is to say, in this embodiment, through this step, various components included in each atomic scenario in the scenario topology structure are loaded with component templates from the template library according to the type of the component. In another implementation manner, the aforementioned verification of components, which requires searching the template library according to the type of the component to check whether there is a corresponding component template, can also be processed in this step. Specifically, if the loading of the component template fails, it means that there is no corresponding component template in the template library, and the user is prompted that a corresponding component template needs to be edited or input, or the user is prompted to specify the template library. In more implementation manners, it is required that the component templates of various types of components involved in the scenario topology structure be pre-configured or stored in the template library.
[0030] In the component template, the class element hybrid automaton template includes a hybrid automaton with a directed graph structure composed of nodes and directed edges between the nodes. Among them, the nodes represent the control modes of the component, and the directed edges represent the mode jumps between the control modes. The class element jump type mapping table is used to map the mode jumps in the class element hybrid automaton template to local jumps or global jumps. That is, the class element jump type mapping table records which mode jumps in the class element hybrid automaton template are local jumps and which are global jumps. The class element variable type mapping table is used to map the types of variables included in the class element hybrid automaton template to local variables, input variables, or output variables, that is, it records which variables in the class element hybrid automaton template are local variables, which are input variables, and which are output variables. Among them, the variables are used to represent the parameters related to the control mode and mode jump and are included in the definitions of the control mode and mode jump. Therefore, it is obvious that the class element hybrid automaton template also includes these variables.
[0031] Take Figure 3Taking the example of the class meta hybrid automaton template, which is a hybrid automaton for UAV flight control, including three nodes: Node1, Node2, and Node3. The three nodes Node1, Node2, and Node3 respectively correspond to three control modes of UAV flight control: cruise control mode, position control mode, and speed control mode. Among them, in the cruise control mode, the UAV flies at normal cruise. Correspondingly, Node1 is both the start node and the end node; in the position control mode and speed control mode, the flight of the UAV needs to be controlled based on the corresponding position and speed. There are 5 directed edges connecting the three nodes, and the 5 directed edges correspond to 5 mode jumps between the three control modes. The 5 mode jumps are respectively: The mode jump J11 from the cruise control mode to the cruise control mode; The mode jump J12 from the cruise control mode to the speed control mode; The mode jump J13 from the cruise control mode to the position control mode; The mode jump J21 from the speed control mode back to the cruise control mode; and, The mode jump J31 from the position control mode back to the cruise control mode.
[0032] Among these mode jumps, the mode jumps J11, J12, and J13 are global jumps; while the mode jumps J21 and J31 are local jumps. The variables included at least include: the three-dimensional coordinate parameters PX, PY, PZ representing the UAV position, the target three-dimensional coordinate parameters TPX, TPY, TPZ representing the position control target in the mode jump J13, the parameter V representing the current flight speed of the UAV, the VX, VY, VZ representing the current flight speed vector of the UAV, the TVX, TVY, TVZ representing the flight speed target vector of the speed control target in the mode jump J12, the AX, AY, AZ representing the current flight acceleration vector of the UAV, the parameter variable representing the pitch angle of the UAV, the parameter variable representing the flight time of the UAV, and so on. Among them, the global jumps, that is, the mode jumps J11, J12, and J13 mean that these mode jumps can be made according to external control.
[0033] For example, in a formation flight of certain unmanned aerial vehicles (UAVs), the leading UAV always remains in the cruise control mode. During the cruise, when performing the mode jump J11 from the cruise control mode to the cruise control mode, it broadcasts its position information to other UAVs in the formation. After receiving the position information broadcast by the leading UAV, these UAVs need to adjust their own positions according to the position of the leading UAV. Therefore, they jump to the position control mode. The process of the leading UAV broadcasting its own position and other UAVs adjusting their positions according to the position of the leading UAV corresponds to the synchronous communication topology information between components in the present invention. In this synchronous communication topology information between components, the sending component is the leading UAV, the receiving components are the other UAVs in the formation, the sending mode jump is J11, the receiving mode jump is J13, and the variables used for content communication when the sending and receiving modes jump are the three-dimensional coordinate parameter variables PX, PY, PZ of the leading UAV and the target three-dimensional coordinate parameters TPX, TPY, TPZ in the mode jump J13 of other UAVs. Therefore, in the class element variable type mapping table, the three-dimensional coordinate parameter variables PX, PY, PZ are defined as output variables, and the target three-dimensional coordinate parameters TPX, TPY, TPZ in the mode jump J13 are defined as input variables.
[0034] More specifically, in the above example of UAVs, the output variables are PX, PY, PZ, VX, VY, VZ, the input variables are TPX, TPY, TPZ, TVX, TVY, TVZ, and the other variables are local variables.
[0035] In addition, in the component template loading step of this embodiment, after the class element hybrid automaton template, the class element jump type mapping table, and the class element variable type mapping table are loaded, the synchronous communication topology information in the atomic scenario is verified according to the class element hybrid automaton template, the class element jump type mapping table, and the class element variable type mapping table. The purpose of the verification is to detect whether the relevant information in the synchronous communication topology information is consistent with the component template. The verification content at least includes: whether the mode jumps and related variables defined in the synchronous communication topology information have been defined in the class element hybrid automaton template, whether the mode jumps in the synchronous communication topology information belong to global jumps, whether the variables used for content communication when the sending mode jumps are output variables, and whether the variables used for content communication when the receiving mode jumps are input variables.
[0036] The component automaton instantiation step, which is the aforementioned step S3, takes the mode jumps included in the synchronous communication topology information of the components in the atomic scenario as the allowed global jumps in the atomic scenario. According to the local jumps determined by the class element jump type mapping table, it extracts the mode nodes reachable by the allowed global jumps and local jumps in the atomic scenario from the class element hybrid automaton template, and constructs a component hybrid automaton instance in the atomic scenario for each component included in the atomic scenario.
[0037] Taking the above-mentioned component template for UAV flight control as an example, in a certain atomic scenario, the components included are UAVs U1, U2, U3, and U4. The synchronous communication topology information among these UAVs is the synchronization of position control with UAV U1 as the sender and other UAVs as the receivers. As the sender of each synchronous communication topology information, UAV U1 is only involved in mode jump J11, and the content of the synchronous communication is the position information of UAV U1, namely output variables PX, PY, and PZ, sent to other UAVs in the form of signal broadcasting. For the other UAVs, namely UAVs U2, U3, and U4, as the receivers of each synchronous communication topology information, their corresponding mode jumps are J13, and the content of the synchronous communication is the position target variables TPX, TPY, and TPZ relative to the positions PX, PY, and PZ of UAV U1.
[0038] Thus, according to the synchronous communication topology information of the components in the above atomic scenario, for UAV U1, the allowed global jump is mode jump J11, while mode jumps J12 and J13 are not allowed global jumps. According to Figure 3 the example meta hybrid automaton template, combined with local jumps J21 and J31, we can obtain Figure 4 the hybrid automaton shown. Then, starting from Node1 and performing reachability traversal on Node2 and Node3, it is found that Node2 and Node3 are unreachable. Finally, we get the hybrid automaton consisting of only the unique Node1 node and mode jump J11 as shown in Figure 6 That is to say, UAV U1, as the leading UAV, is always in the cruise control mode.
[0039] For UAVs U2, U3, or U4, according to the synchronous communication topology information of the components in the above atomic scenario, the allowed global jump is mode jump J13, while mode jumps J11 and J12 are not allowed global jumps. According to Figure 3 the example meta hybrid automaton template, combined with local jumps J21 and J31, we can obtain Figure 5 the hybrid automaton shown. Then, starting from Node1 and performing reachability traversal on Node2 and Node3, it is found that Node2 is unreachable. Finally, we get the hybrid automaton consisting of Node1 node, Node3 node, mode jumps J11, J31, and J13 as shown in Figure 7 That is to say, UAVs U2, U3, or U4, as the leading UAV, is always in the cruise control mode.
[0040] Therefore, the component automaton instantiation step can be implemented by the following steps: Step S31: Use the mode jump included in the synchronous communication topology information of the components in the atomic scenario as the allowed global jump in the atomic scenario. Combine the local jumps determined by the class element jump type mapping table with each node in the class element hybrid automaton template to form an initial instance of the hybrid automaton. Step S32: Starting from the start node of the initial hybrid automaton, traverse each node of the initial hybrid automaton according to the direction specified by the directed edge, and find the nodes reachable from the start node to form the final component hybrid automaton instance.
[0041] It should be noted that both the component hybrid automaton instance and the aforementioned class element hybrid automaton template here are hybrid automata. However, the class element hybrid automaton template is the hybrid automaton of a certain type of component, while the component hybrid automaton instance is the hybrid automaton of a specific component entity in a specific scenario.
[0042] The steps for generating the scenario hybrid system, that is, the aforementioned step S4, perform a depth-first traversal of the scenarios in the scenario topology structure according to the inclusion relationship between scenarios, and construct a scenario real-time hybrid system for the traversed scenarios in the following manner: If the traversed scenario is an atomic scenario, assemble the component hybrid automaton instances constructed by each component in the atomic scenario into the real-time hybrid system of this scenario; If the traversed scenario is a non-atomic scenario and there is an order relationship between the sub-scenarios of this scenario, then form the real-time hybrid system of this scenario according to the order relationship by combining the real-time hybrid systems of each sub-scenario; If the traversed scenario is a non-atomic scenario and there is no order relationship between the sub-scenarios of this scenario, then form the real-time hybrid system of this scenario according to the parallel relationship by combining the real-time hybrid systems of each sub-scenario.
[0043] As mentioned above, the inclusion relationship between scenarios makes the scenarios form a tree-like graph structure. Therefore, a depth-first traversal can be performed on this tree-like graph structure. In this embodiment, a recursive processing method is adopted in the specific implementation. Specifically, the traversed scenario is processed according to the following steps: Step S41: Determine whether the current scenario is an atomic scenario based on whether the current scenario contains sub-scenarios; Step S42: If the current scenario is an atomic scenario, assemble the component hybrid automaton instances constructed by each component in the atomic scenario into the real-time hybrid system of this scenario, and then return; otherwise, execute step S43; Step S43: Determine whether there is a sub-scenario in the sub-scenarios of the current scenario for which a real-time hybrid system has not been created. If there is a sub-scenario for which a real-time hybrid system has not been created, perform a recursive call to process this sub-scenario until real-time hybrid systems corresponding to all sub-scenarios are created, and then execute step S44; Step S44: Determine whether there is an order relationship between sub-scenarios. If there is an order relationship, assemble the real-time hybrid systems of each sub-scenario into the real-time hybrid system of this scenario according to the order relationship; otherwise, assemble the real-time hybrid systems of each sub-scenario into the real-time hybrid system of this scenario according to the parallel relationship.
[0044] In the above step S42, "assembling the component hybrid automaton instances constructed by each component in the atomic scenario into the real-time hybrid system of this scenario" is specifically as follows: Based on the component hybrid automaton instances constructed by each component in the atomic scenario, according to the synchronous communication topology information between the components in the atomic scenario, configure synchronous tags for the mode jumps of the sender and receiver in the synchronous communication topology information, so that a synchronous mode jump connection is formed between the component hybrid automaton instances corresponding to the sender and receiver components in the synchronous communication topology information, and they are connected into a whole, thereby constructing the real-time hybrid system of this atomic scenario.
[0045] Taking the drones U1, U2, U3, and U4 in the previous example as an example, the finally obtained Figure 8 real-time hybrid system as shown in the example. Figure 8 In it, the dotted line represents the synchronous tag, and the synchronous tag connects the hybrid automaton instances of the drones U1, U2, U3, and U4 into a whole as the real-time hybrid system of the corresponding atomic scenario. Simply put, it is to configure the corresponding synchronous tags for the synchronous communication topology information on the basis of the component hybrid automaton instances constructed by each component in the atomic scenario to obtain the real-time hybrid system of the atomic scenario.
[0046] In the above step S44, "assembling the real-time hybrid systems of each sub-scenario into the real-time hybrid system of this scenario according to the order relationship" specifically means constructing a directed edge from the termination node of the real-time hybrid system of the previous scenario to the start node of the real-time hybrid system of the subsequent scenario, so that the real-time hybrid systems of each sub-scenario are connected into the real-time hybrid system of this scenario.
[0047] For "assembling the real-time hybrid systems of each sub-scenario into the real-time hybrid system of this scenario according to the parallel relationship", specifically, construct a virtual start node and a virtual termination node, and construct a directed edge from the virtual start node to the start node of each sub-scenario's real-time hybrid system and a directed edge from the end node of each sub-scenario's real-time hybrid system to the virtual termination node, so that the real-time hybrid systems of each sub-scenario are connected into the real-time hybrid system of this scenario. For the virtual start node and the virtual termination node, all out-degree edges are synchronous, and all in-degree edges are synchronous.
[0048] In addition, considering that there are independent and non-entity start nodes and end nodes when assembling the real-time hybrid systems of each sub-scenario into the real-time hybrid system of this scenario according to the parallel relationship, in order to maintain the consistency of real-time hybrid systems of various scenarios, in this embodiment, when constructing the real-time hybrid system of the foregoing atomic scenario, virtual start nodes and end nodes are also constructed for the real-time hybrid system of this atomic scenario. In the atomic scenario, the virtual start node points to the start nodes of each component hybrid automaton instance through directed edges, and the end nodes of each component hybrid automaton instance point to the constructed virtual end node. For example, after adding virtual start nodes, end nodes and synchronous directed edges to the real-time hybrid system in the foregoing Figure 8 the real-time hybrid system shown in Figure 9 is obtained. Figure 9 In
[0049] Start and End respectively represent the virtual start node and end node.
[0050] The final output of the present invention is the real-time hybrid systems constructed for each scenario in the scenario topology.
[0051] In addition, in another preferred real-time mode, the component hybrid automaton instances constructed for each component in each atomic scenario can be assembled into a real-time hybrid system first, and then when performing the foregoing depth-first traversal processing, only non-atomic scenarios are traversed. This processing method is essentially the same as the foregoing process of processing atomic scenarios through depth-first traversal.
[0052] In addition, it should be pointed out that the foregoing dynamic scenario real-time hybrid system generation device of the present invention is a virtual device implemented by executing computer program instructions, and the modules included therein correspond one by one to the steps in the dynamic scenario real-time hybrid system generation method, which will not be elaborated herein.
Claims
1. A method for generating a real-time hybrid system for a dynamic scene, characterized in that: The steps include: Step S1: Acquire a scene topology structure; the scene topology structure includes scene information and scene relationships; The scene relationship includes the inclusion relationship between scenes and the order relationship between sub-scenes; The scene information includes the elements included in the atomic scene and the synchronous communication topology information between the elements; The sub-scene is a scene included in other scenes; The atomic scene is a scene that does not contain other scenes; The synchronous communication topology information includes elements of the sender and the receiver, mode jumps of the sender and the receiver, and variables used for content communication when the sender and the receiver jump in mode; Step S2: According to the types of components contained in the atomic scene, the corresponding class element hybrid automaton template and class element jump type mapping table are loaded for each type of component; The class element hybrid automaton template includes nodes for representing component control modes, directed edges between nodes for representing mode jumps, and variables for representing control modes and mode jump related parameters; The class element jump type mapping table is used to map the mode jump to a local jump or a global jump; Step S3: taking the mode jump included in the synchronous communication topology information of the components in the atomic scene as the global jump allowed in the atomic scene, extracting the global jump allowed in the atomic scene and the mode nodes reachable by the local jump from the class element hybrid automaton template according to the local jump determined by the class element jump type mapping table, and constructing a component hybrid automaton instance in the atomic scene for each component included in the atomic scene; Step S4: performing a depth-first traversal of the scenes in the scene topology structure according to the inclusion relationship between the scenes, and constructing a scene real-time hybrid system for the traversed scenes in the following manner: If the traversed scene is an atomic scene, based on the component hybrid automaton instance constructed by each component in the atomic scene, according to the synchronous communication topology information between the components of the atomic scene, a synchronization tag is configured for the mode jump of the sender and the receiver in the synchronous communication topology information, so that the component hybrid automaton instances corresponding to the sender and the receiver components in the synchronous communication topology information form a synchronous mode jump connection between mode nodes and are connected as a whole, thereby constructing a real-time hybrid system of the atomic scene; If the traversed scene is a non-atomic scene, and there is a sequential relationship between the sub-scenes of the scene, a directed edge is constructed from the end node of the real-time hybrid system of the preceding scene to the start node of the real-time hybrid system of the succeeding scene, so that the real-time hybrid systems of the sub-scenes are connected to form the real-time hybrid system of the scene; If the traversed scene is a non-atomic scene and there is no sequential relationship between the sub-scenes of the scene, a virtual start node and an end node are constructed, and a directed edge from the virtual start node to the start node of each sub-scene real-time hybrid system and a directed edge from the end node of each sub-scene real-time hybrid system to the virtual end node are constructed, so that the real-time hybrid systems of each sub-scene are connected to form the real-time hybrid system of the scene.
2. The method for generating a real-time hybrid system for a dynamic scene according to claim 1, characterized in that: The step S2 further includes loading a corresponding class meta variable type mapping table for each type of component and verifying the synchronous communication topology information in the atomic scene according to the class meta hybrid automaton template, the class meta jump type mapping table and the class meta variable type mapping table; The class meta-variable type mapping table is used to map the type of the variable to be a local variable, an input variable or an output variable.
3. The method for generating a dynamic scene real-time hybrid system according to claim 1, characterized in that: When constructing a real-time hybrid system of an atomic scene, a virtual start node and end node are constructed for the real-time hybrid system.
4. A dynamic scene real-time hybrid system generation device, characterized in that: Includes the following modules: Module M1 is used to: obtain a scene topology structure; the scene topology structure includes scene information and scene relationships; The scene relationship includes the inclusion relationship between scenes and the order relationship between sub-scenes; The scene information includes the elements included in the atomic scene and the synchronous communication topology information between the elements; The sub-scene is a scene included in other scenes; The atomic scene is a scene that does not contain other scenes; The synchronous communication topology information includes elements of the sender and the receiver, mode jumps of the sender and the receiver, and variables used for content communication when the sender and the receiver jump in mode; Module M2 is used to: load the corresponding class element hybrid automaton template and class element jump type mapping table for each type of component according to the types of components contained in the atomic scene; The class element hybrid automaton template includes nodes for representing component control modes, directed edges between nodes for representing mode jumps, and variables for representing control modes and mode jump related parameters; The class element jump type mapping table is used to map the mode jump to a local jump or a global jump; Module M3 is used to: take the mode jump included in the synchronous communication topology information of the components in the atomic scene as the global jump allowed in the atomic scene, extract the global jump allowed in the atomic scene and the mode node reachable by the local jump from the class element hybrid automaton template according to the local jump determined by the class element jump type mapping table, and construct a component hybrid automaton instance in the atomic scene for each component included in the atomic scene; Module M4 is used to perform depth-first traversal of the scenes in the scene topology structure according to the inclusion relationship between the scenes, and construct a scene real-time hybrid system for the traversed scenes in the following manner: If the traversed scene is an atomic scene, based on the component hybrid automaton instance constructed by each component in the atomic scene, according to the synchronous communication topology information between the components of the atomic scene, a synchronization tag is configured for the mode jump of the sender and the receiver in the synchronous communication topology information, so that the component hybrid automaton instances corresponding to the sender and the receiver components in the synchronous communication topology information form a synchronous mode jump connection between mode nodes and are connected as a whole, thereby constructing a real-time hybrid system of the atomic scene; If the traversed scene is a non-atomic scene, and there is a sequential relationship between the sub-scenes of the scene, a directed edge is constructed from the end node of the real-time hybrid system of the preceding scene to the start node of the real-time hybrid system of the succeeding scene, so that the real-time hybrid systems of the sub-scenes are connected to form the real-time hybrid system of the scene; If the traversed scene is a non-atomic scene and there is no sequential relationship between the sub-scenes of the scene, a virtual start node and an end node are constructed, and a directed edge from the virtual start node to the start node of each sub-scene real-time hybrid system and a directed edge from the end node of each sub-scene real-time hybrid system to the virtual end node are constructed, so that the real-time hybrid systems of each sub-scene are connected to form the real-time hybrid system of the scene.
5. The dynamic scene real-time hybrid system generation device according to claim 4, characterized in that: The module M2 further includes loading a corresponding class meta variable type mapping table for each type of element and verifying the synchronous communication topology information in the atomic scene according to the class meta hybrid automaton template, the class meta jump type mapping table and the class meta variable type mapping table; The class meta-variable type mapping table is used to map the type of the variable to be a local variable, an input variable or an output variable.
6. The dynamic scene real-time hybrid system generation device according to claim 4, characterized in that: When constructing a real-time hybrid system of an atomic scene, a virtual start node and end node are constructed for the real-time hybrid system.
7. A machine-readable medium, characterized in that The medium stores a program instruction set that can be read by a machine. When the program instruction set stored in the medium is read and executed by a machine, the machine can implement the method for generating a dynamic scene real-time hybrid system according to any one of claims 1 to 3.
8. An electronic device, characterized in that: The device includes a connected processor and a memory; the memory stores a program instruction set; when the program instruction set stored in the memory is read and executed by the processor, the device can implement the dynamic scene real-time hybrid system generation method according to any one of claims 1 to 3.