Code Fixing Apparatus Line-Level Encoding Correction

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing code fixing solutions often incorrectly change the modifier of code lines, leading to errors in tracking, as they fix the entire code file rather than specific lines, resulting in incorrect attribution of modifications.

Innovation Solution

A method and apparatus that acquire modified line numbers, identify and fix encoding issues with the identity of the submitter, and undo fixes for lines not included in the modified line numbers to ensure accurate tracking of code modifications.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the existing code fixing tool fixes the entire code file, then the encoding issue can be resolved for all lines, but the modifier of part of code lines is changed into another modifier other than an actual modifier, resulting in incorrect tracking

Engineering Contradiction:
Improveencoding issue resolutionVSAvoidmodifier tracking accuracy
Core Design Contradiction:
ReliabilityVSLoss of information

Solution Approach 1:

The patent segments the code file into individual lines based on the modified line numbers provided in the diff. Instead of fixing the entire file, the system processes only the specific lines that were modified in the current commit, thereby preserving the correct modifier information for each line while still resolving encoding issues.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies local quality by targeting only the specific lines that need fixing (those with encoding issues in the modified lines) rather than applying a blanket fix to the entire file. This ensures that each line retains its correct modifier attribution while still receiving the necessary encoding correction.

Inventive Principle:
Principle #3Local quality

2Productivity

If the code fixing tool processes the entire code file, then all encoding issues are addressed, but subsequent tracking of code lines shows incorrect modifiers

Engineering Contradiction:
Improvecode fixing efficiencyVSAvoidactual modifier information
Core Design Contradiction:
ProductivityVSLoss of information

Solution Approach 1:

The system segments the fixing process by using the modified line numbers from the diff to identify exactly which lines need processing. This segmentation allows efficient processing of only the necessary lines while maintaining accurate modifier tracking, avoiding the need to process the entire file.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies partial action by fixing only the lines that are actually modified in the current commit (as indicated by the diff), rather than fixing the entire file. This partial approach maintains productivity by addressing encoding issues where needed while preserving modifier information that would otherwise be lost in a full-file fix.

Inventive Principle:
Principle #16Partial or excessive action

3Reliability

If the existing solution fixes codes based on the entire code file, then encoding issues are resolved comprehensively, but the modifier information for part of code lines is corrupted

Engineering Contradiction:
Improveencoding correctionVSAvoidmodifier attribution accuracy
Core Design Contradiction:
ReliabilityVSManufacturing precision

Solution Approach 1:

The patent segments the code fixing operation into line-by-line processing based on the modified line numbers. This segmentation ensures that each line is processed independently with its correct modifier information preserved, while still achieving comprehensive encoding correction for the affected lines.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system applies local quality by targeting only the specific lines that were modified in the current commit and have encoding issues. This localized approach ensures high precision in modifier attribution for each line while maintaining reliable encoding correction, avoiding the corruption that occurs with blanket file-wide fixes.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS20240385945A1Code fixing method and apparatus, and device and medium
Publication Date: 2024.11.21 BEIJING ZITIAO NETWORK TECH CO LTD
  • US20240385945A1 patent drawing
  • US20240385945A1 patent drawing
  • US20240385945A1 patent drawing

AI summary

Embodiments of the present disclosure provide a code fixing method and apparatus, and a device and a medium. A specific implementation of the method includes: acquiring a modified line number corresponding to a modified code line in a first code file submitted; according to an encoding issue existing in the code line corresponding to the modified line number, fix a code in the first code file with the identity of a current submitter of the first code file, and acquiring a fixed line number corresponding to the code fixed; determining whether the fixed line number is included in the modified line number; and in response to determining that the fixed line number is not included in the modified line number, undoing the code fixing for the fixed line number. By using the method, the code in the code lines in the code file can be only fixed, thereby avoiding the problem in which the entire code file is fixed in the existing code fixing solution, resulting in an error in the information of an actual modifier of a part of code lines, thus pointing to an incorrect modifier in subsequent tracking of the part of code lines.