A semantic context preservation method, system, device, and medium in an AI-driven human-machine collaborative modeling system.
By establishing a two-layer storage architecture of semantic domain and state domain in the human-computer collaborative modeling system, and combining global asynchronous lock and state synchronization mechanism, the problems of semantic reference failure and communication conflict in existing human-computer collaborative modeling technologies are solved, achieving efficient and stable semantic context maintenance and improving the system's response speed and interaction efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN ZHONGJIANYUAN CONSTR TECH CO LTD
- Filing Date
- 2026-03-31
- Publication Date
- 2026-06-30
AI Technical Summary
Existing technologies lack effective semantic context synchronization mechanisms and adaptation and scheduling schemes for asynchronous communication and single-threaded synchronization interfaces in human-machine collaborative modeling. This makes it difficult for AI assistants to perceive changes in software state after manual user intervention, easily causing semantic reference failures, and facing limited system responsiveness or unstable operation due to communication protocol conflicts.
By establishing independent context storage spaces for semantic and state domains, performing multi-level resolution of object references, using global asynchronous locks to intercept queues and drive API requests in an asynchronous execution environment, and combining state synchronization signals to achieve full updates of the state domain while selectively retaining semantic mapping relationships, the system ensures data consistency and stability in complex interaction scenarios.
It achieves decoupling management of semantic mapping relationships and physical object states, improves the system's parsing robustness and response speed in dynamic modeling environments, ensures the continuity and interaction efficiency of human-computer collaborative modeling, and avoids the tedious process of redefining objects due to manual intervention.
Smart Images

Figure CN122309037A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer software interaction technology, and in particular to a semantic context preservation method, system, device, and medium in an AI-driven human-computer collaborative modeling system. Background Technology
[0002] With the rapid development of Large Language Model (LLM) technology, AI-assisted engineering design has become a key focus in the industry. The release of the Model Context Protocol (MCP) provides a standardized solution for integrating AI assistants with professional tools, enabling AI assistants to drive professional software to perform modeling and analysis tasks through natural language commands. In the field of structural engineering, commercial software such as SAP2000 and ETABS typically provide Component Object Model (COM) interfaces, allowing external programs to achieve automated control by calling these interfaces. Combining AI assistants with such professional software to achieve intelligent modeling is an important direction for the development of the engineering industry.
[0003] However, existing integration solutions still have significant shortcomings in achieving AI-driven human-machine collaborative modeling. Since human-machine collaborative scenarios allow users to issue commands through an AI assistant while simultaneously making manual modifications directly within the software's graphical interface, a complex alternating operation logic arises. In this scenario, the AI assistant needs to maintain a set of relational information to correspond to the user's natural language descriptions and the object identifiers within the software. Because the user's manual operations typically do not involve the AI assistant, this leads to a disconnect between the internal information maintained by the assistant and the actual physical state of the software. Because existing technologies primarily focus on closed-loop scenarios of unidirectional AI-controlled modeling, they do not adequately consider the data coordination issues after manual intervention, thus facing a technical dilemma: without state updates, the assistant will not be able to perceive manually added objects and therefore cannot respond to subsequent requests; if a forced update is performed, existing technologies often cause previously established object references to become invalid. Due to the lack of an effective coordination mechanism, users often need to repeatedly establish reference relationships after manual modifications, thereby reducing the continuity of modeling.
[0004] Furthermore, the Model Context Protocol (MCP) typically employs an asynchronous communication model, while COM interfaces in software such as SAP2000 are usually based on a Single-Threaded Unit (STA) model, requiring API calls to be executed serially within a specific thread. Due to the conflict between these two technical specifications, directly using asynchronous methods to call synchronous interfaces may lead to runtime conflicts or even program crashes; conversely, simply handling requests in a blocking manner will cause artificial intelligence to lose its responsiveness. Current research solutions primarily target open-source libraries that natively support asynchronous calls. However, for commercial software that requires COM interface drivers, the lack of effective scheduling mechanisms makes stable and efficient standardized integration difficult. Summary of the Invention
[0005] (a) Technical problems to be solved
[0006] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a semantic context preservation method, system, device and medium in an AI-driven human-computer collaborative modeling system. It solves the technical problems that, in human-computer collaborative modeling scenarios, the prior art lacks an effective semantic context synchronization mechanism and an adaptation and scheduling scheme for asynchronous communication and single-threaded synchronization interfaces. This makes it difficult for AI assistants to perceive changes in software state after manual intervention by users, and easily causes existing semantic references to become invalid. At the same time, it faces technical problems such as limited system response capabilities or unstable operation caused by communication protocol conflicts.
[0007] (II) Technical Solution
[0008] To achieve the above objectives, the main technical solutions adopted by the present invention include:
[0009] In a first aspect, embodiments of the present invention provide a semantic context preservation method in an AI-driven human-computer collaborative modeling system, comprising:
[0010] When a tool call request is received from the parsing of the input natural language command, a semantic-first multi-level parsing is performed on the object reference in the tool call request. The semantic domain is used to retrieve the object identifier that matches the object reference, and the state domain is used to verify the matched object identifier or the object reference when there is no match, so as to obtain the verified object identifier.
[0011] Based on the verified object identifier, the tool call request is converted into an API request for the structural analysis software. A global asynchronous lock is used to intercept and queue the API request, and the structural analysis software is driven to execute the API request serially in an asynchronous execution environment.
[0012] In response to the state synchronization signal, the latest object list of the structural analysis software after executing API requests or manual operations is obtained, and the state domain is fully updated based on the latest object list. Existing semantic mapping relationships in the semantic domain are selectively retained so that the semantic mapping relationships pointing to the latest object list remain unchanged.
[0013] The semantic domain and the state domain are independent of each other and together constitute the context storage space, which is used to store semantic mapping relationships and object identifiers of structural analysis software, respectively.
[0014] Optionally, the tool invocation request obtained from parsing the input natural language instructions includes:
[0015] Identify semantic operation intent in natural language instructions, wherein the semantic operation intent includes at least one of modeling action, structural analysis action, or result extraction action;
[0016] Extract the operation parameters carried in the natural language instructions, where the operation parameters include object references used to point to the operation object;
[0017] Determine whether a natural language instruction contains a user-defined semantic name;
[0018] If the semantic operation intent involves creating a new operation object and does not contain a user-defined semantic name, then determine whether to assign a preset default semantic name to the new operation object based on the object creation order;
[0019] Map the corresponding Model Context Protocol (MTP) tool according to the semantic operation intent, and populate the parameter field of the MTP tool with the operation parameters and default semantic name, or the operation parameters and user-defined semantic name, to construct a tool call request that conforms to the MTP format.
[0020] Optionally, upon receiving a tool invocation request parsed from an input natural language instruction, a semantic-first multi-level parsing is performed on the object reference in the tool invocation request. This involves using the semantic domain to retrieve object identifiers that match the object references, and then using the state domain to verify the matched object identifiers or object references that do not match, to obtain the verified object identifiers, including:
[0021] Extract object references from tool call requests and search the semantic domain for a user-defined semantic name or an assigned default semantic name that matches the object reference.
[0022] If a matching semantic name is found, the object identifier corresponding to the matching semantic name is obtained from the semantic domain, and the obtained object identifier is determined as the identifier to be verified.
[0023] If no matching semantic name is found, the object reference will be directly identified as the identifier to be verified.
[0024] The identifier to be verified is compared with the currently existing object identifiers in the state domain to determine whether the identifier to be verified belongs to the currently existing object identifiers.
[0025] If the verification passes, the verified identifier will be determined as the verified object identifier.
[0026] Optionally, based on the verified object identifier, the tool call request is converted into an API request for the structural analysis software. A global asynchronous lock is used to intercept and queue the API requests, and the structural analysis software is driven to execute the API requests serially in an asynchronous execution environment, including:
[0027] The object reference in the tool call request is replaced with the verified object identifier to construct a COM call request as an API request;
[0028] In the asynchronous event loop of the main thread, concurrent COM call requests are intercepted using a global asynchronous lock, and an asynchronous waiting queue is maintained to queue the COM call requests according to their arrival order.
[0029] According to the queuing order, when a COM call request in the queue acquires a global asynchronous lock, the corresponding COM call request is dispatched to a background thread pool executor that is independent of the main thread;
[0030] In the background thread pool executor, a single-threaded unit execution environment that meets the COM interface requirements of the structural analysis software is created, and the structural analysis software is driven to serially execute COM call requests in the single-threaded unit execution environment;
[0031] After the current COM call request is completed, the global asynchronous lock is released, and the execution result or exception information that does not meet the preset standard is asynchronously called back to the main thread through the inter-thread communication mechanism, so as to trigger the asynchronous resumption of the execution of the current COM call request and complete the response.
[0032] Optionally, an asynchronous wait queue is maintained to queue COM call requests according to their arrival order, including:
[0033] After the main thread receives a COM call request, it requests and acquires a global asynchronous lock through an asynchronous non-blocking mechanism;
[0034] If the global asynchronous lock is currently occupied, without blocking the main thread's subsequent event processing, suspend the asynchronous coroutine corresponding to the current COM call request and register the asynchronous coroutine to an asynchronous waiting queue;
[0035] When the previous COM call request being executed completes and releases the global asynchronous lock, a lock release signal is triggered;
[0036] The lock release signal is captured by the asynchronous event loop, and the next suspended asynchronous coroutine in the asynchronous waiting queue is automatically woken up according to the first-in-first-out principle of the asynchronous waiting queue.
[0037] The global asynchronous lock is reacquired by the awakened asynchronous coroutine, and upon successful acquisition, the corresponding COM call request is dispatched to a background thread pool executor independent of the main thread.
[0038] Optionally, in response to the state synchronization signal, the latest object list of the structural analysis software after executing the API request or manual operation is obtained, and the state domain is fully updated based on the latest object list. Existing semantic mapping relationships in the semantic domain are selectively retained to ensure that the semantic mapping relationships pointing to the latest object list remain unchanged, including:
[0039] In response to the state synchronization signal, an object query command is sent to the COM interface of the structural analysis software;
[0040] The system receives raw data returned by the structural analysis software based on object query commands via the COM interface, extracts all object identifiers from the returned raw data, and generates the latest object list containing node, element, and material model information.
[0041] Write all object identifiers from the latest object list into the state domain and remove historical object identifiers from the state domain that no longer exist in the latest object list, so as to achieve real-time synchronization between the state domain and the structural analysis software.
[0042] Traverse the existing semantic mapping relationships in the semantic domain, determine whether the object identifier pointed to by each set of semantic mapping relationships exists in the state domain after full update. If it exists, keep the mapping relationship between semantic name and object identifier from being overwritten or reset, and record it in a semantic mapping object list; if it does not exist, mark the corresponding semantic mapping relationship as invalid or remove the corresponding semantic mapping relationship from the semantic domain.
[0043] Calculate the total number of updated state domain objects and the number of semantic domain semantic mappings, and combine them with the list of semantic mapping objects to provide the synchronization result to the user.
[0044] The state synchronization signals include: event signals actively pushed by the API event interface of the structural analysis software when the execution environment changes; and / or, self-synchronization instructions automatically generated by the human-machine collaborative modeling system after executing the API request; and / or, explicit synchronization requests input by the user through natural language.
[0045] Optionally, it also includes:
[0046] The semantic domain stores the mapping relationship between semantic names and object identifiers in the form of key-value pairs. In the semantic domain, one object identifier corresponds to one or more semantic names.
[0047] The object identifiers currently existing in the state domain storage structure analysis software are in the form of a set of identifiers. The currently existing object identifiers include object identifiers created through API requests and object identifiers created through manual operations.
[0048] When executing the API request to create an operation object, the object identifier returned by the structural analysis software is obtained and added to the state domain. If a user-defined semantic name or an assigned default semantic name exists, the user-defined semantic name or the assigned default semantic name and the obtained object identifier are added to the semantic domain to establish a mapping relationship.
[0049] Secondly, embodiments of the present invention provide an AI-driven human-computer collaborative modeling system, comprising: a user interaction layer, an AI assistant layer, an MCP server layer, and a structural analysis software layer connected in sequence; the AI assistant layer includes a natural language parsing module for parsing input natural language instructions into tool call requests in the model context protocol format; the MCP server layer includes: a semantic context management module for establishing and maintaining a context storage space containing mutually independent semantic domains and state domains, to store semantic mapping relationships and object identifiers of the structural analysis software respectively;
[0050] The object reference resolution module performs semantic-priority multi-level resolution on object references in tool call requests. It uses the semantic domain to retrieve object identifiers that match the object references, and then uses the state domain to verify the matched object identifiers or unmatched object references, obtaining the verified object identifiers. The request conversion module converts the tool call requests into API requests for the structural analysis software based on the verified object identifiers. The asynchronous serial execution module intercepts and queues API requests using a global asynchronous lock, and drives the structural analysis software to serially execute API requests in an asynchronous execution environment. The state synchronization module, in response to a state synchronization signal, obtains the latest object list after the structural analysis software executes API requests or performs manual operations, fully updates the state domain based on the latest object list, and selectively retains existing semantic mapping relationships in the semantic domain to maintain the semantic mapping relationships pointing to the latest object list unchanged.
[0051] Thirdly, embodiments of the present invention provide an apparatus, comprising: at least one controller; and a memory communicatively connected to the at least one controller; wherein the memory stores instructions executable by the at least one controller, the instructions being executed by the at least one controller to enable the at least one controller to perform the semantic context preservation method in the AI-driven human-machine collaborative modeling system as described above.
[0052] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a controller, implement the semantic context preservation method in the AI-driven human-machine collaborative modeling system as described above.
[0053] (III) Beneficial Effects
[0054] The beneficial effects of this invention are:
[0055] First, this invention achieves decoupling management of semantic mapping relationships and physical object states by establishing and maintaining a context storage space containing mutually independent semantic and state domains. This two-layer storage architecture changes the traditional situation where context information is singular and coupled, enabling the system to independently control the correspondence between logical references and physical entities, thus ensuring data consistency in complex interaction scenarios from the underlying architecture.
[0056] Secondly, by performing semantically prioritized multi-level resolution of object references, seamless compatibility between semantic references and original identifiers is achieved. This step prioritizes retrieving matching object identifiers in the semantic domain and uses the state domain for validity verification when no match is found. Therefore, users or AI assistants can mix and match intuitive semantic names and software-generated identifiers without needing to know whether the object was created by AI or manually modified, greatly enhancing the system's resolution robustness in dynamic modeling environments.
[0057] Furthermore, by utilizing a global asynchronous lock for interception and queuing, and driving the software to execute serially within an asynchronous execution environment, the technical conflict between asynchronous protocols and single-threaded synchronous interfaces was successfully resolved. Because this step ensures that only one request holds execution privileges at a time, it satisfies the physical requirements of commercial software COM interfaces for the single-threaded unit (STA) model, preventing program crashes due to concurrency contention, while also ensuring the non-blocking operation of the Model Context Protocol (MCP) service main thread. This adaptation mechanism significantly improves the response speed of AI-driven commercial engineering software while maintaining system stability.
[0058] Finally, by employing an update strategy of "fully updating the state domain and selectively retaining the semantic domain" during state synchronization, the core pain point of semantic reference invalidation in human-computer collaborative modeling scenarios is effectively solved. After the user manually modifies the model through the software interface, the system can respond to the synchronization signal and obtain the latest object list. Because the state domain is completely replaced with the latest physical state of the software, the system can perceive the objects manually added by the user in real time. At the same time, because the mapping relationship in the semantic domain is maintained, the semantic references previously established by the AI assistant remain valid after synchronization. Therefore, this invention ensures the consistency of the AI assistant's understanding of the model during human-computer interaction, avoids the tedious process of having to redefine object semantics due to manual intervention, and greatly improves the continuity and interaction efficiency of collaborative modeling. Attached Figure Description
[0059] Figure 1 This is a schematic diagram of the overall process of the method provided in the embodiments of the present invention;
[0060] Figure 2This is a partial flowchart illustrating step S1 of the method provided in this embodiment of the invention;
[0061] Figure 3 This is a schematic diagram illustrating another part of the specific process of step S1 of the method provided in the embodiments of the present invention;
[0062] Figure 4 A flowchart of object reference resolution provided for embodiments of the present invention;
[0063] Figure 5 This is a detailed flowchart illustrating step S2 of the method provided in this embodiment of the invention;
[0064] Figure 6 This is a diagram of the asynchronous serialization adaptation architecture provided in an embodiment of the present invention;
[0065] Figure 7 This is a detailed flowchart illustrating step S22 of the method provided in this embodiment of the invention;
[0066] Figure 8 A flowchart of asynchronous adaptation processing for a single request provided in an embodiment of the present invention;
[0067] Figure 9 This is a detailed flowchart illustrating step S3 of the method provided in this embodiment of the invention;
[0068] Figure 10 A flowchart illustrating state synchronization and semantic preservation provided in this embodiment of the invention;
[0069] Figure 11 A detailed flowchart of step S4 of the method provided in this embodiment of the invention.
[0070] Figure 12 This is a schematic diagram of a two-layer storage data structure provided in an embodiment of the present invention;
[0071] Figure 13 A flowchart illustrating the object creation and semantic mapping establishment process of the method provided in this embodiment of the invention;
[0072] Figure 14 The system architecture diagram provided for embodiments of the present invention. Detailed Implementation
[0073] To better explain and facilitate understanding of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0074] Before proceeding, some concepts will be introduced below to facilitate understanding of the technical solutions provided by this invention.
[0075] The Model Context Protocol (MCP) is an open standard protocol released by Anthropic in November 2024. It is used to enable standardized communication between AI assistants and external tools and data sources, and defines the interaction specifications for tool invocation, resource access, etc.
[0076] The Component Object Model (COM) is a binary interface standard for software components developed by Microsoft. Engineering software such as SAP2000 provides secondary development capabilities through the COM interface.
[0077] A Single-Threaded Apartment (STA) is a thread model for COM objects that requires all calls to that object to be executed in the same thread in which it was created.
[0078] A joint is a basic geometric element in structural analysis software. It is used to define the endpoints of an element and is the basic object for applying constraints and loads. In SAP2000, it is called a joint, while in general finite element software, it is often called a node.
[0079] An asynchronous lock is a synchronization primitive used in asynchronous programming to control concurrent access, ensuring that only one coroutine can execute a protected code segment at any given time.
[0080] The Thread Pool Executor is a thread pool implementation in the Python standard library, used to execute tasks in background threads to avoid blocking the main thread.
[0081] To enable the AI assistant to operate efficiently and stably with structural analysis software, such as... Figure 1As shown in the embodiment of the present invention, a semantic context preservation method in an AI-driven human-machine collaborative modeling system includes: upon receiving a tool call request parsed from an input natural language instruction, performing semantic-priority multi-level parsing on the object references in the tool call request, using the semantic domain to retrieve object identifiers matching the object references, and then using the state domain to verify the matched object identifiers or unmatched object references to obtain verified object identifiers; based on the verified object identifiers, converting the tool call request into an API request for the structural analysis software, using a global asynchronous lock to intercept and queue the API request, and driving the structural analysis software to serially execute the API request in an asynchronous execution environment; in response to a state synchronization signal, obtaining the latest object list of the structural analysis software after executing the API request or manual operation, and fully updating the state domain based on the latest object list, while selectively retaining existing semantic mapping relationships in the semantic domain to keep the semantic mapping relationships pointing to the latest object list unchanged; wherein, the semantic domain and the state domain are independent of each other and together constitute a context storage space, and are used to store semantic mapping relationships and object identifiers of the structural analysis software, respectively.
[0082] First, this invention achieves decoupling management of semantic mapping relationships and physical object states by establishing and maintaining a context storage space containing mutually independent semantic and state domains. This two-layer storage architecture changes the traditional situation where context information is singular and coupled, enabling the system to independently control the correspondence between logical references and physical entities, thus ensuring data consistency in complex interaction scenarios from the underlying architecture.
[0083] Secondly, by performing semantically prioritized multi-level resolution of object references, seamless compatibility between semantic references and original identifiers is achieved. This step prioritizes retrieving matching object identifiers in the semantic domain and uses the state domain for validity verification when no match is found. Therefore, users or AI assistants can mix and match intuitive semantic names and software-generated identifiers without needing to know whether the object was created by AI or manually modified, greatly enhancing the system's resolution robustness in dynamic modeling environments.
[0084] Furthermore, by utilizing a global asynchronous lock for interception and queuing, and driving the software to execute serially within an asynchronous execution environment, the technical conflict between asynchronous protocols and single-threaded synchronous interfaces was successfully resolved. Because this step ensures that only one request holds execution privileges at a time, it satisfies the physical requirements of commercial software COM interfaces for the single-threaded unit (STA) model, preventing program crashes due to concurrency contention, while also ensuring the non-blocking operation of the Model Context Protocol (MCP) service main thread. This adaptation mechanism significantly improves the response speed of AI-driven commercial engineering software while maintaining system stability.
[0085] Finally, by employing an update strategy of "fully updating the state domain and selectively retaining the semantic domain" during state synchronization, the core pain point of semantic reference invalidation in human-computer collaborative modeling scenarios is effectively solved. After the user manually modifies the model through the software interface, the system can respond to the synchronization signal and obtain the latest object list. Because the state domain is completely replaced with the latest physical state of the software, the system can perceive the objects manually added by the user in real time. At the same time, because the mapping relationship in the semantic domain is maintained, the semantic references previously established by the AI assistant remain valid after synchronization. Therefore, this invention ensures the consistency of the AI assistant's understanding of the model during human-computer interaction, avoids the tedious process of having to redefine object semantics due to manual intervention, and greatly improves the continuity and interaction efficiency of collaborative modeling.
[0086] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present invention can be understood more clearly and thoroughly, and that the scope of the present invention can be fully conveyed to those skilled in the art.
[0087] Specifically, embodiments of the present invention provide a semantic context preservation method in an AI-driven human-computer collaborative modeling system, comprising:
[0088] S1. When a tool call request is received from the parsing of the input natural language command, a semantic-first multi-level parsing is performed on the object reference in the tool call request. The semantic domain is used to retrieve the object identifier that matches the object reference. Then, the state domain is used to verify the matched object identifier or the object reference when there is no match, so as to obtain the verified object identifier.
[0089] Furthermore, such as Figure 2 As shown, the tool invocation request obtained from parsing the input natural language instruction in step S1 includes:
[0090] S11. Identify the semantic operation intent in natural language instructions, wherein the semantic operation intent includes at least one of modeling actions, structural analysis actions, or result extraction actions. Specifically, the semantic operation intent includes: modeling actions used to construct, modify, or define structural objects and their physical properties in structural analysis software; structural analysis actions used to drive the structural analysis software to perform force calculations, modal analysis, and other computational processes; and result extraction actions used to obtain mechanical response parameters or engineering calculation values associated with structural objects (such as nodes or elements) from the output data generated after the structural analysis software completes its computation.
[0091] S12. Extract the operation parameters carried in the natural language instructions, wherein the operation parameters include object references used to point to the operation object. In this step, quantitative information and qualitative descriptions used to constrain the execution of actions in the instructions are identified and separated. The operation parameters include object references used to uniquely locate, identify, or describe the operation target. This reference serves as the original semantic input feature, encompassing semantic names specified by the user through natural language (corresponding to logical objects defined by AI) or physical identifiers directly input by the user (corresponding to physical objects generated by manual operations).
[0092] S13. Determine whether the natural language instruction contains a user-defined semantic name. It is necessary to detect whether a specific naming identifier exists in the instruction. For example, if the instruction is "create a node named 'Left Support'", it is determined to contain the user-defined semantic name "Left Support"; if it is only "create a node", that is, only describing object attributes without a specific name, it is determined not to contain a user-defined semantic name.
[0093] S14. If the semantic operation intent involves creating a new operation object and does not include a user-defined semantic name, the system determines whether to assign a preset default semantic name to the new operation object based on the object creation order. In scenarios where the user does not explicitly specify a name, the system will determine whether the object to be created is the "first created object" in the current session. If so, the system automatically assigns it the preset default semantic name "first"; if it is neither user-defined nor the first object, the automatic addition action is not triggered, and the system proceeds directly to the subsequent steps. This mechanism ensures that even in scenarios where the user simplifies input, key objects (such as the starting node) still have a traceable semantic index.
[0094] S15. Map the corresponding Model Context Protocol (MCP) tool according to the semantic operation intent, and populate the parameter field of the MCP tool with the operation parameters and default semantic name, or the operation parameters and user-defined semantic name, to construct a tool invocation request conforming to the MCP format. The identified operation intent category is retrieved and matched with the corresponding execution tool in the preset toolset of the MCP server. Subsequently, the operation parameters and default semantic name, or the operation parameters and user-defined semantic name, are populated into the tool's parameter dictionary to construct a tool invocation request in the MCP format.
[0095] Next, as Figure 3 As shown, step S1 includes:
[0096] S16. Extract the object reference from the tool call request and search the semantic domain for a user-defined semantic name or an assigned default semantic name that matches the object reference. For the received input object reference string, such as "first node" or "node 3", use it as a search term to perform the first round of searching in the semantic domain. The search scope covers user-defined semantic names and system-assigned default names such as "first".
[0097] S17. If a matching semantic name is found, the object identifier corresponding to the matching semantic name is obtained from the semantic domain, and the obtained object identifier is determined as the identifier to be verified. Referring to Table 1, if the object reference entered by the user is a registered semantic name, such as "first node" or "left support", and the retrieval shows that its mapping relationship points to the identifier "1", then the corresponding object identifier is directly extracted from the semantic domain and confirmed as the identifier to be verified in the subsequent verification process.
[0098] Table 1. Resolution results for different referencing methods
[0099]
[0100] S18. If no matching semantic name is found, the object reference is directly identified as the identifier to be verified. If the reference string fails to be found in the semantic domain, for example, if the input is the original identifier "3" or the undefined semantic name "intermediate node", then the string is not processed, but is used as the identifier to be verified.
[0101] S19. The identifier to be verified is compared with the currently existing object identifiers in the state domain to determine whether the identifier to be verified belongs to the currently existing object identifiers. If the verification passes, the verified identifier to be verified is determined as the verified object identifier. In this step, the system uses the state domain to perform the final validity verification, that is, by traversing the set of identifiers stored in the state domain that include those created by AI instructions (such as identifiers "1", "3", and "5") and those manually created by the user (such as identifiers "2" and "4") for matching. Figure 4As shown in Table 1, for the obtained identifier "1" to be verified, since it exists in the state domain, the verification passes and the identifier is returned. For the original identifier input "3" from the semantic domain, although its semantic retrieval result is "no", it is verified as a valid identifier in the state domain, so the verification passes and the result "3" is returned. However, for inputs such as "intermediate node", which cannot be matched in the semantic domain or verified by the identifier in the state domain, they are judged as "unrecognized object reference" and an error message is triggered. This priority-based parsing mechanism allows users to use semantic names and original identifiers in combination for interaction, without needing to care whether the object is automatically generated by the AI assistant or manually intervened, thus ensuring the continuity and flexibility of the human-computer collaborative modeling process at the object reference level.
[0102] S2. Based on the verified object identifier, the tool call request is converted into an API request for the structural analysis software. A global asynchronous lock is used to intercept and queue the API requests, and the structural analysis software is driven to execute the API requests serially in an asynchronous execution environment. In this embodiment, this step aims to resolve the fundamental conflict between the Model Context Protocol (MCP) and the COM interface of commercial structural analysis software (such as SAP2000, ETABS, etc.). As shown in Table 2, the MCP protocol requires asynchronous non-blocking communication and supports concurrent requests, while the COM interface based on the Single Thread Unit (STA) model forces all calls to be executed serially in the created thread. Direct synchronous calls would block the MCP service main thread, causing the service to become unresponsive; direct multi-threaded calls would violate the STA requirements, leading to program crashes or data errors. Therefore, this step, through an asynchronous serialization adaptation architecture, ensures system responsiveness while satisfying the physical constraints of the software interface.
[0103] Table 2 Technical Specification Conflicts Between MCP Protocol and COM Interface
[0104]
[0105] Furthermore, such as Figure 5 As shown, step S2 includes:
[0106] S21. Replace the object reference in the tool call request with the verified object identifier to construct a COM call request as an API request. Specifically, the system constructs a COM call request that can be directly recognized by the structural analysis software API by filling the verified object identifier into the corresponding parameter field of the tool call request. For example, if the initial reference entered by the user is "left support", which is confirmed as the identifier "1" after the aforementioned parsing, then when constructing the underlying instruction, the string "left support" as the original input in the tool call request is replaced with the identifier "1". Through the above parameter replacement and backfilling mechanism, it is ensured that the final generated API request can be correctly recognized by the structural analysis software, thereby enabling the user to use semantic names and identifiers to drive the structural analysis software to execute the corresponding API request.
[0107] S22. In the asynchronous event loop of the main thread, intercept concurrent COM call requests using a global asynchronous lock, and maintain an asynchronous waiting queue to queue the COM call requests according to their arrival order. For example... Figure 6 As shown in the architecture, the main thread of the MCP service runs an asynchronous event loop, which can simultaneously receive concurrent requests from different users. At this point, a global asynchronous lock is introduced. All concurrent requests (such as request 1, request 2, and request 3) must first be intercepted by this lock, ensuring that only one request can physically enter the downstream execution environment at any given time. This achieves serialized queuing of requests at the logical layer.
[0108] Furthermore, step S22 maintains an asynchronous wait queue to queue COM call requests according to their arrival order, such as... Figure 7 As shown, it includes:
[0109] S221. After the main thread receives a COM call request, it requests and acquires a global asynchronous lock through an asynchronous non-blocking mechanism. Whenever the main thread captures a new COM call request, the system immediately attempts to acquire the global asynchronous lock in asynchronous non-blocking mode. This operation only probes the lock status and does not consume CPU resources.
[0110] S222. If the global asynchronous lock is currently occupied, without blocking subsequent event processing in the main thread, suspend the asynchronous coroutine corresponding to the current COM call request and register the asynchronous coroutine to an asynchronous waiting queue. For example... Figure 8 As shown, if the lock is already held, the asynchronous coroutine corresponding to the current request is suspended and needs to wait. At this time, the main thread does not enter a blocked state but continues to process other concurrent transactions. The suspended request is registered in the asynchronous waiting queue and is in a background waiting state.
[0111] S223. When the previous COM call request being executed completes and releases the global asynchronous lock, a lock release signal is triggered. When the preceding task completes, the system releases the lock resource and triggers a notification signal indicating a lock state change.
[0112] S224. The asynchronous event loop captures the lock release signal and automatically wakes up the next suspended asynchronous coroutine in the asynchronous waiting queue according to the first-in-first-out principle. After the asynchronous event loop captures the release signal, it immediately searches the waiting queue and switches the state of the coroutine at the top of the queue from suspended to ready, thereby waking up the next request.
[0113] S225. The awakened asynchronous coroutine reacquires the global asynchronous lock, and upon successful acquisition, triggers the operation of dispatching the corresponding COM call request to a background thread pool executor independent of the main thread. After the awakened coroutine successfully competes for and acquires the global asynchronous lock, it immediately triggers the scheduling logic to dispatch the encapsulated COM request from the main thread to the background execution environment.
[0114] S23. Following the queuing order, when a COM call request in the queue acquires the global asynchronous lock, the corresponding COM call request is dispatched to a background thread pool executor independent of the main thread. Once the request acquires the lock, the system submits it to the independent thread pool executor through the main thread. This executor runs independently in the background, ensuring that any COM call that may cause blocking will not interfere with the normal communication of the main thread.
[0115] S24. A single-threaded unit execution environment conforming to the COM interface requirements of the structural analysis software is created in the background thread pool executor. Within this single-threaded unit execution environment, the structural analysis software is driven to serially execute COM call requests. The thread pool executor is configured in single-threaded mode to meet COM STA requirements. In this independent background thread, the system drives the structural analysis software to perform specific modeling, analysis, or extraction operations through the COM interface layer (such as the interface layer of software like SAP2000). Due to lock protection and thread pool isolation, this process is serial, effectively avoiding multi-threaded conflicts.
[0116] S25. After the current COM call request is completed, the global asynchronous lock is released, and the execution result or exception information that does not meet the preset standard is asynchronously called back to the main thread through the inter-thread communication mechanism. This triggers the asynchronous resumption of the execution of the current COM call request and completes the response. After the background task obtains the execution result or catches exception information such as a crash, the executor issues a notification and releases the global asynchronous lock for the next request in the queue. The execution result is returned to the main thread through the callback mechanism. The main thread resumes the previously suspended context and feeds back the result or error message to the user, completing the entire asynchronous non-blocking response loop.
[0117] S3. In response to the state synchronization signal, obtain the latest object list of the structural analysis software after executing API requests or manual operations, and update the state domain fully based on the latest object list. Selectively retain existing semantic mapping relationships in the semantic domain to ensure that the semantic mapping relationships pointing to the latest object list remain unchanged. In this embodiment, this step aims to achieve information synchronization during the human-machine collaborative modeling process, ensuring that the AI assistant can perceive the physical model state after manual intervention, while maintaining the consistency of logical references.
[0118] Furthermore, such as Figure 9 Step S3 includes:
[0119] S31. In response to the state synchronization signal, an object query command is sent to the COM interface of the structural analysis software; the system monitors and responds to state synchronization signals from multiple sources in real time to trigger the synchronization mechanism. These state synchronization signals include: event signals actively pushed by the API event interface of the structural analysis software when the execution environment changes (e.g., manual user operation); and / or, self-synchronization commands automatically generated by the human-machine collaborative modeling system after executing API requests; and / or, explicit synchronization requests input by the user through natural language.
[0120] S32. Receive raw data returned by the structural analysis software based on object query commands via the COM interface, extract all object identifiers from the returned raw data to generate an updated object list containing node, element, and material information. The system parses the raw data stream returned from the interface and extracts all object identifiers. For example... Figure 10 As shown, the generated latest object list covers model information such as nodes, elements, and materials in the model, ensuring the completeness of the state description.
[0121] S33. Write all object identifiers from the latest object list into the state domain and remove historical object identifiers from the state domain that no longer exist in the latest object list, so as to achieve real-time synchronization between the state domain and the structural analysis software.
[0122] Referring to the comparison example shown in Table 3, if the state field before synchronization only contains the object identifiers "1" and "2" created by the AI, after the user manually adds the identifiers "3" and "4", the entire list of "1, 2, 3, 4" will be written into the state field. In this way, the state field can accurately reflect all objects that actually exist in the software (including objects created by the AI and manually created objects).
[0123] Table 3 Comparison of AI context states before and after synchronization
[0124]
[0125] S34. Traverse the existing semantic mapping relationships in the semantic domain, and determine whether the object identifier pointed to by each set of semantic mapping relationships exists in the state domain after the full update. If it exists, force the semantic name and object identifier mapping relationship to remain unchanged and not be overwritten or reset, and record it in a semantic mapping object list; if it does not exist, mark the corresponding semantic mapping relationship as invalid or remove the corresponding mapping relationship from the semantic domain. In this step, the existing semantic mapping relationships in the semantic domain are checked one by one. As shown in Table 3, although the state domain has been updated to "1, 2, 3, 4", the system determines by traversal that the identifiers "1" and "2" pointed to by the original semantic mapping relationships (such as "first node" → "1", "right end" → "2") are still valid in the state domain. At this time, the system triggers the "selective update" strategy, forcibly keeping these two sets of mapping relationships unchanged and not being modified or reset, and records them in a semantic mapping object list for subsequent feedback. This mechanism ensures that even after a user manually modifies the model, they can still use the previously defined semantic name "first node" to reference object "1" without having to re-execute the naming or definition operation, thus greatly guaranteeing the continuity of the human-computer collaborative modeling process.
[0126] S35. Calculate the total number of updated state domain objects and the number of semantic domain semantic maps, and combine this with the list of semantic map objects to provide the synchronization result to the user. Before the synchronization process ends, the system generates a synchronization report based on the latest storage snapshot. Figure 10 As shown, the report provides detailed statistics on the total number of objects in the state domain (e.g., "4 objects in total"), the number of valid mappings in the semantic domain (e.g., "2 sets of semantic mappings"), and a specific list of semantic mapping objects. Finally, the system feeds back the synchronization result to the user interaction layer, allowing the user to clearly perceive that the model has been synchronized and that manually added nodes (e.g., "3" and "4") have entered the referenceable scope, thus achieving closed-loop feedback for human-computer collaborative modeling.
[0127] Furthermore, the above method also includes: establishing and maintaining a context storage space containing mutually independent semantic and state domains to store semantic mapping relationships and object identifiers of the structural analysis software, respectively. In this step, the system initializes a two-layer storage space containing mutually independent semantic and state domains at the MCP server layer. By realizing the logical separation and independent maintenance of the natural language semantic names on the user side and the underlying physical object identifiers on the structural analysis software side, the system ensures that the storage space has the technical capability to maintain semantic context consistency and reference validity during dynamic changes in the physical state of the model and during human-computer interaction.
[0128] Furthermore, such as Figure 11 As shown, step S4 includes:
[0129] S41. Store the mapping relationship between semantic names and object identifiers in the semantic domain in the form of key-value pairs. In the semantic domain, one object identifier corresponds to one or more semantic names.
[0130] Specifically, a mapping table is established in the semantic domain, where "keys (semantic names)" correspond to "values (object identifiers)". For example... Figure 12 As shown, the dual-layer storage structure of this invention supports a flexible naming mechanism, allowing many semantic names to point to the same physical object. For example, a node with the identifier "1" can be assigned both the semantic labels "first node" and "left support"; while an object with the identifier "5" corresponds to "right support," and an object with the identifier "3" corresponds to "mid-span node." The mapping relationship of semantic domains is incrementally added when the AI assistant executes instructions involving semantic associations. During subsequent execution of state synchronization operations, the semantic domains remain unchanged, without any modification or reset, thereby ensuring the continuity of the AI's cognition of defined objects.
[0131] S42. The state domain stores the currently existing object identifiers in the software as a set of identifiers. These currently existing object identifiers include those created via API requests and those created manually. The state domain is configured as a set of identifiers reflecting the current state of the software. For example... Figure 12 As shown, this identifier set dynamically records all currently existing objects in the structural analysis software. This includes not only objects created through AI commands (such as identifiers "1", "3", and "5"), but also objects manually created by the user directly in the graphical interface, bypassing the AI assistant (such as identifiers "2" and "4"). The state domain is updated during the state synchronization operation phase. At this time, the system retrieves the latest full list of objects from the software and performs a complete replacement update to ensure that the state domain always remains absolutely consistent with the actual modeling state of the software.
[0132] S43. When executing the API request to create an operation object, obtain the object identifier returned by the structural analysis software and add it to the state domain. If a user-defined semantic name or an assigned default semantic name exists, add the user-defined semantic name or the assigned default semantic name and the obtained object identifier to the semantic domain to establish a mapping relationship. (Refer to...) Figure 13When the system receives a creation request containing coordinates, parameters, and a semantic name, it first drives the API to execute the creation action, determining in real time whether the creation was successful. If the execution fails, an error message is immediately returned to the user interaction layer; if the creation is successful, the system obtains the unique object identifier from the structural analysis software and establishes a mapping. During this process, if the user specifies a semantic name in the instruction (e.g., "left support"), a key-value pair (e.g., "left support → object identifier") is added to the semantic domain; if the user does not specify a semantic name, the system retrieves the current record, determines whether the object is the "first created object," and if so, automatically assigns and adds a default mapping relationship (e.g., "first → object identifier"). After completing the semantic domain processing (or determining that no semantic name needs to be added), the object identifier is added to the state domain. Finally, a success result containing the physical identifier and associated semantic name is returned to the user. This process ensures that objects created by the AI assistant possess semantic indexing features, and their corresponding object identifiers are also synchronously recorded in the state domain, thus guaranteeing the system's consistency in maintaining AI-created objects across both semantic logic and physical state dimensions.
[0133] Furthermore, it should be noted that the present invention also provides a variety of alternative implementation schemes to adapt to different engineering application requirements.
[0134] Regarding the implementation of the dual-layer storage space, this invention presupposes several expansion modes. Specifically, Alternative A uses a lightweight database (such as SQLite) to store semantic domain and state domain data separately. Compared to in-memory storage, although this solution increases external dependencies, it supports persistent data storage and session recovery, making it particularly suitable for applications requiring long-term preservation of semantic mappings. Furthermore, Alternative B suggests storing the semantic domain and state domain separately in JSON-formatted structured files. Although its read / write efficiency is lower than in-memory storage, its advantage lies in effectively supporting the maintenance of semantic mappings across sessions. Further, for collaborative scenarios where multiple users share the same model, Alternative C proposes using a distributed cache (such as Redis) to build a distributed storage architecture. The significant difference of this solution is that it supports sharing semantic context among multiple instances, thereby meeting the consistency requirements in complex collaborative environments.
[0135] To address the adaptation of asynchronous protocols to synchronous interfaces, this invention also provides multiple technical approaches. On one hand, Alternative A serializes requests by introducing a message queue (such as RabbitMQ) instead of a global asynchronous lock. While this increases architectural complexity, it offers stronger concurrency handling capabilities. On the other hand, Alternative B employs a process isolation mechanism, deploying COM calls involving structural analysis software in independent processes, with the main process distributing tasks solely through inter-process communication mechanisms. Compared to conventional solutions, this approach offers superior physical isolation, ensuring that an abnormal crash in a single call stage will not affect the stability of the main service, making it suitable for production environments with extremely high reliability requirements.
[0136] Next, regarding the object reference resolution mechanism, this invention provides an alternative three-level resolution scheme based on semantic-first multi-level resolution. In this scheme, the system introduces an additional "alias layer" between the semantic domain and the state domain to store more flexible reference logic. Although adding an intermediate layer increases logical complexity, it can support more complex naming rules and multiple alias mappings.
[0137] Additionally, embodiments of the present invention also provide an AI-driven human-machine collaborative modeling system, see reference. Figure 14The system comprises: a user interaction layer, an AI assistant layer, an MCP server layer, and a structural analysis software layer, connected sequentially. The AI assistant layer includes a natural language parsing module, used to parse input natural language commands into tool call requests in the Model Context Protocol (MCP) format. The MCP server layer includes: the AI assistant layer, which contains a natural language parsing module, used to parse input natural language commands into tool call requests in the MCP format; and the MCP server layer, which includes: a semantic context management module, used to establish and maintain a context storage space containing independent semantic and state domains to store semantic mapping relationships and object identifiers for the structural analysis software; and an object reference parsing module, used to perform semantic-priority multi-level parsing of object references in tool call requests, to utilize semantic domain retrieval and... The system consists of several modules: a reference to a matching object identifier, a state domain to verify the matched object identifier or the object reference when there is no match, and a request conversion module to convert the tool call request into an API request for the structural analysis software based on the verified object identifier; an asynchronous serial execution module to intercept and queue API requests using a global asynchronous lock and drive the structural analysis software to execute API requests serially in an asynchronous execution environment; and a state synchronization module to obtain the latest object list of the structural analysis software after executing API requests or manual operations in response to a state synchronization signal, update the state domain fully based on the latest object list, and selectively retain existing semantic mapping relationships in the semantic domain to keep the semantic mapping relationships pointing to the latest object list unchanged.
[0138] Then, embodiments of the present invention provide an apparatus comprising: at least one controller; and a memory communicatively connected to the at least one controller; wherein the memory stores instructions executable by the at least one controller, the instructions being executed by the at least one controller to enable the at least one controller to perform the semantic context preservation method in the AI-driven human-machine collaborative modeling system as described above.
[0139] Furthermore, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions. When the executable instructions are executed by a controller, they implement the semantic context preservation method in the AI-driven human-machine collaborative modeling system described above.
[0140] In summary, this invention provides a semantic context preservation method, system, device, and medium in an AI-driven human-machine collaborative modeling system. Its core lies in establishing a semantic context preservation mechanism suitable for human-machine collaborative modeling scenarios. Specifically, this invention first connects the AI assistant and structural analysis software through a model context protocol, enabling users to drive the software to perform modeling, analysis, and result extraction operations using natural language commands. Simultaneously, in terms of technological innovation and protection, this invention innovatively proposes a dual-layer storage architecture, dividing the AI assistant's context storage space into independent semantic and state domains, thereby achieving decoupled management of semantic reference relationships and the actual physical state of the software. This architecture is not only the core protection point of this invention but also the foundation for solving the semantic failure problem in human-machine collaborative scenarios.
[0141] During the instruction parsing and execution phase, this invention utilizes a multi-level reference resolution mechanism to process object references in API requests. It employs a semantic domain-first, state domain-last strategy to ensure seamless compatibility between user-defined semantic names and original software identifiers. This resolution method eliminates the need for users to worry about whether objects are created by AI or generated manually, significantly improving the continuity of modeling. Furthermore, addressing the fundamental conflict between the asynchronous non-blocking characteristics of the model context protocol and the single-threaded unit (STA) model of commercial software COM interfaces, this invention constructs an asynchronous serialization adaptation architecture. Through a combination of a global asynchronous lock and a thread pool executor, the system can drive the structural analysis software to serially execute requests containing verified identifiers without blocking the main thread.
[0142] To address the issue of state consistency in human-computer collaboration, this invention employs a "selective update" strategy. Upon responding to a state synchronization signal, the system fully updates the state domain to detect user modifications, while selectively preserving some or all existing mappings in the semantic domain to maintain the semantic mappings pointing to the latest object list. This invention can drive the software in real time and detect manual intervention, ensuring that existing semantic references still point to the correct objects after synchronization. Furthermore, this invention also includes subordinate protection points such as automatically naming the first object "first," supporting multiple semantic names for the same object, and generating a synchronization report after state synchronization, comprehensively ensuring closed-loop feedback in human-computer interaction.
[0143] Meanwhile, compared to general frameworks such as FeaGPT and AutoFEA, this invention deeply optimizes the COM / STA thread model for specific commercial software, filling the gap in the integration of general frameworks with commercial software. Furthermore, unlike commercial products such as Structures AI that use proprietary protocols and whose solutions are not publicly available, this invention is based on the open MCP protocol, possessing strong scalability and platform independence, supporting the access of any mainstream large language model. In particular, this invention avoids existing fields such as traditional BIM management, industrial automation, or simple CAD model generation, focusing on solving the challenges of semantic preservation and asynchronous scheduling when AI and users alternately operate on the same model.
[0144] In summary, this invention addresses the significant shortcomings of existing technologies in human-machine collaboration, semantic continuity, and commercial software interface adaptation through technical means, providing a highly stable, standardized, and deeply interactive technical solution for the field of intelligent engineering design.
[0145] 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, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions.
[0146] Furthermore, it should be noted that in the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0147] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the claims should be interpreted to include both the preferred embodiments and all changes and modifications falling within the scope of the invention. Thus, if these modifications and variations of the invention fall within the scope of the claims and their equivalents, the invention should also include these modifications and variations.
Claims
1. A semantic context preservation method in an AI-driven human-computer collaborative modeling system, characterized in that, include: When a tool call request is received from the parsing of the input natural language command, a semantic-first multi-level parsing is performed on the object reference in the tool call request. The semantic domain is used to retrieve the object identifier that matches the object reference, and the state domain is used to verify the matched object identifier or the object reference when there is no match, so as to obtain the verified object identifier. Based on the verified object identifier, the tool call request is converted into an API request for the structural analysis software. A global asynchronous lock is used to intercept and queue the API request, and the structural analysis software is driven to execute the API request serially in an asynchronous execution environment. In response to the state synchronization signal, the latest object list of the structural analysis software after executing API requests or manual operations is obtained, and the state domain is fully updated based on the latest object list. Existing semantic mapping relationships in the semantic domain are selectively retained so that the semantic mapping relationships pointing to the latest object list remain unchanged. The semantic domain and the state domain are independent of each other and together constitute the context storage space, which is used to store semantic mapping relationships and object identifiers of structural analysis software, respectively.
2. The semantic context preservation method in the AI-driven human-machine collaborative modeling system as described in claim 1, characterized in that, The tool invocation request obtained from parsing the input natural language instructions includes: Identify semantic operation intent in natural language instructions, wherein the semantic operation intent includes at least one of modeling action, structural analysis action, or result extraction action; Extract the operation parameters carried in the natural language instructions, where the operation parameters include object references used to point to the operation object; Determine whether a natural language instruction contains a user-defined semantic name; If the semantic operation intent involves creating a new operation object and does not contain a user-defined semantic name, then determine whether to assign a preset default semantic name to the new operation object based on the object creation order; Map the corresponding Model Context Protocol (MTP) tool according to the semantic operation intent, and populate the parameter field of the MTP tool with the operation parameters and default semantic name, or the operation parameters and user-defined semantic name, to construct a tool call request that conforms to the MTP format.
3. The semantic context preservation method in the AI-driven human-machine collaborative modeling system as described in claim 2, characterized in that, Upon receiving a tool invocation request parsed from an input natural language instruction, a semantic-first multi-level parsing is performed on the object references in the tool invocation request. This involves using the semantic domain to retrieve object identifiers that match the object references, and then using the state domain to verify the matched object identifiers or object references that do not match, obtaining the verified object identifiers, including: Extract object references from tool call requests and search the semantic domain for a user-defined semantic name or an assigned default semantic name that matches the object reference. If a matching semantic name is found, the object identifier corresponding to the matching semantic name is obtained from the semantic domain, and the obtained object identifier is determined as the identifier to be verified. If no matching semantic name is found, the object reference will be directly identified as the identifier to be verified. The identifier to be verified is compared with the currently existing object identifiers in the state domain to determine whether the identifier to be verified belongs to the currently existing object identifiers. If the verification passes, the verified identifier will be determined as the verified object identifier.
4. The semantic context preservation method in the AI-driven human-machine collaborative modeling system as described in claim 1, characterized in that, Based on the verified object identifier, the tool call request is converted into an API request for the structural analysis software. A global asynchronous lock is used to intercept and queue the API requests, and the structural analysis software is driven to execute the API requests serially in an asynchronous execution environment, including: The object reference in the tool call request is replaced with the verified object identifier to construct a COM call request as an API request; In the asynchronous event loop of the main thread, concurrent COM call requests are intercepted using a global asynchronous lock, and an asynchronous waiting queue is maintained to queue the COM call requests according to their arrival order. According to the queuing order, when a COM call request in the queue acquires a global asynchronous lock, the corresponding COM call request is dispatched to a background thread pool executor that is independent of the main thread; In the background thread pool executor, a single-threaded unit execution environment that meets the COM interface requirements of the structural analysis software is created, and the structural analysis software is driven to serially execute COM call requests in the single-threaded unit execution environment; After the current COM call request is completed, the global asynchronous lock is released, and the execution result or exception information that does not meet the preset standard is asynchronously called back to the main thread through the inter-thread communication mechanism, so as to trigger the asynchronous resumption of the execution of the current COM call request and complete the response.
5. The semantic context preservation method in the AI-driven human-machine collaborative modeling system as described in claim 4, characterized in that, Maintain an asynchronous wait queue to queue COM call requests according to their arrival order, including: After the main thread receives a COM call request, it requests and acquires a global asynchronous lock through an asynchronous non-blocking mechanism; If the global asynchronous lock is currently occupied, without blocking the main thread's subsequent event processing, suspend the asynchronous coroutine corresponding to the current COM call request and register the asynchronous coroutine to an asynchronous waiting queue; When the previous COM call request being executed completes and releases the global asynchronous lock, a lock release signal is triggered; The lock release signal is captured by the asynchronous event loop, and the next suspended asynchronous coroutine in the asynchronous waiting queue is automatically woken up according to the first-in-first-out principle of the asynchronous waiting queue. The global asynchronous lock is reacquired by the awakened asynchronous coroutine, and upon successful acquisition, the corresponding COM call request is dispatched to a background thread pool executor independent of the main thread.
6. The semantic context preservation method in an AI-driven human-machine collaborative modeling system as described in any one of claims 1-5, characterized in that, In response to the state synchronization signal, the system acquires the latest object list after the structural analysis software executes an API request or performs a manual operation, and updates the state domain entirely based on the latest object list. It also selectively retains existing semantic mapping relationships in the semantic domain to ensure that the semantic mapping relationships pointing to the latest object list remain unchanged, including: In response to the state synchronization signal, an object query command is sent to the COM interface of the structural analysis software; The system receives raw data returned by the structural analysis software based on object query commands via the COM interface, extracts all object identifiers from the returned raw data, and generates the latest object list containing node, element, and material model information. Write all object identifiers from the latest object list into the state domain and remove historical object identifiers from the state domain that no longer exist in the latest object list, so as to achieve real-time synchronization between the state domain and the structural analysis software. Traverse the existing semantic mapping relationships in the semantic domain, determine whether the object identifier pointed to by each set of semantic mapping relationships exists in the state domain after full update. If it exists, keep the mapping relationship between semantic name and object identifier from being overwritten or reset, and record it in a semantic mapping object list; if it does not exist, mark the corresponding semantic mapping relationship as invalid or remove the corresponding semantic mapping relationship from the semantic domain. Calculate the total number of updated state domain objects and the number of semantic domain semantic mappings, and combine them with the list of semantic mapping objects to provide the synchronization result to the user. The state synchronization signals include: event signals actively pushed by the API event interface of the structural analysis software when the execution environment changes; and / or, self-synchronization instructions automatically generated by the human-machine collaborative modeling system after executing the API request; and / or, explicit synchronization requests input by the user through natural language.
7. The semantic context preservation method in the AI-driven human-machine collaborative modeling system as described in claim 2, characterized in that, Also includes: The semantic domain stores the mapping relationship between semantic names and object identifiers in the form of key-value pairs. In the semantic domain, one object identifier corresponds to one or more semantic names. The object identifiers currently existing in the state domain storage structure analysis software are in the form of a set of identifiers. The currently existing object identifiers include object identifiers created through API requests and object identifiers created through manual operations. When executing the API request to create an operation object, the object identifier returned by the structural analysis software is obtained and added to the state domain. If a user-defined semantic name or an assigned default semantic name exists, the user-defined semantic name or the assigned default semantic name and the obtained object identifier are added to the semantic domain to establish a mapping relationship.
8. An AI-driven human-machine collaborative modeling system, characterized in that, include: The user interaction layer, AI assistant layer, MCP server layer, and structural analysis software layer are connected sequentially. The AI assistant layer includes a natural language parsing module, which parses the input natural language commands into tool call requests in the Model Context Protocol format; The MCP server layer includes: The semantic context management module is used to establish and maintain a context storage space containing mutually independent semantic domains and state domains, so as to store semantic mapping relationships and object identifiers of the structural analysis software respectively; The object reference resolution module is used to perform semantic-first multi-level resolution of object references in tool call requests. It uses the semantic domain to retrieve object identifiers that match the object references, and then uses the state domain to verify the matched object identifiers or object references that do not match, and obtains the verified object identifiers. The request conversion module is used to convert tool call requests into API requests for structural analysis software based on the verified object identifier; The asynchronous serial execution module is used to intercept and queue API requests using a global asynchronous lock, and drive the structural analysis software to serially execute API requests in an asynchronous execution environment; The state synchronization module is used to respond to the state synchronization signal, obtain the latest object list of the structural analysis software after executing API requests or manual operations, update the state domain based on the latest object list, and selectively retain the existing semantic mapping relationships in the semantic domain so that the semantic mapping relationships pointing to the latest object list remain unchanged.
9. A device, characterized in that, include: At least one controller; and a memory that is communicatively connected to at least one controller; The memory stores instructions that can be executed by at least one controller, which are executed by at least one controller to enable the at least one controller to perform the semantic context preservation method in the AI-driven human-machine collaborative modeling system as described in any one of claims 1-7.
10. A computer-readable storage medium storing computer-executable instructions thereon, characterized in that, When the executable instructions are executed by the controller, they implement the semantic context preservation method in the AI-driven human-machine collaborative modeling system as described in any one of claims 1-7.