A Visual Editing System and Method Based on VSCode Plugin

CN122569910APending Publication Date: 2026-08-14ISOFT INFRASTRUCTURE SOFTWARE
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-08
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

用户的编辑操作往往直接或频繁地作用于底层文件,一旦工具崩溃或出现操作失误,极易导致数据丢失或文件损坏,缺乏有效的操作回滚和错误隔离能力

Benefits of technology

1、以VSCode插件形式实现,无需依赖特定Eclipse版本及ARXML XSD文件,即装即用,大幅简化了开发环境的配置流程,消除了对特定工具版本的强制性依赖。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122569910A_ABST
    Figure CN122569910A_ABST
Patent Text Reader

Abstract

This invention provides a visual editing system and method based on a VSCode plugin, relating to the field of automotive electronic system development technology. It includes: an interface editing layer integrated into the VSCode plugin to provide a graphical user interface; a database caching layer that caches operation data in real-time using an in-memory database and implements transaction management and validity verification; a file storage layer that persistently stores data in JSON format and defines a JSON schema corresponding to ARXML semantics; a format conversion module that implements bidirectional mapping between ARXML and JSON; and a data synchronization module responsible for data consistency across all layers. The advantages include: implementation as a VSCode plugin, allowing for immediate use and simplified environment configuration; improved editing response speed through in-memory database caching; data security through transaction management and asynchronous writing; and seamless integration with traditional AUTOSAR toolchains via JSON schema mapping.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automotive electronic system development technology, and in particular to a visual editing system and method based on the VSCode plugin. Background Technology

[0002] AUTOSAR (AUTomotive Open System Architecture) plays a crucial role in the automotive electronics software development industry as the core standardized architecture. Within the AUTOSAR methodology, ARXML (AUTOSAR XML) files serve as the standard carrier for describing model information such as software components, ECU (Electronic Control Unit) configurations, and system constraints. They are the core of data exchange and design deliverables during the development process.

[0003] Currently, mainstream ARXML editing tools are typically built on the Eclipse Rich Client Platform (RCP). While these tools are powerful, they face multiple technical challenges in practical development, directly impacting development efficiency and data security. Complex environment configuration and strong version dependency: Eclipse-based toolchains typically require specific IDE versions and corresponding ARXML XML Schema Definition (XSD) files, resulting in a complex development environment configuration process and strict requirements for tool version upgrades and compatibility management.

[0004] Performance bottlenecks and poor user experience: Traditional ARXML editing tools generally suffer from slow startup and high memory consumption. Some commercial software takes more than 20 seconds to start and consumes more than 2GB of memory, seriously affecting the continuity of the development process. At the same time, directly manipulating large XML files also leads to high data access latency and insufficient concurrency control capabilities.

[0005] High data security risks: Existing tools generally lack layered data caching and transaction management mechanisms. User editing operations often directly or frequently affect the underlying files. Once the tool crashes or operational errors occur, data loss or file corruption can easily occur, and there is a lack of effective operation rollback and error isolation capabilities.

[0006] Therefore, there is an urgent need for a lightweight, efficient, and data-secure AUTOSAR model editing solution to lower the development threshold and improve development efficiency and user experience. Summary of the Invention

[0007] To address the problems existing in the prior art, this invention provides an AUTOSAR model visualization and editing system based on the VSCode plugin, comprising: The interface editing layer, integrated into the VSCode plugin, provides a graphical user interface to support users in adding, deleting, modifying, and querying AUTOSAR model elements. A database caching layer, built on an in-memory database, is used to cache the operation data of the interface editing layer in real time and to implement data transaction management and legality verification. The file storage layer uses JSON as the persistent storage format and defines a JSON schema corresponding to AUTOSAR ARXML semantics. The format conversion module is used to implement bidirectional mapping and conversion between ARXML files and JSON files; The data synchronization module is responsible for synchronizing data consistency between the interface editing layer, the database cache layer, and the file storage layer.

[0008] Preferably, the interface editing layer is built based on the VSCode Webview API, and uses a front-end framework to implement a tree structure view and a form editor, which are used to display the AUTOSAR model hierarchy and edit element attributes.

[0009] Preferably, the database caching layer uses SQLite as an in-memory database, maps the data table structure to a JSON schema, and supports the ACID properties of transactions.

[0010] Preferably, the format conversion module includes: The first transformation submodule is used to parse the ARXML file structure using an XML parsing library, locate elements using XPath, and convert them into a JSON structure that conforms to the JSON schema according to preset mapping rules; The second transformation submodule is used to read the content of the JSON file through the template engine, populate it into the ARXML skeleton, generate an ARXML file that conforms to the AUTOSAR standard, and perform XML format validity verification.

[0011] Preferably, when the interface triggers a change, the data synchronization module first updates the database cache and performs a validity check. After the verification is successful, the data is written to a JSON file asynchronously.

[0012] This invention also provides an AUTOSAR model visualization and editing system based on a VSCode plugin, which applies the visualization and editing method described above and includes the following steps: Step S1: Launch the VSCode plugin, load the JSON schema and format conversion rules, and initialize the database cache; Step S2: When a user operates on a model element through the interface editing layer, the operation is synchronized to the database cache in real time, and then the legality is verified and the operation is rolled back. Step S3: The valid data in the database cache is asynchronously written to a JSON file for persistent storage through the data synchronization module; Step S4: Convert the selected ARXML file into a JSON file through format conversion, and load it synchronously into the database cache and the interface editing layer; Step S5: Read the JSON file data and generate an ARXM format file that conforms to the AUTOSAR standard through format conversion.

[0013] Preferably, the validity check in step S2 includes attribute constraint check and association integrity check.

[0014] Preferably, step S3 includes: Step S31: In response to the operation of the interface editing layer, an operation instruction is generated, which includes an element addition instruction or an attribute update instruction. Step S32: The database cache layer executes the operation instruction and returns the execution result; Step S33: Update the display content of the interface editing layer synchronously according to the execution result; Step S34: Serialize the data in the database cache periodically or triggered by a specific time, and asynchronously write it to the JSON file to achieve persistent storage.

[0015] The above technical solution has the following advantages or beneficial effects: 1. Implemented as a VSCode plugin, it does not depend on a specific Eclipse version or ARXML XSD file, and can be used immediately after installation, greatly simplifying the configuration process of the development environment and eliminating the mandatory dependency on specific tool versions.

[0016] 2. Adopting a layered architecture, the interface is only responsible for interaction, while core data operations are completed in the in-memory database cache layer. This avoids the slow startup and high memory consumption problems caused by loading complex XML files in traditional tools, and significantly improves the editing response speed.

[0017] 3. Data transaction management and validity verification are implemented through a database caching layer, supporting operation rollback and asynchronous writing to JSON files. This three-tier architecture effectively isolates the risks of direct file manipulation, protecting data integrity even in the event of a tool crash through transaction mechanisms.

[0018] 4. By mapping ARXML semantics to JSON schema and using the format conversion module, a two-way lossless conversion between ARXML and JSON is achieved, which maintains the lightweight and efficient internal processing and ensures seamless integration with the traditional AUTOSAR toolchain. Attached Figure Description

[0019] Figure 1 A schematic diagram of the structure of a visual editing system based on the VSCode plugin, as a preferred embodiment of the present invention; Figure 2 A flowchart illustrating a visual editing method based on a VSCode plugin, as a preferred embodiment of the present invention; Figure 3 This is a schematic diagram of the sub-process of step S3 in a preferred embodiment of the present invention. Detailed Implementation

[0020] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. The present invention is not limited to this embodiment; other embodiments that conform to the spirit of the present invention may also fall within the scope of the present invention.

[0021] Example 1: This embodiment provides a visual editing system based on a VSCode plugin. For example... Figure 1 As shown, this system is a complete solution built on the VSCode plugin framework. Its core lies in achieving efficient and secure editing of the AUTOSAR model (AUTOSAR stands for Automotive Open System Architecture) through a layered architecture. For example... Figure 1 As shown, the system specifically includes the following modules: The interface editing layer 100, integrated into the VSCode plugin, serves as the front end for system-user interaction. It utilizes the WebView API provided by VSCode to build a graphical user interface, presenting users with a tree-structured view of the AUTOSAR model and a form editor. Users can add, delete, modify, and query AUTOSAR model elements (such as ECUs, signals, interfaces, and software components) through intuitive operations such as clicking, dragging, and inputting. All operation requests in this layer are encapsulated as instructions and sent to the lower layers for processing.

[0022] The database caching layer 200, built on an in-memory database (such as SQLite), is the system's data hub. When the user interface editing layer generates operation commands, the data is first cached here in real time. This layer is responsible for implementing data transaction management, supporting operation commit and rollback, and ensuring the atomicity, consistency, isolation, and durability (ACID properties) of data operations. Simultaneously, this layer incorporates built-in data validity verification logic, including attribute constraint verification (such as field type and value range) and association integrity verification (such as whether the reference relationships between elements are valid), intercepting errors before data persistence and ensuring the correctness of the model data.

[0023] File storage layer 300 is responsible for data persistence. It uses JSON (JavaScript Object Notation) format as the final file format for disk storage. To ensure that JSON data can losslessly express the complex semantics of the AUTOSAR model, the system predefines a JSON schema that strictly corresponds to the semantics of AUTOSAR ARXML. This schema defines the mapping rules for element types, attributes, and relationships, essentially rewriting the ARXML (ARXML stands for AUTOSAR XML, a file format based on XML defined according to the AUTOSAR standard) data structure using the JSON language.

[0024] Format conversion module 400 is crucial for interoperability between the system and the traditional AUTOSAR toolchain. It contains two core submodules responsible for bidirectional mapping and conversion between ARXML and JSON formats. Specifically: The first transformation submodule, 410 (ARXML to JSON), is responsible for parsing the XML structure of ARXML files. It uses XML parsing libraries (such as Node.js's xmldom) to traverse the XML document tree and locates core elements (such as...) using XPath. <ar-package> 、 <ecu-instance>), and then according to the preset mapping rules (for example, to <short-name>The tag content is mapped to the shortName field in the JSON object, converting XML tags, attributes, and nesting relationships into a JSON structure that conforms to the JSON schema.

[0025] The second transformation submodule 420 (JSON to ARXML): is responsible for reversing the JSON file into a standard ARXML file. It uses a template engine (such as Handlebars) to read a pre-made ARXML skeleton template, then fills the corresponding positions in the template with JSON data, and finally generates an ARXML file that conforms to the AUTOSAR XML Schema standard. It can also perform XML format validity checks on the generated file to ensure that it can be recognized and used by other AUTOSAR tools.

[0026] The data synchronization module 500 acts as a bridge connecting the user interface, cache, and file layers, responsible for maintaining data consistency across the entire system. When a user triggers a data change at the user interface layer, this module prioritizes sending the operation command to the database cache layer for execution, where it performs validity checks. Upon successful validation, the user interface layer immediately updates its display based on the cache layer's response, providing instant feedback to the user. Subsequently, this module asynchronously serializes the valid data from the cache layer and writes it to a JSON file for persistent storage. This mechanism of prioritizing cache updates and asynchronously writing to files effectively improves the response speed of user interface operations and reduces performance overhead and data risks associated with frequent I / O operations.

[0027] In summary, this embodiment constructs a complete and collaborative technical solution through the organic combination of the interface editing layer 100, the database caching layer 200, the file storage layer 300, the format conversion module 400, and the data synchronization module 500. Compared with the prior art, this embodiment has at least the following beneficial effects: Lowering the editing threshold: The interface editing layer 100 provides a graphical interactive interface based on VSCode Webview. Developers do not need to directly deal with complex ARXML tags and XML syntax. They can complete the addition, deletion, modification and query of AUTOSAR models through intuitive tree views and forms, which significantly reduces the dependence on AUTOSAR expertise and XML editing skills.

[0028] Enhanced data security: The database caching layer 200 is implemented based on an in-memory database (such as SQLite), supports the ACID properties of transactions, can perform real-time validity checks during operation and support rollback, effectively isolates the direct interaction between the interface operation and the underlying files, and avoids data loss or file corruption caused by misoperation or tool crash.

[0029] Enhancing tool compatibility and data reusability: The file storage layer 300 uses JSON format as the persistence carrier, and through a JSON schema that strictly corresponds to ARXML semantics, the model data retains complete AUTOSAR semantics while possessing lightweight characteristics that allow for cross-platform, cross-language, and cross-toolchain compatibility. The format conversion module implements bidirectional lossless conversion between ARXML and JSON, ensuring seamless integration with traditional AUTOSAR toolchains.

[0030] Achieving lightweight design and high scalability: The entire system exists as a VSCode plugin, eliminating the need for a heavy IDE, resulting in rapid startup and low memory consumption. Furthermore, its loosely coupled design based on JSON schema and modular architecture facilitates future support for more AUTOSAR element types, custom validation rules, and functional extensions.

[0031] Example 2: This embodiment is a further improvement upon Embodiment 1. As a further optimization of Embodiment 1, the interface editing layer is specifically built based on the VSCode WebView API. The development team chose React, a mainstream front-end framework, to implement a highly interactive user interface. The interface is mainly divided into two parts: the left side is a tree structure view, used to clearly display the hierarchical structure of the AUTOSAR model (such as Packages, Components, Ports, etc.); the right side is a dynamically generated form editor. When the user selects an element in the tree on the left, the form on the right will display all the editable attributes of that element (such as shortName, type, reference path, etc.) for the user to modify. This design makes the structure and attributes of the model clear at a glance, and the editing operation is very intuitive.

[0032] Meanwhile, the database caching layer 200 specifically uses SQLite as its in-memory database. To achieve accurate mapping to the JSON schema, the system has designed a dedicated data table structure within SQLite. For example: Create a main table named Elements to store the unique ID (UUID) of each model element, the element type (such as Executable, AdaptiveSoftwareComponent), and a JSON field that stores all the attributes of that element.

[0033] Create a table named Relations to store the relationships between elements, including fields such as source element ID, target element ID, and relationship type.

[0034] This relational database table structure design efficiently supports querying, transaction management, and integrity verification of complex model data. The SQLite in-memory database's operating mode fully leverages its ACID properties, providing reliable transaction guarantees for every model editing operation.

[0035] Example 3: This embodiment is a further improvement on Embodiment 1, and describes in detail the specific process of data conversion and synchronization. The internal implementation details of the format conversion module are as follows: First conversion submodule 410 (ARXML to JSON): Upon receiving an ARXML file, this module initiates a parsing process. First, it uses the xmldom library to load the ARXML file into an in-memory DOM (Document Object Model) tree. Then, it locates all element nodes requiring transformation using predefined XPath expressions (such as / / AR-PACKAGES / AR-PACKAGE). Next, it traverses these nodes, constructing JSON objects according to mapping rules (e.g., mapping element tag names to the JSON's `type` field, and mapping the text content of child elements' `SHORT-NAME` to the `shortName` field). For complex nested structures and cross-file references, the module converts them into nested objects or path-based reference strings in JSON, ultimately generating a well-structured JSON document conforming to the JSON schema.

[0036] The second conversion submodule, 420 (JSON to ARXML), handles the reverse conversion. It first reads the JSON file and then passes it to a Handlebars template engine. This engine uses a pre-written ARXML template file, which defines a fixed structure and placeholders for ARXML (such as {{#each package}}). The engine parses the JSON data and fills the corresponding placeholders in the template, dynamically generating the complete ARXML text. Finally, this module calls an XML validator to check the format and syntax of the generated text, ensuring it conforms to the AUTOSAR standard.

[0037] The data synchronization module implements a refined synchronization process, which works in conjunction with the aforementioned conversion module: When a user performs an operation in the interface editing layer (such as adding an element or updating an attribute), the interface layer generates an operation instruction that encapsulates the operation type and data.

[0038] The instruction is sent to the data synchronization module, which immediately submits it to the database caching layer for execution.

[0039] While executing instructions, the database caching layer 200 performs data validity checks (such as checking whether required attributes are filled and whether referenced elements exist). Successful or unsuccessful execution results are returned to the UI layer in real time via the data synchronization module.

[0040] The UI layer updates the displayed content in real time based on the returned results (such as highlighting newly added elements or popping up error messages), thereby achieving a smooth interactive experience.

[0041] In the background, the data synchronization module starts an asynchronous task. This task periodically (e.g., every 5 seconds) or when a specific event is triggered (such as when a user saves or switches files), serializes all or incremental data in the database cache and writes it to a JSON file, thus completing the persistent storage of the data.

[0042] Example 4: This embodiment provides a visual editing method based on a VSCode plugin, which applies the system described in any of the foregoing embodiments. For example... Figure 2 As shown, the method specifically includes the following steps: Step S1, Initialization: The user launches VSCode and activates the plugin of this invention. After the plugin is activated, the initialization operation is performed immediately: the predefined JSON schema file and the format conversion rules between ARXML and JSON are loaded, and an in-memory database instance based on SQLite is created and initialized to prepare for subsequent data operations.

[0043] Step S2, Model Editing and Caching: Users edit the AUTOSAR model through the tree view and forms in the interface editing layer. Every operation (such as changing the name of a component) is captured in real time and synchronized to the database caching layer. The caching layer executes the operation while performing validity checks, including checking whether attribute values ​​meet constraints (such as shortName cannot be empty, whether the format is correct) and whether the reference relationships between elements are complete. If the validation fails, the caching layer rejects the operation and allows rollback, while simultaneously prompting the user through the interface layer.

[0044] Step S3, Data Persistence: During or after user editing, the data synchronization module starts. It asynchronously serializes valid data that has passed validity checks in the database cache into JSON format and writes it to a specified JSON file, thus achieving persistent data storage.

[0045] Step S4, Model Import: When a user needs to edit an existing ARXML file, they can select the file and trigger the import operation. The system's format conversion module then starts, calling its ARXML to JSON submodule to parse and convert the selected ARXML file into a JSON file conforming to the JSON schema. After the conversion is complete, the data in the JSON file is synchronously loaded into the database cache layer and rendered into a visual tree structure for the user through the interface editing layer.

[0046] Step S5, Model Export: When the user finishes editing and needs to share the model with colleagues using traditional AUTOSAR tools, the export operation can be triggered. The system's format conversion module will call its JSON to ARXML submodule to read the JSON file corresponding to the current project and reverse it to generate an ARXML format file that conforms to the AUTOSAR standard, thereby achieving seamless integration with traditional toolchains.

[0047] Example 5: This embodiment describes the key steps in the method of Embodiment 4.

[0048] As a refinement of Example 4, the legality verification in step S2 is a multi-layered process. It not only includes the verification of individual element attributes, such as checking data type, value range, string length and other attribute constraints, but also focuses on the verification of association integrity. For example, when a Port element is created and references a Service interface, the system will verify whether the referenced Service interface actually exists in a certain Package of the model, thereby ensuring the overall logical correctness of the model.

[0049] As a further refinement of Embodiment 4, the data persistence process in step S3 can be decomposed into the following sub-steps, such as... Figure 3 As shown: Step S31: In response to the user's operation in the interface editing layer, the system generates a specific operation instruction, such as an element addition instruction, which includes the element type and initial attributes to be added.

[0050] In step S32, the instruction is passed to the database cache layer. The database cache layer parses and executes the instruction, for example, inserting a new record into the Elements table. After execution, the cache layer returns an execution result, indicating whether the operation was successful or failed; if it failed, it will also include an error message.

[0051] In step S33, the interface editing layer updates its display content synchronously based on the received execution result. If the operation is successful, the newly added element will immediately appear in the tree view; if it fails, an error message will be displayed to the user.

[0052] In step S34, the data synchronization module continuously monitors changes in the database in the background. It uses a timer (e.g., every 2 seconds) or an event-triggered method to serialize the data that has changed since the last synchronization in the database cache and write it to a JSON file through asynchronous I / O operations, thereby ensuring reliable data persistence while maintaining a smooth interface.

[0053] The above are merely preferred embodiments of the present invention and are not intended to limit the implementation methods and protection scope of the present invention. Those skilled in the art should recognize that any equivalent substitutions and obvious changes made using the content of this specification and illustrations should be included within the protection scope of the present invention. < / ar-package>

Claims

1. A visual editing system based on a VSCode plugin, characterized in that, include: The interface editing layer, integrated into the VSCode plugin, provides a graphical user interface to support users in adding, deleting, modifying, and querying AUTOSAR model elements. A database caching layer, built on an in-memory database, is used to cache the operation data of the interface editing layer in real time and to implement data transaction management and legality verification. The file storage layer uses JSON as the persistent storage format and defines a JSON schema corresponding to AUTOSAR ARXML semantics. The format conversion module is used to implement bidirectional mapping and conversion between ARXML files and JSON files; The data synchronization module is responsible for synchronizing data consistency between the interface editing layer, the database cache layer, and the file storage layer.

2. The visual editing system according to claim 1, characterized in that, The interface editing layer is built on the VSCode Webview API and uses a front-end framework to implement a tree structure view and a form editor, which are used to display the AUTOSAR model hierarchy and edit element attributes.

3. The visual editing system according to claim 1, characterized in that, The database caching layer uses SQLite as an in-memory database, maps the data table structure to a JSON schema, and supports the ACID properties of transactions.

4. The visual editing system according to claim 1, characterized in that, The format conversion module includes: The first transformation submodule is used to parse the ARXML file structure using an XML parsing library, locate elements using XPath, and convert them into a JSON structure that conforms to the JSON schema according to preset mapping rules; The second transformation submodule is used to read the content of the JSON file through the template engine, populate it into the ARXML skeleton, generate an ARXML file that conforms to the AUTOSAR standard, and perform XML format validity verification.

5. The visual editing system according to claim 1, characterized in that, When a change is triggered on the interface, the data synchronization module first updates the database cache and performs a validity check. After the verification is successful, the data is written to a JSON file asynchronously.

6. A visual editing system based on a VSCode plugin, characterized in that, The visual editing method described in any one of claims 1-5 includes the following steps: Step S1: Launch the VSCode plugin, load the JSON schema and format conversion rules, and initialize the database cache; Step S2: When a user operates on a model element through the interface editing layer, the operation is synchronized to the database cache in real time, and then the legality is verified and the operation is rolled back. Step S3: The valid data in the database cache is asynchronously written to a JSON file for persistent storage through the data synchronization module; Step S4: Convert the selected ARXML file into a JSON file through format conversion, and load it synchronously into the database cache and the interface editing layer; Step S5: Read the JSON file data and generate an ARXM format file that conforms to the AUTOSAR standard through format conversion.

7. The visual editing system according to claim 6, characterized in that, The validity check in step S2 includes attribute constraint check and association integrity check.

8. The visual editing system according to claim 6, characterized in that, Step S3 includes: Step S31: In response to the operation of the interface editing layer, an operation instruction is generated, which includes an element addition instruction or an attribute update instruction. Step S32: The database cache layer executes the operation instruction and returns the execution result; Step S33: Update the display content of the interface editing layer synchronously according to the execution result; Step S34: Serialize the data in the database cache periodically or triggered by a specific time, and asynchronously write it to the JSON file to achieve persistent storage.