Upper computer integration method and system based on Vs Code code editing
By integrating the Vs Code code editor in the host computer, using .NET and JavaScript interoperability and dynamic library technology, the existing host computers have solved the problem of unfriendly interfaces of C applets and Python applets, and achieved seamless integration between the host computer and Vs Code and improved code development efficiency.
Patent Information
- Application Number
- CN202510417816.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-11
AI Technical Summary
The existing code editor interfaces for writing C applets and Python applets for upper computers are not beautiful enough, have poor user experience, and are not powerful enough. They do not support code debugging and integration with large-model AI tools, resulting in low code development efficiency.
Interoperate with JavaScript in the same process through .NET and JavaScript, Vs Code is run into the upper computer software, and the first and second plug-ins are used to edit, compile and debug the first and second codes respectively, so as to realize the interaction with the upper and lower computers through dynamic libraries.
It realizes seamless integration between upper computers and Vs Code, improves code development efficiency, supports code debugging and integration with AI tools, and improves user experience.
Smart Images

Figure CN120295611A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of host computers, and in particular to a host computer integration method and system based on Vs Code code editing. Background Art
[0002] In the automotive industry, the host computer is an important part of the automotive bus software tool chain. It is mainly used for testing, debugging, and monitoring the automotive bus to ensure the stability and reliability of the automotive bus system. The host computer has functions such as testing, debugging, monitoring, data analysis, and report generation, and can also write C small programs and Python small programs to control and monitor the automotive bus system.
[0003] Currently, when writing C small programs and Python small programs on the host computer, code editors provided by, such as CANoe, TSMaste, etc., are required. However, these editors have the following problems:
[0004] 1. A self-developed code editor is integrated in the host computer software.
[0005] 2. The interface is not beautiful enough, the user experience is poor, and the functions are not powerful enough.
[0006] 3. Code debug is not supported.
[0007] 4. It cannot be integrated with popular large model AI tools to improve code development efficiency.
[0008] Therefore, there is an urgent need to provide a solution for the host computer integration method based on Vs Code code editing. Summary of the Invention
[0009] In order to solve the above problems, the technical solution of the present invention provides a host computer integration method and system based on Vs Code code editing, which can improve code development efficiency and facilitate the interaction between the host computer and the lower computer.
[0010] According to the first aspect embodiment of the technical solution of the present invention, a host computer integration method based on Vs Code code editing is provided, including:
[0011] S1. Run Vs Code into the host computer software through the interoperability of.NET and JavaScript in the same process, and form a unified application program with the host computer software.
[0012] S2. Use Vs Code to load the first plugin and the second plugin to edit the first code and the second code respectively.
[0013] S3. Compile and debug the first code and the second code respectively using the first plug-in and the second plug-in;
[0014] S4. Enable the first code or the second code to interact with the upper computer software's interface and the lower computer software through a dynamic library.
[0015] In the above solution, in step S1, directly use the Node.js API in the.NET application and write Vs Code using Node.js.
[0016] In the above solution, in step S2, optimize the first code through the first plug-in and optimize the second code through the second plug-in.
[0017] In the above solution, in step S3, compile the first code through the gcc tool, debug the first code through the gdb tool, compile the second code through the python tool, and debug the second code through the python debug tool.
[0018] In the above solution, in step S4, the dynamic library is the cornerstone module.
[0019] In the above solution, the cornerstone module provides a multi-point upper computer process interaction interface for the first code or the second code through inter-process communication.
[0020] In the above solution, the cornerstone module interacts with the lower computer through the serial port driver.
[0021] In the above solution, the optimization in step S2 includes editing the first code and the second code using the code editing function or extension function of VS code.
[0022] According to the second aspect embodiment of the technical solution of the present invention, a host computer integration system based on Vs Code code editing is provided. The system is used to implement the host computer integration method based on Vs Code code editing in the above solution. The system includes:
[0023] An application module, used to run Vs Code into the host computer software through the interoperability of.NET and JavaScript in the same process and form a unified application program with the host computer software;
[0024] An editing module, used to load the first plug-in and the second plug-in using Vs Code and edit the first code and the second code respectively;
[0025] A compilation and debugging module, used to compile and debug the first code and the second code respectively using the first plug-in and the second plug-in;
[0026] An interaction module for enabling the first code or the second code to interact with the interaction interface of the host computer software and the lower computer software through a dynamic library.
[0027] According to an embodiment of the third aspect of the technical solution of the present invention, an electronic device is provided, and the electronic device includes:
[0028] A memory storing executable instructions;
[0029] A processor that runs the executable instructions in the memory to implement the method described in any one of the above solutions.
[0030] Advantages of the present invention:
[0031] An upper computer integration method and system based on Vs Code code editing disclosed by the present invention can directly interact the code with the upper computer and the lower computer through code editing, compilation and debugging using the VsCode code editor, realizing seamless integration of the upper computer with Vs Code and being able to integrate other AI tools, thereby improving the code development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on the structures shown in these drawings without creative efforts.
[0033] Figure 1 It is a flowchart of the upper computer integration method based on Vs Code code editing provided by the present invention.
[0034] The realization of the object of the present invention, functional features and advantages will be further described in conjunction with the embodiments with reference to the drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0035] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0036] The terms "first", "second", etc. in the description and claims of the present disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way may be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order different from those illustrated or described herein, for example.
[0037] In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0038] "Plurality" includes two or more.
[0039] For the term "and / or" used in the present disclosure, it should be understood that it is merely a relationship describing associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0040] The VS Code (Visual Studio Code) used in the present invention is a free, open-source and cross-platform code editor developed by Microsoft, supporting Windows, macOS and Linux systems. Compared with traditional IDEs (such as Visual Studio), VS Code starts faster, occupies fewer resources, but is powerful. Through extension plugins, it can meet diverse development needs. It has a rich extension library (such as Python, Java, ESLint, themes, etc.), and users can customize the development environment. It has a built-in command-line terminal, and commands can be executed without switching windows, improving the coherence of the workflow. It natively supports JavaScript / TypeScript, HTML / CSS, and through plugin extensions, it can develop almost all mainstream languages such as Python, Java, C++.
[0041] As Figure 1 shown, an embodiment of the technical solution of the present invention provides a host computer integration method based on Vs Code code editing, including:
[0042] S1. Run Vs Code into the host computer software through the interoperability between.NET and JavaScript in the same process, and form a unified application program with the host computer software;
[0043] Specifically, Vs Code is written in JavaScript and runs on a code editor written in Node.js code. The host computer uses the.NET and JavaScript interoperability technology in the same process to start Vs Code written in Node.js and run Vs Code on the host computer, forming a whole with the host computer, achieving seamless integration of Vs Code in the host computer.
[0044] Furthermore, in this embodiment, the Node.js API is directly used in the.NET application, and Vs Code is written using Node.js.
[0045] In this embodiment, the.NET and JavaScript interoperability is implemented using the node-api-dotnet technology. Through its built-in strongly typed marshaling mechanism, it supports the structured transfer of complex objects between dual runtime environments: allowing JavaScript to natively call.NET APIs and handle interface implementations, while also supporting.NET to call back JavaScript functions in reverse; through an automated type adaptation and exception conversion layer, it realizes efficient two-way interaction including delegate callbacks and shared memory operations, providing an encoding experience similar to native development for cross-language calls while maintaining type safety.
[0046] S2. Use Vs Code to load the first plugin and the second plugin to edit the first code and the second code respectively;
[0047] Specifically, optimize the first code through the first plugin and optimize the second code through the second plugin. Among them, the first plugin is the C plugin and the second plugin is the Python plugin, the first code is C code, and the second code is Python code.
[0048] The optimization includes using the code editing function of VS code to edit the first code and the second code, or using the extension function of Vs Code itself to integrate other tools for editing.
[0049] S3. Use the first plugin and the second plugin to compile and debug the first code and the second code respectively;
[0050] Specifically, compile the first code through the gcc tool, debug the first code through the gdb tool, compile the second code through the python tool, and debug the second code through the python debug tool.
[0051] Among them, compilation is to convert the first code and the second code into machine code, and debugging is to set breakpoints, execute step by step, view variable values, etc. for the program through the gdb tool.
[0052] S4. Through the dynamic library, the interaction interfaces of the first code or the second code with the host computer software and the lower computer software are enabled.
[0053] Among them, the dynamic library is the cornerstone module. The cornerstone module provides a multi-point host computer process interaction interface for the first code or the second code through inter-process communication. The dynamic library contains a series of functions, data, and methods that can be called by other programs at runtime. When a program needs to use the functions in the dynamic library, it will load the dynamic library and call the corresponding functions. The host computer, the first code, and the second code use this dynamic library technology to call the functions or methods in the cornerstone module and communicate with each other using the methods provided in the functions. The dynamic library is a collection of code and data that can be shared by multiple programs and is loaded and linked to the calling program at runtime. Cross-language calling of the dynamic library means that programs written in different programming languages can call the functions or methods in the same dynamic library, thus enabling the reuse and integration of the cornerstone module in multiple languages (including C / C++, Python, etc.).
[0054] Furthermore, the cornerstone module interacts with the lower computer through the serial port driver. Among them, the serial port refers to a device that realizes serial communication functions through the USB interface.
[0055] When Vs Code is applied in the host computer, through intelligent prompts and large model assistance, code writing can be quickly completed, reducing the time for manual input and searching for information. Through code formatting and review tools, it is ensured that the code style is consistent, there are no syntax errors and potential problems. Using the debugging function of VS Code, errors can be quickly located and fixed, improving development efficiency. Large model-assisted programming can provide innovative solutions and code suggestions, inspiring the creativity of developers.
[0056] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or device including that element.
[0057] The serial numbers of the above embodiments of the present invention are only for description and do not represent the superiority or inferiority of the embodiments.
[0058] Through the description of the above embodiments, those skilled in the art can clearly understand that the above implementation methods can be realized by means of software plus a necessary general hardware platform. Of course, they can also be realized by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to enable a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0059] The embodiments of the present invention have been described above in conjunction with the accompanying drawings. However, the present invention is not limited to the above specific implementation manners. The above specific implementation manners are merely illustrative rather than restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the purpose of the present invention and the scope protected by the claims. All of these fall within the protection scope of the present invention.
Claims
1. An upper computer integration method based on Vs Code code editing, characterized in that Including: S1. Run Vs Code into the host computer software through.NET and JavaScript interoperating in the same process, and form a unified application program with the host computer software; S2. Use Vs Code to load the first plugin and the second plugin, and edit the first code and the second code respectively; S3. Use the first plugin and the second plugin to compile and debug the first code and the second code respectively; S4. Through the dynamic library, enable the first code or the second code to interact with the interaction interface of the host computer software and the lower computer software.
2. The upper computer integration method based on Vs Code code editing according to claim 1, characterized in that In step S1, directly use the Node.js API in the.NET application, and use Node.js to write Vs Code.
3. The host computer integration method based on Vs Code code editing according to claim 1, characterized in that In step S2, optimize the first code through the first plugin, and optimize the second code through the second plugin.
4. The host computer integration method based on Vs Code code editing according to claim 1, characterized in that In step S3, compile the first code through the gcc tool, debug the first code through the gdb tool, compile the second code through the python tool, and debug the second code through the python debug tool.
5. The upper computer integration method based on Vs Code code editing according to claim 1, wherein In step S4, the dynamic library is the cornerstone module.
6. The host computer integration method based on Vs Code code editing according to claim 5, wherein The cornerstone module provides a multi-point host computer process interaction interface for the first code or the second code through inter-process communication.
7. The host computer integration method based on Vs Code code editing according to claim 5, characterized in that The cornerstone module interacts with the lower computer through the serial port driver.
8. The upper computer integration method based on Vs Code code editing according to claim 3, characterized in that The optimization in step S2 includes using the code editing function or extension function of VS code to edit the first code and the second code.
9. An upper computer integration system based on Vs Code code editing, characterized in that, The system is used to implement the host computer integration method based on Vs Code code editing described in any one of claims 1-8. The system includes: An application module, configured to run Vs Code into the host computer software through.NET and JavaScript interoperating in the same process, and form a unified application program with the host computer software; An editing module, configured to use Vs Code to load the first plugin and the second plugin, and edit the first code and the second code respectively; A compilation and debugging module, configured to use the first plugin and the second plugin to compile and debug the first code and the second code respectively; An interaction module, configured to enable the first code or the second code to interact with the interaction interface of the host computer software and the lower computer software through the dynamic library.
10. An electronic device, characterized in that, The electronic device includes: A memory, storing executable instructions; A processor, where the processor runs the executable instructions in the memory to implement the method described in any one of claims 1-8.
Citation Information
Patent Citations
Intelligent universal development platform for embedded chip
CN113032002A
Embedded software development platform based on AI artificial intelligence
CN114003217A
Visual remote debugging method, environment building method, device and equipment
CN118012759A
Apparatus for developing a software program using an integrated development environment and software program development system using an integrated development environment
KR1020090004210A