Model-driven persistent modeling method
By using a model-driven persistent modeling approach, description files and component code are automatically generated, solving the problems of high cost and errors caused by manual configuration. This achieves reliable component state recovery and port access, improving the development efficiency and reliability of the system.
Patent Information
- Application Number
- CN202511890037.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-15
- Publication Date
- 2026-05-01
AI Technical Summary
In Software Communication Architecture (SCA), existing technologies rely on manual configuration of component and port attributes, resulting in high labor costs, high error rates, and the inability to automatically synchronize configuration and component code. Furthermore, the lack of verification mechanisms affects system reliability.
A model-driven persistence modeling approach is adopted, which defines the persistence attributes of components, ports and connections through a visual model, automatically generates description files and component code, and sets up a two-layer verification mechanism to ensure the validity and synchronization of the configuration.
It reduces labor costs, avoids configuration errors, ensures the reliability of component state recovery and port access, and realizes automatic synchronization of configuration and code, thereby improving system reliability and development efficiency.
Smart Images

Figure CN121957564A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of software development technology, and more specifically, relates to a model-driven persistent modeling method. Background Technology
[0002] In the development of Software Communication Architecture (SCA), persistent modeling of components, ports, and inter-component connections is a core step in maintaining the consistency of system operation. This step relies on XML descriptor files to solidify relevant parameters and restore the state during system runtime. In existing technologies, persistent modeling involves developers manually defining component object references (such as IOR strings conforming to the CORBA standard), port attributes (including the number of connections, data types, and transmission protocols), and inter-component connection relationships. These parameters are then solidified into an XML descriptor file. When the system starts or a component restarts, the default state of the component and the inter-component connection relationships are restored by parsing the XML descriptor file.
[0003] However, various port attributes (such as connection timeout, data buffer size, maximum number of connections, etc.) need to be manually configured by developers to override the component's default values. When these parameters need to be modified, not only must the configuration information be adjusted, but the XML descriptor file must also be updated synchronously. The whole process relies on manual operation, which not only consumes a lot of manpower, but is also prone to human negligence leading to inconsistencies between the configuration parameters and the XML file content, thus causing system malfunctions.
[0004] Secondly, the lack of mandatory verification for components marked as persistent makes it impossible to ensure that such components have implemented necessary interfaces such as state recovery and port access. This could result in components being marked as persistent but lacking the ability to execute recovery logic, ultimately leading to errors during system runtime and affecting system reliability.
[0005] Furthermore, the XML descriptor file generated by persistent configuration is generated independently from the component logic code, and there is no linkage update mechanism between the two. When the parameters in the XML descriptor file are modified, the developer needs to manually adjust the component code to adapt to the new configuration parameters. It is impossible to achieve automatic synchronization between configuration and code, which not only increases the development workload, but may also cause mismatch between the two due to untimely or inadequate manual adjustment, affecting the normal operation of the system.
[0006] In summary, existing technologies suffer from technical problems such as manual reliance, lack of verification, and process disruption. Summary of the Invention
[0007] This invention provides a model-driven persistent modeling method, which aims to solve the technical problems of manual dependency, missing verification, and process interruption in the current software development process.
[0008] A model-driven persistent modeling method includes the following steps: Persistent configuration: Persistent attributes of components, ports and connections between components are defined through a visual model. The persistent configuration follows three types of preset configuration rules: inheritance rules, conflict rules and compatibility rules. The visual model extends the persistent attribute fields based on the software communication architecture meta-model. Automated generation and integration: Description files and component code are automatically generated based on persistent configuration, and the description files and component code are updated synchronously when the persistent configuration changes. The description files include software assembly description files and device configuration description files. Two-layer verification and error handling: The validity of persistent configuration is ensured through static verification during the persistent configuration phase and dynamic verification during the system runtime phase. The static verification is performed in real time after the persistent configuration is completed, and the dynamic verification is performed during the initialization phase of system startup or component restart.
[0009] This invention defines persistent attributes through a visual model, automatically generates description files (and component code), and synchronizes the two when configuration changes occur, replacing traditional manual configuration, XML embedding, and manual synchronization operations. This reduces labor costs and avoids inconsistencies between parameters and files. To address the issue of missing validation, a two-layer validation mechanism of static and dynamic validation is implemented to ensure that persistent components have implemented necessary interfaces such as state recovery and port access, avoiding the problem of components being marked as persistent but lacking recovery logic. To address the issue of process disruption, the automatic generation and change synchronization mechanism breaks the independent relationship between XML and component code, achieving automatic synchronization without the need for manual code adaptation configuration adjustments, reducing development workload and avoiding mismatches caused by improper adaptation.
[0010] Preferably, the persistence configuration is implemented through a visual editor. The persistence configuration of the component includes: checking the persistence option in the visual editor to mark the component as a persistent type, associating a unique object reference property with the component, configuring basic properties through the visual editor interface, and supporting the addition of extended properties through custom property fields. The basic properties include maximum idle time and recovery priority.
[0011] Preferably, the persistent configuration of the port in the persistent configuration includes: after enabling the persistent function for the port, the visual editor automatically displays the maximum number of connections and limits the range of values, automatically generates execution parameter attributes in the format of port, port name, persistent and containing port identifier, and automatically associates the data type and transmission protocol information of the port when mapping the port attributes to the description file.
[0012] Preferably, the persistent configurations connected in the persistent configuration satisfy the following constraints: Both the source and target ports of the connection have persistence enabled; both the source and target components implement port access interfaces, which at least include methods for obtaining the current state of the port and methods for reconstructing the connection; the connection attributes include a unique connection identifier and an attribute that records the last active time of the connection.
[0013] Preferably, the inheritance rule is that when the parent component starts persistence, its subordinate child components inherit the persistence configuration by default and support cancellation methods; The conflict rule is to check the matching between the maximum number of connections on the port and the maximum number of connections supported by the component. If the limit is exceeded, an error will be prompted in real time. The compatibility rule adds a version identifier to persistent attributes, and identifies and adapts different versions of configuration files through the version identifier.
[0014] Preferably, the generation of the description file includes: Based on persistent configuration, the execution parameter attributes of the port are extracted to generate a software assembly description file. The software assembly description file contains a name configuration item, the name of which is the execution parameter attribute name, and the value of which consists of the maximum number of connections and the data type. The object reference attributes and custom extended attributes of the components are extracted to generate a device configuration description file. The device configuration description file contains configuration items, the name of which is a combination of the attribute type and the attribute name, and the value of which is the corresponding attribute value. During the generation process, type representations are added to the object application attributes to indicate that the attribute is an object reference type.
[0015] Preferably, the generation and integration of the component code includes: Based on the completed persistence configuration, persistence recovery code is automatically embedded in the component's initialization function; The persistent recovery code calls a preset persistent connection method to rebuild the port connection between components by parsing the parameters and object references in the description file; it obtains hardware platform parameters through the compilation configuration file, and the code generator dynamically adjusts the generated code logic according to the hardware platform parameters; it simplifies persistent logging on memory platforms with memory below the threshold, recording only error information, and optimizes it into multi-threaded connection recovery logic on multi-core processor platforms.
[0016] Preferably, the static verification includes: Verify whether components marked as persistent have implemented the lifecycle management interface and port access interface. If not, highlight the implementation in the editor. Iterate through all ports marked as persistent and verify whether the target port they connect to is also marked as persistent. If a connection error occurs, provide a real-time notification. The lifecycle management interface includes at least the methods for starting, stopping, and restarting the component.
[0017] Preferably, the dynamic verification includes: During the system or component initialization phase, the connection verification function is automatically invoked to verify whether the target port is active, whether the maximum connection parameters of the port match the upper limit supported by the target component, and whether the component corresponding to the object reference exists. The component corresponding to the object reference is queried and verified through the naming service of the public object request proxy system.
[0018] Preferably, the following error handling procedure is executed when the dynamic verification fails: Error logs are recorded in a fixed order of time, component unique identifier, error type, and error details; connection retries are automatically performed for temporary errors, with a maximum of three retries; if a retry fails, a persistent error exception is thrown, interrupting the initialization process of the current component and notifying the management end.
[0019] The beneficial effects of this invention include: This invention defines persistent attributes through a visual model, automatically generates description files (and component code), and synchronizes the two when configuration changes occur, replacing traditional manual configuration, XML embedding, and manual synchronization operations. This reduces labor costs and avoids inconsistencies between parameters and files. To address the issue of missing validation, a two-layer validation mechanism of static and dynamic validation is implemented to ensure that persistent components have implemented necessary interfaces such as state recovery and port access, avoiding the problem of components being marked as persistent but lacking recovery logic. To address the issue of process disruption, the automatic generation and change synchronization mechanism breaks the independent relationship between XML and component code, achieving automatic synchronization without the need for manual code adaptation configuration adjustments, reducing development workload and avoiding mismatches caused by improper adaptation. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 The overall flowchart provided for embodiments of the present invention.
[0022] Figure 2 This is a structural diagram of the SCA persistence model elements provided in an embodiment of the present invention.
[0023] Figure 3 The automatic generation and integration timing diagram provided for embodiments of the present invention.
[0024] Figure 4 The flowchart for the two-layer verification provided in the embodiments of the present invention is shown. Detailed Implementation
[0025] To make the technical problems, technical solutions, and beneficial effects to be solved by this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this application.
[0026] This embodiment discloses a model-driven persistent modeling method, including the following steps: See Figure 1 and Figure 2 As shown, model-based persistent configuration: The persistent attribute configuration of components, ports and connections is realized through the visual model editing module, which replaces the traditional manual configuration method. This includes the visual operation process of model element definition and the real-time execution logic of configuration rules. The visualization operation process defined by the model elements includes the following steps: After the model editing module starts, it automatically loads the SCA metamodel extension package (including the newly added persistent attribute fields). Users can complete the configuration through the process of creating a new project - adding components - configuring attributes - establishing connections. The specific configuration methods for each element are as follows: Configuration of persistent components: This implementation supports persistent configuration of two types of components: AssemblyComponent and DeviceComponent. The specific steps are as follows: Users can drag and drop target component types from the component library in the model editing interface onto the canvas, and the system will automatically assign a unique identifier to the component (format: Comp_XXX, where XXX is a 3-digit numeric serial number). After selecting a component, the Persistence checkbox will automatically appear in the properties panel. When the user checks it, the persistent properties group will be displayed (the property group is hidden when it is not checked to avoid invalid configuration). The Object Ref field in the Properties panel is automatically associated with the CORBA naming service client. After the user clicks the Generate IOR button, the system generates a 28-byte IOR string through the naming service (format example: IOR:0000000000000000000000000000000000) and automatically fills it into the field. This string ensures cross-platform uniqueness through the CORBA specification, avoiding format errors when manually entering it. The properties panel displays two basic fields: maxIdleTime (maximum idle time, unit: seconds, default value: 300) and recoveryPriority (recovery priority, value range: 1-10, default value: 5). Users can directly modify these values. To extend custom properties, click the "Add Custom Property" button, enter the property name (e.g., backupInterval) and the property value (e.g., 60), and the system will automatically store it in the format of custom_property_name (example: custom_backupInterval=60). After the user completes the configuration and clicks "Save Component," the system serializes and stores the configuration data as a .xmi format model file, and simultaneously triggers the initial verification of the configuration rules.
[0027] By replacing manual input with a visual interface and automated generation (such as IOR strings), the cost of human operation is reduced; fixed field formats and value ranges avoid configuration errors from the source. Compared with the traditional method of manually defining IOR and attributes, configuration efficiency is improved, and formatting errors caused by manual input are avoided.
[0028] Persistent port configuration: In this embodiment, a unified configuration process is designed for UsesPort and ProvidesPort in the SCA architecture. The specific steps are as follows: Select the configured persistent component, right-click and select Add Port. In the pop-up window, select the port type (UsesPort / ProvidesPort) and enter the port's unique identifier (e.g., DataTxPort, which must consist of letters, numbers, and underscores, and be no longer than 32 bytes). The system will automatically generate a port instance. In the port properties panel, the Persistence option is associated with the component it belongs to by default (the port is automatically selected when the component is selected). Users can manually uncheck it, but this will trigger a rule verification prompt. When enabled, the MaxConnections field is forcibly displayed, and the value range is limited to 1-256 (this range is set according to the upper limit requirement for the number of port connections in the SCA 4.0 specification). When the user enters a value outside the range, the interface will pop up a red prompt in real time that the maximum number of connections must be between 1 and 256. The system automatically generates the execParam attribute value based on the unique port identifier, with a fixed format of port_ <portname>_persist, Example: When the port identifier is DataTxPort, the execParam value is port_DataTxPort_persist. This attribute is used for the subsequent association mapping between XML descriptors and code to avoid naming conflicts when manually defined; After the user selects data type (e.g., complex_short) and transport protocol (e.g., TCP) in the data type drop-down box of the properties panel, the system automatically binds these metadata to the port. They can then be directly called when generating XML descriptors, without the need to manually write the association logic.
[0029] By forcing field display, limiting value range, and automatically generating key attributes, the problem of missing or incorrect port attributes in traditional manual configuration is solved; the metadata predefined drop-down list reduces the reliance on developers' professional knowledge.
[0030] Persistent connection configuration: Persistent connections are used to associate the ports of two persistent components. The specific configuration process and constraint validation logic are as follows: In the visual interface, the user selects the UsesPort of the source component, holds down the mouse button and drags it to the ProvidesPort of the target component. After releasing the button, the system pops up a confirmation box to establish a persistent connection. Before the confirmation dialog box pops up, the system automatically performs three constraint checks: ① Whether both the source port and the target port have "Persistence" checked. If one is not checked, a message will be displayed indicating that only connections between persistent ports are supported; ② Whether both the source component and the target component implement the PortAccessor interface. This is checked by reading the component's interface implementation list. If not, a message will be displayed indicating that component XXX does not implement the PortAccessor interface and cannot establish a persistent connection; ③ Whether the MaxConnections of the source port is less than or equal to the hardware interface limit of the target component (the hardware interface limit is predefined by the compilation configuration file, such as 8 ports). If it exceeds this limit, a message will be displayed indicating that the maximum number of port connections exceeds the component's hardware limit XXX. The confirmation dialog box will only be displayed after all three checks pass. The user enters the connectionID in the confirmation box (the system defaults to the format Conn_XXX, where XXX is a 3-digit numeric serial number, which the user can modify but must ensure that it is unique). The lastActiveTime field is automatically recorded by the system as the connection establishment time, in the format YYYY-MM-DD HH:MM:SS. This field is used for the validity verification of connection reconstruction during subsequent runtime. After clicking "Confirm," the system records the connection relationships in the model file and marks persistent connections with blue solid lines (non-persistent connections with black dashed lines) in the interface for easy visual differentiation.
[0031] By moving connection constraint validation to the configuration stage, we avoid the problem of discovering that components do not support persistence only after the connection is established, as is the case in traditional technologies. We also improve development efficiency by visually distinguishing connection types.
[0032] In this embodiment, the configuration rules include inheritance rules, conflict rules, and version compatibility rules, all of which are executed in real time by the rule parser of the model editing module, as detailed below: Integration rule implementation: The rule parser listens for component persistence state change events. When a parent component (such as DeviceComponent) checks Persistence, the parser automatically iterates through all its child components (such as AssemblyComponent), sets the child component's Persistence state to checked, and adds an inheritance flag. When the user manually cancels a child component's Persistence, the system prompts that the component inherits the parent component's persistent state; cancellation will prevent inheritance. Confirmation is required, and the inheritance flag is cleared upon confirmation. If the parent component subsequently cancels persistence and the child component has no inheritance flag, the child component's state remains unchanged. Inheritance reduces repetitive configuration operations while supporting flexible adjustments, balancing efficiency and flexibility.
[0033] Conflict rule implementation: The rule parser has a built-in conflict detection dictionary that stores constraint data such as component hardware limits and port protocol compatibility. When a user configures port attributes (such as MaxConnections) or connection relationships, the parser queries the conflict detection dictionary in real time. If a conflict exists (such as a component hardware interface limit of 8 ports but a port configuration of 16 ports), a red exclamation mark is displayed next to the attribute field, and the specific reason for the conflict is displayed when the mouse hovers over it. The user cannot save the configuration until the conflict is resolved. Through real-time querying and forced verification, conflict issues are intercepted during the configuration stage.
[0034] Version compatibility rules are implemented as follows: The root node of the model file has a built-in version field, which is assigned the default value v1.0 when the user creates a new model. After modifying the configuration, the version number can be adjusted through the version management - upgrade version function (e.g., v1.1). The system creates a configuration snapshot for each version, storing all attribute configurations for that version. When loading a lower version model file, the parser automatically identifies the version number and compares it with the highest version supported by the current system. If there are attribute differences (e.g., the addition of the backupInterval attribute), a version upgrade prompt will pop up, providing two options: retain the old configuration or automatically adapt the new attribute. When the latter is selected, the system assigns a default value to the newly added attribute. Through version snapshots and automatic adaptation, compatibility between different version configuration files is ensured.
[0035] Automated generation and integration: See Figure 3 As shown, an automated generation engine module is used to automatically convert model configuration into XML descriptors and component code, while establishing a linked update mechanism to solve the problem of configuration and code separation in traditional technologies. The input to the generation engine is a .xml format model file, and the output is a SAD file, a DCD file, and .java format component code. The specific steps are as follows: Automatic generation of XML descriptors: The XML descriptor generator uses a template-driven approach, with built-in standard templates for SAD and DCD. It maps model data to XML format using XSLT (Extensible Stylesheet Transformation Language). The specific generation logic is as follows: SAD file generation: The generator reads port instance data from the model file, filters out ports marked with Persistence, and extracts attributes such as execParam, MaxConnections, DataType, and Protocol. Substitute the extracted attributes into the preset positions in the SAD template, where the execParam attribute is mapped to... <propertyname="port_ <portname>_persist" value=" <maxconnections> : <datatype>Example: When the port identifier is "DataTxPort", MaxConnections=8, and DataType="complex_short", the generated... <property name="port_DataTxPort_persist" value="8:complex_short" / > ; Extract the persistent connection's connectionID, source port identifier, and destination port identifier, and write them to... <connection>Node, in the format of <connection id=" <connectionid>" source="<Source Component ID> / <Source Port Identifier>" target="<Target Component ID> / <Target Port Identifier>" / > The generator formats the mapped content (indented by 2 characters and with a unified line break of "\n") and outputs it as the SCA_Assembly.sad file, with the storage path being the same as that of the model file.
[0036] DCD file generation: Read the component instance data in the model file, filter out the components marked with Persistence, and extract Object Ref, maxIdleTime, recoveryPriority, and custom attributes; Map the Object Ref to <property name="object_ref" type="object_ref" value="<IOR String>" / >, where "type="object_ref"" is an identifier automatically added by the system for the runtime parser to recognize the object reference type; map the basic attribute maxIdleTime to <property name="maxIdleTime" value="<Numeric Value>" / >, and map the custom attributes to <property name="custom_<Attribute Name>" value="<Attribute Value>" / >; after formatting, output it as the "SCA_Device.dcd" file, which is stored in the same path as the SAD file.
[0037] In this embodiment, the template-driven method is adopted to ensure that the XML descriptor conforms to the SCA specification, replacing manual writing with automatic mapping to avoid format errors.
[0038] To ensure that the runtime parser accurately recognizes the Object Ref of the component, the generator executes special injection logic during the XML generation stage: After parsing the Object Ref attribute in the model, first verify the validity of the IOR string through the CORBA naming service (such as whether there is a corresponding component instance), and after passing the verification, write it into the XML file and add the "type="object_ref"" identifier; if the verification fails (such as the IOR string is invalid), suspend the generation process and prompt that the Object Ref of component XXX is invalid and the XML file cannot be generated until the user corrects it and triggers the generation again; ensure the validity of the injected object reference through pre-verification to avoid runtime parsing failures.
[0039] Automated generation and integration of component code: Automatic embedding of persistence logic: Generates an initialize() function framework conforming to the SCA specification, including the function definition public void initialize() throws Exception { ...} and basic initialization code; If a component is marked as Persistence, the persistence_connection() method call code this.persistence_connection() will be automatically embedded in the initialize() function. This method is used to restore the component's connection state. The implementation code for this method is generated in the component class. The core logic is as follows: ① Load the SAD and DCD files through the SCA XML parsing service; ② Parse the execParam property to obtain the MaxConnections and DataType of the target port; ③ Parse the object_ref property to obtain the reference of the target component; ④ Call the rebuildConnection() method of the PortAccessor interface to rebuild the connection, and verify the connection status through the getPortState() method. Before generating code, verify whether the component has implemented the LifeCycle and PortAccessor interfaces. If not, automatically add interface declarations to the class definition (e.g., public class DataComponent implements LifeCycle,PortAccessor { ...}) and generate an empty implementation framework of the interface methods, prompting the user to supplement the business logic.
[0040] Deeply integrate persistence logic with the component initialization process to ensure that state restoration is automatically performed when the component starts, avoiding omissions caused by manually embedding logic.
[0041] Adaptive generation of cross-platform code: Users set hardware parameters in this file, such as processor_arch=arm, memory_capacity=4GB, core_number=4, and the generator automatically reads these parameters when it starts. If memory_capacity ≤ 4GB (low memory platform), the generator retains only the error log recording logic in the persistent log output code: if (error) { logger.error("[error message]");}, and deletes the debug log and information log; if memory_capacity > 4GB, it retains the complete logging logic. If core_number ≥ 4 (multi-core processor), the generator generates multi-threaded connection recovery logic in the persistence_connection() method, and rebuilds multiple port connections in parallel through a thread pool (core thread count = core_number / 2); if core_number < 4 (single-core or dual-core processor), it generates single-threaded serial recovery logic to avoid thread switching overhead. After the code is generated based on the hardware parameters, the output is a .java file, and a corresponding Makefile compilation script is also generated. The script automatically adapts to the compiler specified by the processor_arch parameter (e.g., arm-linux-gcc for the ARM platform).
[0042] The code logic is dynamically adjusted based on hardware parameters to balance performance and resource consumption, avoiding the problem of adapting code to different platforms with a one-size-fits-all approach.
[0043] Linked update mechanism: The listening service monitors modification events of model files in real time (such as attribute modification, connection addition / deletion). When a change is detected, it records the type of element (component / port / connection) and attribute name of the changed element. Perform incremental updates instead of full generation based on the change type: ① If it is a component property change (such as a modification of maxIdleTime), only regenerate the corresponding one in the DCD file. <property>① Assignment logic of associated attributes in nodes and code; ② If port attributes change (e.g., MaxConnections are modified), regenerate the corresponding port attribute nodes in the SAD file and the connection parameters of the persistence_connection() method in the code; ③ If connection relationships change, regenerate the SAD file. <connection>node; After the update is complete, the system will display a message indicating that the configuration has been changed and the XML descriptor and code have been automatically updated, and record the update content in the log (e.g., 2025-12-02 10:00:00 The maxIdleTime of component Comp_001 has been changed to 600, and the DCD file has been updated).
[0044] Incremental updates replace full generation, improving update efficiency; real-time monitoring ensures timely synchronization after changes, avoiding inconsistencies between configuration and code.
[0045] Two-layer validation and error handling: See Figure 4 As shown, a two-layer mechanism of static verification at the model layer and dynamic verification at runtime ensures the validity of persistent configurations, proactively avoids errors, and handles exceptions promptly. The specific steps are as follows: Static validation at the model layer: API validation: When a user marks a component as Persistence, the validation submodule automatically performs API validation, with the following logic: Obtain the list of interface implementations of the component class using Java reflection; check if it includes the LifeCycle and PortAccessor interfaces, and whether the interface methods are fully implemented: ① The LifeCycle interface must include start(), stop(), and restart() methods, none of which can be omitted; ② The PortAccessor interface must include getPortState() and rebuildConnection() methods, and the method parameters and return values must conform to the specifications (e.g., getPortState() returns a String type, representing the port status as active / inactive). If an interface is not implemented or a method is incomplete, the component icon will be automatically highlighted in red, and an error message will be displayed at the top of the property panel. Persistent components must implement the LifeCycle and PortAccessor interfaces and include the following methods: start(), stop(), restart(), getPortState(), and rebuildConnection(). When the user clicks the quick generate button next to the prompt, the system can automatically generate the interface implementation code framework, reducing the amount of manual writing work.
[0046] The interface is automatically verified using reflection, avoiding omissions from manual inspection; a rapid generation tool is provided to reduce correction costs.
[0047] Connection consistency verification: When a user establishes or modifies a persistent connection, the verification submodule automatically performs a consistency check, with the following logic: Iterate through all UsesPorts marked with Persistence in the model file and obtain their corresponding connection targets; Check if the target port is ProvidesPort marked Persistence. If it is a non-persistent port, prompt that the persistent port (XXX) needs to be connected to the persistent target port. Check if UsesPort has been established. If no port is connected, a message will appear indicating that the persistent port (XXX) cannot be empty and that you need to connect to the target ProvidesPort. All verification results are summarized and displayed in the verification log panel at the bottom of the interface. Each error message is marked with its error / warning level and can be clicked to jump to the corresponding port or connection.
[0048] Full data verification is achieved by traversing and connecting data to ensure no omissions; related interface navigation improves the efficiency of error location.
[0049] Runtime dynamic validation and error handling: The runtime validation submodule is encapsulated as the PersistenceValidator utility class, which is automatically called during the initialize() phase of system startup or component startup. It includes connection reconstruction validation and a three-level exception handling mechanism, specifically including the following steps: Connection Reconstruction Verification: The `validate_connection()` method is the core of the verification process, called by the `persistence_connection()` method. The specific verification content and logic are as follows: Call the getPortState() method of the target component ProvidesPort to get the port status; if the status is inactive, record the error message "Target port XXX is inactive". Parse the MaxConnections value of the execParam attribute from the XML descriptor and compare it with the return value of the getMaxSupportConnections() method exposed by the target component through the PortAccessor interface; if the former is greater than the latter, record the error message: Port XXX's maximum number of connections (XXX) exceeds the target component's supported limit (XXX). The CORBA naming service is used to check if the component instance corresponding to object_ref in the XML exists; if it is not found, an error message is recorded: the component corresponding to object reference XXX does not exist. If all the above checks pass, return a check pass message; if there are errors, return a list of error messages.
[0050] Three-level exception handling mechanism: When the validate_connection() method returns an error message, the system triggers a three-level exception handling mechanism. The specific process is as follows: Level 1 logging: Calls the system log service to record error information in a fixed format: [Time][Component ID][Error Type][Details]. Example: 2025-12-02 10:05:00 [Comp_001] [ConnectionFailed] Target port DataRxPort is not active; logs are stored simultaneously in local files and on a remote log server, and retained for 90 days for traceability. The second-level retry mechanism: The system determines whether the error type is a temporary error (such as a port not being activated, which may be due to a startup delay). Temporary errors trigger retries: the retry intervals are 1 second, 3 seconds, and 5 seconds, with a maximum of 3 retries; before each retry, the port_activate() method is called to try to activate the target port, and the verification is re-executed after the retry; if the retry is successful, the retry success log is recorded and the component initialization continues; Level 3 Interruption and Alarm: If the retry fails or the error is not temporary (such as an invalid object reference), a PersistenceError exception is thrown, interrupting the component initialization process; at the same time, an alarm message is sent to the administrator through the system alarm module (via email, SMS, or system pop-up). The alarm content includes error details and handling suggestions (such as checking the Object Ref configuration of the component in the model if the object reference is invalid).
[0051] By implementing tiered processing, we achieve full-process coverage of log tracing, temporary error repair, and critical error alerts, balancing automation and timeliness in error handling.
[0052] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.< / connection> < / property> < / connectionid> < / connection> < / datatype> < / maxconnections> < / portname> < / portname>
Claims
1. A model-driven persistent modeling method, characterized in that, Includes the following steps: Persistent configuration: Persistent attributes of components, ports and connections between components are defined through a visual model. The persistent configuration follows three types of preset configuration rules: inheritance rules, conflict rules and compatibility rules. The visual model extends the persistent attribute fields based on the software communication architecture meta-model. Automated generation and integration: Description files and component code are automatically generated based on persistent configuration, and the description files and component code are updated synchronously when the persistent configuration changes. The description files include software assembly description files and device configuration description files. Two-layer verification and error handling: The validity of persistent configuration is ensured through static verification during the persistent configuration phase and dynamic verification during the system runtime phase. The static verification is performed in real time after the persistent configuration is completed, and the dynamic verification is performed during the initialization phase of system startup or component restart.
2. The model-driven persistent modeling method according to claim 1, characterized in that, The persistence configuration is implemented through a visual editor. The persistence configuration of the components includes: checking the persistence option in the visual editor to mark the component as a persistent type, associating a unique object reference property with the component, configuring basic properties through the visual editor interface, and supporting the addition of extended properties through custom property fields. The basic properties include maximum idle time and recovery priority.
3. The model-driven persistent modeling method according to claim 1, characterized in that, The persistent configuration of the port includes: after enabling the persistence function for the port, the visual editor automatically displays the maximum number of connections and limits the range of values, automatically generates execution parameter attributes in the format of port, port name, persistence and port identifier, and automatically associates the data type and transmission protocol information of the port when mapping the port attributes to the description file.
4. The model-driven persistent modeling method according to claim 1, characterized in that, The persistent configurations connected in the persistent configuration satisfy the following constraints: Both the source and target ports of the connection have persistence enabled; both the source and target components implement port access interfaces, which at least include methods for obtaining the current state of the port and methods for reconstructing the connection; the connection attributes include a unique connection identifier and an attribute that records the last active time of the connection.
5. The model-driven persistent modeling method according to claim 1, characterized in that, The inheritance rule is that when the parent component starts persistence, its subordinate child components inherit the persistence configuration by default and support the cancellation of methods. The conflict rule is to check the matching between the maximum number of connections on the port and the maximum number of connections supported by the component. If the limit is exceeded, an error will be prompted in real time. The compatibility rule adds a version identifier to persistent attributes, and identifies and adapts different versions of configuration files through the version identifier.
6. The model-driven persistent modeling method according to claim 1, characterized in that, The generation of the description file includes: Based on persistent configuration, the execution parameter attributes of the port are extracted to generate a software assembly description file. The software assembly description file contains a name configuration item, the name of which is the execution parameter attribute name, and the value of which consists of the maximum number of connections and the data type. The object reference attributes and custom extended attributes of the components are extracted to generate a device configuration description file. The device configuration description file contains configuration items, the name of which is a combination of the attribute type and the attribute name, and the value of which is the corresponding attribute value. During the generation process, type representations are added to the object application attributes to indicate that the attribute is an object reference type.
7. The model-driven persistent modeling method according to claim 1, characterized in that, The generation and integration of the component code includes: Based on the completed persistence configuration, persistence recovery code is automatically embedded in the component's initialization function; The persistent recovery code calls a preset persistent connection method to rebuild the port connection between components by parsing the parameters and object references in the description file; it obtains hardware platform parameters through the compilation configuration file, and the code generator dynamically adjusts the generated code logic according to the hardware platform parameters; it simplifies persistent logging on memory platforms with memory below the threshold, recording only error information, and optimizes it into multi-threaded connection recovery logic on multi-core processor platforms.
8. The model-driven persistent modeling method according to claim 1, characterized in that, The static verification includes: Verify whether components marked as persistent have implemented the lifecycle management interface and port access interface. If not, highlight the implementation in the editor. Iterate through all ports marked as persistent and verify whether the target port they connect to is also marked as persistent. If a connection error occurs, provide a real-time notification. The lifecycle management interface includes at least the methods for starting, stopping, and restarting the component.
9. The model-driven persistent modeling method according to claim 1, characterized in that, The dynamic verification includes: During the system or component initialization phase, the connection verification function is automatically invoked to verify whether the target port is active, whether the maximum connection parameters of the port match the upper limit supported by the target component, and whether the component corresponding to the object reference exists. The component corresponding to the object reference is queried and verified through the naming service of the public object request proxy system.
10. The model-driven persistent modeling method according to claim 9, characterized in that, When the dynamic verification fails, the following error handling procedure is executed: Error logs are recorded in a fixed order of time, component unique identifier, error type, and error details; connection retries are automatically performed for temporary errors, with a maximum of three retries. If a retry fails, a persistence error exception is thrown, interrupting the initialization process of the current component and notifying the management system.
