Project upgrading method based on component updating and related device

By detecting component differences and using large models to generate modified code snippets, component updates are automatically performed, and component updates are solved in the existing technology of component version update compatibility problems, and efficient and reliable component upgrades are achieved.

CN119127272AInactive Publication Date: 2024-12-13XI AN JIAOTONG UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411160660.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, component version update compatibility issues rely on manual solutions, which are inefficient, unassured in quality and high cost, resulting in system security and stability being affected.

Method used

By detecting the differences between the components of the old version and the new version, using the big model to generate modified code snippets, automatically update the components, and verify the upgrade effect through test cases, adjust the modification plan until it is successful.

Benefits of technology

It significantly improves the efficiency of component updates, ensures the security and stability of the software, and reduces manual intervention and costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127272A_ABST
    Figure CN119127272A_ABST
Patent Text Reader

Abstract

The invention belongs to an updating and upgrading method, and provides a project upgrading method based on component updating and a related device aiming at the technical problems that the efficiency is low, the quality cannot be guaranteed and the cost is high due to the fact that a manual means is adopted to solve the component version compatibility problem at present. The method comprises the following steps: acquiring the difference between a component C1 and a component C2 in different versions through difference detection, positioning a code snippet which needs to be modified due to the version update of the component in a project by utilizing the difference between the component C1 and the component C2, integrating the information into Prompt information, and generating a modification scheme required by the project upgrade by a large model according to the Prompt information. According to the method, the project is upgraded by utilizing the large model, the updating of the component version is adapted, and compared with the mode of solving the compatibility problem of the component version by adopting a manual means in the prior art, the efficiency of updating the component in the project can be greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to an update and upgrade method, and specifically to a project upgrade method based on component update and related devices. Background Art

[0002] As modern software systems become increasingly large and complex, these software often rely on a large number of third-party components to provide key functions, and over time, these components are constantly updated to fix security vulnerabilities, improve performance, or add new features. However, due to factors such as system compatibility, business continuity, and resource limitations, users are often unable to keep up with the latest versions of all components in real time.

[0003] In many cases, organizations and individuals may find that the old versions of components they are using have security vulnerabilities, lack support, or no longer meet current security standards. This not only increases the risk of attacks on the system, but may also lead to legal compliance issues. Therefore, it is critical to update old versions of components in the project, especially those with vulnerabilities. This not only ensures that the system can take advantage of the latest technology, but also avoids security threats caused by vulnerabilities and ensures the consistency and stability of the user experience.

[0004] Traditional methods usually use manual solutions to solve compatibility issues related to component version updates in projects. However, such methods have the following shortcomings:

[0005] 1. Inefficiency: Manually solving version update compatibility issues usually requires a lot of time and effort, especially for large systems or software, which involve many components and dependencies, making the problem more complicated. Developers need to pay attention to checking the version compatibility of each component, which is time-consuming and error-prone.

[0006] 2. Quality cannot be guaranteed: Manually solving compatibility issues in version updates depends on the experience and skills of the developer, which means that the quality of the solution may vary. Even experienced developers may miss some important compatibility issues due to negligence or lack of understanding of certain details, resulting in the fact that although the conflict is resolved on the surface, the stability and security of the software are still affected.

[0007] 3. High cost: The inefficiency of manually solving compatibility issues in version updates directly leads to an increase in project costs. In addition to direct labor costs, there may also be project delays due to conflict resolution, resulting in additional time and economic costs. Summary of the invention

[0008] This application aims to solve the technical problems of low efficiency, unguaranteed quality and high cost by currently using manual means to solve the compatibility problem of component versions, and to provide a project upgrade method and related devices based on component updates.

[0009] In order to achieve the above objectives, this application adopts the following technical solutions:

[0010] In a first aspect, the present application proposes a project upgrade method based on component update, comprising:

[0011] Detect the old upstream version component C1 and the corresponding new version component C2 used in the downstream project P to obtain the difference between component C1 and component C2;

[0012] According to the differences between components C1 and C2, locate the code involved in the differences in the downstream project P, and obtain the code snippets to be modified and the corresponding test cases;

[0013] Generate prompt information to guide the large model to modify the code snippet to be modified;

[0014] Input prompt information to the big model to guide the big model to generate a modification plan for the code snippet to be modified;

[0015] Implement the modification plan on the downstream project P, update component C1 to component C2, and obtain the upgraded downstream project P';

[0016] The modified code in the downstream project P' is tested through test cases. If the test case fails, the modification plan generated by the large model is adjusted; if the test case passes, the project upgrade is completed.

[0017] Furthermore, the differences between the components C1 and C2 include:

[0018] Add, delete or modify classes, interfaces and methods.

[0019] Furthermore, the Prompt information includes the difference between component C1 and component C2 and the code snippet to be modified, and is based on a thought chain design framework.

[0020] Furthermore, the modification scheme for adjusting the generation of the large model includes:

[0021] Integrate the failed information into the prompt information and feed it back to the big model, guiding the big model to reflect and adjust the modification plan.

[0022] Furthermore, the modification scheme of guiding the large model to generate the code fragment to be modified includes:

[0023] The macro model defines roles and tasks;

[0024] The large model understands the difference between component C1 and component C2;

[0025] The large model determines a modification plan for the differences based on the understanding of the differences between component C1 and component C2;

[0026] According to the modification scheme of the difference, the modified code is obtained, and the modified code is marked in the downstream project P'.

[0027] Furthermore, after completing the project upgrade, it also includes: publishing the modification plan to an open source platform for reference.

[0028] In a second aspect, the present application proposes a project upgrade system based on component update, comprising:

[0029] A detection module is used to detect the upstream old version component C1 and the corresponding new version component C2 used in the downstream project P to obtain the difference between the component C1 and the component C2;

[0030] The test case module is used to locate the code involved in the difference in the downstream project P according to the difference between the components C1 and C2, and obtain the code fragment to be modified and the corresponding test case;

[0031] A prompt information generation module, used to generate prompt information for guiding the large model to modify the code fragment to be modified;

[0032] The solution module is used to input prompt information into the big model to guide the big model to generate a modification solution for the code snippet to be modified;

[0033] An updating module, used to implement the modification scheme on the downstream project P, update the component C1 to the component C2, and obtain the upgraded downstream project P';

[0034] The test module is used to test the modified code in the downstream project P' through test cases. If the test case fails, the modification plan generated by the large model is adjusted; if the test case passes, the project upgrade is completed.

[0035] Furthermore, the modification scheme for adjusting the generation of the large model includes:

[0036] Integrate the failed information into the prompt information and feed it back to the big model, guiding the big model to reflect and adjust the modification plan.

[0037] In a third aspect, the present application provides an electronic device, comprising:

[0038] Memory for storing computer programs;

[0039] A processor is used to implement the steps of the above-mentioned project upgrade method based on component update when executing the computer program.

[0040] In a fourth aspect, the present application proposes a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned project upgrade method based on component update are implemented.

[0041] Compared with the prior art, this application has the following beneficial effects:

[0042] This application proposes a project upgrade method based on component update, which obtains the difference between two different versions of components C1 and C2 through difference detection, and uses the difference between components C1 and C2 to locate the code fragments in the project that need to be modified due to the update of the component version, and then integrates the above information into Prompt information. The big model generates the modification plan required for the project upgrade based on the Prompt information. This application uses a big model to upgrade the project to adapt to the update of the component version. Compared with the manual means used in the prior art to solve the compatibility problem of component versions, it can greatly improve the efficiency of updating components in the project.

[0043] The present application also proposes a project upgrade system based on component update, an electronic device and a computer storage medium, which have all the advantages of the above-mentioned project upgrade method based on component update. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0045] Figure 1 A first flow chart of a project upgrade method based on component update is provided for this application;

[0046] Figure 2 This is a schematic diagram of the differences between the components log4j-api-2.12.4 and log4j-api-2.21.1 in the embodiment of the present application;

[0047] Figure 3 A schematic diagram of code snippets related to differences in an embodiment of the present application;

[0048] Figure 4 This is a schematic diagram of a Prompt template in an embodiment of the present application;

[0049] Figure 5 This is a schematic diagram of the Prompt information in the embodiment of the present application;

[0050] Figure 6 This is a feedback diagram provided by GPT in an embodiment of the present application;

[0051] Figure 7 This is a schematic diagram of a Prompt template including failure feedback information in an embodiment of the present application;

[0052] Figure 8 This is a schematic diagram of a project upgrade system based on component update in this application. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0054] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0055] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0056] In the description of the embodiments of the present application, it should be noted that if the terms "upper", "lower", "horizontal", "inner", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the drawings, or the orientation or position relationship in which the invented product is usually placed when used. It is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.

[0057] In addition, if the term "horizontal" appears, it does not mean that the component must be absolutely horizontal, but can be slightly tilted. For example, "horizontal" only means that its direction is more horizontal than "vertical", which does not mean that the structure must be completely horizontal, but can be slightly tilted.

[0058] In the description of the embodiments of the present application, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0059] Third-party component updates are an integral part of software development and maintenance. These components are usually provided by external suppliers or open source communities to provide key features or expansion capabilities for projects. As technology continues to advance and security vulnerabilities continue to be discovered, third-party components also need to be continuously updated to adapt to new requirements and fix known issues.

[0060] At present, the traditional method for compatibility issues related to component version updates in projects is usually based on manual solutions, but traditional manual solutions may require a lot of time and human resources and are inefficient. Manual analysis may not be comprehensive enough, resulting in problems that cannot be completely solved, and may also introduce new problems, which will also significantly increase costs. In addition, every time a component is updated, compatibility testing and repair work must be re-performed, lacking an automated and standardized process.

[0061] In order to overcome the limitations of manually solving component update compatibility issues in projects, this application explores the use of large models to improve the efficiency of solving component update compatibility issues in projects, and proposes a project upgrade method based on component update and related devices. The application is described in detail below in conjunction with embodiments and drawings.

[0062] like Figure 1 As shown, it is a first flow chart of a project upgrade method based on component update of the present application, which may include:

[0063] S101, detect the upstream old version component C1 and the corresponding new version component C2 used in the downstream project P to obtain the difference between the component C1 and the component C2.

[0064] In actual applications, the differences between component C1 and component C2 may take many forms. For example, component C2 may add new functions relative to component C1, or remove or replace certain functions. In addition, the behavior or output of the functions may also be different between the two versions. There may also be performance differences, code structure and implementation changes. In order to accurately detect the differences between component C1 and component C2, you can use automated tools to compare the code bases of the two versions, or you can run unit tests, integration tests and functional tests for comparison, etc. It can be determined based on the actual application situation, and this application does not make specific restrictions.

[0065] S102, according to the difference between component C1 and component C2, locate the code involved in the difference in the downstream project P, and obtain the code fragment to be modified and the corresponding test case.

[0066] In actual applications, you can first identify all places where component C1 is used in the downstream project P, evaluate whether these usage points are affected by the change from component C1 to component C2, locate the specific code snippet for each affected usage point, analyze whether each marked code snippet needs to be modified to adapt to component C2, list all code snippets that need to be modified, and for each code snippet to be modified, write or update the corresponding unit test, integration test or functional test case to ensure that the test case can cover the modified code function and verify the compatibility with component C2.

[0067] S103, generating a prompt message for guiding the large model to modify the code segment to be modified.

[0068] S104, inputting prompt information into the large model to guide the large model to generate a modification plan for the code fragment to be modified.

[0069] In practical applications, adjusting the prompt information can help the large model better understand the requirements and generate more accurate modification plans.

[0070] It should be noted that large models, such as ChatGPT, have achieved remarkable results in fields such as natural language processing, providing theoretical support for applying large models to project upgrades and component updates. This application uses large models to enable the large model to design a project upgrade plan based on the detected differences and the located related code snippets, and to test the modified parts based on the original test cases of the project. It can not only significantly improve the efficiency of project upgrades and component updates, but also enhance the security and functionality of the software.

[0071] S105, implementing the modification plan on the downstream project P, updating component C1 to component C2, and obtaining an upgraded downstream project P'.

[0072] S106, testing the modified code in the downstream project P' through test cases. If the test cases fail, the modification plan generated by the large model is adjusted; if the test cases pass, the project upgrade is completed.

[0073] In actual applications, test cases can be used to verify whether the modification works as expected and to ensure that no new problems are introduced. In addition, even if the test case fails, the modification plan generated by the large model can be adjusted, updated and tested again to ensure the final upgrade effect.

[0074] This application obtains the difference between two different versions of components through difference detection, finds the code snippets related to the difference in the project, and the test cases of the code snippets, and forms prompt information. The large model gradually thinks according to the prompt information, gives a code modification plan, and updates the components after upgrading the project according to the modification plan. Then, the code involved in the modification plan is tested based on the test cases. The project upgrade is judged based on the test results. If it is unsuccessful, feedback optimization is performed within a certain number of times. After success, it is published on the open source platform for public reference. It can improve the efficiency and quality of project upgrades to adapt to component updates, reduce manual intervention, and ensure the effective resolution of project component update compatibility issues in the software supply chain.

[0075] As a second embodiment of a project upgrade method based on component update of the present application, it may include:

[0076] S201, detect the upstream old version component C1 and the corresponding new version component C2 used in the downstream project P to obtain the difference between the component C1 and the component C2.

[0077] S202, based on the differences between component C1 and component C2, locate in the downstream project P the relevant codes involved in the differences, that is, the code snippet that needs to be modified to adapt to the component update, and the test cases related to the code snippet.

[0078] S203, generating a prompt message for guiding the large model to modify the relevant code of the downstream project P.

[0079] S204, inputting prompt information into the large model to guide the large model to generate and output a specific modification plan for the relevant code of the downstream project P.

[0080] In actual applications, the prompt template design for resolving version conflicts, in addition to filling in the necessary information in the prompt, such as role and task descriptions, obtained version differences, and located code snippets, the prompt can also adopt CoT design, that is, guiding the thinking of the large model to conform to the normal hierarchical progressive thinking logic: first clarify your own role and tasks, then fully understand and analyze the differences and related codes, and finally generate a project modification plan based on the previously obtained information.

[0081] The thinking process of the big model is no longer a mysterious "black box", but becomes more transparent, which helps the big model to provide high-quality conflict solutions.

[0082] In this embodiment, the prompt template design follows the CoT design principle, guiding the big model to solve problems by following the correct thinking logic. Compared with the traditional "black box" deep learning model, the thinking process of the big model is customized to a certain extent, making the answers given by the big model more credible.

[0083] S205, implementing the modification plan generated by the large model in step S204, and then updating the upstream old version component C1 in the downstream project P to the new version component C2, and the downstream project P is upgraded to the downstream project P'.

[0084] In this application, the big model is used to modify the code in the project that needs to be modified due to component updates. The big model is provided with the differences between two different versions of components and related code snippets in the project. The big model is used to generate a modification plan for the project, so that the project upgrade can adapt to the component update, instead of taking traditional manual modification methods. The big model can process and modify a large amount of code in a very short time, while manual modification may take longer, which is especially important for projects that need to avoid the risk of vulnerabilities in old versions of components through component updates.

[0085] S206 , testing the code involved in the modification in the downstream project P′ based on the test case in S202 .

[0086] S207, if the test case fails, within the limited number of optimization times, the test failure information is fed back to the big model to optimize the modification solution generation process.

[0087] S208, if all the test cases pass, it means that the upgrade task of the downstream project P from component C1 to component C2 has been successfully completed, and the upgrade plan can be released to the open source platform.

[0088] It should be noted that if a test case fails, it means that the project upgrade solution provided by the large model cannot completely solve the compatibility problem caused by updating the old version component C1 in the upstream project P to the new version C2. At this time, the failure information is integrated into the Prompt to provide feedback to the large model, guide the large model to think about the cause of the failure, and provide a new solution. Such optimization iterations can be controlled within a certain number of times. If the problem of test failure cannot be completely solved after exceeding the set number of times, manual methods can be used to solve it. The present application implements feedback of failure information to the large model, and can optimize the quality of code modifications through feedback, which helps to obtain high-quality output.

[0089] The following is an example of a project upgrade method based on component update in this application:

[0090] (1) Obtain the difference between the component log4j-api-2.12.4 currently in use in the project and the new version component log4j-api-2.21.1 to be updated through difference detection. Figure 2 As shown in the figure, it is a schematic diagram of the differences between the components log4j-api-2.12.4 and log4j-api-2.21.1. One of the differences is selected for detailed description. The selected difference is as follows:

[0091] old:method int

[0092] org.apache.logging.log4j.message.StructuredDataId::getEnterpriseNumber()

[0093] new:method java.lang.String

[0094] org.apache.logging.log4j.message.StructuredDataId::getEnterpriseNumber()

[0095] java.method.returnTypeChanged:The return type changed from'int'to

[0096] 'java.lang.String'.

[0097] BINARY:BREAKING,SOURCE:POTENTIALLY_BREAKING

[0098] Specifically, this difference shows

[0099] The return type of the getEnterpriseNumber method in the org.apache.logging.log4j.message.StructuredDataId class has changed. In version 2.12.4, the return type of the getEnterpriseNumber method was int, and in version 2.21.1, the return type of the getEnterpriseNumber method has been changed to java.lang.String. The impact on binary and source compatibility is shown.

[0100] (2) Based on the differences in step (1), search for code snippets and test cases related to the differences in the project. For illustration, an example code snippet is designed based on the actual situation, such as Figure 3 The following is a schematic diagram of the code snippets related to the differences.

[0101] (3) Combine the information in the above steps (1) and (2) to form prompt information for input into the large model, such as Figure 4 The following is a schematic diagram of the Prompt template. The Prompt template restricts the large model to think and output results according to a certain logic:

[0102] A1, specify roles and tasks.

[0103] According to the information at the beginning of the prompt, the big model needs to clarify the role as: system upgrade engineer. The task of the big model is to modify the project code snippets to adapt to the component updates.

[0104] A2, provide differences and related code snippets: understanding <diff>< / diff> The specific meaning of the difference.

[0105] The big model needs to be able to understand the specific meaning of the difference in step A1: "The return type of the getEnterpriseNumber method in the org.apache.logging.log4j.message.StructuredDataId class has changed. In version 2.12.4, the return type of the getEnterpriseNumber method is int. In version 2.21.1, the return type of the getEnterpriseNumber method is changed to java.lang.String. And the impact on binary and source compatibility is shown. Continue to the next thinking step based on a full understanding of the difference.

[0106] A3, guide the big model to think step by step: according to <diff>< / diff> Give modification<codesnippet>< / codesnippet> specific plan.

[0107] The big model has already defined its roles and tasks and understands a specific difference between the two versions. It is also required to make a <codesnippet>< / codesnippet> Make modifications. <codesnippet>< / codesnippet> The specific content is as follows Figure 3 As shown in the figure, the second line of code in the main method calls the getEnterpriseNumber method, obtains the int type parameter enterpriseNumber, and outputs it. The difference shows that the return type of the getEnterpriseNumber method is changed to java.lang.String in the new version, so the large model needs to modify this part according to the difference. The specific measures taken are to first obtain the enterpriseNumber of String type, then convert it to int type and then output it.

[0108] A4, specifies the output: the modified code is given, and the modified code line uses <change>< / change> mark.

[0109] Requires large models to use modified code <change>< / change> Marking makes it easier for users to quickly locate the modified code.

[0110] like Figure 5 The figure is a schematic diagram of the Prompt information in this embodiment.

[0111] (4) Input the prompt information in step (3) into ChatGPT-4. GPT uses its own knowledge base to think and generate a modification plan under the guidance of the prompt information. Figure 6 As shown in Figure 1, it is a feedback diagram given by GPT. Figure 6 As can be seen, GPT perfectly modified the relevant code according to the Prompt information, following the CoT principle and a certain analysis order, and made <change>< / change> Marked, and the original logic of the code snippet is not changed during modification.

[0112] (5) Modify the relevant code in the project according to the modification plan in step (4). After all the codes related to the differences are modified according to the modification plan given by the large model, update the component log4j-api-2.12.4 in the project to log4j-api-2.21.1.

[0113] (6) Use test cases to test the modified code.

[0114] (7) If not all test cases pass, the failure-related information is fed back to GPT within a limited number of times, and GPT regenerates the code modification plan for the project and returns to the above step (5). Figure 7 The following is a schematic diagram of a prompt template that includes failure feedback information. The corresponding steps include B1: specifying roles and tasks; B2: providing component differences, related codes and failure feedback information; B3: guiding the large model to think step by step; and B4: specifying outputs.

[0115] (8) If all test cases pass, it means that the project upgrade is successful and the compatibility issues of component updates are resolved. The project upgrade plan can be published to the open source platform.

[0116] This application implements a method for adapting component updates to project upgrades based on a large model, providing a more efficient and accurate solution to compatibility issues in projects when components are updated.

[0117] Based on the above project upgrade method based on component update, such as Figure 8 As shown, the present application also proposes a project upgrade system based on component update, which may include:

[0118] A detection module is used to detect the upstream old version component C1 and the corresponding new version component C2 used in the downstream project P to obtain the difference between the component C1 and the component C2;

[0119] The test case module is used to locate the code involved in the difference in the downstream project P according to the difference between the components C1 and C2, and obtain the code fragment to be modified and the corresponding test case;

[0120] A prompt information generation module, used to generate prompt information for guiding the large model to modify the code fragment to be modified;

[0121] The solution module is used to input prompt information into the big model to guide the big model to generate a modification solution for the code snippet to be modified;

[0122] An updating module, used to implement the modification scheme on the downstream project P, update the component C1 to the component C2, and obtain the upgraded downstream project P';

[0123] The test module is used to test the modified code in the downstream project P' through test cases. If the test case fails, the modification plan generated by the large model is adjusted; if the test case passes, the project upgrade is completed.

[0124] It should be noted that in the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each module is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules can be combined or integrated into another device, or some features can be ignored or not executed. The module described as a separate component may or may not be physically separated. The component displayed as a module may be a physical unit or multiple physical units, that is, it may be located in one place, or it may be distributed in multiple different places. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

[0125] In addition, each module in each embodiment of the present invention may be integrated into a processing unit, each module may exist physically separately, or two or more modules may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit.

[0126] An electronic device provided in an embodiment of the present application includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps of the project upgrade method based on component update described in any of the above embodiments are implemented.

[0127] Another electronic device provided in the embodiment of the present application may also include: an input port connected to the processor, used to transmit multimodal data collected by an external acquisition device to the processor; and a display unit connected to the processor, used to display the processing results of the processor to the outside world; a communication module connected to the processor, used to realize communication between the electronic device and the outside world. The display unit can be a display panel, a laser scanning display, etc.; the communication mode adopted by the communication module includes but is not limited to mobile high-definition link technology (HML), universal serial bus (USB), high-definition multimedia interface (HDMI), wireless connection (including wireless fidelity technology (WiFi), Bluetooth communication technology, low-power Bluetooth communication technology, and communication technology based on IEEE802.11s).

[0128] An embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the project upgrade method based on component update as described in any of the above embodiments are implemented.

[0129] The computer-readable storage medium involved in the present application includes random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the technical field.

[0130] For the description of the relevant parts of the project upgrade system based on component update, the electronic device, and the computer-readable storage medium provided in the embodiments of the present application, please refer to the detailed description of the corresponding parts in the project upgrade method based on component update provided in the embodiments of the present application, which will not be repeated here. In addition, the parts of the above technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive elaboration.

[0131] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A project upgrade method based on component update, It is characterized in that include: Detect the old upstream version component C1 and the corresponding new version component C2 used in the downstream project P to obtain the difference between component C1 and component C2; According to the differences between components C1 and C2, locate the code involved in the differences in the downstream project P, and obtain the code snippets to be modified and the corresponding test cases; Generate prompt information to guide the large model to modify the code snippet to be modified; Input prompt information to the big model to guide the big model to generate a modification plan for the code snippet to be modified; Implement the modification plan on the downstream project P, update component C1 to component C2, and obtain the upgraded downstream project P'; Test the modified code in the downstream project P' through test cases. If the test cases fail, adjust the modification plan generated by the large model; If the test case passes, the project upgrade is completed.

2. According to the project upgrade method based on component update according to claim 1, It is characterized in that The differences between component C1 and component C2 include: Add, delete or modify classes, interfaces and methods.

3. According to the project upgrade method based on component update according to claim 2, It is characterized in that The Prompt information includes the difference between component C1 and component C2 and the code snippet to be modified, and is based on a thinking chain design framework.

4. According to the project upgrade method based on component update according to claim 3, It is characterized in that The modification scheme for adjusting the generation of the large model includes: Integrate the failed information into the prompt information and feed it back to the big model, guiding the big model to reflect and adjust the modification plan.

5. According to the project upgrade method based on component update according to claim 4, It is characterized in that The modification scheme of guiding the large model to generate the code fragment to be modified includes: The macro model defines roles and tasks; The large model understands the difference between component C1 and component C2; The large model determines a modification plan for the differences based on the understanding of the differences between component C1 and component C2; According to the modification scheme of the difference, the modified code is obtained, and the modified code is marked in the downstream project P'.

6. According to the project upgrade method based on component update according to claim 5, It is characterized in that After completing the project upgrade, the method further includes: publishing the modification plan to an open source platform for reference.

7. A project upgrade system based on component updates, It is characterized in that include: A detection module is used to detect the upstream old version component C1 and the corresponding new version component C2 used in the downstream project P to obtain the difference between the component C1 and the component C2; The test case module is used to locate the code involved in the difference in the downstream project P according to the difference between the components C1 and C2, and obtain the code fragment to be modified and the corresponding test case; A prompt information generation module, used to generate prompt information for guiding the large model to modify the code fragment to be modified; The solution module is used to input prompt information into the big model to guide the big model to generate a modification solution for the code snippet to be modified; An updating module, used to implement the modification scheme on the downstream project P, update the component C1 to the component C2, and obtain the upgraded downstream project P'; The test module is used to test the modified code in the downstream project P' through test cases. If the test case fails, the modification plan generated by the large model is adjusted; If the test case passes, the project upgrade is completed.

8. According to the project upgrade system based on component update of claim 7, It is characterized in that The modification scheme for adjusting the generation of the large model includes: Integrate the failed information into the prompt information and feed it back to the big model, guiding the big model to reflect and adjust the modification plan.

9. An electronic device, It is characterized in that include: Memory for storing computer programs; A processor, configured to implement the steps of the project upgrade method based on component update as claimed in any one of claims 1 to 6 when executing the computer program.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the project upgrade method based on component update according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Code conflict detection method and equipment

    CN108073501A

  • Automatic testing method, device and equipment and storage medium

    CN116881156A

  • Code processing method and device, all-in-one machine and computer program product

    CN117130589A

  • Software development method

    CN117539438A

  • Code detection model training method and device

    CN117707947A