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

398 results about "Code segment" patented technology

In computing, a code segment, also known as a text segment or simply as text, is a portion of an object file or the corresponding section of the program's virtual address space that contains executable instructions. The term "segment" comes from the memory segment, which is a historical approach to memory management that has been succeeded by paging. When a program is stored in an object file, the code segment is a part of this file; when the loader places a program into memory so that it may be executed, various memory regions are allocated (in particular, as pages), corresponding to both the segments in the object files and to segments only needed at run time. For example, the code segment of an object file is loaded into a corresponding code segment in memory.

Code generation method and related device

Disclosed in the present application is a code generation method, which is applied to a code development platform. The code development platform comprises a main plug-in and a plurality of extension plug-ins, wherein the main plug-in is used for providing an actual value of a basic variable of a prompt, and the plurality of extension plug-ins are used for extending the prompt in terms of a programming language, scenario or development framework. The method comprises: a main plug-in receiving a code generation instruction, and then determining, in response to the code generation instruction, at least one extension plug-in corresponding to the code generation instruction from among a plurality of extension plug-ins; the main plug-in receiving a prompt returned by the at least one extension plug-in, wherein the prompt is obtained by means of the at least one extension plug-in extracting an actual value of an extension variable on the basis of extraction logic and replacing an extension variable in a prompt template with the actual value of the extension variable; the main plug-in performing inference by means of a language model and on the basis of the prompt, so as to obtain a second code segment. In the method, a prompt of a specific code generation task and the implementation of prompt engineering is entrusted to corresponding extension plug-ins, thereby realizing flexible extension of prompts.
Owner:HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD

Intelligent completion code optimization method based on texture pre-rendering and multi-level cache

The invention discloses an intelligent completion code optimization method based on texture pre-rendering and multi-level cache, which comprises the following steps of: pre-establishing a grammar rule set and a GPU cache characteristic database, storing a grammar style sheet when a code editor is started, generating a font image set and loading current GPU cache parameters; after a candidate code segment list pops up through intelligent completion, dividing candidate code segments into data blocks, analyzing syntax types, determining character styles, and generating candidate code segment textures through instantiation rendering and a fragment shader; according to the current GPU cache parameter, the selected priority of the candidate code segment and the compressed volume, the texture is distributed to a first-level buffer, a second-level buffer or a global video memory according to a rule, and metadata is recorded and added into a global texture cache table; and after the user selects the candidate code segment, reading texture data from the corresponding GPU buffer, calculating a display coordinate by combining a cursor row and column index, an editor basic style parameter and a DPI scaling, completing texture rendering and drawing, and realizing optimized display of the intelligent completion code.
Owner:北京麟卓信息科技有限公司

Large language model auxiliary vulnerability detection method and system based on abstract syntax tree decomposition and annotation enhancement

The invention discloses a vulnerability detection method and system based on abstract syntax tree decomposition and large language model assistance. The vulnerability detection method and system are used for solving the problem that an existing pre-training model is insufficient in detection accuracy under complex code logic and multiple execution paths. The method comprises the following steps: firstly, analyzing a code snippet into an abstract syntax tree, splitting the abstract syntax tree into a plurality of sub-trees through an improved decomposition algorithm, and combining each sub-tree with a natural language annotation generated by a large language model to form an abstract sub-tree with the annotation; then, a semantic aggregator based on Transform is used for modeling the relation between the sub-trees, features are fused to a target vulnerability vector, and finally, vulnerabilities are predicted through a classifier. Based on the technical scheme, the vulnerability detection accuracy is effectively improved, and the performance of the vulnerability detection model is greatly improved.
Owner:HUNAN UNIV OF SCI & TECH SANYA RES INST

AI code effective proportion statistical method and device, medium and equipment

The invention relates to the technical field of code development, and provides an AI code effective proportion statistical method and device, a medium and equipment. The method comprises the steps of obtaining related information of codes submitted by a user; according to a user name in the related information, searching log information of an AI code generated by a corresponding user through adoption of a code generation tool; under the condition that the file name of the code submitted by the user is matched with the file name in the log information, searching a corresponding submitted code segment from the code submitted by the user according to the mark information in the log information; and calculating the similarity between the AI code and the submitted code segment, and counting the effective proportion corresponding to the AI code according to the similarity. Therefore, the calculation of the effective proportion considers the quality of the AI code, so that the effective proportion can accurately reflect the real contribution of the AI code, and the calculation process is automatically realized, thereby avoiding the tedious, time-consuming and labor-consuming conditions of manual labeling.
Owner:SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD

Generating Software Code Using Large Language Models

Techniques for generating proprietary software code using large language models (LLMs) are disclosed. An LLM is trained on billions of words, tokens, and code segments to generate non-proprietary software code. A system uses the LLM to generate proprietary software code by generating a set of LLM prompts and a proprietary code mapping. Based on receiving an instruction to generate a set of software code, a system generates a set of LLM prompts. The system prompts the LLM to generate a set of non-proprietary software code. The system further prompts the LLM to generate a set of pseudocode from the non-proprietary software code. The system further prompts the LLM to generate proprietary software code from the pseudocode and the proprietary code mapping.
Owner:ORACLE INT CORP

Code generation and correction method based on multilevel context sensing and memory iteration

The invention relates to a machine question answering technology, in particular to a code generation and correction method based on multilevel context awareness and memory iteration, which comprises the following steps of: S1, receiving a preliminary fuzzy demand, proposing a clear question and generating a structured demand document according to content supplement and question answer; s2, learning the context of the item and generating an initial code according to a learning result and the structured demand document; s3, running the initial code; s4, monitoring operation, capturing logs, if the operation is successful, ending circulation, and if the operation is not successful, entering S5; s5, analyzing the log and positioning errors; updating the error to a problem pool and a correction history, and triggering a correction request; the positioning error comprises extraction abnormity, files and line numbers; the correction request comprises an error code snippet, error information and a correction history; and S6, analyzing the correction request and generating a correction code, wherein the correction code comprises construction of an enhanced diagnosis prompt word. According to the invention, rapid, efficient and accurate project code generation can be realized.
Owner:BEIJING JUNTIAN TECHNOLOGY CO LTD

Code similarity detection method and system based on large language model

The invention discloses a code similarity detection method and system based on a large language model, and the method comprises the steps: obtaining a to-be-detected source code pair, and marking the to-be-detected source code pair as a source code A and a source code B; performing code cleaning and format standardization on the source code A and the source code B, and mapping a variable name and a function name which are customized by a user into a uniform placeholder; analyzing the source codes A and B based on the abstract syntax tree, respectively replacing variable names and function names in the source codes A and B with unified serialized placeholders, and maintaining a mapping table; meanwhile, expanding a lexical dictionary of the pre-training large language model, and inserting a special identifier; splicing the replaced code snippets with special identifiers, and constructing a structure sensing input sequence; inputting the structure perception input sequence into a pre-trained large language model backbone network for feature coding to obtain a high-dimensional semantic feature vector containing global context information; connecting a multi-task prediction head behind the large language model backbone network, inputting the feature vector into the multi-task prediction head, outputting probability distribution of code clone types through a classification task head, and respectively outputting a row level similarity score and a lexical element level similarity score through a regression task head; and according to the classification probability and the regression score, performing comprehensive judgment by combining a preset threshold, and generating a detection report. According to the method, similar codes after variable renaming, statement rearrangement or control flow transformation can be accurately recognized, and the accuracy and robustness of code similarity detection are improved.
Owner:NANJING UNIV OF SCI & TECH

Method and device for compiling program code

Embodiments of the present application provide a method and device for compiling program code. The method for compiling program code may include: obtaining source code; and performing a compilation operation to obtain a first compilation result of the source code, where a first code segment in the source code is compiled into machine code in the first compilation result, a second code segment in the source code is compiled into bytecode in the first compilation result, and the first compilation result is configured to be deployed to a target environment. The proposed technical solutions may be conducive to ensuring performance at low storage resource utilization.
Owner:HUAWEI TECH CO LTD +1

Agentic artificial intelligence based software development and modernization

Various embodiments of the present disclosure include systems, methods, and / or apparatuses for executing an agentic-AI-based software modernization system. An example system may be configured to receive one or more portions of monolithic legacy code of a legacy software program product, the monolithic legacy code comprising a plurality of code segments, group the monolithic legacy code by functionally related code segments of the plurality of code segments to define a plurality of groups, generate an API for each identified group, generate modern microservice code for each identified group to define a modernized software program product, and validate the modernized software program product.
Owner:PRESIDIO INC

System calling ptrace-based operating system micro-service security protection system and method

The invention relates to a system calling ptrace-based operating system micro-service security protection system and method, which are characterized in that the running state of micro-service is monitored in real time through calling of a ptrace system in a user state, and dynamic integrity verification is realized in combination with an SM3 hash algorithm. The method comprises the following steps: calculating an SM3 hash value of a code segment of a micro-service when the micro-service is started, storing the SM3 hash value as a static reference, periodically reading memory data of a target process through ptrace in a running process, recalculating a dynamic hash value, and comparing the dynamic hash value with a reference value; if it is detected that the hash values are inconsistent, it is judged that code injection attacks exist, and a defense mechanism is triggered. According to the method, the system stability risk caused by kernel module injection is avoided, meanwhile, real-time interception of tampering attacks during operation is achieved through high-frequency dynamic comparison, the lightweight design enables the method to be suitable for high-reliability scenes such as spaceflight with limited resources, the integrity of a micro-service code segment can be guaranteed, low performance loss of the system can be maintained, and the system reliability is improved. The balance blank between dynamic defense and system stability in the prior art is effectively filled.
Owner:CHINA AEROSPACE TIMES ELECTRONICS CORP

Program defect repairing method and device, equipment and storage medium

The invention discloses a program defect repairing method and device, equipment and a storage medium. The method comprises the steps that a defect code segment is obtained from a first program code which is reported to be wrong, and a similar defect code segment and a similar repair patch corresponding to the defect code segment are inquired in a historical code library; constructing a first prompt word based on the defect code segment, the similar defect code segment and the similar repair patch, generating a repair patch based on the first prompt word, and repairing the first program code through the repair patch to obtain a second program code; and under the condition that the verification of the second program code is not passed, regenerating a repair patch based on a defect code segment appearing in the verification process of the second program code, and repairing the second program code through the newly generated repair patch. According to the method, the big language model is guided to generate the high-credibility repair patch through the historical similar defects and the repair patch thereof, and the problem that in the prior art, the repair patch is unreliable due to the fact that the big language model is separated from an actual repair case is solved.
Owner:ANHUI SANQI JIYU NETWORK TECH CO LTD

Debugging method and device of low-code platform, storage medium and electronic equipment

The invention discloses a debugging method and device for a low-code platform, a storage medium and electronic equipment. The method comprises the steps that a low-code engine is started in a local environment, the low-code engine is used for calling a target code to provide a low-code platform service, and the target code represents a modified original low-code segment; under the condition that the target code is used for transforming the front-end service, request flow data is obtained through a flow forwarding component, breakpoint debugging operation is executed based on the request flow data to obtain a debugging result, and the request flow data is used for indicating an interaction request obtained from a front-end page; the traffic forwarding component is used for controlling the request traffic data to be forwarded from the test environment to the local environment; under the condition that the target code reforms the back-end service, a target interface is used for executing breakpoint debugging operation to obtain a debugging result, and the target interface is used for debugging the target code in the local environment. According to the method and the device, the technical problem that the debugging efficiency is relatively low when the modified original low-code segment in the low-code platform is debugged is solved.
Owner:CHINA CONSTRUCTION BANK +1

System and method for synthetic intrusion data generation and remediation via machine learning

ActiveUS20260039674A1Securing communicationHeuristicsEngineering
Systems, computer program products, and methods are described herein for synthetic intrusion data generation and remediation via machine learning. The present disclosure includes training a first machine learning model using a plurality of malicious code segments from a code repository, generating, using the first machine learning model, a predetermined number of generated code segments, training a second machine learning model using the plurality of malicious code segments, generating, by using the second machine learning model, at least one generated heuristic mitigation resource for the generated code segments, analyzing, via a static heuristics analysis, stored code on an endpoint device, and applying the at least one generated heuristic mitigation resource upon a first condition wherein the static heuristics analysis identifies a malicious activity.
Owner:BANK OF AMERICA CORP

Intelligent contract vulnerability detection method based on hierarchical multi-granularity coding

The invention discloses an intelligent contract vulnerability detection method based on hierarchical multi-granularity coding, and the method comprises the steps: dividing an intelligent contract source code into multi-level data for feature extraction, and determining a token feature corresponding to each token, a statement block feature corresponding to each statement block, and a cross-statement block feature corresponding to each code segment; according to the token feature of the token and the statement block feature corresponding to the statement block, determining an intra-segment feature corresponding to each code segment, according to the cross-statement block feature, determining a cross-segment feature, and according to the intra-segment feature, the cross-segment feature and the document-level feature, determining a vulnerability detection result, therefore, a unique hierarchical structure is divided according to the code features so as to facilitate feature extraction of the vulnerability detection model, and an interaction relationship and a dependency relationship among the token, the statement block and the code segment can be obtained through feature extraction and feature fusion of the vulnerability detection model, so that the accuracy of intelligent contract vulnerability detection is improved.
Owner:CAPITAL UNIV OF ECONOMICS & BUSINESS

Source code reconstruction method and device, equipment and medium

The invention discloses a source code reconstruction method and device, equipment and a medium. The method comprises the following steps: acquiring a to-be-processed source code and reconstruction performance description content; determining at least one target code snippet in the to-be-processed source code according to a code reconstruction standard; according to the to-be-processed source code, generating a calling relation and an input and output relation corresponding to the to-be-processed source code; aiming at each target code snippet, reconstructing the target code snippets according to the calling relation and the input and output relation to obtain reconstructed code snippets; and replacing the target code snippets in the to-be-processed source codes with the reconstructed code snippets, wherein the to-be-processed source codes before replacement and the to-be-processed source codes after replacement have the same functions. According to the embodiment of the invention, the source code upgrading efficiency and automation degree of the original system can be improved.
Owner:PIPECHINA SOUTH CHINA CO +1

User interface test method and device, electronic equipment, medium and program product

PendingCN121858449ARealize intelligent repairAchieve self-evolutionError detection/correctionBiological modelsTest scriptSimulation
The invention provides a user interface testing method and device, electronic equipment, a medium and a program product, and can be applied to the technical field of big data and the technical field of artificial intelligence. The method comprises the following steps: acquiring a target test script, and performing semantic conversion on an operation instruction in the target test script by utilizing a first model to obtain a target test step set containing business semantic description; the target test step set is executed, in the process of executing the target test step set, the first model is used for determining the positioning mode of the target interface element according to the business semantic description, corresponding interaction operation is executed, and actual interface output is obtained; in response to execution failure of the target test step set, generating a diagnosis result by using a first model at least based on the actual interface output and the business semantic description; and inputting the diagnosis result into a second model, generating a modification code snippet by the second model, and applying the modification code snippet to the target test script.
Owner:INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Software vulnerability analysis report generation method and device

The invention discloses a method and a device for generating a software vulnerability analysis report, and relates to the field of information security. The method comprises the following steps: acquiring auditing information of software vulnerabilities; a code feature matching rule for the software vulnerability is generated according to the auditing information through the large language model, and the code feature matching rule is used for matching a code calling mode related to the software vulnerability in the target software project; constructing a calling graph of the target software project; according to the code feature matching rule and the call graph, the correlation degree between each code snippet of the target software project and the software vulnerability is detected, and the correlation degree is used for evaluating the risk level of each code snippet of the target software project; and generating a software vulnerability analysis report of the target software project according to the association degree between each code snippet of the target software project and the software vulnerability. The technical problem that in the prior art, an open source software vulnerability detection tool cannot accurately evaluate the real influence of vulnerabilities in specific project contexts is solved.
Owner:INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Large language models for creating a multi-lingual, low-resource code translation dataset

One or more unit-test cases are generated from a monolingual code corpus and the generated unit-test cases are filtered to generate a corpus of unit-test cases which have acceptability scores exceeding one or more predefined thresholds. One or more of the code samples of the monolingual code corpus are translated from a source language to a target language using a pretrained Large Language Model and the generated unit-test cases are translated from the source language to the target language. The LLM-translated code samples are validated using the translated unit-test cases and a parallel-data training corpus comprising the LLM-translated code samples that pass the validation is created. The pretrained large language model (LLM) is fine-tuned using the parallel-data training corpus, a given code segment is translated using the fine-tuned large language model (LLM), the translated given code segment is tested and the tested given code segment is deployed.
Owner:INTERNATIONAL BUSINESS MACHINE CORPORATION +1

Code processing method and device fusing grammar structure and graph structure learning

The invention discloses a code processing method and device fusing grammar structure and graph structure learning, and the method comprises the steps: collecting high-performance project codes, extracting hot code segments, and analyzing the structural features of the hot code segments; converting the hot code segment into an abstract syntax tree AST file, performing structured analysis, converting the file into Python tree structure data, and expanding node attributes; converting the tree structure data into graph structure data, generating edge, graph and node index files, and constructing the graph structure data and corresponding code structure labels; constructing a graph attention network model for different code structures, and training a plurality of GAT models based on graph structure data and labels; and converting the user input code, inputting the converted code into each GAT model for prediction, and integrating and outputting a feature vector. According to the method, grammar logic is accurately captured through AST conversion and node expansion, multi-language AST is unified into a graph structure, the recognition accuracy of a complex code structure is improved through a GAT multi-model architecture, full-process automation is achieved, and the labor cost is reduced.
Owner:HUNAN UNIV

Code vulnerability detection method based on meta-learning and multi-modal fusion

The invention provides a code vulnerability detection method based on meta-learning and multi-modal fusion, belongs to the technical field of computers, and solves the technical problem that the existing vulnerability detection method is low in detection precision of a long code segment and weak in recognition capability under class imbalance. According to the technical scheme, the method comprises the following steps that S1, an original data set is preprocessed, and super-long code samples are screened; s2, simplifying a super-long code by using a large language model, and retaining key vulnerability semantics; s3, constructing AST extraction structure representation, and taking a code and a structure as multi-modal input; s4, code sequences and structural features are extracted through a pre-training model, and fusion is carried out through a cross-modal attention mechanism; s5, simulating a small sample task by adopting a meta-learning strategy to adapt to a class imbalance scene; and S6, inputting test data and outputting a vulnerability classification result. The method has the beneficial effects that the complex code and rare vulnerability detection performance can be improved, and the model stability and accuracy are enhanced.
Owner:NANTONG UNIV

Python type error repair method and system based on large model

The invention belongs to the technical field of software code automatic repair, and discloses a Python type error repair method based on a large model, which comprises the following steps of: 1, acquiring an error code segment, and running a test case to obtain error information; 2, a repair task is decoupled into three sub-tasks of error understanding, information collection and self-verification and patch generation; 3, inputting the error information description into a large language model to generate a repair hypothesis; 4, analyzing a repair hypothesis, identifying missing repair elements, retrieving a code file, and complementing the repair elements according to a static analysis result and a call chain; 5, verifying the consistency and integrity between the restoration hypothesis and the complementation information through a self-verification agent, generating feedback information if the information is insufficient or conflicts exist, and triggering preorder task iteration; and 6, generating a patch through a patch generation agent according to the verified repair elements, and verifying the correctness of the patch through automatic testing. According to the method, the overall repair accuracy is improved.
Owner:HANGZHOU DIANZI UNIV

Code optimization method and system based on knowledge graph

PendingCN121764474AImprove optimization effectMeet optimization needsBiological modelsIntelligent editorsCoding blockLinguistic model
The invention provides a code optimization method and system based on a knowledge graph, and the method comprises the steps: carrying out the source code analysis based on a to-be-optimized code library, constructing an abstract syntax tree, and determining a to-be-optimized code snippet based on the code complexity of a corresponding code in the abstract syntax tree; determining a reconstruction mode corresponding to each to-be-optimized code snippet based on the to-be-optimized code snippet in combination with a pre-constructed code optimization knowledge graph, and constructing a context dependency graph of each to-be-optimized code snippet based on the abstract syntax tree and the code optimization knowledge graph corresponding to each to-be-optimized code snippet; performing sliding window decomposition based on the context dependency graph to obtain a plurality of mutually associated code blocks, and performing simplification and fusion on the code blocks to obtain a current context; and inputting the reconstruction mode corresponding to each to-be-optimized code snippet and the current context into the large language model for structured reconstruction to obtain a target reconstruction scheme output by the large language model. According to the method and the device, the code optimization effect is improved.
Owner:GUANGDONG MASTER INTELLIGENT SYST CO LTD

Software source code vulnerability detection method, device and system

The invention relates to the technical field of code vulnerability detection, in particular to a software source code vulnerability detection method, device and system, and the method comprises the steps: obtaining an abstract syntax tree of a source code stream, and calculating the syntax depth of each statement in a source code; determining the data flow importance of each statement based on the connection condition of the corresponding edge of each statement in the data flow diagram of the statement in the source code; determining a correlation score of each statement; matching and identifying a high-risk statement in the source code, and determining a local window scale of the high-risk statement; for source codes in the local window of the high-risk statement, determining the attention weight of each token to obtain a context condensation vector of the local window, and screening from all the tokens of the local window to obtain a priority position list; and calculating a self-adaptive threshold value of the local window so as to judge the vulnerability probability of the code snippets in the local window, and performing sandbox verification on the high-risk vulnerability by utilizing the priority position list. Therefore, the source code vulnerability detection accuracy is improved.
Owner:WUXI SOFT TEST CERTIFICATION CO LTD

Multi-scene target detection and behavior recognition method and system based on deep learning

The invention provides a multi-scene target detection and behavior recognition method and system based on deep learning, and relates to the technical field of software development behavior analysis, and the method comprises the steps: obtaining a code editing operation sequence, an interface interaction event sequence and a file access record sequence in a software development environment, and forming a multi-modal development behavior data flow; performing development scene identification on the multi-modal development behavior data flow to obtain a scene state identifier; constructing a semantic perception feature extractor, performing syntax structure analysis and semantic dependency modeling on the code editing operation sequence, extracting an abstract syntax tree structure and a program execution path diagram, and combining to obtain code structured features; performing code mode matching and abnormal mode positioning to obtain a target code segment detection result; extracting operation time sequence features and carrying out cross-modal feature alignment on the operation time sequence features and the code structured features to obtain a unified behavior vector; and performing time sequence dependence reasoning and behavior pattern classification to obtain a behavior recognition result.
Owner:SMIC WANYE TECHNOLOGY CO LTD

Compiling security monitoring method and system for high-reliability software development

The invention relates to the technical field of computer software, and discloses a compilation security monitoring method and system for high-reliability software development, and the method comprises the steps: obtaining an initial source code carrying a security annotation; compiling the initial source code carrying the security annotation to generate an initial abstract syntax tree; analyzing the security annotation in the initial abstract syntax tree, executing deep static analysis, identifying at least one injection point, and determining the type and parameter of the security monitoring logic to be injected for each injection point; selecting a corresponding template from a preset security monitor template library according to the type of the security monitoring logic to generate a security monitoring code segment; inserting the security monitoring code segment into a corresponding injection point in the initial abstract syntax tree to form a modified final abstract syntax tree; converting the final abstract syntax tree back to a final source code file; and compiling the final source code file to generate an executable file. The problem of'black box 'of an automatic tool is solved.
Owner:CHENGDU SHUZI AUTOMATION TECH CO LTD

A dynamic link library updating method, device, equipment and medium

Embodiments of the present application disclose a dynamic link library updating method, device, equipment and medium, the method comprising: obtaining a process list of a dynamic link library to be processed and a new dynamic link library; selecting a target process from the process list and obtaining a virtual address interval of a code segment of the dynamic link library to be processed in the target process; obtaining a virtual address of a next instruction to be executed of the target process and judging whether the virtual address is in the virtual address interval; if the virtual address is not in the virtual address interval, pausing execution of the target process; performing binary difference analysis on the same interface of the dynamic link library to be processed and the new dynamic link library; obtaining new memory page file data from the new dynamic link library, covering data in a difference memory page with the new memory page file data, and resuming execution of the process. By locating and replacing the process outside the virtual address interval, the dynamic link library updating is completed without restarting the process.
Owner:CHINA TELECOM CLOUD TECH CO LTD

Code annotation generation method and system based on token-level semantic matching

The invention belongs to the technical field of software engineering, and discloses a token-level semantic matching-based code annotation generation method and system, and the method comprises the following steps: obtaining a target code and a data set, carrying out the preprocessing and dividing, and obtaining a training set as a corpus; performing word segmentation on the codes in the corpus by using a word segmentation device of a pre-trained large language model, and extracting and storing a context semantic embedding vector of each token in the codes to form a code semantic warehouse; calculating the lexical similarity between the target code and the code in the corpus, and taking the top k high examples as candidate examples; according to the method, a target code and a candidate sample are subjected to token-level semantic matching, the most similar token in another code segment is matched, the accuracy rate and the recall rate are combined to obtain an F1 score, and the sample with the highest score is reused, the context semantic feature of fine granularity is considered in the aspect of retrieval, the code annotation generation precision is improved, extra training is not needed, and the retrieval efficiency is improved. And the method has good applicability to different scenes.
Owner:HANGZHOU DIANZI UNIV

Code detection method, system and device, electronic equipment, storage medium and program product

The embodiment of the invention provides a code detection method, system and device, electronic equipment, a storage medium and a program product. According to the scheme provided by the embodiment of the invention, the received change code data comprises at least one change code line, and the change code line is a code line of which the content is changed relative to the previous version source code in the current version source code. Based on the current version source code and the change code data, extracting at least one code program segment from the current version source code; one code program segment comprises one change code line or a plurality of change code lines with continuous line numbers or a plurality of change code lines with discontinuous line numbers. Furthermore, the change classification corresponding to the code program segment can be determined. And based on the code program segment and a risk rule associated with the change classification corresponding to the code program segment, determining a risk detection result of the change code line in the code program segment.
Owner:ALIPAY (HANGZHOU) INFORMATION TECH CO LTD

Binary loadable file downloading method and device, equipment and medium

The embodiment of the invention discloses a binary loadable file downloading method and device, equipment and a medium. The method comprises the steps that a binary intermediate file generated after a program source code is compiled and a binary link file of a module where the binary intermediate file is imported are obtained; converting the binary intermediate file into a binary loadable file according to the binary link file; in response to a downloading command stream, downloading the binary loadable file to a resource-constrained device to obtain a binary execution file; wherein the binary loadable file comprises a first segment, a function segment, a global segment and a code segment. According to the technical scheme provided by the embodiment of the invention, the downloading and execution efficiency of the WebAssessment module in the resource-constrained equipment can be improved, and the resource consumption of the equipment is reduced.
Owner:BEIJING CEC HUADA ELECTRONIC DESIGN CO LTD

A code retrieval method based on code classification representation in a code repository scenario

The application relates to the technical field of code retrieval, and discloses a code retrieval method based on code classification representation in a code repository scenario, which comprises the following steps: labeling semantics of each code segment as a user query corresponding to the code segment, and constructing a training set and a verification set; extracting auxiliary information and internal structure information of each code segment in the training set; respectively calculating a first correlation matrix of the auxiliary information and the user query and a second correlation matrix of the internal structure information and the user query; splicing the first correlation matrix and the second correlation matrix, and outputting a final correlation score through a neural network; and training a code retrieval model to convergence based on a sorting loss function. The application solves the problems that code information in an existing code retrieval model is single and the effect is difficult to improve, realizes all-round utilization of code information, and effectively improves the effect of code retrieval.
Owner:UNIV OF SCI & TECH OF CHINA