A method and system for declaratively creating CAA component commands

CN122569939APending Publication Date: 2026-08-14CHANGJIANG SURVEY PLANNING DESIGN & RES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-11
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

① 应用框架资源通过自身上下文目录来侦测所扩展的应用和框架(如图1所示),一个典型应用框架资源源文件的声明式配置目录层次存在十多级,且各个目录名称严格约束, Geom_Model_Id和App_Wks_Id需严格对应于模型标识和应用标识;其次如此冗长的目录层次,在IDE集成开发环境中操作非常不便且易于出错

Benefits of technology

本发明方案相比达索原生声明式命令布局开发方法,具有以下显著优势:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122569939A_ABST
    Figure CN122569939A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of software secondary development technology, and specifically relates to a method for declaratively creating CAA component commands. It involves inserting data model identifiers into the comment fields of application framework resource source files to provide program identifiers and their logical paths, thus defining declarative CAA component commands. A custom application framework resource compiler compiles the application framework resource source files into object files, which are then deployed to the corresponding data model identifier directory in the runtime environment. By resetting the user interface resolver in the thick client runtime environment and refreshing the framework commands, the dynamic loading of CAA component commands is completed. This invention is compatible with native declarative command layout development methods, can flatten the application framework resource source file directory, and achieves millisecond-level compilation and hot reloading. This invention also provides a non-transitory readable recording medium storing the method program and a system containing this medium. The program can be invoked through processing circuitry to execute the above method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of software secondary development technology, and discloses a method, recording medium and system for declarative creation of CAA component commands. Background Technology

[0002] Dassault 3DE platform is the mainstream 3D design and BIM application platform in the water conservancy and hydropower industry today. It has four major brands: collaborative design, analysis and calculation, construction simulation, and business intelligence. It manages thousands of functional commands through hierarchical management of products, applications, workbench, modules, workbars, and toolbars, and its applications are very extensive.

[0003] 3DE platform secondary development technology utilizes the CAA component application architecture, with a development philosophy based on component-oriented programming. It enables binary-level reuse and modular development, making it a mainstream approach for large-scale industrial software development. CAA secondary development has two core tasks: ① writing business logic code to extend platform functionality; ② creating command layouts and integrating them into the platform framework. The purpose of integration is to allow end-users to interact and trigger corresponding commands to complete relevant business functions. In the 3DE thick client, the integration point may manifest as an icon, button, menu, or shortcut key.

[0004] For the RADE platform's secondary development kit, two methods are provided for creating command layouts: ① Traditional programming method, which involves writing specific C++ code to extend and implement related commands and layouts; ② Declarative method, which Dassault calls the D-Afr application framework. This uses an XML-based configuration file (i.e., the application framework resource source file) with a .afr extension, and is compiled and deployed using the MkDAfrTool. While D-Afr is a relatively modern method that allows for zero-code creation of CAA commands and layouts, the actual development experience is not user-friendly. If developers lack application skills or experience, and the relevant field attributes are difficult to understand, development efficiency may be lower than traditional coding methods. Its main drawbacks are: ① Application framework resources detect extended applications and frameworks (such as...) through their own context directory. Figure 1 As shown, a typical application framework resource source file has a declarative configuration directory hierarchy of more than ten levels, and the names of each directory are strictly constrained. Geom_Model_Id and App_Wks_Id must strictly correspond to the model identifier and application identifier. Secondly, such a lengthy directory hierarchy is very inconvenient and prone to errors when operating in an IDE integrated development environment.

[0005] ②AFR declarative development itself only requires compilation, but MkDAfrTool uses the MkMk compiler component to build and execute uniformly. During this process, it performs unified verification of the context environment through network communication, which is very slow, has low build efficiency, and makes the development environment cumbersome.

[0006] ③ After safr is loaded into the fat client, commands cannot be dynamically modified and the layout cannot be refreshed. The conventional method is to shut down the 3DE platform, recompile afr (application framework resource source files) and deploy safr (application framework resource target files), and then start running it. This process may take several minutes, and if the application framework resources are configured incorrectly or missing, it is difficult to display error messages. Multiple restarts may be required, making testing extremely costly and the debugging experience very unfriendly. Summary of the Invention

[0007] To address the above problems, this invention provides a method for declaratively creating CAA component commands, comprising the following steps: Insert a data model identifier into the comment field of the application framework resource source file. The data model identifier is used to replace the identifier and logical path of the program provided by the current component, and to define the CAA component command in a declarative manner. By using a custom application framework resource compiler, the application framework resource source file is read, the data model identifier is identified and parsed and restored to the corresponding logical path, and the application framework resource source file is compiled to generate the application framework resource target file. Deploy the application framework resource target files to the runtime environment. The platform will take effect immediately upon startup and automatically create the corresponding framework commands. In the fat client runtime environment, the CAA component commands will be hot-reloaded by resetting the user interface resolver and reloading the workbench and application modules.

[0008] Preferably, the data model identifier is a preset keyword or a custom string, and one data model identifier uniquely corresponds to a set of logical paths.

[0009] Preferably, the custom application framework resource compiler is integrated into the existing CAA secondary development integration environment.

[0010] Preferably, the CAA component command hot reloading is integrated into the 3DE platform fat client in the form of a plug-in function.

[0011] Preferably, the custom application framework resource compiler directly modifies the original application framework resource source file structure, compiles the application framework resource source files into application framework resource target files, and completes runtime deployment based on the logical path identified by the built-in data model.

[0012] Preferably, when dynamically resetting the fat client user interface resolver, the workbench and application are reloaded to achieve hot reloading of the loaded CAA component commands.

[0013] Another aspect of the present invention is to provide a non-transitory readable recording medium for storing one or more programs containing multiple instructions, which, when executed, cause the processing circuitry to execute the above-described method for declaratively creating a CAA component command.

[0014] Another aspect of the present invention provides a system for declaratively creating CAA component commands, including a processing circuit and a memory electrically coupled thereto, the memory being configured to store at least one program, the program containing a plurality of instructions, the processing circuit running the program, and capable of executing the aforementioned method for declaratively creating CAA component commands.

[0015] Compared with existing technologies, the method, recording medium, and system for declaratively creating CAA component commands provided by this invention have the following advantages: Compared to Dassault Systèmes' native declarative command layout development method, the solution of this invention has the following significant advantages: ① By using model identifier fields to indicate the context model associated with the current AFR by the compiler, there is no need to create lengthy directory hierarchies, thus flattening the directory structure (see...). Figure 2 As shown in the AfrNewMod.m module, the directory is clear and concise, and the operation is simple and convenient. In particular, this field is injected via an XML inline comment (see...). Figure 2 Using inline comment tags will not break the original syntax accuracy and can ensure compatibility.

[0016] ② A completely self-developed lightweight AFR compiler, which completely replaces Dassault Systèmes' official MkDAfrTool, achieving millisecond-level compilation and deployment, making builds more flexible and efficient.

[0017] ③ Implement dynamic refresh functionality for AFR files, allowing changes to AFR files to take effect immediately without restarting the fat client session, greatly improving testing efficiency and debugging experience.

[0018] Finally, this technical solution can completely abandon the Dassault RADE development kit. By combining it with VSCode and CMake, it can encapsulate the CAA resource module build target itself. With just a simple click on the interactive object or input of commands, it can realize AFR development, compilation, deployment and automated testing, which significantly improves the development experience and has great practical value. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of a typical AFR declarative development directory structure in existing technologies; Figure 2 This is a comparison diagram of the directory hierarchy and the original directory hierarchy in an embodiment of the present invention; Figure 3 This is a flowchart illustrating the overall workflow of an embodiment of the present invention; Figure 4 This is a commonly used model identifier mapping table in the embodiments of the present invention; Figure 5 This is a flowchart of the AFR encryption algorithm in an embodiment of the present invention; Figure 6 This is a flowchart of the safr decryption algorithm in an embodiment of the present invention; Figure 7 This is the pseudocode for AFR dynamic refresh involved in the embodiments of the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be described below with reference to the accompanying drawings. The described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without innovative effort are within the scope of protection of the present invention.

[0021] The overall workflow of the technical solution of this invention is as follows: Figure 3 The specific implementation steps are as follows: Step 1: Identify resource-type modules. Check the current CAA module build file to determine if the build type is resource-type, including keywords such as "BUILT_OBJECT_TYPE=RUNTIME DATA", "MKTYPE=DATA", and "MKMOD=RES". If the relevant identifiers are found, proceed to the next step.

[0022] Step 2: Search for the .afr source files in the src directory of the current module.

[0023] Step 3: Use the self-built AFR compiler to compile and deploy.

[0024] 2. Build your own AFR compiler, whose core functions are compilation and decompilation.

[0025] (1) Compile the plaintext AFR into ciphertext SAFR. Step 1: Read the AFR file to be compiled and obtain the plaintext; Step 2: Parse the model identifier injection field and use regular expressions to find key-value pairs.

[0026] Taking DataModel as an example with the key name, the expression is:<!--\s*DataModel\s*=\s*([\w.\\\ / ]+)\s*--> .

[0027] Step 3: Obtain the safr target file based on the model identifier value.

[0028] ① If the length is equal to 1 and can be converted to integers, uppercase letters, or lowercase letters, then it is mapped to a common model path. See the default mapping table. Figure 4 It can be defined by the user.

[0029] ② If the length is greater than 1 and it is a valid directory, it can be used directly as the model path.

[0030] ③ The resulting SAFR target file is obtained by concatenating the following: model path + path separator + AFR filename + .safr suffix.

[0031] Step 4: Compile the encrypted AFR file to obtain the ciphertext, and write it to the SAFR target file. See the encryption algorithm below. Figure 5 The main process is as follows: ① Read the SCRAMBLING_KEY obfuscation value and take the modulo 0x11 to obtain the encryption key.

[0032] ② Traverse the plaintext byte order according to the original file size.

[0033] ③ Add the key to the plaintext bytes to obtain the ciphertext bytes.

[0034] ④ If the ciphertext byte is greater than 0xFF, then the plaintext byte is inverted and used as the ciphertext byte.

[0035] ⑤ Insert the current frame identifier, or use the default value "External\n" to form the final ciphertext.

[0036] (2) Decompile the ciphertext safr into a file named afr. Step 1: Based on the input filename, search for the corresponding safr target file in the resource directory ${DsRoot} / resources / ApplicationFrame; Step 2: Read the safr target file to obtain the byte order; Step 3: Verify that the first line of the byte order header is a frame identifier; Step 4: Subsequent byte order decryption yields the plaintext, which is then written to the current directory. See the decryption algorithm below. Figure 6 The main process is as follows: ① Read the SCRAMBLING_KEY obfuscation value and take the modulo 0x11 to obtain the encryption key.

[0037] ② Remove the outer frame identifier "External\n" to obtain the ciphertext to be decrypted.

[0038] ③ Traverse the ciphertext byte order according to the remaining ciphertext size.

[0039] ④ Subtract the key from the ciphertext bytes to obtain the plaintext bytes.

[0040] ⑤ If the plaintext byte is less than zero, then the ciphertext byte is inverted and used as the plaintext byte.

[0041] III. Implement the AFR dynamic refresh function; see the relevant pseudocode below. Figure 7 .

[0042] Step 1: Reverse engineer CATAfrFoundation.dll to obtain the internal business classes and related function pointers related to Afr loading, including CATDeclarUIParser, CATAfrApp, CATWorkbenchDynamicLicensing, l_CATApplicationFrame, etc.

[0043] Step 2 is mandatory; use the CATDeclarUIParser business class to obtain the UI parser instance handle and reset it.

[0044] Step 3 (Optional): Based on user input, use the CATAfrApp business class to reload the application context.

[0045] Step 4 (Optional): Based on user input, reload the global application using the CATWorkbenchDynamicLicensing business class.

[0046] Step 5 Optionally, based on user input, use the l_CATApplicationFrame business class to reload the current application.

[0047] Assembling the above methods and steps into a program and storing it on a hard disk or other non-transitory storage medium constitutes an embodiment of the present invention's "a non-transitory readable recording medium"; while electrically connecting the storage medium to a computer processor and enabling the completion of declarative creation commands for CAA components through data processing constitutes an embodiment of the present invention's "a system for declarative creation commands for CAA components".

[0048] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computers or available storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0049] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0050] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0051] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0052] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for declaratively creating CAA component commands, characterized in that, Includes the following steps: Insert a data model identifier into the comment field of the application framework resource source file. The data model identifier is used to replace the identifier and logical path of the program provided by the current component, and to define the CAA component command in a declarative manner. By using a custom application framework resource compiler, the application framework resource source file is read, the data model identifier is identified and parsed and restored to the corresponding logical path, and the application framework resource source file is compiled to generate the application framework resource target file. Deploy the application framework resource target files to the runtime environment. The platform will take effect immediately upon startup and automatically create the corresponding framework commands. In the fat client runtime environment, the CAA component commands will be hot-reloaded by resetting the user interface resolver and reloading the workbench and application modules.

2. The method for declaratively creating CAA component commands according to claim 1, characterized in that, Data model identifiers are preset keywords or custom strings, and each data model identifier uniquely corresponds to a set of logical paths.

3. The method for declaratively creating CAA component commands according to claim 1, characterized in that, The custom application framework resource compiler is integrated into the existing CAA secondary development integration environment.

4. The method for declaratively creating CAA component commands according to claim 1, characterized in that, The CAA component command hot reload is integrated into the 3DE platform fat client in the form of a plug-in function.

5. The method for declaratively creating CAA component commands according to claim 3, characterized in that, The custom application framework resource compiler directly modifies the original application framework resource source file structure, compiles the application framework resource source files into application framework resource target files, and completes runtime deployment based on the logical path identified by the built-in data model.

6. The method for declaratively creating CAA component commands according to claim 4, characterized in that, When dynamically resetting the fat client user interface resolver, the workbench and application are reloaded, enabling hot reloading of commands for loaded CAA components.

7. A non-transitory readable recording medium for storing one or more programs containing multiple instructions, characterized in that, When the instruction is executed, it will cause the processing circuitry to perform a method for declaratively creating a CAA component command as described in any one of claims 1-6.

8. A system for declaratively creating CAA component commands, comprising processing circuitry and a memory electrically coupled thereto, characterized in that, The memory is configured to store at least one program, the program containing multiple instructions, and the processing circuit runs the program to execute a method for declaratively creating a CAA component command according to any one of claims 1-6.