Method for checking integrity of technical scheme based on code feature library

Through PMD and Flyway tools, a code feature library is established and regression testing is carried out, the shortcomings of change risk management in the microservice architecture are solved, and code quality and testing efficiency are improved.

CN120508497APending Publication Date: 2025-08-19BEIJING BAIJU YIXING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510488394.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-08-19

AI Technical Summary

Technical Problem

Under the microservice architecture, the existing technology cannot effectively manage the dependencies between microservices, resulting in high risk of change, difficulty in identifying the impact on the entire system, increasing the chance of failure, and lacking the ability to respond quickly and adjust.

Method used

The PMD automated code scanning tool is used to extract code change records in combination with Git commands, Flyway detects database migration, builds a code feature library through MySQL, uses Diff tool to compare code changes and technical solutions, generates missing items diagnostic reports, and performs regression testing and supplementary measures.

Benefits of technology

Improve code quality, reduce technical debt, ensure systematization of code change records, reduce omissions and errors, improve the reliability and testing efficiency of the code feature library, and enhance communication effect and problem tracking capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508497A_ABST
    Figure CN120508497A_ABST
Patent Text Reader

Abstract

The invention discloses a method for checking the integrity of a technical scheme based on a code feature library, which relates to the field of automatic monitoring management, and comprises the following steps of: 1, selecting a PMD as an automatic code scanning tool, carrying out traversal scanning on a newest online car-hailing service code, extracting a code change record in combination with a Git command, and storing the code change record in a database; newly added, modified and deleted API interfaces, configuration items, timed tasks and message queue logic are comprehensively defined, database migration is detected through Flyway, and analysis results are stored in an XML format in a structured mode. According to the method, the PMD is used for code scanning to help a team to identify potential problems in codes, Flyway is used for detecting operation performed in a database migration file, it is ensured that change of a database structure is clearly recorded, supplemental measures and a new test case are combined to execute regression testing, and the regression testing efficiency is improved. It is ensured that the system can still keep correct functions after being modified, the effectiveness of supplementary measures is verified, and a detailed test report is passed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automated monitoring and management, and in particular to a method for checking the integrity of a technical solution based on a code feature library. Background Art

[0002] In current software development and testing processes, the risks associated with code changes have become a critical issue that cannot be ignored. In a microservices architecture, the complexity and distributed nature of the system significantly increase the number of business calls. Microservices split applications into multiple independent services, allowing each service to be independently developed, deployed, and scaled. However, due to the close dependencies between these services, changes to any single service can trigger a chain reaction, impacting the stability and reliability of the entire system.

[0003] For the ride-hailing business, the dynamic nature of the system and the diversity of user needs necessitate frequent and necessary technical changes. In such complex systems, the potential for change risk is significantly amplified. A single issue in a single process can often trigger a cascade of failures. The "butterfly effect" is particularly pronounced in such complex systems. A seemingly minor error or omission can have amplified effects across multiple services, causing system failures to spread rapidly and significantly impacting the entire ride-hailing business.

[0004] Existing technologies have the following shortcomings: Dependencies between existing microservices are often poorly managed. Weak tracking and visualization capabilities for dependencies lead to an incomplete understanding of changes to a particular service, increasing potential risks. Current change management tools and processes lack the ability to comprehensively assess the potential impact of changes on the entire system, often failing to quickly identify potentially affected services and increasing the likelihood of failures. Existing methods are unable to promptly detect system runtime anomalies, preventing prompt response and adjustments, thus delaying problem resolution and recovery.

[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art. Summary of the Invention

[0006] The purpose of the present invention is to provide a method for checking the integrity of a technical solution based on a code feature library, improve the consistency of the integrity of the technical solution with test cases, solve the problem of missing test cases, and solve the problems in the above-mentioned background technology.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a method for checking the integrity of a technical solution based on a code feature library, specifically comprising the following steps:

[0008] Step 1: Select PMD as an automated code scanning tool to perform a thorough scan of the latest ride-hailing business code. Use Git commands to extract code change records, comprehensively define newly added, modified, and deleted API interfaces, configuration items, scheduled tasks, and message queue logic. Use Flyway to detect database migrations and store analysis results in a structured XML format.

[0009] Step 2: Create a code signature database using MySQL. Design a table structure that includes unique identifiers, row numbers, change types, commit times, and committers. Use JDBC for database interaction. Use pre-commit hooks to monitor code changes and insert the latest code change information into the signature database. Regularly check and compare signature database data, create a code signature database index, and regularly back up data.

[0010] Step 3: Access the code feature library based on the unique identifier, pull the corresponding technical solution, parse the key information items, and compare the latest code changes with the technical solution using the Diff tool;

[0011] Step 4: Generate a missing item diagnostic report, establish a rollback mechanism to prioritize the implementation of missing key interfaces, conduct a code review and compare each item with the technical solution, and perform regression testing on the affected ride-hailing business processes;

[0012] Step 5: Instruct QA personnel to read and understand the missing item diagnosis report, set preconditions and expected results for actual test comparison, perform regression testing in conjunction with supplementary measures, and summarize the test results to generate a detailed report for problem tracking.

[0013] Preferably, select PMD as an automated code scanning tool to traverse the latest code, create an XML file and configure PMD to define the coding rules to be checked through the rule set, determine the source code path of the online car-hailing business through the terminal, set the PMD execution parameters through the ". / path / to / pmd-bin-xxx / bin / run.sh pmd-d / path / to / your / source-R / path / to / ruleset.xml-f xml" command, output the quality problems, specific locations and descriptions of the latest code, and combine them with Gi Use the t command to view the submission records corresponding to the latest code changes, define new, modified, and deleted API interfaces, and record the HTTP methods, paths, request parameters, and response formats of the extracted API interfaces. Define configuration items and record new, modified, and deleted configuration items in the extracted configuration files. Extract new and modified scheduled task definitions and record the execution frequency and target function of scheduled tasks. Extract new and modified message queue logic and record changes in message topics, consumers, and producers of the message queue logic. Use Flyway to detect operations such as adding fields, deleting fields, and modifying types and constraints in database migration files, and select XML format for structured and formalized storage.

[0014] Preferably, MySQL is selected to establish a code feature library, the code feature library is defined, the ID field is designed as the unique identifier of the latest code change, the line number is designed as the specific number of lines of the latest code change, the change type is designed as the method of the latest code change, the submission time and submitter are designed as the submission record corresponding to the latest code change, SQL statements are run to create the database and table structure, and JDBC is used to set up connections for database interaction, the submission events of the latest code changes are automatically monitored through the pre-commit hook, the git diff command is used to extract the specific content of the latest code change, the latest code change information is inserted into the code feature library through the API interface, the records of the latest code changes are connected to the corresponding technical solutions according to the unique identifier of the latest code change, the code feature library is regularly checked for duplicate records, invalid changes and useless data through SQL queries, and is regularly compared with the latest code feature library. For deleted codes, the records in the code feature library are checked for need to be updated or deleted, a code feature library index is established according to the file path and submission time of the latest code change, the code feature library data is regularly backed up and the operation documents of the code feature library are maintained.

[0015] Preferably, the code feature library is accessed based on the unique identifier of the latest code change, and the technical solution corresponding to the record of the latest code change is pulled, the technical solution wiki document is parsed using regular expressions, and key change information items are extracted, and the Diff tool is used to compare the technical solution and key change information items corresponding to the record of the latest code change, and the same, different and missing online car-hailing business codes are recorded.

[0016] Preferably, a missing item diagnostic report is generated, and the different and missing change information items in the technical solution are sorted out in detail, the specific definition of the change information item in the technical solution is clearly described, and suggested supplementary measures are provided based on the description. When the missing key interface leads to an increase in the response time when performing operations, a rollback mechanism is established and the missing key interface is immediately implemented as a priority. When the modification in the technical solution is not implemented in the code, resulting in incompatibility between the existing functions and the new interface, the code is reviewed and compared item by item with the technical solution, and QA personnel are urged to trace the cause of the problem and immediately supplement the unimplemented modifications. When the configuration items are not updated as expected, resulting in logical errors in the online car-hailing business process, the online car-hailing business log is checked to repair the unupdated configuration items, and regression testing is performed on the affected online car-hailing business processes.

[0017] Preferably, notify QA personnel to read and understand the missing item diagnosis report, and classify the missing items according to priority and importance, design a new test case for each missing item, assign a unique ID based on the new test case, and set the preconditions for the new test to meet the key change information, write the expected results based on the supplementary measures, and record the results of the actual run of the new test for comparison, perform regression testing based on the supplementary measures combined with the new test case, summarize all test results and generate a detailed test report for problem tracking.

[0018] In the above technical solution, the technical effects and advantages provided by the present invention are:

[0019] Using PMD for code scanning helps the team identify potential problems in the code, helps improve the overall code quality, and reduces technical debt in future maintenance. By combining Git commands to extract code change records, you can clearly understand the specific changes of each submission. By defining new, modified, and deleted API interfaces, you can clearly grasp the changes in the interface. By extracting changes in message queue logic, you can clearly understand the changes in system communication. Using Flyway to detect operations performed in database migration files will ensure that changes in database structure are clearly recorded. Establishing a table structure containing unique identifiers, line numbers, change types, submission times, and submitters will systematize code change records. Through pre-commit hooks, ensure that each change is recorded in the feature library in a timely manner, reducing omissions and errors, and using git The diff command extracts the specific latest code changes to ensure that the information recorded in the feature library accurately reflects the actual changes in the code. Regularly checking and comparing feature library data can ensure the consistency of code feature library information with existing code, reduce invalid records and duplicate data, and improve the reliability of the code feature library. The code feature library is accessed through a unique identifier to ensure a clear understanding of the technical background and expected effects of each code change. Regular expressions are used to parse technical solution documents to improve the efficiency of obtaining necessary information from large documents and reduce human errors. Using the Diff tool to compare the latest code changes with the corresponding technical solutions can clearly identify the consistency between the changes and the technical intent. Detailed defect identification will help The development team promptly repairs and adjusts inconsistencies to ensure that the code behaves as expected. The specific definitions of missing change information items are clearly described in the diagnostic report to help quickly understand the importance and impact of each change and enhance communication effectiveness. Recommended supplementary measures are provided based on the description of the missing items to help quickly respond to problems and reduce potential business risks. Classifying missing items by priority and importance helps QA personnel focus on key issues and test the performance after changes in a more targeted manner. Combining supplementary measures with new test cases to perform regression testing ensures that the system can still maintain correct functionality after modification and verifies the effectiveness of supplementary measures. Detailed test reports help form a problem tracking mechanism to promote continuous attention to and repair of defects. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction to the drawings required for use in the embodiments will be given below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0021] Figure 1 This is a flow chart of a method for checking the integrity of a technical solution based on a code feature library according to the present invention. DETAILED DESCRIPTION

[0022] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.

[0023] The present invention provides Figure 1 The method for checking the integrity of a technical solution based on a code feature library shown includes the following steps:

[0024] Step 1: Select PMD as an automated code scanning tool to perform a thorough scan of the latest ride-hailing business code. Use Git commands to extract code change records, comprehensively define newly added, modified, and deleted API interfaces, configuration items, scheduled tasks, and message queue logic. Use Flyway to detect database migrations and store analysis results in a structured XML format.

[0025] Select PMD as the automated code scanning tool to traverse the latest code, create an XML file and configure PMD to define the coding rules to be checked through the rule set, determine the source code path of the online car-hailing business through the terminal, and run the command ". / path / to / pmd-bin-xxx / bin / run.sh The "pmd -d / path / to / your / source -R / path / to / ruleset.xml -fxml" command sets the PMD execution parameters, where the "-d" parameter is followed by the path to the source code of the online car-hailing business to be scanned, the "-R" parameter is followed by the path to the rule set file, and the "-f" parameter specifies the output format as XML. The output identifies the quality issues, specific locations, and descriptions of the latest code. Combined with the Git command, it views the submission records corresponding to the latest code changes. It defines new, modified, and deleted API interfaces, and records the HTTP methods, paths, request parameters, and response formats of the extracted API interfaces. It defines configuration items and records the new, modified, and deleted configuration items in the extracted configuration files, including but not limited to environment variables and configuration information files. It extracts new and modified scheduled task definitions and records the execution frequency and target function of scheduled tasks. It extracts new and modified message queue logic and records changes in message topics, consumers, and producers in the message queue logic. It uses Flyway to detect operations such as adding fields, deleting fields, and modifying types and constraints in database migration files, and selects XML format for structured formal storage.

[0026] Step 2: Create a code signature database using MySQL. Design a table structure that includes unique identifiers, row numbers, change types, submission times, and submitters. Use JDBC for database interaction. Use pre-commit hooks to monitor code changes and insert the latest code change information into the signature database. Regularly check and compare signature database data, create a code signature database index, and regularly back up data.

[0027] Select MySQL to establish a code feature library, define the code feature library, design the ID field as the unique identifier of the latest code change, design the line number as the specific number of lines of the latest code change, design the change type as the method of the latest code change, design the submission time and submitter as the submission record corresponding to the latest code change, run SQL statements to create the database and table structure, and use JDBC to set up connections for database interaction. Automatically monitor the submission events of the latest code changes through the pre-commit hook, use the git diff command to extract the specific content of the latest code changes, insert the latest code change information into the code feature library through the API interface, and connect the records of the latest code changes to the corresponding technical solution based on the unique identifier of the latest code change. Regularly check the code feature library for duplicate records, invalid changes, and useless data through SQL queries, and regularly compare with the latest code feature library to ensure that the code feature library information is consistent with the existing code. For deleted code, check whether the records in the code feature library need to be updated or deleted. Establish a code feature library index based on the file path and submission time of the latest code change to improve query performance. Regularly back up the code feature library data and maintain the operation documentation of the code feature library.

[0028] Step 3: Access the code feature library based on the unique identifier, pull the corresponding technical solution, parse the key information items, and compare the latest code changes with the technical solution using the Diff tool;

[0029] Access the code feature library based on the unique identifier of the latest code change, and pull the technical solution corresponding to the latest code change record. Use regular expressions to parse the technical solution wiki document and extract key change information items, including expected interface behavior changes, configuration item update instructions, and scheduled task adjustment descriptions. Use the Diff tool to compare the technical solution and key change information items corresponding to the latest code change record, and record the same, different, and missing online ride-hailing business codes, including missing interfaces, updated configurations, and the impact of scheduled tasks.

[0030] The expected interface behavior changes extracted using regular expressions are specifically as follows: "Interface name\s*:\s*(\w+)|(Input parameter changes\s*:\s*(.*?))|(Output parameter changes\s*:\s*(.*?))". The configuration item update description extracted using regular expressions is specifically as follows: "Configuration item\s*(new|modified|deleted)\s*:\s*(.*?)". The scheduled task adjustment description extracted using regular expressions is specifically as follows: "Scheduled task\s*(new|modified|cancelled)\s*:\s*(.*?)".

[0031] Step 4: Generate a missing item diagnostic report, establish a rollback mechanism to prioritize the implementation of missing key interfaces, conduct a code review and compare each item with the technical solution, and perform regression testing on the affected ride-hailing business processes;

[0032] Generate a missing item diagnostic report, and organize in detail the different and missing change information items in the technical solution, clearly describe the specific definition of the change information item in the technical solution, including name, type, function and expected behavior, and provide recommended supplementary measures based on the description. When the missing key interface leads to an increase in response time when performing operations, establish a rollback mechanism and immediately prioritize the implementation of the missing key interface. When the modification in the technical solution is not implemented in the code, resulting in incompatibility between the existing function and the new interface, compare the code with the technical solution item by item through code review, urge QA personnel to trace the cause of the problem, and immediately supplement the unimplemented modifications. When the configuration item is not updated as expected, resulting in logical errors in the online car-hailing business process, check the online car-hailing business log to repair the unupdated configuration items, and perform regression testing on the affected online car-hailing business process.

[0033] Step 5: Instruct QA personnel to read and understand the missing item diagnosis report, set preconditions and expected results for actual test comparison, perform regression testing in conjunction with supplementary measures, and summarize the test results to generate a detailed report for problem tracking.

[0034] Instruct QA personnel to read and understand the missing item diagnostic report, classify the missing items by priority and importance, design a new test case for each missing item, assign a unique ID based on the new test case, and set the preconditions for the new test to meet the key change information. Write the expected results based on the supplementary measures, record the actual results of the new test run for comparison, perform regression testing based on the supplementary measures combined with the new test case, summarize all test results and generate a detailed test report for problem tracking.

[0035] Example 1:

[0036] This invention ensures that key information about code changes is accurately recorded and reflected in the technical solution. Accurately recording and reflecting key information about code changes can avoid potential risks caused by missing or inconsistent information. Such risks can directly lead to incomplete software functionality or defects, which in turn affect user experience and the online ride-hailing business process. Regular inspections can help teams identify key areas of the online ride-hailing business process that may be missed. As complexity continues to increase, the introduction of automated tools becomes increasingly important. Using automated tools to scan and analyze the code within the online ride-hailing business process can significantly reduce the workload for developers and testers. By quickly and accurately detecting potential issues within the online ride-hailing business process, developers can focus more on implementing core functionality, while testers can conduct tests more efficiently, optimize test cases, and improve overall testing efficiency. Through unified tools and processes, developers and testers can more clearly see project progress and existing issues. The reports and results generated by the tools enable teams to better track issues and make decisions. Regular testing and feedback mechanisms improve the quality and efficiency of the online ride-hailing business process.

[0037] The above description is merely illustrative of certain exemplary embodiments of the present invention. It goes without saying that those skilled in the art will be able to modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the above drawings and description are illustrative in nature and should not be construed as limiting the scope of protection of the claims.

Claims

1. A method for checking the integrity of a technical solution based on a code feature library, characterized in that: The following steps are involved: Step 1: Select PMD as an automated code scanning tool to perform a thorough scan of the latest ride-hailing business code. Use Git commands to extract code change records, comprehensively define newly added, modified, and deleted API interfaces, configuration items, scheduled tasks, and message queue logic. Use Flyway to detect database migrations and store analysis results in a structured XML format. Step 2: Create a code signature database using MySQL. Design a table structure that includes unique identifiers, row numbers, change types, commit times, and committers. Use JDBC for database interaction. Use pre-commit hooks to monitor code changes and insert the latest code change information into the signature database. Regularly check and compare signature database data, create a code signature database index, and regularly back up data. Step 3: Access the code feature library based on the unique identifier, pull the corresponding technical solution, parse the key information items, and compare the latest code changes with the technical solution using the Diff tool; Step 4: Generate a missing item diagnostic report, establish a rollback mechanism to prioritize the implementation of missing key interfaces, conduct a code review and compare each item with the technical solution, and perform regression testing on the affected ride-hailing business processes; Step 5: Instruct QA personnel to read and understand the missing item diagnosis report, set preconditions and expected results for actual test comparison, perform regression testing in combination with supplementary measures, summarize the test results and generate a detailed report for problem tracking.

2. The method for checking the integrity of a technical solution based on a code feature library according to claim 1, characterized in that: In step one, PMD is selected as an automated code scanning tool to traverse the latest code, an XML file is created and PMD is configured to define the coding rules for inspection through the rule set, the source code path of the online car-hailing business is determined through the terminal, and the PMD execution parameters are set through the ". / path / to / pmd-binx.xx / bin / run.sh pmd-d / path / to / your / source-R / path / to / ruleset.xml-f xml" command. The quality issues, specific locations and descriptions of the latest code are identified and output, and the commit records corresponding to the content of the latest code changes are viewed in combination with the Git command, and the change information is extracted. Flyway is used to detect the operations of adding fields, deleting fields, and modifying types and constraints in the database migration file, and the XML format is selected for structured formal storage.

3. The method for checking the integrity of a technical solution based on a code feature library according to claim 2, characterized in that: The change information includes but is not limited to: defining new, modified, and deleted API interfaces, and recording the HTTP method, path, request parameters, and response format of the API interfaces; defining configuration items, and recording the new, modified, and deleted configuration items in the configuration files; extracting new and modified scheduled task definitions, and recording the execution frequency and target function of the scheduled tasks; extracting new and modified message queue logic, and recording changes in the message topics, consumers, and producers of the message queue logic.

4. The method for checking the integrity of a technical solution based on a code feature library according to claim 1, characterized in that: In the step 2, MySQL is selected to establish a code feature library, the code feature library is defined, an ID field is designed as a unique identifier of the latest code change, a line number is designed as the specific number of lines of the latest code change, a change type is designed as the method of the latest code change, a submission time and a submitter are designed as submission records corresponding to the latest code change, SQL statements are run to create a database and table structure, and a connection is set up using JDBC for database interaction, submission events of the latest code changes are automatically monitored through a pre-commit hook, the content of the specific latest code change is extracted using the git diff command, the latest code change information is inserted into the code feature library through an API interface, the record of the latest code change is connected to the corresponding technical solution according to the unique identifier of the latest code change, the code feature library is regularly checked for duplicate records, invalid changes and useless data through SQL queries, and the code feature library is regularly compared with the latest code feature library. For deleted codes, the records in the code feature library are checked for need to be updated or deleted, a code feature library index is established according to the file path and submission time of the latest code change, the code feature library data is regularly backed up and the operation documents of the code feature library are maintained.

5. The method for checking the integrity of a technical solution based on a code feature library according to claim 1, characterized in that: In step three, the code feature library is accessed based on the unique identifier of the latest code change, and the technical solution corresponding to the record of the latest code change is pulled. The technical solution wiki document is parsed using regular expressions, and key change information items are extracted. The Diff tool is used to compare the technical solution and key change information items corresponding to the record of the latest code change, and the same, different and missing online car-hailing business codes are recorded.

6. The method for checking the integrity of a technical solution based on a code feature library according to claim 1, characterized in that: In the step four, a missing item diagnostic report is generated, and the different and missing change information items in the technical solution are sorted out in detail, the specific definition of the change information item in the technical solution is clearly described, and suggested supplementary measures are provided based on the description. When the missing key interface leads to an increase in response time when executing the operation, a rollback mechanism is established and the missing key interface is immediately implemented as a priority. When the modification in the technical solution is not implemented in the code, resulting in incompatibility between the existing function and the new interface, the code is reviewed and compared item by item with the technical solution, and QA personnel are urged to trace the cause of the problem and immediately supplement the unimplemented modifications. When the configuration item is not updated as expected, resulting in a logical error in the online car-hailing business process, the online car-hailing business log is checked to repair the unupdated configuration item, and regression testing is performed on the affected online car-hailing business process.

7. The method for checking the integrity of a technical solution based on a code feature library according to claim 1, characterized in that: In step five, the QA personnel are notified to read and understand the missing item diagnosis report, and classify the missing items according to priority and importance. A new test case is designed for each missing item, a unique ID is assigned according to the new test case, and the preconditions for the new test to meet the key change information are set. The expected results are written according to the supplementary measures, and the results of the actual operation of the new test are recorded for comparison. The supplementary measures are combined with the new test case to perform regression testing, all test results are summarized and a detailed test report is generated for problem tracking.