An artificial intelligence plug-in based cloud program development system and method

By designing a cloud-based program development system based on artificial intelligence plugins, the problems of insufficient collaboration between local and cloud environments, lack of data security, and poor database visualization have been solved. This system enables seamless integration between efficient and secure programming assistant plugins and the cloud platform, improving development efficiency and the continuity of operational processes.

CN121349423BActive Publication Date: 2026-03-27SHANGHAI RUICHENG SOFTWARE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-18
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing AI-assisted programming tools suffer from problems such as insufficient collaboration between local and cloud environments, lack of data security, fragmented operation processes, and poor database visualization.

Method used

Design a cloud-based application development system based on artificial intelligence plugins, including a database module, storage module, cloud module, plugin module, and service module. This system enables seamless interaction between local and cloud environments, ensures data security through dual security measures of signature and token, and allows local plugins to directly view the results of database operations.

Benefits of technology

It achieves seamless integration between programming assistant plugins, services, cloud-based visual development platform pages, and local files/code, improving development efficiency, ensuring data security and operational continuity, and optimizing the visual experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121349423B_ABST
    Figure CN121349423B_ABST
Patent Text Reader

Abstract

The application provides a cloud program development system and method based on an artificial intelligence plug-in, and belongs to the technical field of software development and intelligent auxiliary programming. The system comprises: a database module comprising a database cluster; a storage module storing local files and codes; a cloud module providing development resources and a visual development platform page; a plug-in module integrating a programming assistant plug-in, generating codes, generating an access request containing a signature and identity authentication carrying a token, previewing and modifying cloud codes, and returning to the plug-in; and a service module performing read-write operations on local files and codes, linking and operating databases in the database cluster. The application has the beneficial effects of realizing seamless linkage of the programming assistant plug-in, the service, the cloud page, and the local files / codes, improving the development efficiency through plug-in operation on the local side and real-time previewing of the cloud side, ensuring the interaction safety through the double security measures of the signature and the token, and allowing the local plug-in to directly view the database operation results.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of software development and intelligent auxiliary programming, and particularly relates to a cloud program development system and method based on an artificial intelligence plug-in. BACKGROUND

[0002] With the acceleration of digital transformation, software development has become the core driving force for innovation in various industries. From traditional enterprise-level applications to emerging cloud computing, Internet of Things and artificial intelligence applications, the complexity and scale of software development continue to rise. Developers not only need to master multi-language, multi-framework development skills, but also need to cope with rapid iteration of demand changes and cross-team collaboration challenges. In this context, improving development efficiency and reducing technical barriers have become an urgent need in the industry.

[0003] In recent years, artificial intelligence (AI) assisted programming tools, such as VS Code, IDEA, and other programming assistant plug-ins, have realized functions such as code auto-completion, natural language to code, error detection, and significantly improved development efficiency. These tools are usually integrated into local development environments in the form of IDE plug-ins, providing real-time support for developers.

[0004] Currently, AI assisted programming tools generally lack local and cloud collaboration. There is a lack of efficient data interaction and functional closed loop between local plug-ins and cloud development platforms, backend services, and developers need to manually synchronize data and push code to the cloud through command operations, which is inefficient. Moreover, the local operation database visualization effect is not good. Users access the database through local plug-ins, but since they cannot directly view the database operation results in the local plug-in, users need to use third-party tools such as Navicat, DBeaver, and other database management tools to view and verify data access effects, or view and verify effects in the cloud database tool after local operation is completed, which is a fragmented operation process.

[0005] In addition, there is a lack of security in AI service access. The interaction between large models and local development environments lacks a perfect signature and authentication (Auth) mechanism, and there is a risk of data leakage and illegal access, which cannot guarantee the data security of large model interaction. SUMMARY

[0006] To solve the above technical problems, the present application provides a cloud program development system based on an artificial intelligence plug-in; on the other hand, a cloud program development method based on an artificial intelligence plug-in is also provided.

[0007] The technical problem solved by the application can be realized by the following technical scheme: a cloud program development system based on an artificial intelligence plug-in, comprising: a database module comprising a database cluster; a storage module for storing local files and codes; a cloud module for providing development resources and a visual development platform page; a plug-in module, wherein an artificial intelligence-based programming assistant plug-in is integrated, for developers to write and generate codes, to generate an access request containing a signature and identity verification carrying a token according to a large model calling instruction input by the developer; and to call the development platform page of the cloud module to preview and modify the content of the cloud-developed code, and return the modification result to the programming assistant plug-in; a service module connected to the database module, the storage module, the cloud module and the plug-in module, for reading and writing operations on the local files and codes in the storage module according to local link access requests issued by the programming assistant plug-in or the cloud module; and linking and operating the databases in the database cluster according to database access requests issued by the programming assistant plug-in or the cloud module.

[0008] Preferably, the database cluster comprises a domestic database cluster and a foreign database cluster; the service module comprises: a driver class loader unit for creating a first class loader for the databases in the domestic database cluster and a second class loader for the databases in the foreign database cluster, the first class loader and the second class loader being independent and corresponding parent class loaders being set to null; an association unit connected to the driver class loader unit, wherein a first mapping relationship between a loader and an adapter is pre-stored in the association unit, for associating a corresponding first class loader according to the first mapping relationship when generating a domestic database adapter, and associating a corresponding second class loader according to the first mapping relationship when generating a foreign database adapter; a scheduling unit connected to the driver class loader unit and the association unit, for continuously monitoring events, and calling a target database through the driver class loader unit and the association unit to handle events according to the event type and the corresponding event priority when an event is monitored, the target database being any one or more databases in the domestic database cluster and / or the foreign database cluster.

[0009] Preferably, the service module comprises: a cluster health detection unit configured to monitor the health status of each instance in the database cluster, the health status comprising at least one of a heartbeat detection result and a connection timeout detection result; and a switching unit connected to the cluster health detection unit and configured to, according to the health status of the instance, add a failure flag to a failed instance when a primary instance is detected to fail, select a high-priority secondary instance from a list of available instances of the database cluster, and switch through a connection pool to clear invalid connections and reestablish a connection between the database and the secondary instance; the cluster health detection unit is further configured to periodically monitor the recovery status of the failed instance with the failure flag, and when the instance is detected to recover, add the recovered instance to the list of available instances and remove the failure flag.

[0010] Preferably, the storage module comprises: a version history management unit configured to generate a version snapshot when a local file is modified; and the programming assistant plug-in further comprises: a version history viewing unit configured to view version history records in a sidebar of the programming assistant plug-in, and one-click back to a target history version, which is a version corresponding to any version history record.

[0011] Preferably, the cloud module comprises: a data throttling unit configured to detect an amount of received data within a preset time window, directly forward the data to the programming assistant plug-in when the amount of data within the preset time window does not exceed a preset data amount threshold, and merge data of the same type and forward the merged data to the programming assistant plug-in when the amount of data within the preset time window exceeds the preset data amount threshold; and a rendering configuration unit configured to configure rendering parameters, generate and store a rendering configuration file; the programming assistant plug-in further comprises: a rendering configuration obtaining unit configured to obtain the rendering configuration file from the rendering configuration unit when the programming assistant plug-in is started, and periodically exchange a rendering verification identifier with the development platform page, and re-synchronize rendering configuration files of the programming assistant plug-in and the development platform page when the rendering verification identifiers are inconsistent; and a rendering unit connected to the data throttling unit and the rendering configuration obtaining unit, and configured to render data forwarded by the data throttling unit in an incremental manner according to the obtained rendering configuration file.

[0012] Preferably, the plug-in module further includes: a security verification thread unit, used to pre-parse and cache the request parameters of the access request as sorted key-value pairs, and generate a signature; a real-time communication thread unit, used to receive the modification results returned by the cloud module in segments; and a write daemon thread unit, used to pause low-priority tasks and write the modification results to a local file of the storage module when the modification results received by the real-time communication thread unit pass verification; wherein, the priority of the security verification thread unit is greater than the priority of the real-time communication thread unit, and the priority of the write daemon thread unit is greater than the priority of the security verification thread unit.

[0013] Preferably, the programming assistant plugin includes: a secure data channel unit for transmitting sensitive data, the sensitive data including signatures and / or tokens; and a communication data channel unit for transmitting non-sensitive data, the non-sensitive data including modification results returned from the cloud and / or operation results from the database.

[0014] Preferably, the service module includes: a file lock detection unit, used to acquire a shared write lock on the target file before writing the code generated by the programming assistant plugin into the target file of the storage module; a temporary cache unit, connected to the file lock detection unit, used to cache the code generated by the programming assistant plugin to a temporary cache directory when the shared write lock is not acquired, and generate and display a first prompt message; a writing unit, connected to the file lock detection unit and the temporary cache unit respectively, used to write the code generated by the programming assistant plugin into the target file when the shared write lock is acquired, and to write the code in the temporary cache directory into the target file incrementally when the shared write lock is detected to be released; and a verification unit, connected to the writing unit, used to verify the code written in the target file, and to trigger code rollback when verification fails, restore the previous version file from the file version history database, and generate and display a second prompt message.

[0015] Preferably, the service module further includes: a syntax conversion unit, used to construct a mapping library between database types and syntax rules; the adapter is also used to analyze the received structured query language request, determine the database type, match the corresponding syntax rules from the mapping library according to the determined database type, and perform syntax correction on the structured query language request according to the matched syntax rules.

[0016] In another aspect, a cloud program development method based on an artificial intelligence plug-in is provided. The method is applied to the cloud program development system based on the artificial intelligence plug-in as described above and includes the following steps. An artificial intelligence-based programming assistant plug-in receives a written code. A service module reads a local file in real time and synchronizes the read local file to a development platform page of a cloud module. The cloud module generates a code preview interface according to the synchronized local file. The programming assistant plug-in calls the development platform page of the cloud module to preview and modify the code content developed in the cloud and returns the modification result to the programming assistant plug-in. The programming assistant plug-in receives the modification result to update the local file. Meanwhile, the service module synchronously checks the associated code in a database cluster and updates the database.

[0017] The advantages or beneficial effects of the technical solution of the present application are as follows. The present application can realize seamless linkage of a programming assistant plug-in, a service, a cloud visual development platform page, and a local file / code, improve development efficiency through plug-in operation in the local and real-time preview effect in the cloud, ensure the security of interaction between a large model service and a local development environment through double security measures of signature and token, and prevent illegal access and data leakage. The local plug-in can directly view the visual result of database operation without relying on third-party tools, the operation process is more coherent, a closed loop of local writing, cloud modification, local updating, and database synchronization is formed, and the visual experience is significantly optimized. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 For a preferred embodiment of the present application, a structure block diagram of the cloud program development system based on the artificial intelligence plug-in is provided.

[0019] Figure 2 For a preferred embodiment of the present application, a structure block diagram of the database module and the service module is provided.

[0020] Figure 3 For a preferred embodiment of the present application, a structure block diagram of the storage module and the programming assistant plug-in is provided.

[0021] Figure 4 For a preferred embodiment of the present application, a structure block diagram of the cloud module and the programming assistant plug-in is provided.

[0022] Figure 5 For a preferred embodiment of the present application, a structure block diagram of the plug-in module is provided.

[0023] Figure 6 For a preferred embodiment of the present application, a structure block diagram of the programming assistant plug-in is provided.

[0024] Figure 7 For a preferred embodiment of the present application, a structure block diagram of the service module is provided.

[0025] Figure 8 For the preferred embodiment of the present application, the structural block diagram of the service module;

[0026] Figure 9 For the preferred embodiment of the present application, the flowchart of the cloud program development method based on the artificial intelligence plug-in. DETAILED DESCRIPTION

[0027] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0028] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0029] The present application will be further described below with reference to the drawings and specific embodiments, but not as a limitation of the present application.

[0030] In the preferred embodiment of the present application, based on the above problems existing in the prior art, a cloud program development system and method based on an artificial intelligence plug-in are provided, as shown in Figure 1 The system includes: a database module 1, the database module 1 includes a database cluster 11; a storage module 2, used for storing local files and codes; a cloud module 3, used for providing development resources and a visual development platform page 32; a plug-in module 4, the plug-in module 4 is integrated with a programming assistant plug-in 41 based on artificial intelligence (hereinafter referred to as AI plug-in) for developers to write and generate codes, according to the large model calling instruction input by the developer to generate an access request containing a signature and carrying token identity authentication; and for calling the development platform page of the cloud module 3 to preview and modify the content of the cloud developed code, and returning the modification result to the programming assistant plug-in 41; a service module 5, respectively connected with the database module 1, the storage module 2, the cloud module 3 and the plug-in module 4, used for reading and writing operations on the local files and codes in the storage module 2 according to the local link access request issued by the programming assistant plug-in 41 or the cloud module 3; and linking and operating the databases in the database cluster 11 according to the database access request issued by the programming assistant plug-in 41 or the cloud module 3.

[0031] Specifically, the plug-in module 4 is developed with TypeScript, integrated with a programming assistant, deployed and extended in the form of an AI plug-in of mainstream IDEs such as VS Code and IDEA, and provides an interactive entrance such as a command panel and a side bar as a front-end entrance for local operation of a developer. When a large model AI service needs to be called, an HMAC signature conforming to the RFC 2104 standard and a JWT (JSON Web Token) token based on the RFC 7519 standard are generated and encapsulated in an HTTP request header, and are sent to a specified interface of the service module 5 such as an API, an AI or a Request RESTful interface through an HTTPS protocol. At the same time, the plug-in module 4 and the cloud module 3 establish a long connection through a WebSocket protocol, the plug-in can support dynamic loading of the cloud visual development platform page 32, realize preview and modification of the cloud code, and after receiving the modification result returned by the cloud, automatically overwrite the corresponding local file, and pop up a window to prompt the developer that the cloud modification has been synchronized to the local. The application can realize secure access of a large model AI service, preview and modification of the code of the cloud visual development platform page 32 on the plug-in side, and receiving the modification result returned by the cloud.

[0032] The service module 5 is built based on a Spring Boot framework and deployed as a local independent service process. Its built-in database adaptation layer includes: a domestic database adapter, encapsulating JDBC drivers of domestic databases such as Dream (DM) and Renmin Jinku (Kingbase), realizing SQL syntax adaptation, such as DATE type conversion of Dream database and paging syntax adaptation of Renmin Jinku; a foreign database adapter, encapsulating JDBC drivers and SQL syntax adaptation of international mainstream databases such as Oracle and MySQL, switching database types through the database.type parameter (taking values of domestic or foreign) in the configuration file (such as application.yml).

[0033] The service module 5 as a core service layer also undertakes the following functions: verifying the AI service access request sent by the plug-in module 4 containing the HMAC signature and the JWT token; dynamically linking the database through the adapter, executing the SQL operation and returning the database operation result, and synchronizing the result to the local AI plug-in and the cloud module 3; uniformly scheduling the two-way data interaction between the local file, the database of the storage module 2 and the cloud module 3, avoiding data conflicts caused by concurrent operations.

[0034] The storage module 2 stores the local files and codes in the default path of the local disk of the developer. The local files and codes stored in the storage module 2 are local development resources, and the codes are synchronized with the service module 5. The service module 5 realizes the reading and writing of the local files through the JavaNIO (non-blocking I / O) package, supports the two-way interaction of directly writing the AI generated code into the local file and synchronizing the local code to the cloud after modification, and ensures the data consistency.

[0035] The cloud module is cooperated by the cloud 31 and the visual development platform page 32. The cloud 31 is carried by a cloud server, and the visual development platform page 32 is developed based on Vue3. The visual development platform page 32 establishes a long connection with the plug-in module 4 through the WebSocket protocol and communicates with the local AI plug-in in real time, realizes the preview and modification of the cloud code and the real-time return of the modification result, forms a closed loop process of "local operation-cloud preview-result return", and interacts with the service module 5 through RESTful API, such as POST / API / sync / db interface, to complete the synchronization of database operation.

[0036] The database module 1 includes a plurality of types of database clusters. The domestic database cluster includes Dream, Renmin Jinku, and Haixing domestic databases, and is deployed on a domestic server such as a Pengpeng server. The foreign database cluster includes Oracle, MySQL, and Postgres foreign databases, and is deployed on a general server. The service module 5 establishes a connection with the cluster through an adapter, supports single cluster multi-instance access, such as the master-slave instances of the same domestic database cluster Dream.

[0037] Further, as shown in Figure 2 The database cluster 11 includes a domestic database cluster 111 and a foreign database cluster 112.

[0038] Specifically, to solve the problem that the prior art is single in adapting to multiple types of databases, only supports foreign mainstream databases, cannot adapt to domestic databases, and thus cannot meet the development needs of domestic projects, in the embodiment, the domestic database cluster 111 and the foreign database cluster 112 are integrated. The domestic database cluster 111 includes but is not limited to domestic databases such as Dream and Renmin Jinku, and the foreign database cluster 112 includes but is not limited to foreign databases such as Oracle and MySQL.

[0039] Further, as shown in Figure 2As shown, the service module 5 includes: a driver class loader unit 51 for creating a first class loader 511 for databases within the domestic database cluster 111 and a second class loader 512 for databases within the foreign database cluster, the first class loader 511 and the second class loader 512 being independent and corresponding parent class loaders being set as null; an association unit 52 connected to the driver class loader unit 51, the association unit 52 being pre-stored with a first mapping relationship between the loaders and the adapters, for associating the corresponding first class loader 511 according to the first mapping relationship when generating the domestic database adapter 521, and associating the corresponding second class loader 512 according to the first mapping relationship when generating the foreign database adapter 522; and a scheduling unit 53 connected to the driver class loader unit 51 and the association unit 52, for continuously monitoring events and processing the events according to the event types and corresponding event priorities when the events are monitored.

[0040] Specifically, for the service module in the prior art to implement dynamic switching of multiple types of databases and unified scheduling of local file, AI request processing and database operation, there are two problems:

[0041] Database driver conflict: the JDBC drivers of domestic databases and foreign databases have repeated class names, such as some drivers containing the jdbc.driver.Driver class, which will cause class loader conflict if loaded at the same time, resulting in service module startup failure.

[0042] Scheduling timing disorder: the triggering time of local file modification, AI request processing and database operation may overlap, such as developers modifying the code and executing SQL queries at the same time.

[0043] If there is no unified scheduling logic, timing errors may occur, such as executing database operations before the code is synchronized, resulting in mismatch between data query results and code logic.

[0044] In this embodiment, an isolated loading mechanism of database drivers is adopted, a database driver class loader is first defined, and java.net.URLClassLoader is inherited. Independent class loader instances are created for domestic and foreign databases, domestic database drivers are loaded by DomesticDriverClassLoader, and foreign database drivers are loaded by ForeignDriverClassLoader; and the parent class loaders of the two types of loaders are set to null to avoid class conflicts caused by parent class loader sharing.

[0045] Then, the adapter is bound with the loader, the loader-adapter mapping relationship is added in the DatabaseAdapterFactory, the DomesticDriverClassLoader is automatically associated when the DomesticDatabaseAdapter is generated, the corresponding driver is loaded; the ForeignDriverClassLoader is associated when the ForeignDatabaseAdapter is generated, and the driver loading is ensured not to interfere with each other, and the service module startup success rate is improved to 100%.

[0046] Meanwhile, a unified scheduling logic based on an event bus is adopted to construct a service module event bus, the bus is implemented based on SpringEvent, three core event types are defined, i.e., a local file modification event (LocalFileModifyEvent), an AI request processing event (AIRequestEvent), and a database operation event (DatabaseOperateEvent), and corresponding event priorities are set. Preferably, the priority of the database operation event is higher than that of the AI request processing event, and the priority of the AI request processing event is higher than that of the local file modification event, i.e., DatabaseOperateEvent> AIRequestEvent> LocalFileModifyEvent.

[0047] The components in the service module 5 serve as event monitors, and after receiving events, the events are processed according to priorities. For example, when the local file modification event (LocalFileModifyEvent) and the database operation event (DatabaseOperateEvent) are triggered at the same time, the event monitor processes the LocalFileModifyEvent event first, and after the code is synchronized to the cloud and a synchronization completion identifier is generated, the DatabaseOperateEvent event corresponding to the SQL query is executed.

[0048] Meanwhile, through an event lock mechanism such as ReentrantLock, the same resource (such as a database connection) is prevented from being occupied by multiple events at the same time, and the timing error rate is reduced to 0.

[0049] Through the drive isolation loading and the timing scheduling based on the event bus, the drive conflict and the scheduling confusion problem are solved.

[0050] The database adaptation layer of the service module 5 is designed in a factory mode. Exemplarily, the core code is as follows:

[0051] public interface DatabaseAdapter {

[0052] Connection getConnection(); / / Establishes a database connection

[0053] List <Map<String, Object> executeQuery(String sql); / / Executes the query and returns the results in a visual format.

[0054] int executeUpdate(String sql); / / Perform the update operation

[0055] String getDatabaseType(); / / Gets the database type (domestic / foreign)

[0056] }

[0057] public class DomesticDatabaseAdapter implements DatabaseAdapter {

[0058] @Override

[0059] public Connection getConnection() {

[0060] / / Load domestic database drivers such as DM and Kingbase, and establish connections.

[0061] Class.forName("dm.jdbc.driver.DmDriver");

[0062] return DriverManager.getConnection("jdbc:dm: / / localhost:5236", "username", "password");

[0063] }

[0064] / / Other methods to achieve this (adapting to domestic database SQL syntax)

[0065] }

[0066] public class ForeignDatabaseAdapter implements DatabaseAdapter {

[0067] @Override

[0068] public Connection getConnection() {

[0069] / / Load foreign database drivers such as Oracle and MySQL, and establish connections.

[0070] Class.forName("oracle.jdbc.driver.OracleDriver");

[0071] return DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORCL", "username", "password");

[0072] }

[0073] / / Other methods to achieve this (adapting to foreign database SQL syntax)

[0074] }

[0075] public class DatabaseAdapterFactory {

[0076] public static DatabaseAdapter createAdapter(String type) {

[0077] / / Read the configuration file and dynamically generate the corresponding adapter

[0078] String dbType = ConfigUtil.getConfig("database.type");

[0079] if ("domestic".equals(dbType)) {

[0080] return new DomesticDatabaseAdapter();

[0081] } else if ("foreign".equals(dbType)) {

[0082] return new ForeignDatabaseAdapter();

[0083] }

[0084] throw new IllegalArgumentException("unsupported database type: " + dbType);

[0085] }

[0086] }

[0087] When the database needs to be switched, only the database.type parameter in the configuration file (such as application.yml) needs to be modified, and after the service module 5 is restarted, the factory class can generate the corresponding adapter to realize the non-aware switching.

[0088] Further, as shown in Figure 2 The service module 5 includes: a cluster health detection unit 12, configured to monitor the health state of each database in the database cluster 11, the health state including at least one of a heartbeat detection result and a connection timeout detection result; a switching unit 13 connected to the cluster health detection unit 12, configured to add a fault label to a fault instance when a master instance fails is detected according to the health state of the instance, and select a high-priority slave instance from a list of available instances of the database cluster 11, and clear the invalid connection through the connection pool switching to reestablish the connection between the database and the slave instance; the cluster health detection unit 12 is further configured to periodically monitor the recovery state of the fault instance added with the fault label, and when the instance recovers to the healthy state, add the instance to the list of available instances and remove the fault label.

[0089] Specifically, in view of the instability of the cluster switching in the prior art, taking a domestic database cluster as an example, such as a dream master-slave cluster, when the master instance fails, if the service module does not detect the fault state in time, the request is still initiated to the master instance, which will cause the database connection timeout, and the timeout time is up to 5 seconds, thereby affecting the continuity of the development process.

[0090] In the embodiment, the cluster health detection unit 12 adopts a cluster health detection component, which contains domestic database clusters / foreign database clusters for each database cluster, and monitors the instance health state in real time through heartbeat detection and connection timeout detection.

[0091] In the heartbeat detection process, the component sends a SELECT1 request to all instances in the cluster every 100 milliseconds, and judges whether the instance is in a normal working state through the response of the instance to the request. In the connection timeout detection process, the connection timeout time is set to 1 second, and if an effective connection cannot be established within the connection timeout time, it means that the instance has failed.

[0092] When the component detects that the master instance fails, specifically, the heartbeat is not responded or the connection is timed out, the failed master instance is immediately marked as unavailable, and the highest priority slave instance is selected from the available instance list of the cluster. For example, the slave instance with CPU occupancy lower than 30% is preferentially selected according to the load condition of the instance.

[0093] In order to ensure the effectiveness and stability of the connection, the component clears the invalid connection through the connection pool switching mechanism, specifically through the evictConnections() method of the HikariCP connection pool, and re-establishes the connection with the slave instance. The whole switching process takes no more than 300 milliseconds, the service interruption rate is reduced to 0, and the impact on the business is minimized.

[0094] In addition, the component can also periodically detect the recovery state of the unavailable instance, for example, every 5 seconds. If it is found that a certain unavailable instance has recovered normally, it will automatically rejoin the available instance list, fully utilize the resources of the cluster, avoid resource idling, and improve the running efficiency and reliability of the whole cluster.

[0095] Further, as shown in Figure 3 The storage module 2 includes a version history management unit 21 for generating a version snapshot when the local file is modified, and the programming assistant plug-in 41 further includes a version history viewing unit 411 for viewing the version history record in the sidebar of the programming assistant plug-in 41 and one-click backtracking to the target historical version, which is any version corresponding to the version history record.

[0096] Specifically, the embodiment adopts a version backtracking mechanism, and the storage module 2 constructs a lightweight version library, which is used to store the modification record of the local file / code.

[0097] The file modification mentioned here includes writing the code generated by the AI plug-in to the local file and synchronizing the code modified manually by the developer through the cloud development visualization platform page to the local file. Each time the local file is modified, a version snapshot is generated, and the version snapshot only stores the incremental modification part of the file and the corresponding modification timestamp, realizing version history management. The generated version snapshot is stored in a specified directory, and the occupied space is ≤100MB.

[0098] The developer can view the version history record through the sidebar of the plug-in. The sidebar presents the detailed information of each version in an intuitive and clear interface, including the modification time and modification content summary of the version, so that the developer can quickly understand the evolution history of the file. Moreover, the developer can backtrace to any historical version with one-click operation, avoiding the loss caused by data damage.

[0099] Further, as shown in Figure 4As shown, the cloud module 3 comprises: a data throttling unit 33 for detecting the amount of received data within a preset time window, directly forwarding the data to the programming assistant plug-in 41 when the amount of data within the preset time window does not exceed the preset data amount threshold, and merging the same type of data and forwarding the merged data to the programming assistant plug-in 41 when the amount of data within the preset time window exceeds the preset data amount threshold; a rendering configuration unit 34 for configuring rendering parameters, generating and storing a rendering configuration file; the programming assistant plug-in 41 further comprises: a rendering configuration acquisition unit 412 for acquiring the rendering configuration file from the rendering configuration unit 34 when the programming assistant plug-in 41 starts, and periodically exchanging a rendering verification identifier with the development platform page, and re-synchronizing the rendering configuration files of the programming assistant plug-in 41 and the development platform page when the rendering verification identifiers are inconsistent; a rendering unit 413 connected to the data throttling unit 33 and the rendering configuration acquisition unit 412, respectively, for rendering the data forwarded by the data throttling unit 33 in an incremental manner according to the acquired rendering configuration file.

[0100] Specifically, for the prior art, when the developer frequently modifies the code, such as 2-3 times per second, the WebSocket protocol will frequently return data, and each time 1-2 KB of code fragments are returned. If the page triggers full rendering, such as re-rendering the entire code editor, every time data is received, it will cause the CPU occupancy rate of the browser to soar, reaching 60%-70% of the CPU occupancy rate, causing the page to appear to be stuck and to drop frames. In addition, if the rendering logic of the cloud development platform page and the local AI plug-in is inconsistent, such as code highlighting rules and format layout differences, the cloud preview and the local display will be out of sync, such as the cloud displaying code indentation errors, which will affect the problem of team collaboration judgment.

[0101] In this embodiment, by means of data throttling, incremental rendering, and rendering rule uniform synchronization, the real-time performance and rendering performance are balanced, and the problem of imbalance between high-frequency real-time return of cloud modification results and rendering performance of page visual preview is solved.

[0102] The cloud development platform page uses a data throttling component, which uses a dual throttling mechanism based on a time window and a data amount threshold. Specifically, taking a 50 ms set time window and 3 times as the data amount threshold as an example, if the returned data received within 50 ms does not exceed 3 times, the data will be directly forwarded to the rendering unit 413 for processing; if it exceeds 3 times, the component will merge the same type of data. For example, if there are 3 consecutive code character modifications, the component will merge these modifications and only forward the final modification result, reducing the data forwarding amount by 60%, thereby reducing the processing pressure of the subsequent rendering module.

[0103] The page rendering adopts a DOM node partial update strategy. The code editor is implemented based on MonacoEditor. After receiving the returned data, the code editor locates the modified code line through line number matching, and re-renders only the DOM node of the line, instead of rendering the entire editor.

[0104] To further optimize performance, some unnecessary rendering functions are turned off. For example, the real-time syntax checking function is no longer triggered in real time, but is started 100 ms after code modification stops. The CPU occupancy rate of the browser is successfully reduced to below 30%, and the page freezing rate is also reduced to 0, significantly improving the response speed and operation fluency of the page.

[0105] To ensure that the rendering logic of the cloud and the local AI plug-in is consistent, a rendering rule synchronization service is built. The cloud module 3 and the local programming assistant plug-in 41 share the same set of rendering configuration files, which contain key information such as code highlighting rules, indentation format, and line separator type. The configuration file is stored on the cloud server, and the local AI plug-in automatically pulls the latest configuration from the cloud when it starts, ensuring that both ends follow the same rules when rendering.

[0106] The cloud page and the local AI plug-in will regularly exchange rendering verification identifiers, such as the MD5 value of the current page code, through the WebSocket protocol every 5 seconds. By comparing the rendering verification identifiers of both ends, if the identifiers are inconsistent, the configuration resynchronization mechanism is automatically triggered, and the local AI plug-in pulls the rendering configuration file from the cloud again, or the cloud development platform page 32 receives the configuration update from the local AI plug-in, ensuring consistency in multi-end display and reducing multi-end synchronization errors to 0, providing reliable protection for team collaboration.

[0107] Further, as shown in Figure 5 The plug-in module 4 further includes: a security verification thread unit 42 for pre-parsing the request parameters of the access request and caching them as sorted key-value pairs, and generating a signature; and a real-time communication thread unit 43 for receiving the modification results returned by the cloud module 3 in slices.

[0108] Specifically, for the local AI plug-in in the prior art, if the secure access (encryption signature processing) of the large model service and the real-time return (low-latency communication) of the cloud modification result are implemented at the same time, two major conflicts are likely to occur. One is the performance conflict. The parameter sorting and signature calculation (such as the SHA-256 algorithm) in the security verification process consume a large amount of CPU resources. If they are processed in parallel with the high-frequency data based on the WebSocket protocol real-time return, the plug-in response delay will be caused, and the delay will increase by 200-300 ms, which will further affect the operation experience of the developer. The second is the data consistency conflict. The modification result (such as a code snippet) returned by the cloud needs to be written into the local file in real time. However, the security verification process may intercept abnormal requests. If the returned data is not synchronized with the local file writing operation, the data deviation situation that the return is successful but the file is not updated will easily occur.

[0109] In the embodiment, the multi-thread task splitting mode is adopted to overcome the compatibility of security verification and real-time return in the complex parameter scenario, and to ensure security and real-time performance.

[0110] Specifically, the core task of the plug-in is split into security verification and real-time communication, which are processed by two types of threads respectively. The security verification thread is used to process the parameter sorting and signature generation of the artificial intelligence plug-in request. A parameter pre-analysis caching strategy is adopted, that is, the commonly used parameter structure is disassembled into sorted key-value pairs in advance, so as to reduce repeated calculation and reduce the CPU occupancy rate by 40%. The real-time communication thread receives the cloud return data through the WebSocket protocol, and adopts a data slicing receiving mode to split the large code file into 1 KB / slice, so as to avoid the delay caused by too large single data volume.

[0111] Further, the priority of the security verification thread unit 42 is higher than the priority of the real-time communication thread unit 43.

[0112] Specifically, the priority scheduling mechanism is further adopted in the embodiment. Each type of thread corresponds to a priority, and the priorities corresponding to different threads are the same or different. Specifically, the priority of the security verification thread is higher than that of the real-time communication thread, which solves the performance and consistency conflict while ensuring security and real-time performance.

[0113] Further, as shown in Figure 5 , the plug-in module 4 further includes a writing daemon thread unit 44, which is used to suspend the low-priority task when the modification result received by the real-time communication thread unit 43 is verified, and write the modification result into the local file of the storage module 2.

[0114] Further, the priority of the writing daemon thread unit 44 is higher than the priority of the security verification thread unit 42.

[0115] Specifically, the embodiment sets the file writing daemon thread unit 44, the priority of the file writing daemon thread is the highest, only when the data received by the real-time communication thread passes the basic verification, such as data integrity CRC32 verification, the file writing daemon thread immediately suspends the low-priority task, and preferentially performs the local file writing operation, thereby ensuring the synchronization of the returned data and the file updating, and reducing the data deviation rate to 0.

[0116] Further, as shown in Figure 6 The programming assistant plug-in 41 includes a secure data channel unit 414 for transmitting sensitive data including signatures and / or tokens, and a communication data channel unit 415 for transmitting non-sensitive data including modification results returned by the cloud and / or operation results of the database.

[0117] Specifically, the embodiment adopts a secure and communication data isolation mechanism, and constructs a secure data channel and a communication data channel double-buffer queue in the plug-in. The secure data channel only transmits sensitive data such as signatures and JWT tokens of AI requests, and adopts memory encryption storage (AES-128); the communication data channel transmits non-sensitive data such as code returned by the cloud and database results, and adopts a receive-while-verify mode, that is, verifying once for every 1 piece of data received.

[0118] Meanwhile, when the security verification and real-time return are triggered at the same time, the built-in task scheduler in the plug-in, such as the TypeScript-based p-queue library, is used to realize conflict arbitration and dynamically allocate CPU resources, so as to ensure that the security verification response time is less than or equal to 100 ms, and the real-time return delay is less than or equal to 50 ms, thereby meeting the experience demand of the developer for operation and feedback.

[0119] The embodiment of the application solves the performance and consistency conflict problem while ensuring security and real-time performance through the combination of multi-thread task scheduling and data verification double buffering.

[0120] Further, as shown in Figure 7As shown, the service module 5 includes: a file lock detection unit 54, configured to acquire a shared write lock of a target file before writing the code generated by the programming assistant plug-in 41 into the target file of the storage module; a temporary cache unit 55 connected to the file lock detection unit 54, configured to cache the code generated by the programming assistant plug-in 41 to a temporary cache directory when the shared write lock is not acquired, and generate and display first prompt information; a writing unit 56 connected to the file lock detection unit 54 and the temporary cache unit 55 respectively, configured to write the code generated by the programming assistant plug-in 41 into the target file when the shared write lock is acquired, and write the code in the temporary cache directory into the target file in an incremental manner when the shared write lock is released; and a verification unit 57 connected to the writing unit 56, configured to verify the code written in the target file, and trigger code rollback to restore the last version of the file from the file version history library and generate and display second prompt information when the verification fails.

[0121] Specifically, for the code generated by the AI plug-in in the prior art, if the developer simultaneously opens the file with the integrated development environment (IDE) and edits it, the IDE will add an exclusive write lock to the file, causing the writing operation of the service module to be blocked. According to actual measurement, the blocking time can be 1-2 seconds, or even the file content is overwritten, and the AI plug-in generated content is overwritten by the developer's manual modification. If the file lock conflict causes the writing to be interrupted, only part of the content will be written into the file, resulting in damage, such as missing closing parentheses in a Java class file, thereby causing data damage risk and affecting subsequent code compilation and running.

[0122] To solve the file lock conflict problem encountered by the prior art for implementing parallel operation of AI plug-in generated code directly written into a local file and manual modification of the file by the developer, in this embodiment, a three-level protection mechanism of file lock detection, incremental writing and version rollback is used to solve the writing conflict and data damage problem.

[0123] The file lock detection unit 54 adopts a file lock detection component, which attempts to acquire a shared write lock of the file through the tryLock() method of java.nio.file.FileChannel before writing the AI plug-in generated code into the local file.

[0124] If the acquisition is successful, it means that there is no IDE exclusive lock, and the writing operation can be directly performed.

[0125] If the acquisition fails, it means that there is an IDE exclusive lock, and the avoidance logic is triggered to temporarily store the AI plug-in generated code in a temporary cache directory, and prompt the developer through a plug-in pop-up window. Exemplarily, the first prompt information displayed by the pop-up window is "AI generated content has been temporarily stored, please click Synchronize after closing the file."

[0126] In addition, the file lock detection component also monitors the file lock state through a timing task that is executed every 100 ms. Once it detects that the IDE has released the exclusive lock, it automatically writes the AI plug-in generated code in the temporary cache to the target file immediately, without the need for manual intervention by the developer, greatly improving the convenience and efficiency of operations.

[0127] During the writing process, the service module 5 does not directly overwrite the entire file, but rather identifies the differences between the AI plug-in generated code and the local file based on a Diff algorithm through code snippet comparison, such as newly added functions and modified variable names. Only these difference parts are written to the file, effectively reducing the writing operation time from 500 ms to 100 ms, improving writing efficiency.

[0128] After writing is completed, the service module 5 automatically performs syntax checking on the file, such as calling the syntax checking API of the IDE, such as the syntax checking function vscode.languages.validateTextDocument of VS Code. If syntax errors are found, such as missing parentheses due to interrupted writing, a rollback mechanism is triggered immediately to restore the previous version of the file from the file version history library, and a second prompt message is generated, preferably "Write exception has been rolled back, please try again", to promptly inform the developer and ensure the correctness and stability of the file.

[0129] Further, as shown in Figure 8 The syntax conversion unit 58 is configured to construct a mapping library of database types and syntax rules. The domestic database adapter 521 or the foreign database adapter 522 is further configured to analyze the received structured query language request, determine the database type, match the corresponding syntax rule from the mapping library according to the determined database type, and perform syntax correction on the structured query language request according to the matched syntax rule.

[0130] Specifically, the existing technology has a syntax difference between domestic databases and standard SQL. Taking the Dream Database as an example, the TO_DATE function is used for DATE type conversion, instead of the commonly used CAST function in standard SQL. Taking the Renmin Jinkuandatabase as an example, the LIMIT keyword must be added with the OFFSET keyword for paging syntax. If the standard SQL statement generated by the AI plug-in is directly executed, a syntax error will occur. Through actual testing, it is found that the actual error rate reaches 35%, causing poor SQL syntax compatibility.

[0131] In this embodiment, the service module 5 constructs a database type-syntactic rule mapping library through the SQL syntax conversion component. The mapping library is used to store the unique syntactic rules of domestic databases. For example, for the Dream Database, CAST(date_str AS DATE) in standard SQL is converted to TO_DATE(date_str, 'YYYY-MM-DD'); for the RDBMS database, SELECT * FROM table LIMIT 10 is converted to SELECT * FROM table LIMIT 10 OFFSET 0, realizing SQL syntax adaptive conversion and improving the syntactic compatibility between different databases.

[0132] The conversion logic of the component is closely bound to the adapter. When the DomesticDatabaseAdapter receives a SQL request, first, the type of the SQL statement is analyzed by a syntax parser based on ANTLR, to determine whether it belongs to query, update or paging, etc. Then, according to the type of the database used, such as Dream Database / RDBMS, the corresponding conversion rule is matched from the pre-constructed mapping library, and the syntax of the SQL statement is automatically corrected according to the matched rule to ensure that it meets the syntax requirements of the target database.

[0133] In order to further ensure the correctness of the SQL statement, after completing the syntax conversion, the SQL statement generated by the AI plug-in will also be pre-verified. The specific method is to call the EXPLAIN command of the database, which can simulate the execution process of the SQL statement to discover possible problems in advance. If syntax errors are still found after pre-verification, the system will prompt the developer in time through the plug-in and give the recommended SQL syntax content, reducing the SQL syntax error rate to below 5%, improving the stability and reliability of database operation, and providing strong support for the dynamic switching of domestic database cluster and foreign database cluster.

[0134] The application provides a cloud program development method based on an artificial intelligence plug-in, which is applied to the cloud program development system based on the artificial intelligence plug-in as described above, as shown in the figure, comprising: Figure 9 A1, the programming assistant plug-in 41 based on artificial intelligence receives the written code, the service module reads the local file in real time, and synchronizes the read local file to the development platform page of the cloud module 3; A2, the cloud module 3 generates a code preview interface according to the synchronized local file, the programming assistant plug-in 41 calls the development platform page of the cloud module 3, previews and modifies the code content developed in the cloud, and returns the modification result to the programming assistant plug-in 41; A3, the programming assistant plug-in 41 receives the modification result, updates the local file, at the same time, the service module synchronously checks the associated code in the database cluster, and updates the database.

[0135] Specifically, in view of the existing technology without cloud modification and local return logic and no data linkage mechanism, the embodiment adopts multi-end cooperation to realize real-time closed loop and linkage and synchronization of database and code modification. The operation process is as follows: the developer writes and generates code in the AI plug-in in the plug-in module 4, the service module 5 reads the local file in real time, and synchronizes to the cloud visual development platform page 32; the cloud development platform page 32 generates a code preview effect, and the developer modifies the code on the cloud development platform page 32, such as adjusting the function logic; the modification result is returned to the AI plug-in of the plug-in module 4 in real time through the WebSocket protocol; after receiving the modification result, the plug-in module 4 automatically updates the local file to ensure the consistency of the local code and the cloud code; at the same time, the service module 5 synchronously checks the database associated code, such as SQL statements, and if there is a modification, triggers the database operation process to update the database data, and realizes the synchronous update of the code and the data.

[0136] The whole process does not need the developer to manually push the code or synchronize the data, forms a closed loop of local writing-cloud modification-local updating-database synchronization, and improves the development efficiency.

[0137] Further, the plug-in module 4 can call a large model AI service by using an AI service security access process. The AI service security access process adopts a dynamic key hierarchical mechanism, multi-dimensional request fingerprint verification and risk request intelligent interception three innovative designs, and upgrades the single signature verification to a three-dimensional protection system of identity-data-behavior. The specific steps of the AI service security access process are as follows:

[0138] Step 1, before initiating the large model access request, the programming assistant plug-in 41 completes dynamic hierarchical key generation and request parameter structuring preprocessing, and the specific operation is as follows:

[0139] Step 1.1, generate a hierarchical key, which includes a basic key (User-Base-Secret) and a temporary request key (Request-Temp-Secret);

[0140] The basic key: when the user logs in, the user account, device hardware fingerprint and second-level login timestamp are encrypted by SHA-512, wherein the device hardware fingerprint includes the CPU serial number and the motherboard Universally Unique Identifier (UUID). The key is bound to the user account and the device, is encrypted by AES-256, is stored in the local security cache of the AI plug-in in non-plain text, has the same validity period as the user login session, and is automatically invalidated when the session expires, thereby ensuring the security and timeliness of the key.

[0141] Temporary request key: Each time the AI access request is initiated, the AI plug-in automatically generates a 16-bit random string (Nonce value), which is spliced with the base key to generate a temporary request key through the HMAC-SHA256 algorithm. This key is only valid for the current request and is destroyed immediately after the request is completed to prevent misuse of the key.

[0142] Step 1.2, for the request parameters of the access request, including nested JSON format parameters such as large model prompt, model version model_version, request priority priority, etc. Request parameters are structured and disassembled, and sorted according to parameter level and key name ASCII code. For example, for nested parameters params{model:GPT-4,config{temperature:0.8}}, the sorted parameters are params.config.temperature=0.8¶ms.model=GPT-4, which solves the problem of complex parameters that cannot be processed by traditional single sorting; then, the sorted parameter string, current millisecond timestamp and Nonce value are spliced to form the original data string (Raw-Data).

[0143] Step 2, multi-dimensional signature and request encapsulation (multi-dimensional request fingerprint): Plug-in module 4 generates double signatures and request fingerprints based on the original data string and layered keys, completes HTTP request encapsulation, and its specific operations are as follows:

[0144] Step 2.1, generate double signatures; among them, the first double signature (Data-Sign) uses the temporary request key to encrypt the original data string through HMAC-SHA256 to generate a data integrity signature, which is placed in the X-Data-Sign field of the request header to ensure that the data is not tampered with during transmission; the second double signature (Request-Sign) splices the first double signature (Data-Sign) with the payload part of the JWT token (including user ID, role, and permission range), and encrypts it through the base key SHA-256 to generate a request identity association signature, which is placed in the X-Request-Sign field of the request header to ensure the legality and association of the request identity;

[0145] Step 2.2, request fingerprint and JWT token carrying: first, the user IP, device hardware fingerprint and Nonce value are spliced and encrypted through MD5 to generate a request fingerprint (Request-Fingerprint), which is placed in the X-Request-Fingerprint field of the request header, which is used for subsequent behavior risk verification and effectively identifies abnormal requests;

[0146] Auth verification: Adopt JWT mechanism, after the user logs in the programming assistant plug-in 41, the service module 5 generates a JWT token, which contains the user identity, the permission range (such as allowing to call the code generation model only, and prohibiting to call the sensitive data processing model), and the token validity period (default 12 hours, configurable); Adopt RSA asymmetric encryption signature, the AI plug-in places the token in the Authorization field; Then, integrate all the above fields (X-Data-Sign, X-Request-Sign, X-Request-Fingerprint, Authorization, millisecond level timestamp, Nonce value), generate a complete HTTP request, and initiate a secure and reliable access.

[0147] Step 3: Three-dimensional verification of the server, including hierarchical verification and risk interception;

[0148] After the service module 5 receives the HTTP access request, it performs three-dimensional verification according to the progressive logic of identity verification, data integrity verification, and behavior risk verification, and rejects the request if any link fails. The specific operation is as follows:

[0149] Step 3.1, the first dimension: identity and permission verification;

[0150] JWT token parsing: parse the JWT token in the Authorization field through the RSA public key, verify the token validity period (reject the request if it is overdue), user identity legality (query the system user library to confirm whether the user exists) and permission range (such as whether the AI model called is in the user permission list), and ensure the legality of user identity and permission.

[0151] Basic key restoration: according to the user account in the JWT token and the device hardware fingerprint in the request header X-Request-Fingerprint, query the basic key encryption ciphertext stored when the user logs in, and get the basic key (User-Base-Secret) through the key decryption of the service module 5;

[0152] Step 3.2, the second dimension: data integrity verification;

[0153] Temporary key reconstruction: extract the Nonce value in the request header, concatenate it with the restored basic key, and generate a temporary request key (Request-Temp-Secret) through the same HMAC-SHA256 algorithm, to ensure that it is consistent with the temporary key generated by the plug-in side;

[0154] Double signature verification: Verify X-Data-Sign: The service module 5 generates the original data string according to the parameter preprocessing rules of step 1 (i.e. double sorting and splicing timestamp / Nonce value), and uses the temporary request key for HMAC-SHA256 encryption. Compare with X-Data-Sign, if they are not consistent, it is determined that the parameters are tampered with, and the request is rejected; Verify X-Request-Sign: splice the X-Data-Sign that passes the verification with the payload of the JWT token, and use the basic key for SHA-256 encryption. Compare with X-Request-Sign, if they are not consistent, it is determined that the request identity association is abnormal, and the request is rejected.

[0155] Timestamp and Nonce value verification: Verify whether the difference between the millisecond timestamp in the request header and the current time is ≤3 minutes to prevent expired request replay; Query the Nonce value blacklist of the service module 5, which stores the Nonce values used within 24 hours. If there is a duplicate Nonce value, it is determined to be a replay attack, and the request is rejected and the IP address is added to the temporary blacklist, and access is prohibited within 1 hour, effectively preventing malicious attacks.

[0156] Step 3.3, third dimension: behavior risk verification;

[0157] Request fingerprint comparison: Extract the user IP address and device hardware fingerprint in X-Request-Fingerprint, query the user's historical access record (within 24 hours), if the same user account initiates a request under different device hardware fingerprints, the same device hardware fingerprint uses different user accounts to initiate a request, etc. Abnormal behavior triggers risk warning, and abnormal behavior is discovered in time.

[0158] Frequency and content risk interception: Statistics of the number of AI access requests of this user account or its corresponding IP address within 1 minute, whether the requested AI large model is a sensitive model, and whether the prompt word (Prompt) content contains sensitive keywords (such as malicious code instructions). Risk conditions are as follows: If the number of AI access requests initiated by this user account or IP within 1 minute is too high, for example, more than 10 times, it is determined to be a high-frequency attack; When the requested AI large model involves data desensitization related operations, or the prompt word content contains malicious code instructions and other sensitive keywords, trigger risk determination. When it is determined that the current request meets any risk condition, the request is rejected, abnormal logs are recorded and administrators are notified.

[0159] Further, for the prior art without adaptive switching capability and returning only the original data of the database, the embodiment dynamically switches the database adapter through the factory mode, and can realize the visual conversion of the result. The specific steps of the above database operation process are as follows: the developer inputs the database operation instruction, such as SQL query, in the programming assistant plug-in 41, the plug-in module 4 sends the instruction to the service module 5; the service module 5 reads the database.type parameter (domestic / foreign) in the configuration file application.yml, calls the DatabaseAdapterFactory factory class to generate the corresponding adapter (DomesticDatabaseAdapter / ForeignDatabaseAdapter); the adapter loads the corresponding database driver, establishes the database connection, and executes the operation instruction; the execution result is returned to the service module 5 in JSON format, and the service module 5 converts the result into a visual format, such as a table and a chart, and synchronously pushes it to the programming assistant plug-in 41 to realize local viewing and to the cloud visualization platform to realize cloud preview.

[0160] The developer does not need to rely on third-party tools to view the result locally or in the cloud.

[0161] The application adopts multi-end efficient cooperation to realize seamless linkage of local programming assistant plug-in, service, cloud, local file / code, the developer can operate through the plug-in locally, preview the effect in the cloud in real time, and improve the development efficiency; through the double security measures of JWT token and SHA-256 signature, the safety of the interaction between the AI service such as the large model and the local development environment is ensured, and illegal access and data leakage are prevented.

[0162] Meanwhile, the multi-database flexible adaptation supports dynamic switching of multiple types of domestic and foreign databases, meets the database adaptation needs of different scenes such as domestic projects and traditional commercial projects, and has strong compatibility; in addition, the visual experience is optimized, the local AI plug-in can directly view the visual result of the database operation, does not need to rely on third-party tools, and the operation process is more coherent.

[0163] The above is only the preferred embodiment of the application, and does not limit the implementation and protection scope of the application. For those skilled in the art, it should be realized that any equivalent replacement and obvious change made by applying the content of the specification and drawings should be included in the protection scope of the application.

Claims

1. An artificial intelligence plug-in based cloud program development system, characterized by, The application comprises: a database module comprising a database cluster; a storage module for storing local files and codes; a cloud module for providing development resources and visualized development platform pages; a plug-in module, in which an artificial intelligence-based programming assistant plug-in is integrated, for developers to write generated codes, and an access request containing a signature and carrying token authentication is generated according to a large model calling instruction input by the developer; and for calling the development platform page of the cloud module to preview and modify the content of the cloud-developed code, and returning the modification result to the programming assistant plug-in; a service module connected to the database module, the storage module, the cloud module and the plug-in module, respectively, for reading and writing operations on the local files and codes in the storage module according to local link access requests issued by the programming assistant plug-in or the cloud module, and linking and operating the databases in the database cluster according to database access requests issued by the programming assistant plug-in or the cloud module; the database cluster comprises a domestic database cluster and a foreign database cluster; the service module comprises: a driver class loader unit for creating a first class loader for databases in the domestic database cluster and a second class loader for databases in the foreign database cluster, the first class loader and the second class loader being independent and corresponding parent class loaders being set to null; an association unit connected to the driver class loader unit, the association unit having a first mapping relationship between the loader and the adapter pre-stored therein, for associating the corresponding first class loader according to the first mapping relationship when generating a domestic database adapter, and associating the corresponding second class loader according to the first mapping relationship when generating a foreign database adapter; a scheduling unit connected to the driver class loader unit and the association unit, respectively, for continuously monitoring events and processing events according to event types and corresponding event priorities when events are monitored. 2.The artificial intelligence plug-in based cloud program development system of claim 1, wherein, The database module comprises: a cluster health detection unit for monitoring the health status of instances for each database in the database cluster, the health status comprising at least one of a heartbeat detection result and a connection timeout detection result; a switching unit connected to the cluster health detection unit, for adding a fault tag to a fault instance when a master instance is monitored to have a fault, selecting a high-priority slave instance from a list of available instances of the database cluster, and switching through a connection pool to clear invalid connections and re-establish connections between the database and the slave instance; the cluster health detection unit is further configured to periodically monitor the recovery state of the fault instance with the fault tag, and when the instance is monitored to be healthy, add the healthy instance to the list of available instances and remove the fault tag. 3.The artificial intelligence plug-in based cloud program development system of claim 1, wherein, The storage module comprises: a version history management unit for generating a version snapshot when a local file is modified; The programming assistant plug-in further comprises a version history viewing unit configured to view version histories in a sidebar of the programming assistant plug-in, and trace back to a target history version, which is any version corresponding to a version history record. 4.The AI plug-in based cloud program development system of claim 1, wherein, The cloud module comprises: a data throttling unit configured to detect an amount of received data within a preset time window, and forward the data directly to the programming assistant plug-in when the amount of data within the preset time window does not exceed a preset data amount threshold, and merge data of the same type and forward the merged data to the programming assistant plug-in when the amount of data within the preset time window exceeds the preset data amount threshold; a rendering configuration unit configured to configure rendering parameters, and generate and store a rendering configuration file; The programming assistant plug-in further comprises: a rendering configuration obtaining unit configured to obtain the rendering configuration file from the rendering configuration unit when the programming assistant plug-in is started, and periodically exchange a rendering verification identifier with the development platform page, and re-synchronize rendering configuration files of the programming assistant plug-in and the development platform page when the rendering verification identifiers are inconsistent; a rendering unit connected to the data throttling unit and the rendering configuration obtaining unit, and configured to render data forwarded by the data throttling unit in an incremental manner according to the obtained rendering configuration file. 5.The artificial intelligence plug-in based cloud program development system of claim 1, wherein, The plug-in module further comprises: a security verification thread unit configured to pre-analyze request parameters of the access request and cache the request parameters as sorted key-value pairs, and generate a signature; a real-time communication thread unit configured to receive modification results returned by the cloud module in fragments; a write daemon thread unit configured to suspend a low-priority task when the modification results received by the real-time communication thread unit pass verification, and write the modification results into a local file of the storage module; wherein a priority of the security verification thread unit is higher than a priority of the real-time communication thread unit, and a priority of the write daemon thread unit is higher than a priority of the security verification thread unit. 6.The artificial intelligence plug-in based cloud program development system of claim 1, wherein, The programming assistant plug-in comprises: a secure data channel unit configured to transmit sensitive data, the sensitive data comprising a signature and / or a token; a communication data channel unit configured to transmit non-sensitive data, the non-sensitive data comprising modification results returned by the cloud and / or operation results of a database. 7.The artificial intelligence plug-in based cloud program development system of claim 1, wherein, The service module comprises: a file lock detection unit configured to acquire a shared write lock of a target file before writing code generated by the programming assistant plug-in into the target file of the storage module; a temporary cache unit connected to the file lock detection unit, and configured to cache the code generated by the programming assistant plug-in into a temporary cache directory when the shared write lock is not acquired, and generate and display a first prompt information; a writing unit connected to the file lock detection unit and the temporary cache unit, and configured to write the code generated by the programming assistant plug-in into the target file when the shared write lock is acquired, and write the code in the temporary cache directory into the target file in an incremental manner when the shared write lock is released. The check unit is connected with the write unit, configured to check the code written in the target file, and trigger code rollback to recover the previous version of the file from the file version history library and generate and display the second prompt information when the check fails. 8.The artificial intelligence plug-in based cloud program development system of claim 1, wherein, The service module further comprises: The syntax conversion unit is configured to construct a mapping library of database types and syntax rules. The adapter is further configured to analyze the received structured query language request, determine the database type, match the corresponding syntax rule from the mapping library according to the determined database type, and correct the syntax of the structured query language request according to the matched syntax rule.

9. A cloud-based application development method based on an artificial intelligence plugin, characterized in that, Applied to the cloud program development system based on the artificial intelligence plug-in as claimed in any one of claims 1-8, comprising: The programming assistant plug-in based on artificial intelligence receives the written code, the service module reads the local file in real time, and synchronizes the read local file to the development platform page of the cloud module; The cloud module generates a code preview interface according to the synchronized local file, the programming assistant plug-in calls the development platform page of the cloud module, previews and modifies the code content developed in the cloud, and returns the modification result to the programming assistant plug-in; The programming assistant plug-in receives the modification result, updates the local file, and at the same time, the service module synchronously checks the associated code in the database cluster and updates the database.

Citation Information

Patent Citations

  • Server-free application real-time development, debugging and deployment system and method

    CN119155306A