Input association prompting method and device of code editor, equipment and medium
By obtaining browser information to write compatibility code, calling the browser interface for structural and semantic analysis, and combining context-aware analysis with database matching, the accuracy and real-time performance issues of input association prompts in code editors in complex scenarios are solved, thereby improving development efficiency and quality.
Patent Information
- Application Number
- CN202510722337.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-12
AI Technical Summary
Existing code editors lack accuracy and real-time performance in input association prompts in complex scenarios, and are unable to fully utilize server-side computing resources, resulting in limited development efficiency and quality.
By obtaining the browser information corresponding to the code editor, writing compatibility code, calling the browser interface to obtain the input code, performing structural and semantic analysis, combining context-aware analysis, and matching with the preset database, the network communication protocol is used to send input association prompts.
It improves the real-time and accuracy of code writing, reduces the error rate, improves development efficiency and quality, and enhances the applicability and versatility of the system.
Smart Images

Figure CN120631329A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent decision-making technology, and in particular to an input association prompt method, device, equipment and medium for a code editor. Background Art
[0002] The current programming environment is becoming increasingly complex, involving numerous programming languages, frameworks, and tools. To improve development efficiency, many integrated development environments and code editors provide code auto-completion, smart prompts, and code snippets.
[0003] For example, locally deployed development environments provide code input association prompts through built-in or plug-in forms. Online code editors provide code input association prompts through the server.
[0004] In the healthcare sector, for example, developing an online medical service platform requires processing a vast amount of medical data, such as symptom descriptions, test results, and diagnoses, when writing code for a patient medical record management system. When new disease types emerge or medical terminology is updated, code association prompts cannot keep up quickly, forcing developers to manually search and write relevant code, extending the development cycle. Due to the specialized nature and complexity of the medical field, code association prompts can provide inaccurate code suggestions. For example, when processing diagnostic codes for rare diseases, incorrect codes or outdated diagnostic criteria may be prompted. This can lead to incorrect entry of medical record data, impacting subsequent medical decisions and patient treatment outcomes.
[0005] In the fintech sector, for example, developing an intelligent wealth management system. Financial regulations and policies change frequently, and code association prompts may not accurately reflect the latest regulatory requirements and business logic. For example, when writing the return calculation code for a wealth management product, an incorrect interest rate calculation method may be prompted, affecting the accuracy of the return calculation and harming investors' interests.
[0006] The inventors realized that the input association prompt effect of the above code editing mainly relies on local processing and cannot fully utilize the computing resources of the server. As a result, when analyzing complex scenarios, the accuracy and real-time performance of the input association prompt are limited, affecting development efficiency and quality.
[0007] Therefore, the problems of real-time performance and accuracy in the code editing input association in the prior art need to be solved urgently. Summary of the Invention
[0008] The present invention provides an input association prompt method, device, equipment and medium for a code editor to solve the accuracy and real-time problems of input association prompts in complex scenarios, thereby improving development efficiency and quality.
[0009] In a first aspect, a method for providing an input association prompt for a code editor is provided, comprising:
[0010] Obtaining browser information of a browser corresponding to the code editor, and writing compatibility code according to the browser information;
[0011] Calling the browser interface corresponding to the code editor through the compatibility code to obtain the input code;
[0012] Performing structural and semantic analysis on the input code to obtain basic analysis results;
[0013] Performing context-aware analysis on the basic analysis results to obtain code analysis results;
[0014] The code analysis result is matched with a preset database display code to obtain an input association prompt, and the input association prompt is sent to a display interface corresponding to the code editor using a preset network communication protocol.
[0015] In a second aspect, an input association prompt device for a code editor is provided, comprising:
[0016] A writing module, used to obtain browser information of the browser corresponding to the code editor and write compatibility code according to the browser information;
[0017] A calling module, configured to call a browser interface corresponding to the code editor through the compatibility code to obtain an input code;
[0018] An analysis module, configured to perform structural and semantic analysis on the input code to obtain basic analysis results;
[0019] A perception module, configured to perform context-aware analysis on the basic analysis results to obtain code analysis results;
[0020] The matching module matches the code analysis result with the display code of a preset database to obtain an input association prompt, and sends the input association prompt to the display interface corresponding to the code editor using a preset network communication protocol.
[0021] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the input association prompt method of the above-mentioned code editor are implemented.
[0022] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the input association prompt method of the above-mentioned code editor are implemented.
[0023] In the scheme implemented by the above-mentioned code editor input association prompt method, device, equipment and medium, by obtaining browser information of the browser corresponding to the code editor and writing compatibility code, the system can ensure stable operation in different browser environments, avoid functional abnormalities caused by browser differences, and enhance the applicability and versatility of the system; calling the browser interface through the compatibility code to obtain the input code ensures the accuracy and stability of the code acquisition process; performing structural and semantic analysis on the input code to obtain basic analysis results helps to understand the basic logic and meaning of the code, providing a basis for subsequent more in-depth analysis; performing context-aware analysis on the basic analysis results to obtain code analysis results, which can combine the context information of the code to more accurately grasp the code intent and prompt the accuracy of the input association prompt; matching the code analysis results with the display code of a preset database to obtain input association prompts, and sending them to the display interface using a preset network communication protocol, providing users with intelligent code writing assistance, saving users time in searching for code, improving the real-time and accuracy of code writing, significantly improving the user's code writing experience, reducing the difficulty and error rate of code writing, accelerating the development process, and helping to improve the overall project development efficiency and quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0025] Figure 1 This is a schematic diagram of an application environment of an input association prompt method for a code editor according to an embodiment of the present invention;
[0026] Figure 2 This is a flow chart of an input association prompt method for a code editor according to an embodiment of the present invention;
[0027] Figure 3 yes Figure 1 A schematic flow chart of a specific implementation of step S3;
[0028] Figure 4 yes Figure 1 A schematic flow chart of a specific implementation of step S5;
[0029] Figure 5 This is a structural diagram of an input association prompt device of a code editor according to an embodiment of the present invention;
[0030] Figure 6is a structural diagram of a computer device in one embodiment of the present invention;
[0031] Figure 7 FIG. 2 is another structural diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0033] The embodiment of the present invention provides an input association prompt method for a code editor, which can be applied in the following situations: Figure 1 In an application environment, the client communicates with the server through a network. The server can obtain browser information of the browser corresponding to the code editor, write compatibility code according to the browser information; call the browser interface corresponding to the code editor through the compatibility code to obtain input code; perform structural and semantic analysis on the input code to obtain basic analysis results; perform context-aware analysis on the basic analysis results to obtain code analysis results; match the code analysis results with the display code of a preset database to obtain input association prompts, send the input association prompts to the display interface corresponding to the code editor using a preset network communication protocol, and feed back the input association prompts to the client. The present invention provides an input association prompt device for a code editor, which significantly improves the real-time and accuracy of code writing by obtaining input association prompts for code writing for target result business, reduces the difficulty and error rate of code writing, speeds up the development process, and helps to improve the development efficiency and quality of the overall project. The client can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices. The server can be implemented with an independent server or a server cluster consisting of multiple servers. The present invention is described in detail below through specific embodiments.
[0034] See also Figure 2 As shown, Figure 2 A flowchart of an input association prompt method for a code editor provided by an embodiment of the present invention includes the following steps:
[0035] S1. Obtain browser information of a browser corresponding to a code editor, and write a compatibility code according to the browser information.
[0036] In the example of the present invention, the code editor is a code editing tool that runs based on a web browser. It is an editor that can write, debug and run codes online through a browser without the need to install special software locally.
[0037] The browser information includes the browser type and version number, protocol support, event monitoring mechanism characteristics, input method processing compatibility flag, page visibility interface support, and current network environment type.
[0038] In an embodiment of the present invention, writing the compatibility code according to the browser information includes:
[0039] Performing data standardization and structuring processing on the browser information to obtain a structured configuration object;
[0040] Converting the structured configuration object into executable code logic;
[0041] The executable code logic is converted into a compatible code.
[0042] In the embodiment of the present invention, data standardization involves converting data in different formats and ranges within the browser information into a unified and standardized form through data cleaning, data conversion, and data normalization. Data structuring involves organizing the standardized data into objects according to certain rules, with each data item corresponding to a key-value pair within the object, resulting in a structured configuration object.
[0043] Specifically, the structured configuration object is a standardized data model instance that follows preset specifications. The instance stores the browser type and its version number, the protocol support status, the event listening mechanism characteristics, the input method processing compatibility flag, the page visibility interface support and the current network environment type in a structured format (such as JSON, XML).
[0044] In this embodiment of the present invention, the structured configuration object is converted into executable code logic by parsing and matching the structured configuration object based on a predefined set of rules, algorithms, and policies using a preset policy decision engine. The preset policy decision engine is a tool that can provide intelligent decision support for different business scenarios based on complex decision rules. By separating business logic from policy rules, it enables centralized management and flexible regulation of rules.
[0045] The parsing process involves the preset policy decision engine extracting, converting, and semantically understanding the fields of the structured configuration object (e.g., browser type) according to predefined rules, converting them into a parameter structure recognizable by the preset policy decision engine. The matching process involves the preset policy decision engine searching for corresponding logical mapping relationships in predefined rule sets, algorithms, and policies based on the parsed parameters, and obtaining the executable code logic through conditional judgment, pattern recognition, and other methods.
[0046] Specifically, the parameter structure refers to a structured data format that conforms to the internal logical recognition specifications of the preset policy decision engine. This format usually includes unified naming of fields (such as mapping browser type to BrowserType), data type conversion, value range normalization and definition of association relationships between fields (such as combining browser type and version number to form a version feature parameter group).
[0047] In an embodiment of the present invention, converting the executable code logic into compatible code involves selecting an appropriate template from a preset templated code based on key information and rules within the executable code logic, and then filling the template with specific parameters and content within the executable code logic, thereby generating compatible code that complies with the browser. The preset templated code includes a code structure and basic framework that meets compatibility requirements in different scenarios.
[0048] The compatibility code refers to the code that can run normally and perform consistently in different browsers, different devices, different operating systems and different environments in software development.
[0049] In an embodiment of the present invention, the protocol support status refers to the browser's support status for the network communication protocol, including whether it supports the network communication protocol interface, whether it is compatible with different versions of protocol specifications, whether it can handle parameter negotiation during the protocol handshake process, and its support capabilities for advanced features such as binary data transmission and message fragmentation.
[0050] The event monitoring mechanism characteristics refer to the way the browser monitors and responds to various events (such as connection opening, message reception, connection closing, and error occurrence) in network communication protocol communications, including the timing of event triggering and parameter transmission rules.
[0051] Specifically, the input method processing compatibility flag refers to the browser's compatibility with different input methods (such as Pinyin, Wubi, and Handwriting) in the network communication protocol message input scenario, including cursor positioning accuracy when the input method is activated, the timeliness of synchronizing input content to the network communication protocol send buffer, character encoding processing when switching between multiple language input methods, and protocol message parsing consistency when inputting special symbols. The page visibility interface support refers to whether the browser supports monitoring the page visibility status through the page visibility interface.
[0052] In embodiments of the present invention, data cleaning refers to identifying, deleting, and completing invalid data, such as erroneous values, missing values, and duplicate values, in the browser information. Data conversion involves converting data in different formats into a unified data type or structure, such as converting a browser version number string into a structured array that facilitates numerical comparison. Data normalization involves mapping data of different ranges to specific intervals, such as scaling the latency of a network communication protocol connection (in milliseconds) to the interval [0, 1] via a linear transformation.
[0053] In an embodiment of the present invention, the certain rules are predefined rules that determine how data is organized based on the inherent logic of the data, business requirements, and the convenience of subsequent processing and use. For example, when standardizing and structuring the browser information, the rules may consider the relevance and hierarchical relationships between the data, grouping data related to the browser's own attributes (such as browser type and version number) and arranging the structure order based on the data's importance and frequency of use.
[0054] Specifically, the key-value pair is a way of storing and representing data, where the key is a descriptive name used to identify the meaning of a data item, and the value is the specific content of the data item. In the structured configuration object, each data item will exist in the form of a key-value pair.
[0055] In the embodiments of the present invention, the predefined rule set is a series of pre-defined, clear, and targeted conditions and criteria developed based on an understanding of different browser characteristics, environments, and business requirements. The predefined algorithm is a series of computational steps and methods used to process the relationship between the structured configuration object and the predefined rule set. The predefined strategy is a decision-making solution developed based on the predefined rule set and the predefined algorithm, taking into account multiple factors such as business objectives, performance requirements, and compatibility requirements.
[0056] For example, imagine a medical software company developing a comprehensive electronic medical record management system. The development team uses a web browser-based code editor to write code for functional components such as patient information management, medical image processing, and remote diagnosis. Due to differences in browser type, version number, protocol support, event monitoring mechanism characteristics, input method processing compatibility flags, page visibility interface support, and current network environment type, components run differently across browsers. To address this, developers obtain browser information, standardize data formats such as version numbers, clean up errors and missing values, convert data types, and perform normalization. They then structure the standardized data according to predefined rules to form a structured configuration object. Using a predefined policy decision engine, the structured configuration object is parsed and matched based on a predefined set of rules, algorithms, and policies to generate executable code logic. Appropriate templates are selected from the predefined templated code to populate the parameters in the executable code logic, generating compatible code. This ensures stable operation of the electronic medical record management system components across different browsers and provides a stable environment for input suggestion.
[0057] In an embodiment of the present invention, by obtaining browser information corresponding to a code editor and writing compatibility code based on the browser information, the stability of the code editor's operation is enhanced and the user experience is improved. Performing compatibility processing in advance can reduce subsequent maintenance costs and avoid frequent code modifications due to browser upgrades or the emergence of new browsers.
[0058] S2. Call the browser interface corresponding to the code editor through the compatibility code to obtain an input code.
[0059] In an embodiment of the present invention, the browser interface corresponding to the code editor is an interface related to Document Object Model (DOM) operations and an event listening interface. The Document Object Model is a programming interface that converts Hypertext Markup Language (HTML) documents into a tree-structured object model. Each element in the document (such as a tag, text, attributes, etc.) is abstracted as a node object, forming a hierarchical structure consisting of parent nodes, child nodes, and sibling nodes, which is used to describe the logical structure and content of the document.
[0060] The DOM operation-related interfaces refer to the methods and properties used to access, modify, and manage nodes in the DOM tree, enabling updates to the document structure and content. The event listening interface is a mechanism provided by the DOM for binding and processing events. It allows code to monitor user operations (such as clicks and keyboard input) or browser behaviors (such as page loading and window size changes) on documents or elements, and register callback functions for the user operation event types using the addEventListener method.
[0061] In an embodiment of the present invention, the compatibility code calls the browser interface corresponding to the code editor to obtain the input code, including:
[0062] Deriving the available interface types of the browser according to the compatibility code;
[0063] Generate calling code according to the available interface type;
[0064] The calling code is run to obtain the input code.
[0065] In an embodiment of the present invention, deriving the available interface types of the browser based on the compatibility code refers to determining the available interface types by parsing the structured configuration object corresponding to the compatibility code, reading the protocol configuration information in the runtime configuration transport protocol (runtimeConfig.transport), and for example, if the network communication protocol is enabled and the configuration parameters meet the settings, then including it in the basic communication interface range; if not, then excluding it, thereby screening out the adapted basic communication interfaces. Based on the characteristics of the event monitoring mechanism, determining whether the interface can trigger and respond to specific events; filtering out interfaces that are incompatible with the input logic of different input methods based on the input method processing compatibility flag; and excluding interfaces that do not support the page status detection function based on the page visibility interface support, thereby completing the screening of advanced function interfaces. The performance and stability of the candidate interfaces under current conditions are evaluated in combination with runtime constraints (such as the current network environment type), and interfaces that do not meet the runtime constraints are excluded. The remaining interfaces that meet all the screening conditions are stored in the form of a data list, where each element in the list represents an available interface type, and the characteristics, functions, and usage of the interface are added to obtain the available interface type.
[0066] In an embodiment of the present invention, generating calling code based on the available interface type means writing the calling code based on the characteristics, functions, and usage of the available interface type, such as the interface's input parameters, return value type, and call preconditions, in combination with the programming language's grammatical specifications and the overall style of the project code. For example, according to the interface input parameter requirements, parameters of the required type and quantity are prepared. If the parameter is a complex object, the correct value must be assigned based on its structure; if there is a default value, whether to overwrite it is determined as needed.
[0067] In an embodiment of the present invention, running the calling code to obtain the input code means triggering and running instructions in the compatibility code that interact with the browser interface according to the code running logic in the calling code to obtain the input code.
[0068] In embodiments of the present invention, using the compatibility code to call the browser interface corresponding to the code editor to obtain input code can improve development efficiency, leverage the browser's existing functions and resources, and reduce development workload and time costs. In terms of system scalability and flexibility, the browser interface facilitates the integration of the code editor with other systems or services, allowing for easy connection with cloud storage, version control systems, and other systems, enabling code storage, sharing, and collaborative development, thereby enhancing the functionality and practicality of the code editor.
[0069] For example, in telemedicine scenarios within the healthcare and health sector, technicians can access code through a browser by calling this API to optimize remote diagnosis and treatment platforms. Using this code, they can adjust the image quality and smoothness of video consultations and optimize the data transmission stability of remote monitoring devices in different browser environments, providing patients with timely and accurate telemedicine services, breaking geographical restrictions and enabling wider sharing of high-quality medical resources.
[0070] S3. Perform structural and semantic analysis on the input code to obtain basic analysis results.
[0071] In the present invention, see Figure 3 As shown, the structural and semantic analysis of the input code is performed to obtain basic analysis results, including:
[0072] S31, performing lexical analysis on the input code to obtain a lexical unit sequence;
[0073] S32, performing grammatical analysis on the lexical unit sequence to obtain an abstract syntax tree;
[0074] S33: Perform semantic analysis on the abstract syntax tree to obtain a basic analysis result.
[0075] In an embodiment of the present invention, the lexical analysis is to identify the character sequence in the code according to the lexical rules of the target programming language through a scanner according to the lexical rules of the target programming language, and divide it into lexical units (Tokens) such as keywords (such as if, for), identifiers (variable names, function names), constants (numerical values, strings), operators (+, =), delimiters (brackets, semicolons), etc., and store the identified lexical units in the order of their appearance in the code to form a lexical unit sequence.
[0076] In an embodiment of the present invention, the grammatical analysis uses a grammatical analyzer to perform grammatical rule matching on the lexical unit sequence obtained by the lexical analysis according to the grammatical rules of the target programming language. The grammatical rule matching is to parse and verify the grammatical structure of the lexical unit sequence output by the lexical analyzer based on the grammatical rules of the target programming language. The grammatical analyzer combines the lexical unit sequence into a hierarchical structure that conforms to the grammatical rules through a top-down or bottom-up parsing strategy, and checks whether there are grammatical errors (such as mismatched brackets, incorrect sentence structure, incorrect keyword order, etc.) during this process. If the parsing is successful, a legal Abstract Syntax Tree (AST) is constructed.
[0077] In the embodiment of the present invention, the semantic analysis of the abstract syntax tree to obtain a basic analysis result includes:
[0078] Traversing the abstract syntax tree to establish a symbol table;
[0079] Performing type and control flow verification on the symbol table to obtain verification information;
[0080] The symbol table and the verification information are combined to obtain a basic analysis result of the input association prompt.
[0081] In the examples of the present invention, the symbol table is a data structure used in the semantic analysis to store various identifiers (such as variable names, function names, class names, type names, etc.) that appear in the source program and the types, scopes, storage locations, etc. of the identifiers. For example, when developing an intelligent investment analysis system in the field of financial technology, developers write algorithmic codes for analyzing stock trends, calculating investment portfolio risk returns, etc., which involve a large number of variables (such as stock price variables, investment amount variables), functions (such as return calculation functions, risk assessment functions) and custom classes (such as investment portfolio classes). The symbol table records these identifiers, clarifies the variable types (such as floating-point prices, integer quantities), defines their scopes, and marks the storage locations so that the program can efficiently access and operate data. Through the management of the symbol table, when performing semantic analysis, the system can quickly determine whether the identifiers in the code are used correctly, avoid deviations in investment analysis results caused by problems such as repeated variable definitions and function call errors, and ensure the stable and accurate operation of the intelligent investment analysis system.
[0082] Specifically, the traversal begins at the root node of the abstract syntax tree and, following a depth-first or breadth-first traversal strategy, sequentially visits each child node in the abstract syntax tree until all nodes have been processed. When visiting each node, the parser analyzes the node's type (e.g., variable declaration node, function definition node, type definition node, etc.), extracts identifiers from the source program (e.g., variable names, function names, type names), and collects semantic information related to these identifiers (e.g., identifier type, scope level, storage location constraints, etc.).
[0083] Among them, traversing the abstract syntax tree to establish a symbol table is to traverse the abstract syntax tree, and in the traversal process, identify various identifiers in the source program, such as variable names, function names, type names, etc., and store these identifiers and related information (such as the type, scope, storage location, etc. of the identifier) in the symbol table.
[0084] In the present invention, the type verification is based on the identifier type information recorded in the symbol table to compare whether the expressions and statements in the source program are correct in type. For example, whether the left value and right value types in the assignment statement match, etc. If it is found that the types do not match, it will be marked as a type error in the verification information. The control flow verification is to check whether the control structure (such as conditional statements, loop statements, jump statements, etc.) in the source program is correct in semantics. If it is found that there is a problem with the control flow, it will also be marked as a control flow error in the verification information. The verification information then reflects the error information of the source program in semantics.
[0085] In an embodiment of the present invention, the combining of the symbol table and the verification information to obtain the basic analysis result includes:
[0086] Traversing the symbol table to locate each entry and obtain information about each entry;
[0087] Matching each item of information with the verification information to obtain associated set information;
[0088] The association set information is added to the entry attributes of the symbol table to obtain the basic analysis result.
[0089] In the embodiment of the present invention, traversing the symbol table to locate each entry and obtain information about each entry involves traversing the symbol table, accessing each record therein one by one, determining the specific location of each identifier in the symbol table, and obtaining information contained in each entry. The information about each entry is the record corresponding to each identifier in the symbol table, including information such as the identifier's name, type, scope, and storage location.
[0090] In the example of the present invention, the item information and the verification information are matched to obtain the associated set information based on the key identifiers (such as variable names, function names, scopes, etc.) in the item information, and the associated set information is searched in the verification information. For example, for each item in each item information, the system uses the identifier of the item (such as the variable name) as an index to search for the corresponding verification record in the verification information. If there is a corresponding verification record, whether it is a mark of type verification passed, an error description of type mismatch, or specific information of control flow exception, the record will be associated with the corresponding symbol table entry; if there is no record related to the entry in the verification information, its verification status is defaulted to "no exception" and an association is established. By processing all items in each item information one by one, a complete associated set information is obtained.
[0091] In this embodiment of the present invention, adding the association set information to the entry attributes of the symbol table involves adding the verification information in the association set information to the attributes of each entry in the symbol table. The updated symbol table not only records the basic definition information of the identifier but also records the verification information, thereby forming the basic analysis result.
[0092] In the examples of the present invention, the lexical rules of the target programming language specify the specific forms and matching patterns of character sequences combined into meaningful lexical units, including keywords (such as if, for, while), identifiers (variable names, function names, etc.), constants (integers, floating-point numbers, strings, etc.), operators (+, *, =, etc.), and delimiters (brackets, semicolons, commas, etc.).
[0093] In the example of the present invention, the structural and semantic analysis of the input code is performed to obtain basic analysis results to improve the quality of code input association prompts. The code is decomposed into a sequence of lexical units through lexical analysis, and an abstract syntax tree is constructed through syntactic analysis. The semantic analysis further generates a symbol table and verifies it. This series of operations can comprehensively check whether the code conforms to the grammatical and semantic rules of the language, and promptly discover and locate grammatical errors, type mismatches, undefined variables and other problems in the code, thereby improving the correctness and stability of the code input association prompts.
[0094] For example, in the healthcare sector, structural and semantic analysis of medical information system code (such as electronic health records and medical image processing algorithms) can significantly improve system security and clinical reliability. Specifically, lexical and grammatical analysis can accurately identify medical data format errors, abstract syntax tree traversal can verify the logical integrity of clinical decision support systems (such as nested conditional coverage of drug interaction rules), and symbol table and type verification can ensure the type safety of variables in medical calculations (such as dosage algorithms) (avoiding medication errors caused by misuse of floating-point and integer types).
[0095] S4. Perform context-aware analysis on the basic analysis results to obtain code analysis results.
[0096] The code analysis results include the code's static structural information, such as the definition and declaration of variables, functions, and classes, type information, scope, etc.; the code's dynamic execution information, such as function call relationships, data flow, and control flow direction. For example, when developing a quantitative trading system in the financial technology field, developers write complex trading strategy code that contains a large number of variables (such as transaction amounts and stop-loss thresholds), functions (such as order generation functions and risk assessment functions), and classes (such as trading strategy classes). By performing a basic analysis of the code and then a context-aware analysis, the system can deeply sort out the code's static structural information, clearly grasp the type and scope of each variable, and the definition details of functions and classes; at the same time, it captures dynamic execution information to clarify the order of function calls, the flow path of data between modules, and how the control flow branches and jumps according to changes in market data.
[0097] In an embodiment of the present invention, performing context-aware analysis on the basic analysis result to obtain a code analysis result includes:
[0098] Extracting context information in the code from the basic analysis results;
[0099] Establishing a mapping relationship between the context information and the basic analysis result through association matching;
[0100] Perform dynamic reasoning based on the mapping relationship to obtain a dynamic reasoning prediction result;
[0101] The code analysis result is obtained by summarizing the basic analysis result and the dynamic reasoning prediction result.
[0102] In the example of the present invention, the context information extracted from the code of the basic analysis result is to scan the input code line by line and perform logical analysis based on the updated symbol table in the basic analysis result. For example, for variables, their declaration location, usage scope, and value changes will be collected; for functions, their call relationships, parameter passing, return value processing, etc. will be collected. At the same time, the execution environment information of the code will also be collected, such as the initial state of global variables, the configuration parameters of specific modules, etc. By scanning and logically analyzing the input code line by line, these scattered context information are integrated to finally obtain a complete set of context information. The context information refers to a set of information that is closely related to code elements (such as variables, functions, classes, etc.) around a specific position in the code and can provide semantic and environmental support for it.
[0103] Specifically, the logical analysis implements different actions for different objects. For example, for variables, the declaration position of the variables is clarified based on the declaration information of the variables in the symbol table, and the assignment and reference statements of the variables in the code are analyzed to clarify the scope of use of the variables; for functions, the definition information of the functions in the symbol table is used to search for the function call statement in the input code to obtain the parameter type and value passed when the function is called.
[0104] In the examples of the present invention, the association matching is to classify and organize the context information and basic analysis results, group them according to the same dimensions (such as variables, functions, statements, etc.), and establish a mapping relationship between the groups by comparing key attributes such as identifiers, types, and scopes. For example, the usage of a variable in the context is matched with the declaration information of the variable in the symbol table to determine its semantic consistency at different code locations, and an association matching result is generated based on the matching result to clarify the association relationship between the various elements in the code at different levels. The different levels refer to the division of code elements from multiple dimensions such as the semantic structure, logical relationship, and execution environment of the input code.
[0105] In the examples of the present invention, the dynamic reasoning refers to the process of logically deducing the behavior, state changes, and potential results of the code during operation based on the mapping relationship. For example, the control flow and data flow in the code are analyzed, and the value changes of variables, the call path of the function, and the side effects generated under different conditional branches are considered. By simulating the execution process of the code, the behavior of the code under different input and operating environments is predicted. For example, based on the judgment conditions of the conditional statement and the current value of the variable, which code blocks will be executed are predicted; based on the parameters and return value type of the function, the possible results of the function call are inferred. At the same time, the dynamic characteristics of the code, such as asynchronous operations, exception handling, etc., are also considered to predict possible abnormal situations and errors. Finally, these reasoning and predictions are combined to obtain the dynamic reasoning prediction results of the input association prompt.
[0106] Specifically, control flow refers to the order and path of code execution, which refers to how a program switches and jumps between different code blocks at runtime. For example, conditional statements, loop statements, and jump statements in the code collectively determine the direction of control flow. Data flow refers to the flow and changes of data in the code, which refers to the entire process from data generation (variable declaration and initialization) to data use (participation in expression calculation, passing as function parameters, etc.).
[0107] In the example of the present invention, the code analysis result is obtained by summarizing the basic analysis result and the dynamic reasoning prediction result, which is to integrate the relatively stable element information determined in the basic analysis result with the information about changes and potential possibilities in the code runtime in the dynamic reasoning prediction result. For example, the basic analysis result clarifies the parameter type and return value of a function, while the dynamic reasoning prediction result points out the frequency and scenario in which the function may be called under specific conditions. This information is combined to obtain the code analysis result. The code analysis result is presented in a structured data form, which is a data set containing multiple fields, which may include element definition information, such as variable name, type, scope; function parameter list, return value type, calling relationship; class attributes and methods, etc. At the same time, there is also information obtained by dynamic reasoning prediction, such as the execution results of certain code snippets under specific input, possible abnormal situations, etc.
[0108] In the examples of the present invention, the various contextual information in the code is collected based on the basic analysis results, and the contextual information obtained has many significant benefits. For example, collecting contextual information can fully understand the usage of the code in different scenarios, including the actual value changes of variables, the specific path of function calls, etc.; the association matching process combines this contextual information with the basic analysis results to establish a closer connection between code elements, thereby more accurately identifying potential problems in the code, such as logical errors, improper boundary condition handling, etc.; dynamic reasoning prediction can simulate the behavior of the code under different input and operating environments, predict possible abnormal situations and errors in advance, and improve the accuracy of code input association prompts.
[0109] For example, in the healthcare and health sector, medical information systems require accurate processing and storage of large amounts of patient data. Context-aware analysis ensures that when processing data such as medical records and examination reports from different patients, the code performs the correct operations based on the specific context, avoiding data confusion and errors. For example, when processing data from patients with different departments and conditions, the code can accurately identify the meaning and scope of the data.
[0110] S5. Match the code analysis result with a preset database display code to obtain an input association prompt, and send the input association prompt to a display interface corresponding to the code editor using a preset network communication protocol.
[0111] In an embodiment of the present invention, the preset database refers to a database that is pre-built and stores specific data information to assist in code analysis. For example, when developing an online banking core transaction system in the field of financial technology, when developers write core business codes such as transfers and payments, the system can retrieve standard code patterns from the preset database, such as using a factory pattern to build transaction order creation logic, thereby improving the maintainability and scalability of the code; when a syntax error occurs in the code and the transaction interface cannot be called normally, the system quickly locates the error location and gives detailed error prompts based on the known code errors and their corresponding error information stored in the database, such as pointing out spelling errors in the field name in the statement; for performance bottlenecks caused by complex fund calculation logic in the code, the optimization suggestions in the database will prompt developers to improve computing efficiency through algorithm optimization or caching mechanisms. This improves the accuracy and efficiency of code input association prompts when developing online banking transaction systems.
[0112] Specifically, matching the code analysis results with the database display code to obtain an input association prompt refers to searching the database for codes that are similar or related to the key information in the code analysis results, such as variable names, function definitions, grammatical structures, semantic features, etc. A string matching algorithm is used to calculate the similarity between the code analysis results and each record in the database, and records with higher similarity are selected as matching results for input association prompts. The string matching algorithm searches the database for string data that is similar or related to the key information in the code analysis results (such as variable names, function definitions, and string content involved in the grammatical structure, etc.).
[0113] Furthermore, the network communication protocol refers to the Web Sockets Protocol (WebSocket), which is a network communication protocol that performs full-duplex communication over a single Transmission Control Protocol (TCP) connection. The TCP is a connection-oriented, reliable, byte-stream-based transport layer communication protocol. The Hypertext Transfer Protocol is a simple request-response protocol, typically running on top of the TCP, that specifies the types of messages a client may send to a server and how the server may respond.
[0114] In the present invention, see Figure 4 As shown, the step of sending the input association prompt to the display interface corresponding to the code editor using a preset network communication protocol includes:
[0115] S51, establishing a communication connection using the network communication protocol;
[0116] S52: Encapsulating the input association prompt into a data frame corresponding to the network communication protocol, and transmitting the data frame to a display interface backend corresponding to the code editor via the communication connection;
[0117] S53: Visually analyze the data frame through the display interface background and display it on the display interface corresponding to the code editor.
[0118] In the embodiment of the present invention, establishing a communication connection using the network communication protocol means that the code editor sends a hypertext transfer protocol request, which includes specific header information for requesting an upgrade of the communication protocol from the hypertext transfer protocol to the network communication protocol. Once the upgrade is successful, a persistent, bidirectional network communication protocol connection is established.
[0119] In the examples of the present invention, the encapsulation refers to adding header information, verification information, etc. to the original data of the input association prompt in accordance with the format and rules specified by the network communication protocol, so that it conforms to the data structure required by the protocol and is converted into a standard unit that can be transmitted in the network. The data frame is an encapsulated standard unit, which contains the input association prompt data and the control information required by the protocol. The transmission is to use the established communication connection to send the encapsulated data frame from the sending end to the display interface background corresponding to the code editor safely and orderly. The display interface background corresponding to the code editor is the receiving end, which receives the transmitted data frame.
[0120] In the examples of the present invention, the visual parsing process involves the display interface backend decoding and analyzing received data frames, extracting input-related prompt information, and converting this information into visual content, such as text or icons, displayed on the corresponding display interface of the code editor for intuitive viewing and use by developers. For example, when developing a digital currency trading system in the fintech sector, developers use an online code editor to write trading strategy code. The system backend generates input-related prompts based on market data, historical trading records, and other information, such as intelligently recommended trading algorithm code snippets and risk control function call prompts. These prompts are transmitted to the code editor display interface backend in the form of data frames via a network communication protocol. Upon receiving the data frames, the backend performs visual parsing, decoding and analyzing the originally abstract data frames to extract specific input-related prompt information. For example, recommended trading algorithm code snippets are displayed as highlighted text in the code editing area, with small icons indicating the code function; risk control function call prompts are presented as pop-up windows with brief descriptions. Developers can intuitively access these prompts and quickly integrate relevant code into trading strategies, improving development efficiency and ensuring the functional accuracy and stability of the digital currency trading system.
[0121] In the example of the present invention, the code analysis results are matched with the display code of a preset database to obtain input association prompts, and the input association prompts are sent to the display interface corresponding to the code editor using a preset network communication protocol. There are many benefits. From the perspective of development efficiency, input association prompts can help developers quickly obtain sample code related to the current code analysis results, reducing the time developers spend looking for information and writing code, especially when dealing with complex programming tasks or using unfamiliar libraries and frameworks, which can greatly improve the development speed; in terms of code quality, the code in the database has been screened and organized and has high standardization. The code written by developers with reference to these input association prompts is more likely to comply with industry standards and best practices, thereby reducing the probability of code errors and improving the stability and maintainability of the code; from a learning perspective, for novice developers, input association prompts are a good learning resource, which can enable them to be exposed to excellent code patterns and programming ideas, and promote the improvement of their technical capabilities; the network communication protocol ensures that the input association prompts can be transmitted to the display interface in real time and accurately, allowing developers to obtain the required information in a timely manner and maintain the fluency of development.
[0122] For example, in medical research within the healthcare and health sectors, input predictions can help developers write accurate and efficient data processing and analysis code, accelerating research progress and providing strong support for medical research. Promptly delivering input predictions to the display interface allows medical software development teams to quickly respond to changing requirements and resolve issues, ensuring the stable operation of medical software systems and better serving various efforts within the healthcare and health sectors.
[0123] It can be seen that in the above scheme, for the target result business, the browser information of the browser corresponding to the code editor is obtained, and the compatibility code is written according to the browser information; the browser interface corresponding to the code editor is called through the compatibility code to obtain the input code; the input code is structurally and semantically analyzed to obtain a basic analysis result; the basic analysis result is context-awarely analyzed to obtain a code analysis result; the code analysis result is matched with the preset database to display the code to obtain an input association prompt, and the input association prompt is sent to the display interface corresponding to the code editor using a preset network communication protocol. The user can write code according to the input association prompt, which significantly improves the real-time and accuracy of code writing, reduces the difficulty and error rate of code writing, speeds up the development process, and helps to improve the development efficiency and quality of the overall project.
[0124] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0125] In one embodiment, an input association prompting device for a code editor is provided. The input association prompting device based on a code editor corresponds one-to-one with the input association prompting method based on a code editor in the above embodiment. Figure 5 As shown, the input association prompt device of the code editor includes a writing module 101, a calling module 102, an analysis module 103, a perception module 104 and a matching module 105. The functional modules are described in detail as follows:
[0126] The writing module 101 is used to obtain browser information of the browser corresponding to the code editor and write the compatibility code according to the browser information;
[0127] A calling module 102 is configured to call a browser interface corresponding to the code editor through the compatibility code to obtain an input code;
[0128] An analysis module 103 is configured to perform structural and semantic analysis on the input code to obtain basic analysis results;
[0129] A perception module 104 is configured to perform context-aware analysis on the basic analysis results to obtain code analysis results;
[0130] The matching module 105 matches the code analysis result with a preset database to display code, obtains an input association prompt, and sends the input association prompt to a display interface corresponding to the code editor using a preset network communication protocol.
[0131] In one embodiment, the writing module 101 obtains browser information of a browser corresponding to the code editor and writes a compatibility code according to the browser information, for:
[0132] Performing data standardization and structuring processing on the browser information to obtain a structured configuration object;
[0133] Converting the structured configuration object into executable code logic;
[0134] The executable code logic is converted into a compatible code.
[0135] In one embodiment, the calling module 102 calls the browser interface corresponding to the code editor through the compatibility code to obtain an input code for:
[0136] Deriving the available interface types of the browser according to the compatibility code;
[0137] Generate calling code according to the available interface type;
[0138] The calling code is run to obtain the input code.
[0139] In one embodiment, the analysis module 103 performs structural and semantic analysis on the input code to obtain basic analysis results for:
[0140] Performing lexical analysis on the input code to obtain a lexical unit sequence;
[0141] Performing grammatical analysis on the lexical unit sequence to obtain an abstract syntax tree;
[0142] Perform semantic analysis on the abstract syntax tree to obtain a basic analysis result.
[0143] In one embodiment, the analysis module 103, after performing structural and semantic analysis on the input code to obtain basic analysis results, is further configured to:
[0144] Traversing the abstract syntax tree to establish a symbol table;
[0145] Performing type and control flow verification on the symbol table to obtain verification information;
[0146] The symbol table and the verification information are combined to obtain a basic analysis result of the input association prompt.
[0147] In one embodiment, the perception module 104 performs context-aware analysis on the basic analysis result to obtain a code analysis result for:
[0148] Traversing the symbol table to locate each entry and obtain information about each entry;
[0149] Matching each item of information with the verification information to obtain associated set information;
[0150] The association set information is added to the entry attributes of the symbol table to obtain the basic analysis result.
[0151] In one embodiment, the matching module 105 matches the code analysis result with a preset database display code to obtain an input association prompt, and sends the input association prompt to a display interface corresponding to the code editor using a preset network communication protocol, for:
[0152] Establishing a communication connection using the network communication protocol;
[0153] Encapsulating the input association prompt into a data frame corresponding to the network communication protocol, and transmitting the data frame to a display interface backend corresponding to the code editor using the communication connection;
[0154] The data frame is visually parsed through the display interface background and displayed on the display interface corresponding to the code editor.
[0155] The present invention provides an input association prompt device for a code editor. For a target result business, browser information of a browser corresponding to the code editor is obtained, and compatibility code is written according to the browser information; a browser interface corresponding to the code editor is called through the compatibility code to obtain input code; structural and semantic analysis is performed on the input code to obtain a basic analysis result; context-aware analysis is performed on the basic analysis result to obtain a code analysis result; the code analysis result is matched with a preset database for display code to obtain an input association prompt, and the input association prompt is sent to a display interface corresponding to the code editor using a preset network communication protocol. A user can write code according to the input association prompt, which significantly improves the real-time performance and accuracy of code writing, reduces the difficulty and error rate of code writing, speeds up the development process, and helps to improve the development efficiency and quality of the entire project.
[0156] For the specific definition of the input association prompt device of a code editor, please refer to the definition of the input association prompt method of a code editor above, which will not be repeated here. The various modules in the input association prompt device of the above-mentioned code editor can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0157] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external client via a network connection. When the computer program is executed by the processor, it implements the functions or steps of the server side of the input association prompt method of a code editor.
[0158] In one embodiment, a computer device is provided. The computer device may be a client, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, memory, network interface, display screen and input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it realizes the functions or steps on the client side of a code editor input association prompt method.
[0159] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:
[0160] Obtaining browser information of a browser corresponding to the code editor, and writing compatibility code according to the browser information;
[0161] Calling the browser interface corresponding to the code editor through the compatibility code to obtain the input code;
[0162] Performing structural and semantic analysis on the input code to obtain basic analysis results;
[0163] Performing context-aware analysis on the basic analysis results to obtain code analysis results;
[0164] The code analysis result is matched with a preset database display code to obtain an input association prompt, and the input association prompt is sent to a display interface corresponding to the code editor using a preset network communication protocol.
[0165] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0166] Obtaining browser information of a browser corresponding to the code editor, and writing compatibility code according to the browser information;
[0167] Calling the browser interface corresponding to the code editor through the compatibility code to obtain the input code;
[0168] Performing structural and semantic analysis on the input code to obtain basic analysis results;
[0169] Performing context-aware analysis on the basic analysis results to obtain code analysis results;
[0170] The code analysis result is matched with a preset database display code to obtain an input association prompt, and the input association prompt is sent to a display interface corresponding to the code editor using a preset network communication protocol.
[0171] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can be found in the relevant descriptions of the server side and the client side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0172] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0173] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0174] It should be noted that if software tools or components other than those of our company appear in the embodiments of this application, they are only used for illustration and do not represent actual use.
[0175] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.
Claims
1. A method for input association prompting of a code editor, characterized in that: include: Obtaining browser information of a browser corresponding to the code editor, and writing compatibility code according to the browser information; Calling the browser interface corresponding to the code editor through the compatibility code to obtain the input code; Performing structural and semantic analysis on the input code to obtain basic analysis results; Performing context-aware analysis on the basic analysis results to obtain code analysis results; The code analysis result is matched with a preset database display code to obtain an input association prompt, and the input association prompt is sent to a display interface corresponding to the code editor using a preset network communication protocol.
2. The input association prompt method of a code editor according to claim 1, characterized in that: The compatibility code is written according to the browser information, including: Performing data standardization and structuring processing on the browser information to obtain a structured configuration object; Converting the structured configuration object into executable code logic; The executable code logic is converted into a compatible code.
3. The input association prompt method of a code editor according to claim 1, wherein: The step of calling a browser interface corresponding to the code editor through the compatibility code to obtain an input code includes: Deriving the available interface types of the browser according to the compatibility code; Generate calling code according to the available interface type; The calling code is run to obtain the input code.
4. The input association prompt method of a code editor according to claim 1, wherein: The structural and semantic analysis of the input code to obtain basic analysis results includes: Performing lexical analysis on the input code to obtain a lexical unit sequence; Performing grammatical analysis on the lexical unit sequence to obtain an abstract syntax tree; Perform semantic analysis on the abstract syntax tree to obtain a basic analysis result.
5. The input association prompt method of a code editor according to claim 4, characterized in that: The performing semantic analysis on the abstract syntax tree to obtain a basic analysis result includes: Traversing the abstract syntax tree to establish a symbol table; Performing type and control flow verification on the symbol table to obtain verification information; The symbol table and the verification information are combined to obtain a basic analysis result of the input association prompt.
6. The input association prompt method of a code editor according to claim 1, wherein: The performing context-aware analysis on the basic analysis result to obtain a code analysis result includes: Extracting context information in the code from the basic analysis results; Establishing a mapping relationship between the context information and the basic analysis result through association matching; Perform dynamic reasoning based on the mapping relationship to obtain a dynamic reasoning prediction result; The code analysis result is obtained by summarizing the basic analysis result and the dynamic reasoning prediction result.
7. The input association prompt method of a code editor according to claim 1, wherein: The step of sending the input association prompt to a display interface corresponding to the code editor using a preset network communication protocol includes: Establishing a communication connection using the network communication protocol; Encapsulating the input association prompt into a data frame corresponding to the network communication protocol, and transmitting the data frame to a display interface backend corresponding to the code editor using the communication connection; The data frame is visually parsed through the display interface background and displayed on the display interface corresponding to the code editor.
8. An input association prompt device for a code editor, characterized in that: include: A writing module, used to obtain browser information of the browser corresponding to the code editor and write compatibility code according to the browser information; A calling module, configured to call a browser interface corresponding to the code editor through the compatibility code to obtain an input code; An analysis module, configured to perform structural and semantic analysis on the input code to obtain basic analysis results; A perception module, configured to perform context-aware analysis on the basic analysis results to obtain code analysis results; The matching module matches the code analysis result with the display code of a preset database to obtain an input association prompt, and sends the input association prompt to the display interface corresponding to the code editor using a preset network communication protocol.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the input association prompt method of the code editor as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the input association prompt method of a code editor as described in any one of claims 1 to 7 are implemented.