Intelligent compiling method and system of software development kit based on cloud platform
By monitoring and analyzing the differences and cross-influence of software development packages on the cloud platform, machine learning technology is used to predict merge conflicts and provide intelligent pre-compilation repair methods, which solves the problem of merge conflicts during the software development process and improves compilation efficiency and code quality. .
Patent Information
- Application Number
- CN202411109810.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-08-14
AI Technical Summary
During the software development process, cross-influence and differences between development branches lead to frequent merge conflicts, which affects the stability and development efficiency of the software. The existing technology lacks intelligent analysis and early warning mechanisms, leading to the occurrence of compilation errors.
The intelligent compilation method based on the cloud platform monitors and records the development status and difference data by preprocessing the software development package, generates difference coefficients and cross-influence coefficients, uses machine learning technology to fit the merge conflict index, and sets conflict thresholds for intelligent pre-compilation repair. , providing early warning and automated repair methods.
It effectively reduces conflicts when merging branches, improves compilation efficiency and code quality, reduces development risks, and provides a more intelligent and efficient development environment.
Smart Images

Figure CN118760434A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent compilation, and in particular 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 at the intersection of cloud computing and distributed development, the software development kit (SDK) is a crucial tool that provides the libraries and tools required to develop specific applications or services. Before intelligent compilation, the software will undergo multiple branch revisions and updates during the development process. At this time, the cross-influence between the various development branches, as well as the differences between the branches and the main branch, will have a significant impact on the subsequent compilation results. If these conflicts and differences are not discovered and handled in a timely manner, a large number of conflicts may occur when the code is merged, which will in turn affect the stability and function implementation of the software.
[0003] In the Chinese invention patent with 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, the reasoning speed of the deep neural network is further improved. First, a translation method for various operators for the compilation acceleration library is added to the deep learning compiler, and various operators are automatically converted into a form that can be recognized by the compilation acceleration library. Secondly, a method for calling the compilation acceleration library in the deep learning compiler is proposed to realize the execution of various operators through the compilation acceleration library. Then, in the operator optimization stage of the deep learning compiler, the optimization effect is compared with the compilation acceleration library to select the best solution. Finally, a code generation method combined with the compilation acceleration library in a deep learning compiler is proposed to generate optimized executable code to achieve further optimization of the deep neural network.
[0004] In the technical solution recorded 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, and further improve the reasoning speed of the deep neural network by adding support for the compilation acceleration library in the open source deep learning compiler. However, in combination with the prior art and the above application, before intelligent compilation, the correction of each development branch in the software development process will affect the difference between it and the main branch. At the same time, the cross-influence between the branches often leads to frequent merge conflicts, which in turn affects the stability and development efficiency of the software. In addition, there is a lack of intelligent analysis and early warning mechanisms, which makes it easy for compilation errors to occur during the compilation process, which makes it difficult for existing optimization methods to play a practical role. Summary of the invention
[0005] In view of the deficiencies in 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 technology.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: an intelligent compilation method of a software development kit based on a cloud platform, comprising the following steps: 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. S2. According to step S1, the preprocessed software development kit is obtained, and the relevant development task data information in the preprocessed software development kit is monitored. Meanwhile, in the process of continuous software development, the relevant difference data information between the main branch and each development branch is recorded, and a development status set is comprehensively constructed. A difference coefficient Cyxs is generated according to the development status set. If the difference coefficient Cyxs exceeds the safety threshold, a mobilization warning instruction is issued; S3. After receiving the mobilization warning instruction, synchronize the modification results of each development branch to the main branch, and collect the related data information between the development branches during the software development process to generate a branch cross-impact set, and generate a cross-impact coefficient Jyxs based on the branch cross-impact set. Based on machine learning technology, the cross-impact coefficient Jyxs is associated with the difference coefficient Cyxs, and after dimensionless processing, the merge conflict index Hczs is obtained by fitting; S4. Preset a conflict threshold V, and compare and analyze the conflict threshold V with the merge conflict index Hczs to comprehensively determine the degree of conflict when merging branches in the current software development package; issue a warning instruction according to the corresponding conflict degree, and make intelligent pre-compilation repair measures.
[0007] Preferably, S11, the software development kit in the cloud platform is subjected to code parsing, dependency analysis and preliminary code optimization in sequence, wherein the 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.
[0008] S12. Dependency analysis includes identifying the files that each file depends on through the parsed code, and constructing a dependency graph based on the parsing results, where the nodes in the dependency graph represent files and the edges represent dependency relationships; S13. Preliminary code optimization includes using code formatting tools to unify the format of the code in the software development kit; using static analysis tools to detect potential errors, code smells and security vulnerabilities, making code corrections based on static analysis reports, and then identifying and deleting unused code to reduce code redundancy.
[0009] Preferably, S21, the development status set includes relevant development task data information and relevant difference data information, and the relevant development task data information in the software development kit is monitored and recorded according to the software development kit preprocessed in step S1, and the relevant development task data information includes the code base Dmjs, the number of dependencies Yssp and the test coverage Cfq; In the process of continuous software development, the relevant difference data information between the main branch and each development branch in the software development kit is monitored and recorded, and the relevant difference data information includes the synchronization frequency Tbp and the code change difference Dcb.
[0010] Preferably, 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, and the complexity factor Fcyz is obtained by the following formula:
[0011] Where Dmjs is the code base, They are respectively expressed as the weight coefficients of the number of dependencies Yssp, the test coverage Cfq, and the code base Dmjs.
[0012] Preferably, 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, and the difference coefficient Cyxs is obtained by the following formula:
[0013] In the formula, Dcb represents the code change difference, Tbp represents the synchronization frequency, , and are weight coefficients, Expressed as the first correction constant; S231, pre-set a safety threshold, compare and analyze the safety threshold with the difference coefficient Cyxs, and preliminarily determine whether the modification results of each development branch need to be synchronized to the main branch during the development of the current software; If the difference coefficient Cyxs exceeds the safety threshold, a mobilization warning instruction is issued, and further analysis will be performed to execute step S3; If the difference coefficient Cyxs does not exceed the safety threshold, there is no need to issue a mobilization warning instruction.
[0014] Preferably, S31, when receiving the mobilization warning instruction, the modification results of each development branch are synchronized to the main branch, so as to keep the synchronization of the code in the software development kit in a normal state; S32. During the software development process, the associated data information between the development branches will be monitored and collected, and a branch cross-impact set will be generated. The branch cross-impact set includes the number of dependencies Yjss, the overlap ratio Cdbz and the number of branches Fzs.
[0015] Preferably, S33, based on the branch cross-influence set, by adding the dependency, the cross-influence coefficient Jyxs, the cross-influence coefficient Jyxs is obtained by the following formula:
[0016] In the formula, Fzs represents the number of branches, Yjss represents the number of dependencies, and Cdbz represents the overlap ratio. and is the weight coefficient, and C is the second correction constant.
[0017] Preferably, S34, the merge conflict index Hczs is obtained as follows: by associating the cross-influence coefficient Jyxs with the difference coefficient Cyxs, and after dimensionless processing, mapping the corresponding data value to the interval According to the following formula:
[0018] In the formula, Expressed as the number of modification conflicts, Indicates the time taken to merge. , is the weight coefficient, and N is the third correction constant.
[0019] Preferably, a conflict threshold V is pre-set, and the merge conflict index Hczs is compared and analyzed with the conflict threshold V to comprehensively judge the conflict degree when merging branches in the current software development kit, and issue a warning instruction according to the corresponding conflict degree to make intelligent pre-compilation repair measures, the specific contents are as follows: If the merge conflict index Hczs is greater than the conflict threshold V, it means that the conflict level during the current branch merge is in an abnormal state. At this time, a red conflict warning instruction will be issued to the developer, and the conflicting files and code segments will be prompted. The conflict points will be automatically detected, and the specific conflict locations will be marked in the code, and refactoring suggestions will be provided for the complex parts of the dependency relationship; If the merge conflict index Hczs is equal to the conflict threshold V, it means that the conflict level during the current branch merge is in a critical state and there is a risk of conflict. At this time, an orange conflict warning instruction will be issued to the developer, and detailed information on the conflict point will be provided. At the same time, it is recommended to merge in stages and on a small scale to gradually resolve the conflict and run automated tests to ensure that the merged code remains stable and fully functional; If the merge conflict index Hczs is less than the conflict threshold V, it means that the conflict level during the current branch merge is not abnormal. 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.
[0020] An intelligent compilation system for software development kits 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; The processing module pre-acquires the software development kit and uploads the software development kit to the cloud platform, and the cloud platform pre-processes the software development kit, including code parsing, dependency analysis and preliminary code optimization; The development monitoring module obtains the preprocessed software development kit according to step S1, and monitors the relevant development task data information in the preprocessed software development kit. At the same time, in the process of continuous software development, the relevant difference data information between the main branch and each development branch is recorded to comprehensively construct a development status set; The difference analysis module generates a difference coefficient Cyxs according to the development status set, and issues a mobilization warning instruction if the difference coefficient Cyxs exceeds a safety threshold; 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 associated data information between the development branches during the software development process to generate a branch cross-impact set; The association analysis module generates a cross-influence coefficient Jyxs according to the branch cross-influence set, and obtains the merge conflict index Hczs by fitting based on machine learning technology by associating the cross-influence coefficient Jyxs with the difference coefficient Cyxs and performing dimensionless processing; 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 determine the degree of conflict when merging branches in the current software development package; issues a warning instruction according to the corresponding conflict degree, and makes intelligent pre-compilation repair measures.
[0021] The present invention provides an intelligent compilation method and system for a software development kit based on a cloud platform, which has the following beneficial effects: (1) Through step S1, the software development kit is preprocessed, including code parsing, dependency analysis and preliminary code optimization, to further ensure 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 it in the early stage, thereby reducing the problems that may be encountered 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 the difference coefficient Cyxs and issuing a mobilization warning instruction when the difference coefficient exceeds the safety threshold, it can timely remind developers to pay attention to and solve potential merge conflict problems, further preventing the accumulation of problems. After receiving the mobilization warning instruction, step S3 synchronizes the modification results of each development branch to the main branch, collects the related data information between each development branch, and generates a branch cross-impact set. Through machine learning technology, the cross-impact coefficient Jyxs is associated with the difference coefficient Cyxs and dimensionless processing is performed to obtain the merge conflict index Hczs. This process ensures that during the synchronization process, the system can intelligently analyze and manage conflicts between branches, and prepare for effective synchronization in the later stage. Step S4 sets the conflict threshold V and compares it with the merge conflict index Hczs to comprehensively judge the degree of conflict when the branch is merged, and issues an early warning instruction according to the degree of conflict. According to different degrees of conflict, 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 pre-compilation code. Through the implementation of the above steps, the system can effectively reduce conflict problems when branches are merged, improve overall compilation efficiency, and ensure the stability of the software after the merger.
[0022] Compared with traditional methods, this intelligent compilation method can better analyze the conflict level of the current merge based on the dependencies and code changes between branches, and prepare for a more efficient compilation process and more reliable compilation results. In short, the intelligent compilation method of the cloud platform-based software development kit not only improves the compilation efficiency and code quality in the software development process through automated preprocessing, real-time monitoring, intelligent synchronization and accurate early warning, but also significantly reduces the development risks caused by branch merge conflicts, providing developers with a smarter and more efficient development environment.
[0023] (2) Generate the difference coefficient Cyxs based on the development status set, and use the difference coefficient Cyxs to evaluate the difference between the main branch and each development branch. If the difference coefficient Cyxs exceeds the safety threshold, issue a mobilization warning instruction to urge developers to synchronize and coordinate in time, effectively reducing the occurrence of merge conflicts. A mobilization warning instruction will be issued to urge developers to synchronize in time, reduce the difference between the main branch and the development branch, and reduce the risk of merge conflicts caused by excessive differences. By real-time monitoring and recording of difference information, potential conflict points can be identified in advance, and corresponding preventive measures can be taken to ensure the smooth progress of the code merge process, improve development efficiency and the overall quality of the software.
[0024] (3) The present invention comprehensively considers multi-dimensional factors in branch cross-impact analysis, further accurately reflects the degree of cross-impact between branches, and can dynamically adjust code synchronization and optimization strategies during the development process by timely synchronizing branches and monitoring branch cross-impact. Compared with the existing technology, the accuracy and intelligence level of early warning and repair are significantly improved, reducing the occurrence of compilation errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 This is a schematic diagram of the steps of the intelligent compilation method of the software development kit based on the cloud platform of the present invention; Figure 2 The figure is a flow chart of the intelligent compilation system of the software development kit based on the cloud platform of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Example
[0027] See also Figure 1 The present invention provides an intelligent compilation method for a software development kit based on a cloud platform, comprising the following steps: S1. Obtain the software development kit in advance and upload it to the cloud platform. The cloud platform pre-processes the software development kit, including code parsing, dependency analysis and preliminary code optimization, eliminating many potential problems in advance and ensuring the basic quality of the development kit. S2. According to step S1, the preprocessed software development kit is obtained, and the relevant development task data information in the preprocessed software development kit is monitored. At the same time, in the process of continuous software development, the relevant difference data information between the main branch and each development branch is recorded, and a development status set is comprehensively constructed. A difference coefficient Cyxs is generated according to the development status set. If the difference coefficient Cyxs exceeds the safety threshold, a mobilization warning instruction is issued to remind the developer to deal with potential conflict problems. This active monitoring and early warning mechanism effectively prevents the accumulation and deterioration of problems.
[0028] S3. After receiving the mobilization warning instruction, synchronize the modification results of each development branch to the main branch, and collect the related data information between the development branches during the software development process to generate a branch cross-impact set, and generate a cross-impact coefficient Jyxs based on the branch cross-impact set. Based on machine learning technology, the cross-impact coefficient Jyxs is associated with the difference coefficient Cyxs, and after dimensionless processing, the merge conflict index Hczs is obtained by fitting; S4. Preset a conflict threshold V, and compare and analyze the conflict threshold V with the merge conflict index Hczs to comprehensively determine the degree of conflict when merging branches in the current software development package; issue a warning instruction according to the corresponding conflict degree, and make intelligent pre-compilation repair measures.
[0029] In this embodiment, by performing 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 problems and code quality problems in the subsequent development process. In step S2, the relevant development task data information in the preprocessed software development kit is monitored, the difference between the main branch and each development branch is recorded in real time, and the 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 deal with the difference problem to prevent the difference from accumulating to a difficult 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 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 merge conflict index Hczs is obtained by fitting. This process effectively predicts and quantifies the risk of merge conflicts. The conflict threshold V is set in advance, and compared with the merge conflict index Hczs to determine the degree of conflict when merging branches in the current software development package. Warning instructions are issued according to the degree of conflict, and corresponding repair measures are provided, such as automatic conflict detection and marking and code review suggestions, which significantly reduce the frequency and difficulty of merge conflicts. Machine learning technology is used in the entire method to intelligently generate the merge conflict index Hczs by dimensionless processing and fitting of multidimensional data. This intelligent process reduces the workload of manual analysis and judgment and improves the accuracy and efficiency of processing. According to the comparison results of the conflict index and the conflict threshold, corresponding warnings and repair measures are automatically provided, which greatly reduces the manual processing work of developers and makes the development process more efficient and reliable. Example
[0030] Please refer to Figure 1 Specifically: S11, the software development kit in the cloud platform is subjected to code parsing, dependency analysis and preliminary code optimization in turn, wherein the code parsing includes scanning the software development kit uploaded to the cloud platform to identify the programming language and file type, and using the parser to perform syntax analysis on the code to generate an abstract syntax tree. The parser will check whether the syntax of the code is correct, identify structures such as classes, functions, variables, and perform semantic analysis based on the generated abstract syntax tree to ensure the consistency of the code logic and language rules.
[0031] S12. Dependency analysis includes identifying the files that each file depends on through the parsed code, and building a dependency graph based on the parsing results. The nodes in the dependency graph represent files, and the edges represent dependencies. Through the dependency graph, it is clear which files depend on other files, or which modules depend on other modules; 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 to ensure consistent code style and easy reading and maintenance; and using static analysis tools, such as SonarQube, ESLint, and Pylint to detect potential errors, code smells, and security vulnerabilities, make code corrections based on static analysis reports, and then identify and delete unused code, i.e. dead code, to reduce code redundancy.
[0032] In this embodiment, by performing a comprehensive code scan on 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. A symbol table is created to record symbols such as variables, functions, classes and their properties in the code to enhance the readability and maintainability of the code. Code formatting tools are used to unify the format of the code to ensure consistent code style, make the code easier to read and maintain, and reduce the risk of code conflicts during teamwork. By building a dependency graph, the dependencies between files and modules are clearly displayed, so that developers can better understand the code structure and optimize the coupling between modules, thereby improving the stability and scalability of the system. Static analysis tools are used to detect potential errors, code smells and security vulnerabilities, and code corrections are performed according to the analysis report to reduce errors and vulnerabilities in the code and improve the robustness and security of the code. Unused code is identified and deleted to reduce code redundancy and improve the efficiency and maintainability of the code. Example
[0033] Please refer to Figure 1 Specifically: 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, the relevant development task data information in the software development kit is monitored and recorded. The relevant development task data information includes the code base Dmjs, the number of dependencies Yssp and the test coverage Cfq; In the process of continuous software development, the relevant difference data information between the main branch and each development branch in the software development kit is monitored and recorded, and the relevant difference data information includes the synchronization frequency Tbp and the code change difference Dcb.
[0034] 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 assessed, providing a reliable basis for resource allocation and development planning. Monitoring the number of dependencies Yssp helps to identify the dependencies of each module in the project, discover potential dependency conflicts in advance, and ensure coordination and compatibility between modules. By recording the test coverage Cfq, the test perfection of the project can be understood in real time, the test blind spots can be discovered 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 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 assessed, potential conflict points can be identified, and measures can be taken in advance for coordination and optimization. Comprehensively monitor the relevant development task data information and the relevant difference data information, build a development status set, provide comprehensive and real-time development process monitoring and recording, and help the development team better understand the project progress and current status.
[0035] Example 4 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 and obtained. The complexity factor Fcyz is obtained by the following formula:
[0036] Where Dmjs is the code base. They are respectively expressed as the weight coefficients of the number of dependencies Yssp, the test coverage Cfq, and the code base Dmjs, where 0< ≤1,0< ≤1,0< ≤1, and =1.
[0037] The above-mentioned number of dependencies Yssp can be parsed through the dependency management tool to parse the project's dependency files and count the number of dependencies.
[0038] Test coverage Cfq can generate coverage reports after executing tests through test coverage tools.
[0039] Code base Dmjs can count the number of code lines or code files through code statistics tools.
[0040] 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, a difference coefficient Cyxs is obtained. The difference coefficient Cyxs is obtained by the following formula:
[0041] In the formula, Dcb represents the code change difference, Tbp represents the synchronization frequency, , and are weight coefficients, where 0 < ≤1,0< ≤1,0< ≤1, and + + =1, Expressed as the first correction constant; The above-mentioned code change difference Dcb refers to the difference in the modification range between each branch, and the code differences between branches are compared through the version control system.
[0042] The synchronization frequency Tbp can be obtained by recording the synchronization operation frequency of the branch and the main branch.
[0043] S231, pre-set a safety threshold, compare and analyze the safety threshold with the difference coefficient Cyxs, and preliminarily determine whether the modification results of each development branch need to be synchronized to the main branch during the development of the current software; If the difference coefficient Cyxs exceeds the safety threshold, a warning instruction will be issued, and further analysis will be performed to execute step S3; reminding developers to synchronize branches in time to reduce the risk of merge conflicts. This mechanism effectively ensures the stability and consistency of the main branch, and improves development efficiency and software quality.
[0044] If the difference coefficient Cyxs does not exceed the safety threshold, there is no need to issue a mobilization warning instruction to the outside, thereby avoiding unnecessary branch synchronization operations, reducing interference in the development process, and maintaining the consistency and efficiency of the development work.
[0045] In this embodiment, the complexity factor Fcyz of the task is calculated, which comprehensively reflects the complexity of the code, test coverage and dependencies, provides a scientific basis for evaluating the difficulty of the development task, and helps to better plan development resources and time. Based on the code change difference Dcb and 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 degree of difference between the branches in real time, helping the development team to promptly discover and resolve potential merge conflicts. The security threshold is set in advance and compared with the difference coefficient Cyxs for analysis. Through the automated data monitoring, analysis and early warning mechanism, the intelligent management of the development process is realized, manual intervention and subjective judgment are reduced, and the overall development efficiency and quality are improved. In short, 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 kit on the cloud platform, reduces the occurrence of merge conflicts, and ensures the stability and consistency of the software, with significant novelty and practical application value.
[0046] Example 5 Please refer to Figure 1 ,Specifically: S31, when receiving the mobilization warning instruction, the modification results of each development branch are synchronized to the main branch, and the synchronization of the code in the software development kit is kept in a normal state; S32. During the software development process, the associated data information between the development branches will be monitored and collected, and a branch cross-impact set will be generated. The branch cross-impact set includes the number of dependencies Yjss, the overlap ratio Cdbz and the number of branches Fzs.
[0047] S33, based on the branch cross-influence set, by adding the dependency, the cross-influence coefficient Jyxs, the cross-influence coefficient Jyxs is obtained by the following formula:
[0048] In the formula, Fzs represents the number of branches, Yjss represents the number of dependencies, and Cdbz represents the overlap ratio. and is the weight coefficient, where 0< ≤1,0< ≤1, and + =1, C is represented as the second correction constant.
[0049] The branch number Fzs mentioned above can query the number of currently existing branches through the version control system.
[0050] The number of dependencies Yjss refers to the number of other feature branches or shared code libraries that the branch depends on. The dependency files of the project are parsed through the dependency management tool; The overlap ratio Cdbz is used to describe the degree of overlap between code change ranges between different branches. It is calculated by calculating the ratio of the number of code lines modified by multiple branches to the total number of code lines in the code base.
[0051] In this embodiment, when the mobilization warning instruction is received, the modification results of each development branch are synchronized to the main branch to ensure that the synchronization of the code in the software development kit is in a normal state. This measure can effectively reduce the merge conflicts caused by asynchrony and improve development efficiency and code quality. During the development process, the associated data information between each development branch is monitored and collected, including the number of dependencies Yjss, the overlap ratio Cdbz and the number of branches Fzs, to generate a branch cross-impact set. Through comprehensive data information collection, it is possible to deeply understand the cross-impact between each branch and provide accurate decision support. Based on the branch cross-impact set, the cross-impact coefficient Jyxs is calculated by formula. The introduction of the cross-impact coefficient Jyxs enables the system to quantify the degree of cross-impact between different development branches. Before intelligent compilation, the system can identify potential conflict points in advance, make corresponding repairs and adjustments, ensure the smooth progress of the compilation process, and improve compilation efficiency and code quality.
[0052] Example 6 Please refer to Figure 1 Specifically: S34, the merge conflict index Hczs is obtained as follows: by associating the cross-influence coefficient Jyxs with the difference coefficient Cyxs, and after dimensionless processing, mapping the corresponding data value to the interval According to the following formula:
[0053] In the formula, Expressed as the number of modification conflicts, Indicates the time taken to merge. , is the weight coefficient, N is the third correction constant, where 0< ≤1,0< ≤1,0< ≤1,0< ≤1, and + =1.
[0054] The number of modification conflicts mentioned above Refers to the number of conflicts automatically detected by the version control system during the merge process.
[0055] Merge time You can calculate the time taken by recording the start and end time of the merge operation.
[0056] The conflict threshold V is set in advance, and the merge conflict index Hczs is compared and analyzed with the conflict threshold V to comprehensively judge the conflict degree of branch merge in the current software development package, and issue a warning instruction according to the corresponding conflict degree to make intelligent pre-compilation repair measures. The specific contents are as follows: If the merge conflict index Hczs is greater than the conflict threshold V, it means that the conflict level during the current branch merge is in an abnormal state, there are many conflict issues, and there is a greater risk of merging. At this time, a red conflict warning instruction will be issued to the developer, and the conflicting files and code segments will be prompted. The conflict points will be automatically detected, and the specific conflict locations will be marked in the code. Refactoring suggestions will then be provided for the complex parts of the dependency relationship to reduce the possibility of future merge conflicts; If the merge conflict index Hczs is equal to the conflict threshold V, it means that the conflict level when the current branch is merged 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 issued to the developer, and detailed information on the conflict point will be provided. At the same time, it is recommended to merge in stages and on a small scale to gradually resolve conflicts and run automated tests to ensure that the merged code remains stable and fully functional.
[0057] If the merge conflict index Hczs is less than the conflict threshold V, it means that the conflict level during the current branch merge is not abnormal, there are fewer conflict issues, 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 and the conflict threshold V, corresponding repair measures can be taken before intelligent compilation to ensure a smooth branch merge process, reduce conflict risks, and improve code quality and team collaboration efficiency.
[0058] In this embodiment, by generating a merge conflict index Hczs, this method makes it possible to quantify the conflict risk, so that developers can clearly understand the degree of conflict of the current branch merge, and provide a clear merge risk assessment standard. Based on the comparative analysis of the merge conflict index Hczs and the conflict threshold V, the system can intelligently issue conflict warning instructions of different levels. This hierarchical warning mechanism ensures that developers take corresponding measures under different conflict risks, effectively reduce the occurrence of merge conflicts, and provide targeted repair suggestions. When the merge conflict index Hczs is greater than the threshold, it means that there are more conflicts and higher risks. The system automatically detects and marks the specific conflict locations, provides reconstruction suggestions, and helps developers solve complex conflict problems in a timely manner. When the merge conflict index Hczs is equal to the threshold, it means that the conflict risk is in a critical state. The system recommends merging in stages and on a small scale, gradually resolving conflicts, and running automated tests at the same time to ensure code stability and functional integrity. When the merge conflict index is less than the threshold V, it means 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 well documented. This recording mechanism not only improves the traceability of the code, but also facilitates collaboration and communication between team members, ensuring the consistency and stability of code quality. In the case of high-risk conflicts, the system will automatically analyze dependencies and provide code refactoring suggestions to help developers optimize 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 techniques, the present invention significantly improves the development efficiency and compilation quality of the software development kit on the cloud platform, reduces the occurrence of merge conflicts, and has high practical application value and innovation.
[0059] Example 7 Please refer to Figure 1 and Figure 2 ,Specifically: An intelligent compilation system based on the ,software development kit on the 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; The processing module pre-acquires the software development kit and uploads the software development kit to the cloud platform, and the cloud platform pre-processes the software development kit, including code parsing, dependency analysis and preliminary code optimization; The development monitoring module obtains the preprocessed software development kit according to step S1, and monitors the relevant development task data information in the preprocessed software development kit. At the same time, in the process of continuous software development, the relevant difference data information between the main branch and each development branch is recorded to comprehensively construct a development status set; The difference analysis module generates a difference coefficient Cyxs according to the development status set, and issues a mobilization warning instruction if the difference coefficient Cyxs exceeds a safety threshold; 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 associated data information between the development branches during the software development process to generate a branch cross-impact set; The association analysis module generates a cross-influence coefficient Jyxs according to the branch cross-influence set, and obtains the merge conflict index Hczs by fitting based on machine learning technology by associating the cross-influence coefficient Jyxs with the difference coefficient Cyxs and performing dimensionless processing; 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 determine the degree of conflict when merging branches in the current software development package; issues a warning instruction according to the corresponding conflict degree, and makes intelligent pre-compilation repair measures.
[0060] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that 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: The following steps are included: 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. S2. According to step S1, the preprocessed software development kit is obtained, and the relevant development task data information in the preprocessed software development kit is monitored. Meanwhile, in the process of continuous software development, the relevant difference data information between the main branch and each development branch is recorded, and a development status set is comprehensively constructed. A difference coefficient Cyxs is generated according to the development status set. If the difference coefficient Cyxs exceeds the safety threshold, a mobilization warning instruction is issued; S3. After receiving the mobilization warning instruction, synchronize the modification results of each development branch to the main branch, and collect the related data information between the development branches during the software development process to generate a branch cross-impact set, and generate a cross-impact coefficient Jyxs based on the branch cross-impact set. Based on machine learning technology, the cross-impact coefficient Jyxs is associated with the difference coefficient Cyxs, and after dimensionless processing, the merge conflict index Hczs is obtained by fitting; S4. Preset a conflict threshold V, and compare and analyze the conflict threshold V with the merge conflict index Hczs to comprehensively determine the degree of conflict when merging branches in the current software development package; issue a warning instruction according to the corresponding conflict degree, and make intelligent pre-compilation repair measures.
2. The intelligent compilation method of the software development kit based on the cloud platform according to claim 1, characterized in that: S11, performing code parsing, dependency analysis, and preliminary code optimization on the software development kit in the cloud platform in sequence, wherein the 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 that each file depends on through the parsed code, and constructing a dependency graph based on the parsing results, where the nodes in the dependency graph represent files and the edges represent dependency relationships; S13. Preliminary code optimization includes using code formatting tools to unify the format of the code in the software development kit; using static analysis tools to detect potential errors, code smells and security vulnerabilities, making code corrections based on static analysis reports, and then identifying and deleting unused code to reduce code redundancy.
3. The intelligent compilation method of 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, and the relevant development task data information in the software development kit is monitored and recorded according to the software development kit preprocessed in step S1, and the relevant development task data information includes the code base Dmjs, the number of dependencies Yssp and the test coverage Cfq; In the process of continuous software development, the relevant difference data information between the main branch and each development branch in the software development kit is monitored and recorded, and 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: 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 by the following formula: ; Where Dmjs is the code base. They are respectively expressed as the weight coefficients of the number of dependencies Yssp, the test coverage Cfq, and the code base Dmjs.
5. The intelligent compilation method of the software development kit based on the cloud platform according to claim 4, characterized in that: 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, a difference coefficient Cyxs is obtained. The difference coefficient Cyxs is obtained by the following formula: ; In the formula, Dcb represents the code change difference, Tbp represents the synchronization frequency, , and are weight coefficients, Expressed as the first correction constant; S231, pre-set a safety threshold, compare and analyze the safety threshold with the difference coefficient Cyxs, and preliminarily determine whether the modification results of each development branch need to be synchronized to the main branch during the development of the current software; If the difference coefficient Cyxs exceeds the safety threshold, a mobilization warning instruction is issued, and further analysis will be performed to execute step S3; If the difference coefficient Cyxs does not exceed the safety threshold, there is no need to issue a mobilization warning instruction.
6. The intelligent compilation method of the software development kit based on the cloud platform according to claim 5, characterized in that ; S31. When a mobilization warning instruction is received, the modification results of each development branch are synchronized to the main branch to keep the synchronization of the code in the software development kit in a normal state; S32. During the software development process, the associated data information between the development branches will be monitored and collected, and a branch cross-impact set will be generated. The branch cross-impact set includes the number of dependencies Yjss, the overlap ratio Cdbz and the number of branches Fzs.
7. The intelligent compilation method of the software development kit based on the cloud platform according to claim 6, characterized in that: S33, based on the branch cross-influence set, by adding the dependency, the cross-influence coefficient Jyxs, the cross-influence coefficient Jyxs is obtained by the following formula: ; In the formula, Fzs represents the number of branches, Yjss represents the number of dependencies, and Cdbz represents the overlap ratio. and is the weight coefficient, and C is the second correction constant.
8. The intelligent compilation method of the software development kit based on the cloud platform according to claim 1, characterized in that: S34, the merge conflict index Hczs is obtained as follows: by associating the cross-influence coefficient Jyxs with the difference coefficient Cyxs, and after dimensionless processing, mapping the corresponding data value to the interval According to the following formula: ; In the formula, Expressed as the number of modification conflicts, Indicates the time taken to merge. , is the weight coefficient, and N is the third correction constant.
9. The intelligent compilation method of the software development kit based on the cloud platform according to claim 1, characterized in that: The conflict threshold V is set in advance, and the merge conflict index Hczs is compared and analyzed with the conflict threshold V to comprehensively judge the conflict degree of branch merge in the current software development package, and issue a warning instruction according to the corresponding conflict degree to make intelligent pre-compilation repair measures. The specific contents are as follows: If the merge conflict index Hczs is greater than the conflict threshold V, it means that the conflict level during the current branch merge is in an abnormal state. At this time, a red conflict warning instruction will be issued to the developer, and the conflicting files and code segments will be prompted. The conflict points will be automatically detected, and the specific conflict locations will be marked in the code, and refactoring suggestions will be provided for the complex parts of the dependency relationship; If the merge conflict index Hczs is equal to the conflict threshold V, it means that the conflict level during the current branch merge is in a critical state and there is a risk of conflict. At this time, an orange conflict warning instruction will be issued to the developer, and detailed information on the conflict point will be provided. At the same time, it is recommended to merge in stages and on a small scale to gradually resolve the conflict and run automated tests to ensure that the merged code remains stable and fully functional; If the merge conflict index Hczs is less than the conflict threshold V, it means that the conflict level during the current branch merge is not abnormal. 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.
10. 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 9, characterized in that: It includes processing module, development monitoring module, difference analysis module, inter-branch monitoring module, correlation analysis module and repair module; The processing module pre-acquires the software development kit and uploads the software development kit to the cloud platform, and the cloud platform pre-processes the software development kit, including code parsing, dependency analysis and preliminary code optimization; The development monitoring module obtains the preprocessed software development kit according to step S1, and monitors the relevant development task data information in the preprocessed software development kit. At the same time, in the process of continuous software development, the relevant difference data information between the main branch and each development branch is recorded to comprehensively construct a development status set; The difference analysis module generates a difference coefficient Cyxs according to the development status set, and issues a mobilization warning instruction if the difference coefficient Cyxs exceeds a safety threshold; 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 associated data information between the development branches during the software development process to generate a branch cross-impact set; The association analysis module generates a cross-influence coefficient Jyxs according to the branch cross-influence set, and obtains the merge conflict index Hczs by fitting based on machine learning technology by associating the cross-influence coefficient Jyxs with the difference coefficient Cyxs and performing dimensionless processing; 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 determine the degree of conflict when merging branches in the current software development package; issues a warning instruction according to the corresponding conflict degree, and makes intelligent pre-compilation repair measures.
Citation Information
Patent Citations
Processing system for intelligently judging and predicting occurrence of events
CN109636012A
Method for carrying out validity evaluation on software testing and evaluation device
CN110543417A
Data quantification method and device based on hardware environment, and readable storage medium
CN111240640A
Software code automatic compiling method and device, equipment and storage medium
CN116107589A
Self-learning code conflict resolution tool
US20210191715A1
Cited By
Development method and system of software development platform
CN119718278A
A software development platform development method and system
CN119718278B
Program package management system, method and equipment and storage medium
CN119861964A
Software development data management method and system based on cloud service
CN120540692A
A cloud service-based software development data management method and system
CN120540692B
