Patents
Literature
Patsnap Eureka AI that helps you search prior art, draft patents, and assess FTO risks, powered by patent and scientific literature data.

26 results about "Code snippet" patented technology

A method and system for managing and automatically laying out slide content based on a tree structure

This invention discloses a method and system for managing and automatically formatting slide content based on a tree structure. By abstracting different types of materials such as text, images, tables, code snippets, and mathematical formulas into tree nodes with parent-child hierarchical relationships, users can freely add, delete, move, or mark nodes in a visual interface to achieve rapid merging or splitting of multi-level documents. The system then maps several nodes into multiple slides based on the node merging or splitting markers; and automatically formats the pages during the output stage, including overflow detection and font scaling, adaptive image proportioning, line wrapping for tables or code snippets, and format conversion of mathematical formulas. This approach significantly reduces the burden of manually adjusting text and images, maintains consistency and aesthetics in slide layout across different resolutions, and is suitable for multi-level, text-rich, and large-scale presentation document scenarios.
Owner:SHANGHAI SUOSIXIAO TECHNOLOGY CO LTD

Logical language model prompts for fraud detection

PendingCN122270758ANatural language translationMathematical modelsCode snippetModula
In some embodiments, a secure chatbot includes a generative language module (GLM) and a prompt manager configured to dynamically update GLM input prompts according to outputs of the GLM. The input prompts instruct the GLM to perform a task (e.g., determine whether a target message received by a user indicates online fraud) and, in response, output a particular token. In response to detecting the token within the output of the GLM, the prompt manager can selectively execute a code snippet identified according to the respective token. Executing the code snippet effectively updates the prompt, which is then fed back to the GLM for a next inference step. In contrast to conventional LLM prompts, the updates to the prompts herein include modifications (e.g., insertion of other tokens, etc.) rather than merely appending inferred tokens to previous prompts. Moreover, the prompt modifications are executed inline, i.e., without submitting a wholly new prompt to the GLM.
Owner:BITDEFENDER IPR MANAGEMENT

A method for complex functions in low-code platforms based on large model code interpretation and generation

This invention provides a method for generating complex functions on a low-code platform based on large model code interpretation and generation. By capturing and standardizing user input, a structured intent graph containing business entities, operational relationships, parameter constraints, and control flow topology is constructed as a unified semantic anchor. Combined with a pre-defined domain rule base, a semantic alignment validator is designed to achieve multi-dimensional semantic comparison and conflict detection between code and requirements. Code snippets are generated in parallel by multiple models and verified in real time, and semantic conflicts are resolved through local regeneration. By fusing the results of multiple models to construct a joint abstract syntax tree, lightweight symbolic execution is used to simulate the correctness of cross-model code, locate and correct core logical conflicts. This invention significantly improves the consistency, accuracy, and automatic correction capabilities of low-code platform code generation.
Owner:GUANGZHOU ZHUORUI DIGITAL TECHNOLOGY CO LTD

Enhanced cyber-resiliency in byzantine fault tolerant technology

PendingUS20260178291A1Error detection/correctionSoftware reuseByzantine fault toleranceCode snippet
The disclosed method involves utilizing a machine learning model to process a plurality of task descriptions corresponding to individual tasks of a divided algorithm or application. The model generates multiple code snippets for each task description, which are then stored in a code snippets database. This database is designed to accommodate updates to metadata associated with the code snippets, where the metadata provides information regarding the state of the code snippets. A subset of these stored code snippets is combined to create node replication codes, which, upon deployment, facilitate the generation of node replications within a platform. The deployment of these node replication codes on the platform results in the creation of node replications.
Owner:DELL PROD LP

Decomposing quantum source code files into quantum code snippets

ActiveUS12639605B2Quantum computersCode compilationSource code fileCode snippet
A quantum source code file is received. One or more portions of the quantum source code file to be decomposed into at least one quantum code snippet are identified. The one or more portions of the quantum source code file are validated as independently compilable. The at least one quantum code snippet is generated.
Owner:RED HAT INC

API driven continuous testing systems for testing disparate software

ActiveUS12645575B2Error detection/correctionRelational databasesContinuous integrationTest platform
A system for providing an API-driven continuous test platform is disclosed. The system may include one or more processors, a test engine, one or more test agents, and a database. The system may prepare (according to a configuration file) a first test configuration comprising a first selection of the one or more test agents, execute (using the test engine) the first test configuration to produce one or more first test results, and store (using the database) the one or more first test results. Finally, the system may process (using a continuous integration and continuous delivery (CI / CD) pipeline) the first test results by performing at least one of the following CI / CD processes: updating a central code base of an enterprise production environment, rejecting at least one code snippet processed by the test engine during execution of the first test configuration, and marking the first test results as inconclusive.
Owner:CAPITAL ONE SERVICES LLC

Abstract syntax tree-based ai-assisted low-code page synchronization method and device, computer device and computer program product

This application relates to an AI-assisted low-code page synchronization method and related equipment based on an abstract syntax tree (AST), belonging to the field of computer software technology. The method includes: establishing a view file model with the AST as the sole data source, holding an original AST with node tracking identifiers and maintaining node source type identifiers; parsing AI-generated code and injecting node tracking identifiers, establishing mapping relationships, and rendering it to a visual designer; responding to incremental modification commands, marking user-edited nodes as protected nodes, and generating incremental code snippets based on the current AST state; performing incremental AST difference comparison to generate change sets only for unprotected nodes and updating the original AST; generating synchronized source code and preview content based on the updated AST to maintain consistency across multiple views; achieving seamless integration of AI-generated content and user-edited content during AI-assisted low-code development.
Owner:深圳市灵智数字科技有限公司

Data construction method, code question-answering method, task platform and code question-answering system

PCT designated stageWO2026103407A1Digital data information retrievalProgramming languages/paradigmsCode snippetTheoretical computer science
Provided in the embodiments of the present disclosure are a data construction method, a code question-answering method, a task platform and a code question-answering system. The data construction method comprises: acquiring a first code snippet and an initial sample question for the first code snippet; using a text processing model to rewrite the initial sample question by using directory structure information of a sample code repository in a code library as context information, so as to obtain a sample question; on the basis of the first code snippet and the sample question, recalling a related second code snippet from the code library; and using the text processing model to generate, by using the second code snippet as context information, a sample answer corresponding to the sample question, wherein the sample question and the sample answer are sample data used for training a code question-answering model, and the code question-answering model is applicable to the code repository. The data construction efficiency is improved, and the data construction cost is reduced; and a model obtained by means of training is adapted to a code repository, thereby improving the user experience.
Owner:ALIBABA (CHINA) CO LTD

A method for detecting defects in unsafe code snippets in the Rust programming language

The application designs a detection method for the defect of the UNSAFE code segment in the Rust programming language, first, based on the rustc_lint module, whether the expression in the program language is contained in the unsafe block written by the developer is judged by using HIR; the structure of the expression is analyzed by using HIR; then, the unsafe operation is analyzed and identified by using MIR; finally, the safe expression or statement in the unsafe block written by the developer is reported; the data flow analysis technology for the function parameter is proposed, the alias propagation chain of the function parameter is found out; it is the key technology required for judging whether the function or method is marked with the unsafe keyword, and the target function is tested by combining the fuzz test technology to judge whether the function must be marked with the unsafe keyword.
Owner:NORTHEASTERN UNIV CHINA

Method and system for learning project code base and locating erroneous code

The present disclosure provides a method for learning a project code base and locating error codes, comprising: constructing a knowledge graph of a project code base based on a code framework of the project code base; generating an exploration task based on the knowledge graph; formulating an action plan comprising specific exploration steps and retrieving associated code snippets based on the exploration task; and learning the retrieved code snippets by executing the action plan to update the knowledge graph. The present disclosure can automatically learn the knowledge of the project code base.
Owner:BAYERISCHE MOTOREN WERKE AG

Integrated third-party application builder trigger for message flow

A message management platform may receive, from an application operator, a configuration of a message flow. The message flow includes one or more messages associated with trigger conditions. The platform may receive, from a code snippet incorporated in an application of a user computing device, a notification that the user computing device has used the application. The platform may associate a user identifier with the user computing device. The platform may subscribe to, on behalf of the application operator, one or more API notification channels of the application builder platform. The platform may receive an API notification from the application builder platform. The platform may determine that the application builder platform's user is associated with the user identifier used by the message management platform. The platform may determine that the event described in the payload matches the trigger condition and transmit the first message to the user computing device.
Owner:STODGE INC

Modifying website element styles based on user interaction

ActiveUS12675544B2Web siteCode snippet
In some implementations, a style engine may receive, using a first code snippet included in a website, an indication of a first user action. The style engine may transmit an instruction to modify a first style, associated with a first element on the website, based on the indication of the first user action. The instruction to modify the first style may be omitted from code comprising the website. The style engine may receive, using a second code snippet included in the website, an indication of a second user action. The style engine may transmit an instruction to modify a second style, associated with a second element on the website, based on the indication of the second user action. The instruction to modify the second style may be omitted from the code comprising the website.
Owner:CAPITAL ONE SERVICES LLC

Open source component vulnerability upgrade compatibility analysis methods and electronic devices

ActiveCN119645483BCode snippetSoftware engineering
This application proposes a method and electronic device for open-source component vulnerability upgrade compatibility analysis, belonging to the field of upgrade compatibility analysis technology. This method performs automated pre-upgrade verification on vulnerable components in open-source components called by project files, obtaining upgrade compatibility information for these vulnerable components. By integrating the upgrade compatibility information of various vulnerable components corresponding to different project files, a large-scale model knowledge base can be constructed. This knowledge base includes the component name, pre-upgrade version number, post-upgrade version number, upgrade compatibility result, calling method, calling code snippet, and repair code example for each vulnerable component. This allows the large-scale model to rely on this knowledge base to perform upgrade compatibility analysis on vulnerable components in open-source components called by the project file under test, obtaining upgrade compatibility results for each vulnerable component. In other words, the large-scale model ensures the accuracy and comprehensiveness of compatibility analysis while effectively improving upgrade efficiency.
Owner:WEBANK (CHINA)

Method and system for automated code retrieval and code generation

Disclosed is method for automated code retrieval and code generation, comprising: receiving code repository (302); extracting coding components (CC); generating knowledge graph (KG) comprising nodes representing extracted CC, and edges representing relationships between the extracted CC; identifying node(s) in generated KG for indexing; creating first index (FI) (406, 512) and second index (SI) (408, 514) of generated KG; receiving user request (502) for generating code; searching FI and SI based on entity(s) (510) extracted from user query (UQ) and embeddings (506) of UQ, respectively, for identifying predefined number of nodes (PNN) (516, 520A) in KG; retrieving identified PNN from KG; retrieving neighbouring nodes (NN) (520B-C); generating subgraph of retrieved NN and relationships between retrieved NN; filtering generated subgraph (GS); retrieving code snippets (404C) of retrieved NN; generating contextualized subgraph; and prompting Large Language Model (608) with generated contextualized subgraph, predefined KG ontology and area of interest(s), for generating code (610).
Owner:QUANTIPHI INC

A code snippet function description method based on tree-shaped neural network machine learning

This invention discloses a method for describing the functionality of code snippets based on tree-structured neural network machine learning. First, a code dataset is selected for preprocessing, and an abstract syntax tree (AST) is extracted from the code snippet. The descriptive text of the code is then preprocessed, and subtrees within the AST are identified. Irregular trees are transformed into binary trees, and the AST is embedded to obtain its feature vector set. Finally, a logical description model of the code snippet is constructed and trained. A code snippet without comments is input to generate a functional description. This method can quickly parse irregular code snippets, improving reuse efficiency, software quality, and reliability. It also reduces resource investment during reuse, lowers development costs, and enables faster development and launch of new products to meet market demands and competitive pressures through low-cost software reuse.
Owner:UNIV OF ELECTRONICS SCI & TECH OF CHINA

Code snippet generation method and system based on project private component library semantic index

PendingCN122363666ACode snippetSoftware engineering
The application discloses a code snippet generation method and system based on a project private component library semantic index, belongs to the technical field of software development tools, and comprises the following steps: scanning a current project, identifying a private component library relied on by the project, performing syntax analysis on the private component to extract metadata, and constructing a semantic feature index based on the metadata; in response to a coding input event in an integrated development environment, analyzing a semantic intention to generate an intention vector; matching the intention vector with the semantic feature index, combining project context sorting to determine a target private component; and automatically generating a calling code snippet according to the metadata of the target private component and outputting the calling code snippet to the integrated development environment. The application realizes intelligent recommendation of a private component and automatic generation of code based on natural language semantics, can reduce the cognitive burden of a developer, improve development efficiency, guarantee code specification, promote component reuse, and completes a processing process locally, thereby guaranteeing code safety.

Test case generation method, device, storage medium and program product

ActiveCN122132323AError detection/correctionCode snippetAlgorithm
This application discloses a test case generation method, device, storage medium, and program product, relating to the field of software testing technology. It includes acquiring test cases to be optimized and code snippets to be tested, extracting and structuring boundary conditions in the code, constructing a pre-trained language model with structured prompt words to generate a test coverage analysis report, and filtering valid test cases, eliminating redundancy, and supplementing test cases corresponding to uncovered boundaries based on the report. This achieves automated generation of optimized test cases with complete boundary coverage, no redundancy, and controllable effectiveness. It overcomes the limitations of traditional tools in identifying deep boundaries and avoids the randomness and instability of simply relying on pre-trained language models to generate test cases, providing accurate and efficient testing support for code quality assurance.
Owner:INSPUR SUZHOU INTELLIGENT TECH CO LTD

A data-driven software cross-instruction set architecture porting method

PendingCN122363753ACode snippetObject code
This invention provides a data-driven method for porting software across instruction set architectures, relating to the field of software porting technology. By constructing a cross-architecture porting knowledge base, this invention transforms successful porting cases from the open-source ecosystem into reusable and searchable structured knowledge, overcoming the limitations of traditional porting methods that rely on expert experience or general tools. This enables efficient and accurate porting of C / C++ source code. This invention optimizes vector function content, ensuring accuracy and performance through in-depth analysis of differences in vector functions across architectures. Tree-sitter static analysis is used to precisely locate the code to be ported. Combined with contextual information, code examples, architectural knowledge, the code snippet to be ported, and other contextual information, structured prompts are generated. Furthermore, iterative feedback from static checking rules generates code, effectively automating the generation of target code and reducing the cost of manual porting.
Owner:NORTHEASTERN UNIV CHINA

Test case generation methods, devices, storage media, and program products

ActiveCN122132323BCode snippetTheoretical computer science
This application discloses a test case generation method, device, storage medium, and program product, relating to the field of software testing technology. It includes acquiring test cases to be optimized and code snippets to be tested, extracting and structuring boundary conditions in the code, constructing a pre-trained language model with structured prompt words to generate a test coverage analysis report, and filtering valid test cases, eliminating redundancy, and supplementing test cases corresponding to uncovered boundaries based on the report. This achieves automated generation of optimized test cases with complete boundary coverage, no redundancy, and controllable effectiveness. It overcomes the limitations of traditional tools in identifying deep boundaries and avoids the randomness and instability of simply relying on pre-trained language models to generate test cases, providing accurate and efficient testing support for code quality assurance.
Owner:INSPUR SUZHOU INTELLIGENT TECH CO LTD

A method for automatic generation of annotations based on multi-modal code representations

This invention discloses an automatic annotation generation method based on multimodal code representation. It employs multiple encoders to learn the source code representation, including a graph encoder to holistically represent the API context graph, a tree encoder to represent the abstract syntax tree, and a field encoder to represent the token sequence, thereby learning a holistic and comprehensive code representation. Unlike existing annotation generation techniques based on encoders and decoders, this invention models the code from a holistic perspective, focusing on API usage and control flow information. Furthermore, it designs a feature fusion method to combine multiple intermediate encoding results, which are then fed into a joint decoder to generate annotations word by word. This invention can effectively generate high-quality annotations for specified code snippets, thereby promoting software maintenance and significantly improving software productivity.
Owner:SICHUAN UNIV

A code segment abstract generation method fusing data dependence and control structure information

The application discloses a code snippet summary generation method fusing data dependency and control structure information, and belongs to the technical field of software engineering and natural language processing. A corresponding token sequence is obtained through lexical analysis; a data dependency structure is constructed in combination with the definition and use relationship of variables in a program, and control structure semantic labels are assigned to each token according to the code syntax structure. The code semantic representation and the control structure embedded vector are fused and processed, and are input into a Transformer-based encoder for structure-enhanced coding. In the coding process, a data dependency adjacency matrix is introduced, so that the model can pay more attention to code elements with a dependency relationship when calculating attention weights; then, a natural language summary corresponding to the code snippet semantics is generated through a decoder. The application can improve the understanding ability of the model for code semantics and execution logic, and further generate a code summary with higher semantic consistency and a more complete structure.
Owner:BEIJING UNIV OF TECH

Method and system for automatically generating reusable APIs based on code snippets

ActiveCN117892031BCode snippetEngineering
This invention discloses a method and system for automatically generating reusable APIs based on code snippets. Specifically, it includes: first, acquiring webpage data to be processed and extracting information contained in the webpage data, including the question title, several Q&A posts corresponding to the question title, and code snippets corresponding to each Q&A post; constructing prompt words for a large language model, including role-specific prompt words, thought chain reasoning prompt words, and few-shot context learning prompt words; inputting the constructed prompt words and each code snippet into the large language model, outputting an API method with a text description; and using regular expressions to clean the API method with the text description, removing the text description from the API method to obtain the API method corresponding to each code snippet. Compared with existing technologies, the method proposed in this invention can generate more accurate APIs.
Owner:SHANGHAI INST FOR ADVANCED STUDY OF ZHEJIANG UNIV