Electronic device for automated codebase semantic analysis

TWM688724UActive Publication Date: 2026-10-21TAIWAN SHIN KONG COMML BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
TW115203519
Authority / Receiving Office
TW · TW
Patent Type
Utility models
Current Assignee / Owner
Filing Date
2026-04-21
Publication Date
2026-10-21
Estimated Expiration
2036-04-20

Smart Images

  • Figure TWG2TB001917677_001
    Figure TWG2TB001917677_001
  • Figure TWG2TB001917677_002
    Figure TWG2TB001917677_002
Patent Text Reader

Abstract

An electronic device for automatic semantic analysis of a code library includes a processor and a computer-readable storage medium. When the processor executes computer-executable instructions on the storage medium, it performs the following actions: dividing the code library to be analyzed into complex analysis units based on the dependencies between code entities and establishing a multi-level index; establishing a state record for each analysis unit's analysis stage and writing it to a persistent storage medium so that completed and verified stages are skipped during execution; dynamically selecting a large language model with corresponding reasoning capabilities to perform semantic structured analysis based on code size level or degradation conditions; calculating a consistency hash value for the analysis results to verify integrity; and finally performing format alignment and deduplication using a deterministic alignment algorithm to integrate and generate a structured knowledge base.
Need to check novelty before this filing date? Find Prior Art

Claims

1. An electronic device for automatic semantic analysis of code libraries, comprising: One processor; The processor is connected to a non-transitory computer-readable storage medium storing computer-executable instructions. When the processor executes the computer-executable instructions, the processor performs at least the following: (a) dividing a code library to be analyzed into complex analysis units based on the dependencies between code entities, and establishing at least one level of index for each analysis unit, including a first-level index; (b) establishing a state record for a complex analysis stage for each analysis unit, and writing the identification code and initial execution state of each analysis stage to a non-volatile persistent storage medium; (c) skipping analysis stages that are completed and have passed integrity verification based on the state record of each analysis stage, and executing the remaining analysis stages to be executed; (d) selecting a large language model corresponding to the reasoning ability level based on the scale level corresponding to the number of lines of code in each analysis unit, and performing semantic structured analysis on the code fragment corresponding to the current analysis stage using the selected large language model to produce an analysis stage result. (e) Calculate a consistency hash value as an integrity verification value for the results of the analysis phase, and write the identification code, the completed status and the integrity verification value into the non-volatile persistent storage medium; and (f) after all analysis phases are completed, use a deterministic standardized alignment algorithm to perform format alignment and remove duplicate items based on the unique identification code for each analysis phase result according to a predetermined data structure, integrate them to generate a structured knowledge base, and calculate a global consistency hash value to verify the consistency of the overall output.

2. The electronic device for automatic semantic analysis of a code library as described in claim 1, wherein, Step (a) further includes: establishing a second-level slice index and a third-level source code index for each analysis unit; wherein the number of tokens in each first-level index does not exceed a first upper limit value, the number of tokens in each second-level slice index is between a second lower limit value and a second upper limit value, and the number of tokens in each third-level source code index does not exceed a third upper limit value; and each analysis stage selectively loads the corresponding first-level index, second-level slice index or third-level source code index as context input according to the analysis content requirements, so that the number of input tokens in each large-scale language model call does not exceed the upper limit of the context window of the selected large-scale language model.

3. The electronic device for automatic semantic analysis of a code library as described in claim 1, wherein, Step (d) further includes: monitoring the call results of the selected large language model; when any of the following events are detected, such as service unavailability, response delay exceeding the threshold, output capacity exceeding the limit, or continuous failure, adjusting to a large language model with a lower inference capability level or increasing the granularity of the analysis unit according to a predetermined degradation condition matrix; and recording the event type, model identification information before and after the switch, and time information in an audit log.

4. The electronic device for automatic semantic analysis of a code library as described in claim 3, wherein, Step (c) further includes: establishing a phase dependency graph based on the semantic dependencies between each analysis phase; blocking the execution of an analysis phase when the state of a preceding dependent phase is not completed; and intercepting the execution of each analysis phase for exceptions, writing the event type, error code and stack trace of the exception to the audit log, marking the analysis phase as a failure, and continuing to execute the remaining analysis phases that have no dependencies.

5. The electronic device for automatic semantic analysis of a code library as described in claim 1, wherein, The predetermined data structure is a JSON schema.