Intelligent Compilation Method and System for Software Development Kit Based on Cloud Platform
By intelligently compiling the software development package on the cloud platform, using the difference coefficients and cross-impact coefficients to analyze merge conflicts, setting conflict thresholds, the merge conflict problems between development branches are solved, compilation efficiency and software stability are improved, and intelligent early warning and repair are achieved.
Patent Information
- Application Number
- CN202411109810.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2044-08-14
AI Technical Summary
During the software development process, the differences and cross-effects between each development branch and the main branch lead to frequent merge conflicts, affecting the stability and development efficiency of the software. The lack of intelligent analysis and early warning mechanisms makes it difficult to effectively solve existing optimization methods.
The intelligent compilation method based on the cloud platform generates the difference coefficient Cyxs and the cross-impact coefficient Jyxs through code parsing, dependency analysis and preliminary optimization, sets the conflict threshold V, intelligently analyzes the degree of merge conflict, and issues early warning instructions to perform intelligent pre-compilation repair.
It reduces conflict problems during branch merging, improves compilation efficiency and software stability, reduces development risks, provides intelligent early warning and repair methods, and improves code quality and consistency.
Smart Images

Figure CN118760434B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent compilation, and particularly to an intelligent compilation method and system for a software development kit based on a cloud platform. Background Art
[0002] In the field of software engineering, especially in the cross-field of cloud computing and distributed development, a software development kit (SDK) is a crucial tool that provides libraries and tools required for developing specific applications or services. Before intelligent compilation, during the software development process, there will be multiple branches of corrections and updates. At this time, the cross-influence between each development branch and the differences between each branch and the main branch will have a significant impact on the later compilation results. If these conflicts and differences are not discovered and processed in a timely manner, it may lead to a large number of conflicts during code merging, thereby affecting the stability and function implementation of the software.
[0003] In the Chinese invention patent with the application publication number CN113031966B, a deep learning compilation optimization method for intelligently selecting a compilation acceleration library is disclosed, including: by adding a compilation acceleration library to a deep learning compiler, combining the respective advantages of the deep learning compiler and the compilation acceleration library to further improve the inference speed of a deep neural network. First, add translation methods for various operators in the deep learning compiler for the compilation acceleration library to automatically convert various operators into forms recognizable by the compilation acceleration library. Secondly, propose a method for calling the compilation acceleration library in the deep learning compiler to implement the execution of various operators through the compilation acceleration library. Then, compare the optimization effect with the compilation acceleration library during the operator optimization stage of the deep learning compiler to select the optimal solution. Finally, propose a code generation method for combining the compilation acceleration library in the deep learning compiler to generate optimized executable code to further optimize the deep neural network.
[0004] In the technical solution described in the above application, compared with the traditional system, this technical method can take into account the respective advantages of the deep learning compiler and the compilation acceleration library. By adding support for the compilation acceleration library to the open-source deep learning compiler, it further improves the inference speed of the deep neural network. However, combining the existing technology and the above application, since before intelligent compilation, the corrections of each development branch in the software development process will affect the differences between it and the main branch, and at the same time, the cross-influence between each branch often leads to frequent merging conflicts, thereby affecting the stability and development efficiency of the software, and lacking an intelligent analysis and warning mechanism, it is easy to have compilation errors during the compilation process, which makes it difficult for the existing optimization methods to play an actual role. Summary of the Invention
[0005] In view of the deficiencies of the prior art, the present invention provides an intelligent compilation method and system for a software development kit based on a cloud platform, which solves the problems in the above-mentioned background art.
[0006] To achieve the above objectives, the present invention is realized through the following technical solutions: An intelligent compilation method for a software development kit based on a cloud platform includes the following steps.
[0007] S1. Obtain the software development kit in advance and upload it to the cloud platform. The cloud platform preprocesses the software development kit, including code parsing, dependency analysis, and preliminary code optimization.
[0008] S2. Obtain the preprocessed software development kit according to step S1, and monitor the relevant development task data information in the preprocessed software development kit. At the same time, during the continuous software development process, record the relevant difference data information between the main branch and each development branch, comprehensively construct a development status set, generate a difference coefficient Cyxs according to the development status set. If the difference coefficient Cyxs exceeds the safety threshold, send a mobilization warning instruction.
[0009] S3. After receiving the mobilization warning instruction, synchronize the modification results of each development branch to the main branch. During the software development process, collect the relevant associated data information between each development branch to generate a branch cross-influence set, generate a cross-influence coefficient Jyxs according to the branch cross-influence set. Based on machine learning technology, by associating the cross-influence coefficient Jyxs with the difference coefficient Cyxs and performing dimensionless processing, fit to obtain a merge conflict index Hczs.
[0010] S4. Preset a conflict threshold V, and compare and analyze the conflict threshold V with the merge conflict index Hczs to comprehensively judge the conflict degree during branch merging in the current software development kit; issue a warning instruction according to the corresponding conflict degree and take pre-repair measures before intelligent compilation.
[0011] Preferably, S11. Perform code parsing, dependency analysis, and preliminary code optimization on the software development kit in the cloud platform in sequence. Among them, code parsing includes scanning the software development kit uploaded to the cloud platform to identify the programming language and file type, and using a parser to perform syntax analysis on the code to generate an abstract syntax tree.
[0012] S12. Dependency analysis includes identifying the files on which each file depends through the parsed code, and constructing a dependency graph according to the parsing results. Represent the nodes in the dependency graph as files and the edges as dependency relationships.
[0013] S13. Preliminary code optimization includes using code formatting tools to unify the format of the code in the software development kit; and using static analysis tools to detect potential errors, code smells, and security vulnerabilities, correcting the code according to the static analysis report, and then identifying and deleting unused code to reduce code redundancy.
[0014] Preferably, in S21, the development status set includes relevant development task data information and relevant difference data information. Based on the software development kit preprocessed in step S1, the relevant development task data information in the software development kit will be monitored and recorded. The relevant development task data information includes the code base Dmjs, the number of dependencies Yssp, and the test coverage rate Cfq.
[0015] And during the continuous software development process, the relevant difference data information between the main branch and each development branch in the software development kit will be monitored and recorded. The relevant difference data information includes the synchronization frequency Tbp and the code change difference Dcb.
[0016] Preferably, in S22, based on the relevant development task data information obtained in step S21, the test coverage rate Cfq is associated with the number of dependencies Yssp, and after dimensionless processing, the complexity factor Fcyz of the task is calculated. The complexity factor Fcyz is obtained through the following formula:
[0017] ;
[0018] In the formula, Dmjs represents the code base, respectively represent the weight coefficients of the number of dependencies Yssp, the test coverage rate Cfq, and the code base Dmjs.
[0019] Preferably, in S23, based on the relevant difference data information between the main branch and each development branch in the software development kit, and combined with the complexity factor Fcyz obtained in step S22, the difference coefficient Cyxs is obtained. The difference coefficient Cyxs is obtained through the following formula:
[0020] ;
[0021] In the formula, Dcb represents the code change difference, Tbp represents the synchronization frequency, , and are all weight coefficients, represents the first correction constant;
[0022] S231. Preset a security threshold, compare and analyze the security threshold with the difference coefficient Cyxs to preliminarily determine whether it is necessary to synchronize the modification results of each development branch to the main branch during the current software development process.
[0023] If the coefficient of variation Cyxs exceeds the safety threshold, a transfer warning instruction is sent outwards. At this time, further analysis will be carried out and step S3 will be executed;
[0024] If the coefficient of variation Cyxs does not exceed the safety threshold, there is no need to send out a transfer warning instruction outwards for the time being.
[0025] Preferably, S31: When a transfer warning instruction is received, at this time, the modification results of each development branch are synchronized to the inside of the main branch to keep the code synchronization in the software development package in a normal state;
[0026] S32: During the software development process, relevant data information between each development branch is monitored and collected, and a branch cross-influence set is generated. The branch cross-influence set includes the number of dependency relationships Yjss, the overlap ratio Cdbz, and the number of branches Fzs.
[0027] Preferably, S33: Based on the branch cross-influence set, after dimensionless processing of the number of dependency relationships Yjss, the overlap ratio Cdbz, and the number of branches Fzs, a cross-influence coefficient Jyxs is constructed. The cross-influence coefficient Jyxs is obtained through the following formula:
[0028] ;
[0029] In the formula, Fzs represents the number of branches, Yjss represents the number of dependency relationships, and Cdbz represents the overlap ratio, and are weight coefficients, and C represents the second correction constant.
[0030] Preferably, the acquisition method of the merge conflict index Hczs is as follows: By associating the cross-influence coefficient Jyxs with the coefficient of variation Cyxs and performing dimensionless processing, the corresponding data values are mapped to the interval inside, according to the following formula:
[0031] ;
[0032] In the formula, represents the number of modification conflicts, represents the merge time-consuming, , are weight coefficients, and N represents the third correction constant.
[0033] Preferably, a conflict threshold V is preset. By comparing and analyzing the merge conflict index Hczs with the conflict threshold V, the conflict degree during branch merging in the current software development package is comprehensively judged, and a warning instruction is issued according to the corresponding conflict degree to make pre - repair means before intelligent compilation. The specific content is as follows:
[0034] If the merge conflict index Hczs is greater than the conflict threshold V, it indicates that the conflict degree during the current branch merging is in an abnormal state. At this time, a red conflict warning instruction will be sent to the developer, and the files and code segments with conflicts will be prompted. The conflict points will be automatically detected, and the specific conflict positions will be marked in the code. Then, a refactoring suggestion will be provided for the dependency relationship;
[0035] If the merge conflict index Hczs is equal to the conflict threshold V, it indicates that the conflict degree during the current branch merging is in a critical state and there is a conflict risk. At this time, an orange conflict warning instruction will be sent to the developer, and detailed information about the conflict points will be provided. At the same time, it is recommended to merge in stages and on a small scale to gradually resolve the conflicts, and run automated tests to ensure that the merged code remains stable and functionally complete;
[0036] If the merge conflict index Hczs is less than the conflict threshold V, it indicates that the conflict degree during the current branch merging is not in an abnormal state. At this time, a regular merge will be performed, and the merge process will be recorded to ensure that all changes are recorded for future reference.
[0037] An intelligent compilation system for a software development package based on a cloud platform includes a processing module, a development monitoring module, a difference analysis module, an inter - branch monitoring module, a correlation analysis module, and a repair module;
[0038] The processing module pre - obtains the software development package and uploads the software development package to the cloud platform. The cloud platform pre - processes the software development package, including code parsing, dependency relationship analysis, and preliminary code optimization;
[0039] The development monitoring module obtains the pre - processed software development package according to step S1, monitors the relevant development task data information in the pre - processed software development package, and records the relevant difference data information between the main branch and each development branch during the continuous software development process, and comprehensively constructs a development status set;
[0040] The difference analysis module generates a difference coefficient Cyxs according to the development status set. If the difference coefficient Cyxs exceeds the safety threshold, a mobilization warning instruction is issued;
[0041] After receiving the mobilization warning instruction, the inter-branch monitoring module synchronizes the modification results of each development branch to the main branch, and collects the relevant data information between the development branches during the software development process to generate a branch cross-influence set;
[0042] The correlation analysis module generates a cross-influence coefficient Jyxs according to the branch cross-influence set. Based on machine learning technology, by correlating the cross-influence coefficient Jyxs with the difference coefficient Cyxs and performing dimensionless processing, the merged conflict index Hczs is obtained by fitting;
[0043] The repair module pre-sets a conflict threshold V, and compares and analyzes the conflict threshold V with the merged conflict index Hczs to comprehensively judge the conflict degree during the branch merge in the current software development package; issue a warning instruction according to the corresponding conflict degree and make pre-intelligent compilation repair means.
[0044] The present invention provides an intelligent compilation method and system for a software development package based on a cloud platform, having the following beneficial effects:
[0045] (1) Through step S1, the software development kit is preprocessed, including code parsing, dependency analysis, and preliminary code optimization, further ensuring that the software development kit uploaded to the cloud platform has high quality at the initial stage. This preprocessing process can automatically identify potential problems in the code and optimize them at an early stage, thus reducing possible problems in the subsequent development process. In step S2, the system monitors the relevant development task data information in the preprocessed software development kit and records the relevant difference data information between the main branch and each development branch. By generating a difference coefficient Cyxs and issuing a transfer warning instruction when the difference coefficient exceeds the safety threshold, developers can be timely reminded to pay attention to and solve potential merge conflict problems, further preventing problem accumulation. After receiving the transfer warning instruction in step S3, the modification results of each development branch are synchronized to the main branch, and the relevant associated data information between each development branch is collected to generate a branch cross-influence set. Through machine learning technology, the cross-influence coefficient Jyxs is associated with the difference coefficient Cyxs and dimensionless processed to fit and obtain a merge conflict index Hczs. This process ensures that during the synchronization process, the system can intelligently analyze and manage conflicts between branches, preparing for effective synchronization in the later stage. In step S4, by setting a conflict threshold V and comparing and analyzing it with the merge conflict index Hczs, the conflict degree during branch merging is comprehensively judged, and a warning instruction is issued according to the conflict degree. For different conflict degrees, the system can make corresponding intelligent pre-compilation repair measures, such as automatically detecting and marking conflict points, providing merge suggestions, and running automated tests, thereby reducing the manual processing workload of developers and improving the quality and consistency of the code before compilation. Through the implementation of the above steps, the system can effectively reduce conflict problems during branch merging, improve the overall compilation efficiency, and ensure the stability of the software after merging.
[0046] Compared with traditional methods, this intelligent compilation method can better analyze the conflict degree of the current merge based on the dependencies between branches and code changes, preparing for a more efficient compilation process and a more reliable compilation result. In short, the intelligent compilation method for software development kits based on the cloud platform, through automated preprocessing, real-time monitoring, intelligent synchronization, and precise warning, not only improves the compilation efficiency and code quality in the software development process but also significantly reduces the development risks caused by branch merge conflicts, providing a more intelligent and efficient development environment for developers.
[0047] (2)Generate the difference coefficient Cyxs based on the development status set, and evaluate the difference degree between the main branch and each development branch through the difference coefficient Cyxs. If the difference coefficient Cyxs exceeds the safety threshold, a transfer warning instruction will be issued to prompt developers to synchronize and coordinate in a timely manner, effectively reducing the occurrence of merge conflicts. A transfer warning instruction will also be issued to prompt developers to perform synchronization operations in a timely manner, reducing the difference between the main branch and the development branch, and reducing the risk of merge conflicts caused by excessive differences. By monitoring and recording difference information in real time, potential conflict points can be identified in advance, and corresponding preventive measures can be taken to ensure the smooth progress of the code merging process, improving development efficiency and the overall quality of the software.
[0048] (3)In the branch cross - influence analysis of the present invention, multi - dimensional factors are comprehensively considered, which further accurately reflects the cross - influence degree between branches. By synchronizing branches in a timely manner and monitoring branch cross - influence, the system can dynamically adjust the code synchronization and optimization strategies in the development process. Compared with the prior art, the accuracy and intelligence level of warning and repair are significantly improved, and the occurrence of compilation errors is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a schematic diagram of the steps of the intelligent compilation method for the software development package based on the cloud platform of the present invention;
[0050] Figure 2 It is a schematic diagram of the process of the intelligent compilation system for the software development package based on the cloud platform of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0051] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0052] Embodiment 1
[0053] Please refer to Figure 1 , the present invention provides an intelligent compilation method for a software development package based on a cloud platform, including the following steps,
[0054] S1. Obtain the software development package in advance and upload the software development package to the cloud platform. The cloud platform pre - processes the software development package, including code parsing, dependency analysis, and preliminary code optimization, eliminating many potential problems in advance and ensuring the basic quality of the development package.
[0055] S2. Obtain the preprocessed software development kit according to step S1, monitor the relevant development task data information in the preprocessed software development kit, and record the relevant difference data information between the main branch and each development branch during the continuous software development process. Comprehensively construct a development status set, generate a difference coefficient Cyxs based on the development status set. If the difference coefficient Cyxs exceeds the safety threshold, issue a transfer warning instruction to remind developers to handle potential conflict problems. This active monitoring and warning mechanism effectively prevents the accumulation and deterioration of problems.
[0056] S3. After receiving the transfer warning instruction, synchronize the modification results of each development branch to the main branch, and collect the relevant associated data information between each development branch during the software development process to generate a branch cross-influence set. Generate a cross-influence coefficient Jyxs based on the branch cross-influence set. Based on machine learning technology, by correlating the cross-influence coefficient Jyxs with the difference coefficient Cyxs and performing dimensionless processing, fit and obtain the merge conflict index Hczs;
[0057] S4. Preset a conflict threshold V, compare and analyze the conflict threshold V with the merge conflict index Hczs to comprehensively judge the conflict degree during branch merging in the current software development kit; issue a warning instruction according to the corresponding conflict degree and make an intelligent pre-compilation repair method.
[0058] In this embodiment, through code parsing, dependency analysis, and preliminary code optimization in step S1, it is ensured that the software development kit has been preliminarily optimized and organized after being uploaded to the cloud platform, reducing dependency issues and code quality issues during subsequent development. In step S2, the relevant development task data information in the preprocessed software development kit is monitored, the differences between the main branch and each development branch are recorded in real time, and a difference coefficient Cyxs is generated. When the difference coefficient Cyxs exceeds the safety threshold, a mobilization warning instruction is issued to promptly remind the developer to handle the difference problem and prevent the differences from accumulating to an intractable level. In step S3, after receiving the mobilization warning instruction, the modification results of each development branch are synchronized to the main branch, and the relevant associated data information between each development branch is collected to generate a branch cross-influence set and a cross-influence coefficient Jyxs. Through dimensionless processing based on machine learning technology, the cross-influence coefficient Jyxs is associated with the difference coefficient Cyxs, and the merging conflict index Hczs is obtained by fitting. This process effectively predicts and quantifies the risk of merging conflicts. A conflict threshold V is preset and compared with the merging conflict index Hczs to determine the conflict degree when branches in the current software development kit are merged. Warning instructions are issued according to the conflict degree, and corresponding repair measures are provided, such as automatic conflict detection and marking and code review suggestions, significantly reducing the occurrence frequency and handling difficulty of merging conflicts. Machine learning technology is adopted in the whole method. Through dimensionless processing and fitting of multi-dimensional data, the merging conflict index Hczs is intelligently generated. This intelligent process reduces the workload of manual analysis and judgment, improves the accuracy and efficiency of processing. According to the comparison result of the conflict index and the conflict threshold, corresponding warnings and repair measures are automatically provided, greatly reducing the manual processing work of developers and making the development process more efficient and reliable.
[0059] Embodiment 2
[0060] Please refer to Figure 1 , specifically: S11. The software development kits in the cloud platform are successively subjected to code parsing, dependency analysis, and preliminary code optimization. Among them, code parsing includes scanning the software development kits uploaded to the cloud platform to identify the programming language and file type, and using a parser to perform syntax analysis on the code to generate an abstract syntax tree. The parser checks whether the syntax of the code is correct, identifies structures such as classes, functions, and variables, and performs semantic analysis based on the generated abstract syntax tree to ensure the consistency of code logic and language rules.
[0061] S12. Dependency analysis involves identifying the files that each file depends on through the parsed code, constructing a dependency graph based on the parsing results, representing the nodes in the dependency graph as files and the edges as dependency relationships. Through the dependency graph, it can be clearly seen which files depend on other files or which modules depend on other modules;
[0062] S13. Preliminary code optimization includes using code formatting tools such as Prettier, Black, and clang-format to unify the format of the code in the software development kit, ensuring consistent code style for easy reading and maintenance; and using static analysis tools such as SonarQube, ESLint, and Pylint to detect potential errors, code smells, and security vulnerabilities, correcting the code according to the static analysis report, and then identifying and deleting unused code, i.e., dead code, to reduce code redundancy.
[0063] In this embodiment, by comprehensively scanning the software development kit, identifying the programming language and file type, and generating an abstract syntax tree for syntax analysis and semantic analysis, the syntax and logical consistency of the code are further ensured. Creating a symbol table to record symbols such as variables, functions, and classes in the code and their attributes enhances the readability and maintainability of the code. Using a code formatting tool to unify the format of the code ensures a consistent code style, making the code easier to read and maintain and reducing the risk of code conflicts during team cooperation. By constructing a dependency graph, the dependency relationships between files and modules are clearly shown, enabling developers to better understand the code structure, optimize the coupling degree between modules, and thus improve the stability and scalability of the system. Using a static analysis tool to detect potential errors, code smells, and security vulnerabilities and correcting the code according to the analysis report reduce errors and vulnerabilities in the code, improving the robustness and security of the code. Identifying and deleting unused code reduces code redundancy and improves the efficiency and maintainability of the code.
[0064] Embodiment 3
[0065] Please refer to Figure 1 Specifically: S21. The development status set includes relevant development task data information and relevant difference data information. Based on the software development kit preprocessed in step S1, the relevant development task data information in the software development kit will be monitored and recorded. The relevant development task data information includes the code base Dmjs, the number of dependencies Yssp, and the test coverage rate Cfq;
[0066] During the continuous development of the software, the relevant difference data information between the main branch and each development branch in the software development kit will be monitored and recorded. The relevant difference data information includes the synchronization frequency Tbp and the code change difference Dcb.
[0067] In this embodiment, by monitoring and recording the code base Dmjs in the software development kit, the scale and complexity of the project can be further accurately evaluated, providing a reliable basis for resource allocation and development planning. Monitoring the number of dependencies Yssp helps identify the dependency relationships between modules in the project, detect potential dependency conflicts in advance, and ensure the coordination and compatibility between modules. By recording the test coverage Cfq, the test perfection degree of the project can be understood in real time, test blind spots can be detected in time, and the reliability and stability of the software can be improved. Monitoring the synchronization frequency between the main branch and each development branch helps to understand the synchronization situation between branches in time, prompting developers to synchronize frequently and reducing merge conflicts caused by excessive differences between branches. By recording the code change difference Dcb, the code change amount of each development branch relative to the main branch can be accurately evaluated, potential conflict points can be identified, and measures can be taken in advance for coordination and optimization. By comprehensively monitoring the relevant development task data information and relevant difference data information, a development status set is constructed to provide comprehensive and real-time monitoring and recording of the development process, helping the development team better understand the project progress and current status.
[0068] Embodiment 4
[0069] Please refer to Figure 1 , specifically: S22. According to the relevant development task data information obtained in step S21, the test coverage Cfq is associated with the number of dependencies Yssp, and after dimensionless processing, the complexity factor Fcyz of the task is calculated. The complexity factor Fcyz is obtained through the following formula:
[0070] ;
[0071] In the formula, Dmjs represents the code base, respectively represent the weight coefficients of the number of dependencies Yssp, the test coverage Cfq, and the code base Dmjs. Among them, 0 < ≤1, 0 < ≤1, 0 < ≤1, and =1.
[0072] The above-mentioned number of dependencies Yssp can parse the dependency files of the project through a dependency management tool and count the number of dependencies.
[0073] The test coverage Cfq can generate a coverage report after executing tests through a test coverage tool.
[0074] The code base Dmjs can count the number of code lines or the number of code files through a code statistics tool.
[0075] S23. Obtain the difference coefficient Cyxs based on the relevant difference data information between the main branch and each development branch in the software development kit, and in combination with the complexity factor Fcyz obtained in step S22. The difference coefficient Cyxs is obtained through the following formula:
[0076] ;
[0077] In the formula, Dcb represents the code change difference, and Tbp represents the synchronization frequency. 、 and are all weight coefficients. Among them, 0 < ≤ 1, 0 < ≤ 1, 0 < ≤ 1, and + + = 1. represents the first correction constant.
[0078] The above-mentioned code change difference Dcb refers to the difference in the modification range between branches, and the code differences between branches are compared through the version control system.
[0079] The synchronization frequency Tbp can be obtained by recording the synchronization operation frequency of the branch and the main branch.
[0080] S231. Preset a safety threshold, and compare and analyze the safety threshold with the difference coefficient Cyxs to initially judge whether it is necessary to synchronize the modification results of each development branch to the main branch during the development of the current software;
[0081] If the difference coefficient Cyxs exceeds the safety threshold, send out a transfer warning instruction. At this time, further analysis will be carried out and step S3 will be executed; remind developers to synchronize branches in time to reduce the risk of merge conflicts. This mechanism effectively guarantees the stability and consistency of the main branch, and improves the development efficiency and software quality.
[0082] If the difference coefficient Cyxs does not exceed the safety threshold, there is no need to send out a transfer warning instruction temporarily, which avoids unnecessary branch synchronization operations, reduces interference during the development process, and maintains the coherence and high efficiency of the development work.
[0083] In this embodiment, the complexity factor Fcyz of the task is calculated. This factor comprehensively reflects the complexity of the code, the test coverage, and the dependencies, providing a scientific basis for evaluating the difficulty of the development task and helping to better plan the development resources and time. Based on the code change difference Dcb and the synchronization frequency Tbp between the main branch and each development branch, combined with the complexity factor Fcyz, the difference coefficient Cyxs is calculated. The difference coefficient Cyxs reflects the difference degree between branches in real time, helping the development team to detect and resolve potential merge conflicts in a timely manner. A safety threshold is set in advance and compared with the difference coefficient Cyxs for analysis. Through the automated data monitoring, analysis, and warning mechanism, the intelligent management of the development process is realized, reducing manual intervention and subjective judgment, and improving the overall development efficiency and quality. In summary, by introducing the calculation of the complexity factor Fcyz and the difference coefficient Cyxs, this system effectively improves the development efficiency and compilation quality of the software development package on the cloud platform, reduces the occurrence of merge conflicts, ensures the stability and consistency of the software, and has significant novelty and practical application value.
[0084] Embodiment 5
[0085] Please refer to Figure 1 , specifically: S31. When a transfer warning instruction is received, at this time, the modification results of each development branch are synchronized to the inside of the main branch to keep the code synchronization in the software development package in a normal state;
[0086] S32. During the software development process, monitor and collect the relevant data information between each development branch, and generate a branch cross-influence set. The branch cross-influence set includes the number of dependency relationships Yjss, the overlap ratio Cdbz, and the number of branches Fzs.
[0087] S33. Based on the branch cross-influence set, after dimensionless processing of the number of dependency relationships Yjss, the overlap ratio Cdbz, and the number of branches Fzs, a cross-influence coefficient Jyxs is constructed. The cross-influence coefficient Jyxs is obtained through the following formula:
[0088] ;
[0089] In the formula, Fzs represents the number of branches, Yjss represents the number of dependency relationships, Cdbz represents the overlap ratio, and are weight coefficients, where 0 < ≤1, 0 < ≤1, and + = 1, and C represents the second correction constant.
[0090] The above-mentioned number of branches Fzs can query the number of existing branches currently through the version control system.
[0091] The number of dependency relationships Yjss refers to the number of other feature branches or shared code libraries that a branch depends on, and resolves the dependency files of the project through a dependency management tool;
[0092] The overlapping ratio Cdbz is used to describe the degree of overlap of the code change ranges between different branches, and is obtained by calculating the ratio of the number of code lines modified by multiple branches in the code library to the total number of code lines.
[0093] In this embodiment, when receiving a transfer warning instruction, the modification results of each development branch are synchronized to the main branch to ensure that the code in the software development package is synchronized in a normal state. This measure can effectively reduce merge conflicts caused by out-of-sync, and improve development efficiency and code quality. During the development process, monitor and collect the relevant data information between each development branch, including the number of dependency relationships Yjss, the overlapping ratio Cdbz, and the number of branches Fzs, and generate a set of cross-influence of branches. Through comprehensive data information collection, the cross-influence between each branch can be deeply understood, providing accurate decision support. Based on the set of cross-influence of branches, the cross-influence coefficient Jyxs is calculated through a formula. The introduction of the cross-influence coefficient Jyxs enables the system to quantify the degree of cross-influence between different development branches. Before intelligent compilation, the system can identify potential conflict points in advance, perform corresponding repairs and adjustments, ensure the smooth progress of the compilation process, and improve compilation efficiency and code quality.
[0094] Embodiment 6
[0095] Please refer to Figure 1 , specifically: S34. The acquisition method of the merge conflict index Hczs is as follows: By associating the cross-influence coefficient Jyxs with the difference coefficient Cyxs and performing dimensionless processing, the corresponding data value is mapped to the interval According to the following formula:
[0096] ;
[0097] In the formula, represents the number of modification conflicts, represents the merge time-consuming, , are weight coefficients, N represents the third correction constant, where 0 < ≤1, 0 < ≤1, 0 < ≤1, 0 < ≤1, and + = 1.
[0098] The above-mentioned number of modification conflicts refers to the number of conflicts automatically detected during the merge process through the version control system.
[0099] Merge time consumption The time consumption can be calculated by recording the start and end times of the merge operation.
[0100] Preset a conflict threshold V. By comparing and analyzing the merge conflict index Hczs with the conflict threshold V, comprehensively judge the conflict degree during branch merging within the current software development package, and issue a warning instruction according to the corresponding conflict degree to make pre-repair means before intelligent compilation. The specific content is as follows:
[0101] If the merge conflict index Hczs is greater than the conflict threshold V, it means that the conflict degree during the current branch merge is in an abnormal state, there are many conflict problems, and there is a greater risk in the merge. At this time, a red conflict warning instruction will be sent to the developer, and the files and code segments with conflicts will be prompted, the conflict points will be automatically detected, and the specific conflict positions will be marked in the code. Then, reconstruction suggestions will be provided for the dependency relationship to reduce the possibility of future merge conflicts;
[0102] If the merge conflict index Hczs is equal to the conflict threshold V, it means that the conflict degree during the current branch merge is in a critical state, there is a conflict risk, but it is not particularly high. At this time, an orange conflict warning instruction will be sent to the developer, and detailed information about the conflict points will be provided. At the same time, it is recommended to merge in stages and on a small scale to gradually resolve the conflicts, and run automated tests to ensure that the merged code remains stable and functionally complete.
[0103] If the merge conflict index Hczs is less than the conflict threshold V, it means that the conflict degree during the current branch merge is not in an abnormal state, there are few conflict problems, and the merge risk is low. At this time, a regular merge will be performed, and the merge process will be recorded to ensure that all changes are recorded for future reference. By comparing and analyzing the merge conflict index Hczs with the conflict threshold V, corresponding repair means can be taken before intelligent compilation to ensure the smooth progress of the branch merge process, reduce the conflict risk, and improve the code quality and team collaboration efficiency.
[0104] In this embodiment, by generating a merge conflict index Hczs, this method makes it possible to quantify the conflict risk. Developers can clearly understand the conflict degree of the current branch merge, providing a clear merge risk assessment criterion. Based on the comparative analysis of the merge conflict index Hczs and the conflict threshold V, the system can intelligently issue conflict warning instructions at different levels. This hierarchical warning mechanism ensures that developers take corresponding measures under different conflict risks, effectively reducing the occurrence of merge conflicts and providing targeted repair suggestions. When the merge conflict index Hczs is greater than the threshold, it indicates that there are more conflicts and higher risks. The system automatically detects and marks the specific conflict positions, providing refactoring suggestions to help developers solve complex conflict problems in a timely manner. When the merge conflict index Hczs is equal to the threshold, it indicates that the conflict risk is in a critical state. The system recommends merging in stages and on a small scale to gradually resolve the conflicts, while running automated tests to ensure code stability and functional integrity. When the merge conflict index is less than the threshold V, it indicates that there are fewer conflicts and lower risks. Through automated tools and intelligent algorithms, developers can solve conflict problems faster and focus on function development and optimization. The system records all changes in detail during each merge process to ensure that the merge process is transparent and traceable. This recording mechanism not only improves the traceability of the code but also facilitates collaboration and communication among team members, ensuring the consistency and stability of code quality. In high-risk conflict situations, the system automatically analyzes the dependency relationships and provides code refactoring suggestions to help developers optimize the code structure and reduce future merge conflicts. This optimization mechanism not only improves the efficiency of current development but also lays a solid foundation for future development work. Through the above methods and technologies, the present invention significantly improves the development efficiency and compilation quality of the software development package on the cloud platform, reduces the occurrence of merge conflicts, and has high practical application value and innovation.
[0105] Embodiment 7
[0106] Please refer to Figure 1 and Figure 2 , specifically: An intelligent compilation system for a software development package based on a cloud platform, including a processing module, a development monitoring module, a difference analysis module, an inter-branch monitoring module, a correlation analysis module, and a repair module;
[0107] The processing module pre-obtains the software development package and uploads the software development package to the cloud platform. The cloud platform preprocesses the software development package, including code parsing, dependency relationship analysis, and preliminary code optimization;
[0108] The development monitoring module obtains the preprocessed software development package according to step S1, monitors the relevant development task data information in the preprocessed software development package, and records the relevant difference data information between the main branch and each development branch during the continuous software development process, and comprehensively constructs a development status set;
[0109] The difference analysis module generates a difference coefficient Cyxs according to the development status set. If the difference coefficient Cyxs exceeds the safety threshold, a mobilization warning instruction is issued;
[0110] After receiving the mobilization warning instruction, the inter-branch monitoring module synchronizes the modification results of each development branch to the main branch, and collects the relevant associated data information between each development branch during the software development process to generate an inter-branch cross-influence set;
[0111] The association analysis module generates a cross-influence coefficient Jyxs according to the inter-branch cross-influence set. Based on machine learning technology, by associating the cross-influence coefficient Jyxs with the difference coefficient Cyxs and performing dimensionless processing, a merged conflict index Hczs is obtained by fitting;
[0112] The repair module pre-sets a conflict threshold V, compares and analyzes the conflict threshold V with the merged conflict index Hczs to comprehensively judge the conflict degree during branch merging in the current software development package; issues a warning instruction according to the corresponding conflict degree and makes a pre-intelligent compilation repair method.
[0113] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. An intelligent compilation method for a software development kit based on a cloud platform, characterized in that: It includes the following steps: S1. Pre-acquire a software development kit and upload it to a cloud platform. The cloud platform preprocesses the software development kit, including code parsing, dependency analysis, and preliminary code optimization; S2. Obtain the preprocessed software development kit according to step S1, monitor the relevant development task data information in the preprocessed software development kit, and record the relevant difference data information between the main branch and each development branch during the continuous software development process. Comprehensively construct a development status set, generate a difference coefficient Cyxs according to the development status set. If the difference coefficient Cyxs exceeds the safety threshold, issue a mobilization warning instruction; S22. Based on the obtained relevant development task data information, associate the test coverage rate Cfq with the number of dependencies Yssp, and after dimensionless processing, calculate and obtain the complexity factor Fcyz of the task. The complexity factor Fcyz is obtained through the following formula: ; In the formula, Dmjs represents the code base, which respectively represent the weight coefficients of the number of dependencies Yssp, the test coverage Cfq, and the code base Dmjs; S23. According to the relevant difference data information between the main branch and each development branch in the software development kit, and in combination with the complexity factor Fcyz obtained in step S22, obtain the difference coefficient Cyxs. The difference coefficient Cyxs is obtained through the following formula: ; In the formula, Dcb represents the code change difference, and Tbp represents the synchronization frequency, , and are all weighting coefficients, represents the first correction constant; S231. Preset a safety threshold, compare and analyze the safety threshold with the difference coefficient Cyxs to preliminarily judge whether the modification results of each development branch need to be synchronized to the main branch during the current software development process; If the difference coefficient Cyxs exceeds the safety threshold, issue a mobilization warning instruction outward. At this time, further analysis will be carried out and step S3 will be executed; If the difference coefficient Cyxs does not exceed the safety threshold, there is no need to issue a mobilization warning instruction outward for the time being; S3. After receiving the mobilization warning instruction, synchronize the modification results of each development branch to the main branch, and collect the relevant associated data information between each development branch during the software development process to generate a branch cross-influence set. Generate a cross-influence coefficient Jyxs according to the branch cross-influence set. Based on machine learning technology, by associating the cross-influence coefficient Jyxs with the difference coefficient Cyxs and after dimensionless processing, fit and obtain a merge conflict index Hczs; S33. Based on the branch cross-influence set, after dimensionless processing of the number of dependency relationships Yjss, the overlap ratio Cdbz, and the number of branches Fzs, construct a cross-influence coefficient Jyxs. The cross-influence coefficient Jyxs is obtained through the following formula: ; Wherein, Fzs represents the number of branches, Yjss represents the number of dependency relationships, Cdbz represents the overlapping ratio, and is the weight coefficient, and C represents the second correction constant; S4. Preset a conflict threshold V, compare and analyze the conflict threshold V with the merge conflict index Hczs to comprehensively judge the conflict degree during branch merging in the current software development kit; issue a warning instruction according to the corresponding conflict degree and make an intelligent pre-compilation repair measure.
2. The intelligent compilation method for a software development kit based on a cloud platform according to claim 1, wherein: S11. Parse the software development kit in the cloud platform successively for code parsing, dependency analysis, and preliminary code optimization. Among them, code parsing includes scanning the software development kit uploaded to the cloud platform to identify the programming language and file type, and using a parser to perform syntax analysis on the code to generate an abstract syntax tree; S12. Dependency analysis includes identifying the files on which each file depends through the parsed code, and constructing a dependency graph according to the parsing results. The nodes in the dependency graph are represented as files, and the edges are represented as dependency relationships; S13. Preliminary code optimization includes using a code formatting tool to unify the format of the code in the software development kit; and using a static analysis tool to detect potential errors, code smells, and security vulnerabilities, correcting the code according to the static analysis report, then identifying and deleting unused code to reduce code redundancy.
3. The intelligent compilation method for the software development kit based on the cloud platform according to claim 1, characterized in that: S21. The development status set includes relevant development task data information and relevant difference data information. According to the software development kit preprocessed in step S1, monitor and record the relevant development task data information in the software development kit. The relevant development task data information includes the code base Dmjs, the number of dependencies Yssp, and the test coverage Cfq; And during the continuous development of the software, monitor and record the relevant difference data information between the main branch and each development branch in the software development kit. The relevant difference data information includes the synchronization frequency Tbp and the code change difference Dcb.
4. The intelligent compilation method of the software development kit based on the cloud platform according to claim 3, characterized in that ; S31. When receiving a mobilization warning instruction, at this time, synchronize the modification results of each development branch to the inside of the main branch to keep the code synchronization in the software development kit in a normal state; S32. During the development of the software, monitor and collect the relevant associated data information between each development branch, and generate a branch cross-influence set. The branch cross-influence set includes the number of dependency relationships Yjss, the overlap ratio Cdbz, and the number of branches Fzs.
5. The intelligent compilation method for the software development kit based on the cloud platform according to claim 1, characterized in that: S34. The method for obtaining the merging conflict index Hczs is as follows: By correlating the cross-influence coefficient Jyxs with the difference coefficient Cyxs and performing dimensionless processing, the corresponding data values are mapped to the interval as follows: ; In the formula, represents the number of modified conflicts, represents the time taken for merging, , are weight coefficients, and N represents the third correction constant.
6. The intelligent compilation method for the software development kit based on the cloud platform according to claim 1, characterized in that: Pre-set a conflict threshold V, and through comparative analysis of the merge conflict index Hczs and the conflict threshold V, comprehensively judge the conflict degree during branch merging in the current software development kit, and issue a warning instruction according to the corresponding conflict degree to make a repair measure before intelligent compilation. The specific content is as follows: If the merge conflict index Hczs is greater than the conflict threshold V, it means that the conflict degree during the current branch merging is in an abnormal state. At this time, send a red conflict warning instruction to the developer, prompt the files and code segments where the conflict occurs, automatically detect the conflict point, mark the specific conflict location in the code, and then provide a refactoring suggestion for the dependency relationship; If the merge conflict index Hczs is equal to the conflict threshold V, it indicates that the conflict degree during the current branch merge is at a critical state, and there is a conflict risk. At this time, an orange conflict warning instruction will be sent to the developer, and detailed information about the conflict points will be provided. At the same time, the developer will be advised to merge in stages and on a small scale, gradually resolve the conflicts, and run automated tests to ensure that the merged code remains stable and functionally complete; If the merge conflict index Hczs is less than the conflict threshold V, it indicates that the conflict degree during the current branch merge is not in an abnormal state. At this time, a regular merge will be performed, and the merge process will be recorded to ensure that all changes are documented for future reference.
7. An intelligent compilation system for a software development kit based on a cloud platform, comprising the intelligent compilation method for a software development kit based on a cloud platform according to any one of claims 1 to 6 above, characterized in that: It includes a processing module, a development monitoring module, a difference analysis module, an inter-branch monitoring module, a correlation analysis module, and a repair module; The processing module pre-obtains a software development package and uploads the software development package to the cloud platform. The cloud platform preprocesses the software development package, including code parsing, dependency analysis, and preliminary code optimization; The development monitoring module obtains the preprocessed software development package according to step S1, monitors the relevant development task data information in the preprocessed software development package, and records the relevant difference data information between the main branch and each development branch during the continuous software development process, and comprehensively constructs a development status set; The difference analysis module generates a difference coefficient Cyxs according to the development status set. If the difference coefficient Cyxs exceeds the safety threshold, a mobilization warning instruction will be issued; After receiving the mobilization warning instruction, the inter-branch monitoring module synchronizes the modification results of each development branch to the main branch, and collects the relevant associated data information between each development branch during the software development process to generate a branch cross-influence set; The correlation analysis module generates a cross-influence coefficient Jyxs according to the branch cross-influence set. Based on machine learning technology, by correlating the cross-influence coefficient Jyxs with the difference coefficient Cyxs and performing dimensionless processing, the merge conflict index Hczs is obtained by fitting; The repair module pre-sets a conflict threshold V, and compares and analyzes the conflict threshold V with the merge conflict index Hczs to comprehensively judge the conflict degree during the branch merge in the current software development package; issue a warning instruction according to the corresponding conflict degree and make an intelligent pre-compilation repair method.
Citation Information
Patent Citations
A Deep Learning Compilation Optimization Method for Intelligent Selection of Compilation Acceleration Libraries
CN113031966B
Processing system for intelligently judging and predicting occurrence of events
CN109636012A
Data quantification method and device based on hardware environment, and readable storage medium
CN111240640A