A code editing method and system based on a low-code development platform
By integrating an online code editor and detection components into a low-code development platform, providing code completion suggestions and chained error detection, the limitations of existing platforms in complex scenarios are resolved, enabling efficient code editing and cross-platform access, and improving development efficiency and project security.
Patent Information
- Application Number
- CN202411426181.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2044-10-14
AI Technical Summary
Existing low-code development platforms have limitations in code editing, making it difficult to meet the development needs of complex scenarios. They also lack real-time feedback and error messages, resulting in low development efficiency.
It adopts a code editing method based on a low-code development platform, and integrates development and detection components through a built-in online code editor on a cloud server. It provides code completion suggestions, chained error detection and syntax checking, supports multiple programming languages, automatic package import and version control, and enables cross-platform access.
It improves the standardization and readability of code editing, reduces error rates, increases programming efficiency, supports multiple programming languages, provides cross-platform responsive design and version control, and ensures project security.
Smart Images

Figure CN119336310B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of low-code development, and in particular to a code editing method and system based on a low-code development platform. Background Technology
[0002] Currently, in the software development field, traditional code-based development requires developers to possess extensive programming knowledge and skills. However, this development model presents a high barrier to entry and low development efficiency for non-professional developers or users without rich programming experience. To address this issue, low-code development platforms have emerged. By simplifying the programming process, low-code development platforms allow users to complete application development through simple operations such as drag-and-drop and configuration, significantly reducing development difficulty and costs.
[0003] However, existing low-code development platforms still have certain limitations in terms of code editing.
[0004] On the one hand, the code editing functions provided by these platforms are relatively simple and cannot meet the development needs of complex scenarios;
[0005] On the other hand, users often lack effective real-time feedback and error messages when writing code, which makes it easy for errors to occur during the development process and affects development efficiency. Summary of the Invention
[0006] This invention proposes a code editing method and system based on a low-code development platform to address the issues mentioned in the background section.
[0007] In a first aspect, the present invention proposes a code editing method based on a low-code development platform, including a user terminal and a cloud server, wherein the cloud server has a built-in online code editor;
[0008] An online code editor is pre-configured on a cloud server; the online code editor is equipped with development and testing components.
[0009] When the code editor receives the user's input code, the cloud server parses the input code to determine the class name and the detection information based on the class name reflection;
[0010] The detection information is determined by the detection component through the detection of the input code. The detection information includes: code completion suggestions, code chain error messages, and code variables.
[0011] Based on the detection information, a component editing recommendation interface for code revisions is constructed.
[0012] In conjunction with the first aspect, the online editor is connected to a public script library, which is used to identify the user terminal accessing the online editor. The user terminal includes third-party applications, proprietary applications, and third-party browsers.
[0013] When the cloud server receives the first development access request from a third-party application, it determines the development permissions for the development operation through the second development access request and configures the corresponding code editing environment; where the third-party application is the application development program.
[0014] When the cloud server receives a second development access request from a third-party browser, it determines the execution system and device for the development operation based on the second development access request and configures the corresponding development environment.
[0015] When the cloud server receives a third-party development access request from a dedicated application, it adapts the display interface with the development device through the third-party development access request.
[0016] In conjunction with the first aspect, the development components include editing components and functional components; wherein,
[0017] The editing components include: an online text editing component, a syntax highlighting component, and an automatic indentation control component; among them, the online text editing component adapts corresponding functional components according to the programming language.
[0018] The functional components include a quick operation control component, a code folding component, and a code visualization component.
[0019] In conjunction with the first aspect, the detection component performs input code detection during the pre-compilation stage, and the detection component includes: a static analysis component, a syntax detection component, and a chained code error detection component;
[0020] The static analysis component is used to include a first analysis trigger condition and a second analysis trigger condition. The first analysis trigger condition is configured to generate a temporary trigger signal after the user inputs a code, and the second analysis trigger condition is configured to generate a temporary trigger signal when the first analysis trigger condition has been triggered and a Boolean event is generated.
[0021] The syntax detection component is used to trigger synchronously when the first analysis trigger condition is triggered;
[0022] The chained code error component is used to trigger startup after the first analysis trigger condition is triggered or the second analysis trigger condition is triggered.
[0023] In conjunction with the first aspect, the process of the code editor receiving user input code further includes:
[0024] The code recognition mechanism, which triggers the import of input code and code information through the first code transfer page of the online editor, is used to identify code type, code development environment, and code chain text.
[0025] Based on the recognition results of the code recognition mechanism, the pre-compilation environment is automatically configured, and shortcut keys and commonly used statements for the corresponding code type are generated in the pre-compilation environment.
[0026] In conjunction with the first aspect, the detection information is reflected from the cloud server to the user terminal;
[0027] Among them, when code completion prompts are present in the detection information, the code completion location and the completed code text are determined based on the preset standard code database and the prompt semantics in the prompt information;
[0028] Generate quick completion suggestion buttons based on the code completion location;
[0029] Generate a list of completed codes based on the completed code text and the shortcut completion suggestion keys;
[0030] When the system receives a first trigger command from the user for any completion code in the completion code list and a second trigger command for the shortcut key, it will perform auto-completion.
[0031] In conjunction with the first aspect, the process of the code editor receiving user input code further includes:
[0032] Create a unique editing space for the corresponding input code, and set exclusive permissions for the unique editing space;
[0033] Based on exclusive permissions, set editing verification conditions. When a user meets the editing verification conditions, the corresponding user is authorized to connect to the display interface of the unique editing space to edit the code.
[0034] In conjunction with the first aspect, the component editing recommendation interface for constructing code revisions also includes:
[0035] Obtain at least one revision measure corresponding to the detection information in the component editing recommendation interface; and
[0036] From the detection information, identify at least one code revision item and obtain at least one revision measure; and
[0037] Based on at least one revision measure, the priority order of the revision measure set is obtained from the component editing recommendation interface, which includes multiple revision measures, and then fed back to the user.
[0038] In conjunction with the first aspect, the component editing recommendation interface for constructing code revisions also includes:
[0039] When it is detected that there is no required editing component in the component editing recommendation interface, an external editing tool library is connected, and an editing tool loading interface is generated based on the external editing tool library; the external editing tool library is used to set up various code editing tools.
[0040] In response to the establishment of a connection between an external editing tool library and an online code editor service, the system controls the loading of editing tools by the online code editor, generates a second component editing recommendation interface, and displays the edited content of the code entered in the online editor on the second component editing recommendation interface.
[0041] Secondly, this invention proposes a code editing system based on a low-code development platform, comprising:
[0042] Cloud server: used to pre-configure the online code editor; the online code editor is configured with development components and detection components;
[0043] Online code editor: After receiving user input code, it parses the input code, determines the class name, and detects information based on class name reflection;
[0044] The detection information is determined by the detection component through the detection of the input code. The detection information includes: code completion suggestions, code chain error messages, and code variables.
[0045] User-side: Used to build a component editing recommendation interface for code revisions based on detection information.
[0046] The beneficial effects of this invention are as follows:
[0047] Code Editor: Provides online text editing features, supporting syntax highlighting, automatic indentation, code folding, and more, helping developers write more standardized and readable code. Supports multiple programming languages, including but not limited to JavaScript, Java, and CSS.
[0048] Code completion: After the user enters code, the browser sends the input and code information to the server. The server parses the input and code information to obtain the actual class name, uses reflection to retrieve related variables, methods, and other suggestible information, converts the information packet into a specific format, and returns it to the browser for rendering and display. The user can select or use the tab key to select suggested code for input. It supports automatic completion of chained code and automatic completion of generic information in the code, reducing input time and error rate.
[0049] Automatic import: When saving, the system can automatically identify the classes or methods that need to be imported and automatically add the corresponding import statements. This feature can improve programming efficiency and allow developers to focus on the implementation of code logic rather than tedious import operations.
[0050] Pre-compilation: sunway_IDE provides a manual compilation function. The pre-compilation stage can be used to perform static analysis and syntax checks, identify potential problems in advance, and provide fix suggestions, thereby improving code quality.
[0051] Keyboard shortcuts: sunway_IDE has a rich set of built-in keyboard shortcuts, which make it convenient for users to perform some common operations during the coding process. When the built-in keyboard shortcuts do not meet the user's needs, custom keyboard shortcuts can also be maintained to meet the user's more personalized needs.
[0052] Version control: Our self-developed version control mechanism ensures that a file can only be edited by one person at a time, preventing code conflicts. It also supports viewing and rolling back historical code commits, ensuring project security.
[0053] Cross-platform support: No local installation is required; it can be accessed and used simply through a browser. It supports all major operating systems and devices, and its responsive design ensures a good user experience on various screen sizes.
[0054] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.
[0055] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0056] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0057] In the attached diagram:
[0058] Figure 1 This is a flowchart illustrating a code editing method based on a low-code development platform according to an embodiment of the present invention.
[0059] Figure 2 This is a system composition diagram of a code editing system based on a low-code development platform according to an embodiment of the present invention;
[0060] Figure 3 This is a diagram showing the Java script writing interface in an embodiment of the present invention;
[0061] Figure 4 This is a diagram showing the automatic package import interface in an embodiment of the present invention;
[0062] Figure 5 This is a diagram showing the interface for writing JavaScript in an embodiment of the present invention;
[0063] Figure 6 This is a diagram showing the interface of the Mapper in this embodiment of the invention;
[0064] Figure 7 This is a diagram showing the built-in shortcut key interface in an embodiment of the present invention;
[0065] Figure 8 This is a diagram illustrating the custom editing of shortcut keys in an embodiment of the present invention;
[0066] Figure 9 This is a diagram illustrating the automatic completion prompts in an embodiment of the present invention. Detailed Implementation
[0067] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0068] like Figure 1 As shown, this embodiment provides a code editing method based on a low-code development platform, including: a user terminal and a cloud server, wherein the cloud server has a built-in online code editor;
[0069] An online code editor is pre-configured on a cloud server; the online code editor is equipped with development and testing components.
[0070] When the code editor receives the user's input code, the cloud server parses the input code to determine the class name and the detection information based on the class name reflection;
[0071] The detection information is determined by the detection component through the detection of the input code. The detection information includes: code completion suggestions, code chain error messages, and code variables.
[0072] Based on the detection information, a component editing recommendation interface for code revisions is constructed.
[0073] The principle behind the above technical solution is as follows:
[0074] This invention comprises two parts: a user terminal and a cloud server. The user terminal refers to the port through which an individual or team using a low-code development platform performs development functions via a terminal device. The user terminal can access powerful code editing capabilities through the cloud server. The cloud server has a built-in online code editor that supports multiple programming languages and development frameworks based on user requests.
[0075] Online code editors are pre-configured by cloud servers and integrate development and detection components. These components automatically recognize the code written by the user and provide corresponding feedback based on the code's content. When a user enters code into the code editor, the cloud server parses the code, extracts the class names, and then provides feedback based on those class names, thus obtaining some detection information.
[0076] The detection information is processed and analyzed by the detection component. When code errors or omissions are found, code completion suggestions are provided. For example, if a user attempts to write a function named "hello," the system will prompt the user to add "function" before the filename to avoid incorrect type input. Furthermore, the detection component also identifies chained errors in the code, such as issuing warnings when a user uses undefined variables or functions. Finally, the detection component checks the correctness of variables in the code; if correct, it returns "correct"; otherwise, it issues an error message.
[0077] Based on this detection information, the cloud server will build a component editing recommendation interface for code revisions. On this interface, users can see all the modification suggestions provided by the system and choose to accept or reject them according to their needs. If the modification suggestions are accepted, they will be automatically applied to the code for rapid iteration and debugging. If the modification suggestions are rejected, users can also manually view the reasons for the errors and fix them.
[0078] The beneficial effects of the above technical solution are as follows:
[0079] Code Editor: Provides online text editing features, supporting syntax highlighting, automatic indentation, code folding, and more, helping developers write more standardized and readable code. Supports multiple programming languages, including but not limited to JavaScript, Java, and CSS.
[0080] Code completion: After the user enters code, the browser sends the input and code information to the server. The server parses the input and code information to obtain the actual class name, uses reflection to retrieve related variables, methods, and other suggestible information, converts the information packet into a specific format, and returns it to the browser for rendering and display. The user can select or use the tab key to select suggested code for input. It supports automatic completion of chained code and automatic completion of generic information in the code, reducing input time and error rate.
[0081] Automatic import: When saving, the system can automatically identify the classes or methods that need to be imported and automatically add the corresponding import statements. This feature can improve programming efficiency and allow developers to focus on the implementation of code logic rather than tedious import operations.
[0082] Pre-compilation: sunway_IDE provides a manual compilation function. The pre-compilation stage can be used to perform static analysis and syntax checks, identify potential problems in advance, and provide fix suggestions, thereby improving code quality.
[0083] Keyboard shortcuts: sunway_IDE includes a rich set of built-in keyboard shortcuts for convenient and quick access to frequently used operations during coding. When the built-in shortcuts don't meet user needs, custom shortcuts can be created to satisfy more personalized requirements.
[0084] Version control: A self-developed version control mechanism ensures that a file can only be edited by one person at a time, preventing code conflicts. It supports viewing and rolling back code commit history, guaranteeing project security.
[0085] Cross-platform support: No local installation is required; simply access and use it through a browser. It supports all major operating systems and devices. Responsive design ensures a good user experience on various screen sizes.
[0086] As one embodiment of the present invention: the online editor is connected to a public script library, wherein the public script library is used to identify the user terminal accessing the online editor, and the user terminal includes third-party applications, dedicated applications, and third-party browsers;
[0087] When the cloud server receives the first development access request from a third-party application, it determines the development permissions for the development operation through the second development access request and configures the corresponding code editing environment; where the third-party application is the application development program.
[0088] When the cloud server receives a second development access request from a third-party browser, it determines the execution system and device for the development operation based on the second development access request and configures the corresponding development environment.
[0089] When the cloud server receives a third-party development access request from a dedicated application, it adapts the display interface with the development device through the third-party development access request.
[0090] The principle of the above technical solution is as follows: Figure 3 , Figure 5 and Figure 6As shown, the online editor connects to a public script library, which includes client types such as third-party applications, proprietary applications, and third-party browsers. When processing the first development access request from a third-party application, the cloud server determines the permissions for development operations through a second development access request and configures the code editing environment accordingly. This is because third-party applications typically involve specific technologies and development requirements, thus necessitating the allocation of appropriate permissions and environments to meet their specific needs. For the second development access request from a third-party browser, the cloud server determines the execution system and device through the second development access request and configures the development environment accordingly.
[0091] In practice, development on third-party browsers may be subject to certain limitations. For example, some functions may only be available on specific operating systems or devices. Therefore, it is necessary to configure appropriate execution systems and devices to ensure smooth development. For the third development access request of a dedicated application, the cloud server will use this third development access request to adapt the interface with the development device. This is because dedicated applications are usually customized solutions for a specific domain or need, and therefore require interface adaptation based on the actual application scenario and device characteristics to ensure a good user experience.
[0092] The beneficial effects of the above technical solution are as follows:
[0093] This invention can connect to third-party browsers, third-party applications, and dedicated applications, and will adapt the most suitable editing tools and editing interfaces for different user terminal types.
[0094] As one embodiment of the present invention: the development component includes an editing component and a functional component; wherein...
[0095] The editing components include: an online text editing component, a syntax highlighting component, and an automatic indentation control component; among them, the online text editing component adapts corresponding functional components according to the programming language.
[0096] The functional components include a quick operation control component, a code folding component, and a code visualization component.
[0097] The principle behind the above technical solution is as follows:
[0098] In practice, the editing component enables the following: Real-time synchronization: The online text editing component can synchronize data between the user's client and the cloud server in real time, ensuring that users can view and update their code promptly regardless of their location; Code templates: The online text editing component can automatically generate code templates based on the user's input code, facilitating quick copying and pasting; Automatic error correction: The online text editing component can automatically check the user's input code, displaying error messages in real time to help users avoid errors; Code formatting: The online text editing component can automatically format the user's input code to conform to programming standards and coding styles; Automatic completion: The online text editing component can automatically complete the user's input code based on the user's programming habits and project requirements, improving writing speed and efficiency; Code comments: The online text editing component can automatically recognize and insert code comments, helping users better understand and maintain the code.
[0099] The beneficial effects of the above technical solution are as follows:
[0100] This invention includes various editing tools and functional components to achieve automated development.
[0101] As one embodiment of the present invention: such as Figure 4 and Figure 9 As shown, the detection component performs input code detection during the pre-compilation stage. The detection component includes: a static analysis component, a syntax detection component, and a chained code error detection component.
[0102] The static analysis component is used to include a first analysis trigger condition and a second analysis trigger condition. The first analysis trigger condition is configured to generate a temporary trigger signal after the user inputs a code, and the second analysis trigger condition is configured to generate a temporary trigger signal when the first analysis trigger condition has been triggered and a Boolean event is generated.
[0103] The syntax detection component is used to trigger synchronously when the first analysis trigger condition is triggered;
[0104] The chained code error component is used to trigger startup after the first analysis trigger condition is triggered or the second analysis trigger condition is triggered.
[0105] The principle behind the above technical solution is as follows:
[0106] In practical implementation, the detection component comprises three parts: a static analysis component, a syntax detection component, and a chained code error detection component. The static analysis component primarily monitors user-input code and generates temporary trigger signals under certain conditions. The syntax detection component monitors the user's code in real time when the first analysis trigger condition is met, ensuring it conforms to programming standards. The chained code error detection component detects the user's code in real time after either the first or second analysis trigger condition is met, promptly identifying and correcting errors.
[0107] The beneficial effects of the above technical solution are as follows:
[0108] This approach allows error detection to begin immediately after code is entered into the editor, minimizing the error rate during code writing and reducing the workload for later code maintenance. Furthermore, since all error detection is performed before the code is written, users do not need to retest the code's correctness at runtime, saving them time and effort.
[0109] As one embodiment of the present invention: such as Figure 7 and Figure 8 As shown, after the code editor receives the user's input code, it also includes:
[0110] The code recognition mechanism, which triggers the import of input code and code information through the first code transfer page of the online editor, is used to identify code type, code development environment, and code chain text.
[0111] Based on the recognition results of the code recognition mechanism, the pre-compilation environment is automatically configured, and shortcut keys and commonly used statements for the corresponding code type are generated in the pre-compilation environment.
[0112] The principle behind the above technical solution is as follows:
[0113] In practice, when the code editor receives user input code, the system triggers a code recognition mechanism on the online editor's first code transfer page, initiating the input code and information processing. This step enables automatic understanding and processing of the code. Next, the code recognition mechanism identifies the code type, development environment, and code chaining. This allows the system to understand the specific content and context of the user's input, providing better assistance. Then, based on the recognition results, the system automatically configures a pre-compilation environment. This step makes programming easier and reduces errors. Finally, in the pre-compilation environment, the system generates shortcut keys and commonly used statements for the corresponding code type.
[0114] The beneficial effects of the above technical solution are as follows:
[0115] The quick-setup code recognition mechanism and pre-compilation environment greatly improve users' programming efficiency, enabling them to complete more programming tasks in a shorter time.
[0116] As one embodiment of the present invention: the detection information is reflected from the cloud server to the user terminal;
[0117] Among them, when code completion prompts are present in the detection information, the code completion location and the completed code text are determined based on the preset standard code database and the prompt semantics in the prompt information;
[0118] Generate quick completion suggestion buttons based on the code completion location;
[0119] Generate a list of completed codes based on the completed code text and the shortcut completion suggestion keys;
[0120] When the system receives a first trigger command from the user for any completion code in the completion code list and a second trigger command for the shortcut key, it will perform auto-completion.
[0121] The principle behind the above technical solution is as follows:
[0122] In practice, when a user enters code in the code editor, relevant detection information is retrieved from a cloud server. This monitoring information displays the code completion status, allowing the user to choose whether to accept code completion suggestions. When code completion suggestions are present in the detection information, the system uses a pre-set standard code database and the semantics of the suggestions to determine the location and text of the completed code. This ensures the system provides accurate and effective code completion suggestions to the user. Based on the location of the completed code, the system generates quick completion suggestion buttons. These buttons simplify the user's workflow and improve their programming efficiency. Next, a complete list of completed codes is generated by combining the completed code text and the quick completion suggestion buttons. This list contains all relevant code for the user to directly access when needed. When the user receives a first trigger command for completing any item in the completed code list and a second trigger command for the quick suggestion buttons, the system will perform automatic completion. This further optimizes the user's programming process and improves their work efficiency.
[0123] The beneficial effects of the above technical solution are as follows:
[0124] This invention can automatically complete code; if the input code is found to be incomplete or contains errors, it will automatically complete it.
[0125] As one embodiment of the present invention: after the code editor receives the user's input code, it further includes:
[0126] Create a unique editing space for the corresponding input code, and set exclusive permissions for the unique editing space;
[0127] Based on exclusive permissions, set editing verification conditions. When a user meets the editing verification conditions, the corresponding user is authorized to connect to the display interface of the unique editing space to edit the code.
[0128] The principle behind the above technical solution is as follows:
[0129] In practice, when a user attempts to edit their code in the code editor, the system will create a unique editing space for them. This space will have a unique identifier to ensure it belongs only to the user. Simultaneously, the system will set exclusive permissions for this space, allowing only the user to access and edit. Based on the user's permissions, the system will set editing verification conditions. For example, users may need to meet certain knowledge or experience requirements to be allowed to edit their code. If the user meets these verification conditions, the system will authorize the user to enter the editing interface and authenticate the user to ensure they are a legitimate editor. The system can also provide a display interface allowing users to view their code and editing status on a page. This interface may include features such as code folding, collapsing, and tagging to help users better organize and manage their code.
[0130] The beneficial effects of the above technical solution are as follows:
[0131] Each user who enters code has a unique development space, preventing confusion in user script development.
[0132] As an embodiment of the present invention: the component editing recommendation interface for building code revisions further includes:
[0133] Obtain at least one revision measure corresponding to the detection information in the component editing recommendation interface; and
[0134] From the detection information, identify at least one code revision item and obtain at least one revision measure; and
[0135] Based on at least one revision measure, the priority order of the revision measure set is obtained from the component editing recommendation interface, which includes multiple revision measures, and then fed back to the user.
[0136] The principle behind the above technical solution is as follows:
[0137] In practical implementation, after building the code revision recommendation interface, at least one revision measure should be obtained from the detection information. The most relevant or most important revision measures should be identified and recommended to the user. After obtaining the revision measures, the system needs to prioritize them. This process can be based on factors such as the importance of the revision measures or the difficulty of implementation to provide the best recommendations to the user. Finally, one or more revision measures that best meet the current user's needs will be extracted from the ranked set of revision measures and fed back to the user. This ensures that regardless of the user's programming experience and goals, they will receive the most suitable revision suggestions.
[0138] The beneficial effects of the above technical solution are as follows:
[0139] During revisions, the system can prioritize and recommend revision options based on the code editing needs and priorities.
[0140] As an embodiment of the present invention: the component editing recommendation interface for building code revisions further includes:
[0141] When it is detected that there is no required editing component in the component editing recommendation interface, an external editing tool library is connected, and an editing tool loading interface is generated based on the external editing tool library; the external editing tool library is used to set up various code editing tools.
[0142] In response to the establishment of a connection between an external editing tool library and an online code editor service, the system controls the loading of editing tools by the online code editor, generates a second component editing recommendation interface, and displays the edited content of the code entered in the online editor on the second component editing recommendation interface.
[0143] The principle behind the above technical solution is as follows: When building the code revision recommendation interface, if it detects that the recommended component editing interface does not have the required editing component, we connect to an external editing tool library and generate the corresponding editing tool loading interface based on the library's requirements. This allows us to provide more accurate and efficient code editing tools according to the user's actual needs. When the external editing tool library establishes a connection with the online code editor service and controls the editing tools loaded by the online code editor, we generate a second component editing recommendation interface. This interface displays the edited code entered by the user in the online code editor, allowing users to view and manage all their code editing information from any editing interface.
[0144] The beneficial effects of the above technical solution are as follows:
[0145] By connecting to external editing tool libraries and generating corresponding editing tools based on users' actual needs, as well as displaying all of the user's code editing information through two component editing recommendation interfaces, the editing tools can be expanded.
[0146] As one embodiment of the present invention, the present invention proposes a code editing system based on a low-code development platform, comprising:
[0147] Cloud server: used to pre-configure the online code editor; the online code editor is configured with development components and detection components;
[0148] Online code editor: After receiving user input code, it parses the input code, determines the class name, and detects information based on class name reflection;
[0149] The detection information is determined by the detection component through the detection of the input code. The detection information includes: code completion suggestions, code chain error messages, and code variables.
[0150] User-side: Used to build a component editing recommendation interface for code revisions based on detection information.
[0151] The principle behind the above technical solution is as follows: This invention comprises two parts: a user client and a cloud server. The user client refers to individuals or teams using a low-code development platform, who can access powerful code editing functions through the cloud server. The cloud server has a built-in online code editor that easily supports multiple programming languages and development frameworks.
[0152] Specifically, the online code editor is pre-configured by a cloud server. It integrates development and detection components that automatically recognize the code written by the user and provide corresponding feedback based on the code's content. Specifically, when the user enters code into the code editor, the cloud server parses the code, extracts the class names, and then uses reflection based on these class names to obtain detection information.
[0153] This detection information is processed and analyzed by the detection component. It provides code completion suggestions; for example, when a user attempts to write a function named "hello," the system will suggest adding "function" before the filename to prevent incorrect type input. Furthermore, the detection component identifies chained errors in the code; for instance, it issues a warning if the user uses an undefined variable or function. Finally, the component checks the correctness of variables in the code; if correct, it returns "correct"; otherwise, it issues an error message.
[0154] Based on this detection information, the cloud server will build a component editing recommendation interface for code revisions. On this interface, users can see all the modification suggestions provided by the system and choose to accept or reject them according to their needs. If these modification suggestions are accepted, they will be automatically applied to the code, allowing for rapid iteration and debugging. If these modification suggestions are rejected, users can also manually view the reasons for the errors and fix them.
[0155] The beneficial effects of the above technical solution are as follows:
[0156] Code Editor: Provides online text editing features, supporting syntax highlighting, automatic indentation, code folding, and more, helping developers write more standardized and readable code. Supports multiple programming languages, including but not limited to JavaScript, Java, and CSS.
[0157] Code completion: After the user enters code, the browser sends the input and code information to the server. The server parses the input and code information to obtain the actual class name, uses reflection to retrieve related variables, methods, and other suggestible information, converts the information packet into a specific format, and returns it to the browser for rendering and display. The user can select or use the tab key to select suggested code for input. It supports automatic completion of chained code and automatic completion of generic information in the code, reducing input time and error rate.
[0158] Automatic import: When saving, the system can automatically identify the classes or methods that need to be imported and automatically add the corresponding import statements. This feature can improve programming efficiency and allow developers to focus on the implementation of code logic rather than tedious import operations.
[0159] Pre-compilation: sunway_IDE provides a manual compilation function. The pre-compilation stage can be used to perform static analysis and syntax checks, identify potential problems in advance, and provide fix suggestions, thereby improving code quality.
[0160] Keyboard shortcuts: sunway_IDE includes a rich set of built-in keyboard shortcuts for convenient and quick access to frequently used operations during coding. When the built-in shortcuts don't meet user needs, custom shortcuts can be created to satisfy more personalized requirements.
[0161] Version control: A self-developed version control mechanism ensures that a file can only be edited by one person at a time, preventing code conflicts. It supports viewing and rolling back code commit history, guaranteeing project security.
[0162] Cross-platform support: No local installation is required; simply access and use it through a browser. It supports all major operating systems and devices. Responsive design ensures a good user experience on various screen sizes.
[0163] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A code editing method based on a low-code development platform, characterized by, The user terminal and the cloud server are included, and the cloud server is built-in with an online code editor; The online code editor is set in the cloud server in advance; wherein the online code editor is configured with a development component and a detection component; After the online code editor receives the input code of the user, the cloud server analyzes the input code to determine the class name and the detection information reflected based on the class name; The detection information is determined by the detection component detecting the input code, and the detection information includes code completion prompt information, code chain error information and code variable; The detection component performs detection of the input code in the pre-compilation phase, and the detection component includes a static analysis component, a syntax detection component and a chain code error detection component; The static analysis component is configured with a first analysis trigger condition and a second analysis trigger condition, wherein the first analysis trigger condition is configured to be triggered after the user inputs the code, and the second analysis trigger condition is configured to generate a temporary trigger signal when the first analysis trigger condition has been triggered and a Boolean event is generated; The syntax detection component is configured to be triggered synchronously when the first analysis trigger condition is triggered; The chain code error component is configured to be triggered after the first analysis trigger condition is triggered or after the second analysis trigger condition is triggered; The online code editor also includes: Triggering a code recognition mechanism for importing input code and code information through a code first transfer page of the online editor; wherein the code recognition mechanism is used to identify the code type, the code development environment and the code chain text; According to the recognition result of the code recognition mechanism, the pre-compilation environment is automatically configured, and the shortcut keys and common statements corresponding to the code type are generated in the pre-compilation environment; According to the detection information, a component editing recommendation interface for code revision is constructed; The component editing recommendation interface for code revision also includes: Obtaining at least one revision measure corresponding to the detection information in the component editing recommendation interface; and From the detection information, at least one revision measure is obtained from at least one code revision item; and Based on the at least one revision measure, the priority order of the revision measure set is obtained from the component editing recommendation interface including a plurality of revision measures, and is fed back to the user terminal.
2. The code editing method based on a low-code development platform according to claim 1, wherein, The online editor is connected with a public script library, wherein the public script library is used to identify the user terminal accessing the online editor, and the user terminal includes a third-party application, a dedicated application program and a third-party browser; When the cloud server receives a first development access request of the third-party application, the development operation development permission is determined through a second development access request, and the corresponding code editing environment is configured; wherein the third-party application is an application development program; When the cloud server receives a second development access request of the third-party browser, the execution system and the execution device of the development operation are determined through the second development access request, and the corresponding development environment is configured; When the cloud server receives a third development access request of the dedicated application program, the display interface adaptation is performed between the third development access request and the development device.
3. The code editing method based on a low-code development platform according to claim 1, wherein, The development component includes an editing component and a function component; wherein The editing component includes: an online text editing component, a syntax highlighting component, an automatic indentation control component; wherein the online text editing component is adapted to the corresponding function component according to the programming language; The function component includes a shortcut operation control component, a code folding component, and a code visualization component.
4. The code editing method based on a low-code development platform according to claim 1, wherein, The detection information is reflected to the user end by the cloud server; When the code completion prompt information exists in the detection information, the code completion position and the completion code text are determined based on the preset standard code database and the prompt semantics in the prompt information; According to the code completion position, a shortcut completion prompt key is generated; According to the completion code text and the shortcut completion prompt key, a completion code list is generated; When the user end receives a first trigger instruction of any completion code in the completion code list and a second trigger key of the shortcut prompt key, automatic completion is performed.
5. The code editing method based on a low-code development platform according to claim 1, wherein, When the online code editor receives the input code of the user, it further includes: A unique editing space corresponding to the input code is constructed, and the exclusive authority of the unique editing space is set; According to the exclusive authority, the editing verification condition is set, and when the user end meets the editing verification condition, the corresponding user end is authorized to connect the display interface of the unique editing space for code editing.
6. The code editing method based on a low-code development platform according to claim 1, wherein, The component editing recommendation interface for building code revision further includes: When it is detected that the component editing recommendation interface does not have the required editing component, an external editing tool library is connected, and an editing tool loading interface is generated based on the external editing tool library; wherein the external editing tool library is used to set a variety of code editing tools; In response to the connection between the external editing tool library and the online code editor service, the editing tool loaded by the online code editor is controlled, a second component editing recommendation interface is generated, and the editing content of the input code on the online editor is displayed on the second component editing recommendation interface.
7. A code editing system based on a low-code development platform, characterized by, It includes: Cloud server: used for pre-setting online code editor; wherein the online code editor is configured with development component and detection component; Online code editor: used for receiving input code of user, analyzing input code, determining class name and reflecting detection information based on class name; Wherein, the detection information is determined by the detection component detecting the input code, and the detection information includes: code completion prompt information, code chain error information and code variable; The detection component performs detection of the input code in the pre-compilation stage, and the detection component includes: static analysis component, syntax detection component and chain code error detection; Wherein, the static analysis component includes a first analysis trigger condition and a second analysis trigger condition, wherein the first analysis trigger condition is configured to be triggered after the user inputs the code, and the second analysis trigger condition is configured to generate a temporary trigger signal when the first analysis trigger condition has been triggered and a Boolean event is generated; The syntax detection component is used to trigger synchronously when the first analysis trigger condition is triggered; The chain code error component is used to trigger after the first analysis trigger condition is triggered or after the second analysis trigger condition is triggered; When the online code editor receives the input code of the user, it further includes: The code recognition mechanism for importing input code and code information is triggered through a code first transfer page of an online code editor; wherein the code recognition mechanism is used to recognize code type, code development environment and code chain text; According to the recognition result of the code recognition mechanism, a pre-compiled environment is automatically configured, and shortcut keys and common statements corresponding to the code type are generated in the pre-compiled environment; User end: for constructing a component editing recommendation interface for code revision according to the detection information; The component editing recommendation interface for code revision also includes: At least one revision measure corresponding to the detection information in the component editing recommendation interface is obtained; and At least one revision measure is obtained from at least one code revision item in the detection information; and Based on the at least one revision measure, the priority order of the revision measure set is obtained from the component editing recommendation interface including a plurality of revision measures, and is fed back to the user end.
Citation Information
Patent Citations
Code editing method and device, server, user equipment and storage medium
CN112817583A
Code processing method and device, equipment and medium
CN118535141A
System and method for software development on mobile devices
US20240111501A1