Code merging method and device, equipment, medium and product

By embedding machine learning models into the code merging method, code conflicts are resolved automatically, improving the efficiency and accuracy of code merging, reducing manual interaction steps, and enhancing the security of code merging.

CN122018876APending Publication Date: 2026-05-12BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING ZITIAO NETWORK TECH CO LTD
Filing Date
2026-02-09
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In existing technologies, machine learning models lack effective conflict resolution when merging code, resulting in low merging efficiency and requiring users to perform cumbersome interactions and input information.

Method used

By embedding a machine learning model, it provides a one-click method for merging conflict-free code, displays code conflicts, and automatically merges code upon receiving user interaction, reducing manual intervention.

Benefits of technology

It improves the efficiency and accuracy of code merging, reduces manual interaction steps, and enhances the security and accuracy of code merging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122018876A_ABST
    Figure CN122018876A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a method and device for merging codes, equipment, a storage medium and a computer program product. The method includes displaying a first identifier and a second identifier, the second identifier being selected from a plurality of identifiers, the first identifier corresponding to the first code, and the second identifier corresponding to the second code. The method further includes receiving a first interaction operation for merging the first code and the second code. The method further includes displaying a conflict between the first code and the second code. The method further includes, in response to receiving the second interaction operation, merging the first code and the second code by eliminating the conflict. According to the method disclosed by the embodiment of the invention, the codes used for merging can be flexibly set, the machine learning model is embedded into a code merging mechanism, and conflicts are eliminated by one key, so that the code merging efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure generally relates to the field of computers, and more specifically to methods, apparatus, devices, computer-readable storage media, and computer program products for merging code. Background Technology

[0002] Machine learning models have entered a stage of rapid iterative development, with continuous technological updates constantly expanding the boundaries of their application scenarios and performance limits. Among them, machine learning technology, with language models as its core, has built a high-level technical system that combines accurate semantic understanding, flexible logical reasoning, and high-quality content generation, thanks to the dual empowerment of large-scale data training and deep neural network architecture. This has enabled a technological leap from simple language interaction to complex intelligent information processing.

[0003] Specifically, machine learning models can efficiently handle cross-domain, multi-level user query requests, demonstrating excellent technical performance in both routine information inquiries and professional knowledge explanations. They have already achieved large-scale applications in many fields such as intelligent customer service, educational Q&A, and professional consulting. For example, in the field of code development, large models have become core auxiliary tools. Leveraging their learning and accumulation of massive amounts of code and deep logical reasoning capabilities, they achieve accurate conversion of natural language into code. Developers only need to describe functional requirements in plain language to quickly generate executable code that adapts to different technology stacks, adheres to syntax standards, and has complete logic. Summary of the Invention

[0004] According to exemplary embodiments of this disclosure, a method, apparatus, device, computer storage medium, and computer program product for merging code are provided.

[0005] In a first aspect of this disclosure, a method for merging code is provided, the method comprising displaying a first identifier and a second identifier, the second identifier being selected from a plurality of identifiers, the first identifier corresponding to a first code, and the second identifier corresponding to a second code. The method further comprises receiving a first interactive operation for merging the first code and the second code. The method further comprises displaying a conflict between the first code and the second code. The method further comprises merging the first code and the second code by eliminating the conflict in response to receiving a second interactive operation.

[0006] In a second aspect of this disclosure, an apparatus for merging codes is provided. The apparatus includes a first display module configured to display a first identifier and a second identifier, the second identifier being selected from a plurality of identifiers, the first identifier corresponding to a first code, and the second identifier corresponding to a second code. The apparatus further includes a receiving module configured to receive a first interactive operation for merging the first and second codes. The apparatus also includes a second display module configured to display a conflict between the first and second codes. Finally, the apparatus includes a merging module configured to merge the first and second codes by eliminating the conflict in response to receiving the second interactive operation.

[0007] In a third aspect of this disclosure, an electronic device is provided, comprising: at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method described in the first aspect of this disclosure when executed by the at least one processing unit.

[0008] In a fourth aspect of this disclosure, a computer-readable storage medium is provided having machine-executable instructions stored thereon, which, when executed by a device, cause the device to perform the method described in the first aspect of this disclosure.

[0009] In a fifth aspect of this disclosure, a computer program product is provided, including computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the method described in the first aspect of this disclosure.

[0010] The summary section is provided to introduce a series of concepts in a simplified form, which will be further described in the detailed description below. The summary section is not intended to identify key or essential features of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0011] Figure 1A A schematic diagram of an example environment in which embodiments of the present disclosure can be implemented is shown;

[0012] Figure 1B A schematic diagram of a preparation interface for a merging process according to an embodiment of the present disclosure is shown;

[0013] Figure 2 A flowchart of a method for merging code according to an embodiment of the present disclosure is shown;

[0014] Figure 3 A schematic diagram of the interaction process according to an embodiment of the present disclosure is shown;

[0015] Figure 4 A schematic diagram of a conflict-free interface according to an embodiment of the present disclosure is shown;

[0016] Figure 5 A schematic diagram of a preparation process prior to conflict resolution is shown according to an embodiment of the present disclosure;

[0017] Figure 6A A schematic diagram illustrating the process of inheritance context according to an embodiment of the present disclosure is shown;

[0018] Figure 6B A schematic diagram illustrating the context change process according to embodiments of the present disclosure is shown;

[0019] Figure 7 A schematic diagram of an interface for manually de-conflict codes according to an embodiment of the present disclosure is shown;

[0020] Figure 8 A schematic diagram of a summary interface according to an embodiment of the present disclosure is shown;

[0021] Figure 9 A schematic block diagram of an example apparatus according to some embodiments of the present disclosure is shown; and

[0022] Figure 10 A block diagram of an example device that can be used to implement embodiments of the present disclosure is shown.

[0023] In all the accompanying figures, the same or similar reference numerals denote the same or similar elements. Detailed Implementation

[0024] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of these messages or information. It is understood that before using the technical solutions disclosed in the embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0025] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message. As an optional but non-limiting implementation, the prompt message can be sent to the user in the form of a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0026] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0027] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0028] In the description of embodiments of this disclosure, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects unless explicitly stated. Other explicit and implicit definitions may also be included below.

[0029] When writing code using machine learning models, multiple developers can work in parallel, each maintaining their own code branch locally. Different developers can program on the same or different branches, supplementing or completing different functionalities. In some cases, developers need to merge code branches into the main branch of the application under development. Because different developers may lack prior communication, their respective code branches may conflict. Currently, there is no solution in related technologies that utilizes machine learning models to resolve conflicts. Even if a solution exists that uses machine learning models to resolve conflicts, it requires communication with the machine learning model in a chat-like manner, requiring users to input precise commands and provide conflicting code that needs adjustment, resulting in low efficiency in resolving conflicts and merging code.

[0030] To address this issue, this disclosure proposes a method for merging code. This method allows setting the code to be merged, receiving a first interactive operation (such as clicking a button) to merge first and second code, displaying conflicts between the code to the user, and upon receiving a second interactive operation, eliminating the conflicts and merging the first and second code with a single click. This method allows for flexible setting of the code to be merged, embedding machine learning models into the code merging mechanism, and eliminating conflicts with a single click, thereby improving the efficiency of code merging.

[0031] The embodiments of this disclosure will now be described in further detail with reference to the accompanying drawings, wherein... Figure 1A A schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented is shown. The example environment 100 includes an application 110 on a user device. The application 110 may be deployed with multiple models (such as multimodal machine learning models), which are trained models capable of generating content in response to user requests. In one scenario, the application 110 performs the methods of embodiments of the present disclosure.

[0032] In some embodiments, a user can copy a copy from the target code branch (i.e., the second code) to application 110 to obtain a first branch (i.e., the first code), and update the first branch in application 110. For example, a user can provide user input 112, "Write a client development framework," in application 110. After receiving user input 112, application 110 inputs it into the coding model. Based on its powerful algorithms and training parameters, the coding model performs deep semantic analysis and logical processing on the user input, thereby generating response 114, "Client development framework file," as a new module of the first branch. In some embodiments, application 110 can obtain and display the response 114, "Client development framework file," to user input 112. For example, application 110 can display the identifier of response 114 in a dialog box on the left and the specific content of the response in a preview page on the right. Response 114 is not necessarily a single message generated by the coding model; it can be a collection of multiple messages, such as the model's thought process, the execution of subtasks, and the results of calling tools.

[0033] In some embodiments, application 110 can receive a click operation (i.e., an example of a first interactive operation), which is used to merge a first branch and a target branch. For example, application 110 can add a button 116 to the console, which the user clicks to trigger a code merge. In some embodiments, the console can also display a first identifier and a second identifier, where the first identifier corresponds to the first code and the second identifier corresponds to the second code. That is, the first identifier can be the identifier of the first branch, and the second identifier can be the identifier of the target branch. The user can select one identifier from multiple identifiers as the second identifier, where these multiple identifiers correspond to multiple different codes. When the user clicks the button 116, application 110 can trigger a merge process to merge the first branch into the target branch.

[0034] In some embodiments, a user can modify the second identifier in application 110 to merge the first branch into another branch. In some embodiments, application 110 can obtain a modification operation, wherein the modification operation is used to change the second identifier to a third identifier, the third identifier corresponding to a third code. For example, a user can click the arrow at the second identifier to bring up a drop-down menu, which can display one or more identifiers. The user can select from the drop-down menu to switch the second identifier to the third identifier. In some embodiments, application 110 can display the first identifier and the third identifier. This way, the user knows that if the merge button is clicked, the first code will be merged into the code corresponding to the third identifier.

[0035] Figure 1B A schematic diagram of a preparation interface for a merge process according to an embodiment of the present disclosure is shown. After the user provides a first interactive operation, application 110 may not immediately trigger the merge operation, but instead present some descriptive information to help the user quickly understand the status of the first branch and the target branch. For example, application 110 may provide card 118, in which application 110 may display the changes made by the first branch relative to the target branch. These changes are not conflicting content, but rather updates made by the first branch. That is, change point 1, change point 2, and change point 3 are the changes made by the first branch relative to the original code at the time of copying. For example, change point 1 could be "Added client development framework files".

[0036] In some embodiments, application 110 can display components, such as a "Details" button, within the changed content. When the user clicks the "Details" button (i.e., an example of the third interactive operation), application 110 can display change code, which includes code corresponding to the changed content in the first branch and code corresponding to the changed content in the target branch. As an example, the changed content can be content summarized by the model through analyzing the differences between the first branch and the target branch. As another example, application 110 can utilize tools to obtain a difference file that records all differences between the first branch and the target branch, including both conflicting codes and change codes (or update codes). The model can then directly analyze the change codes in the difference file to generate the changed content. For example, in the difference file, change tags can be used to mark change codes, and conflict tags can be used to mark conflicting codes.

[0037] In some embodiments, application 110 can display a conflict between the first code and the second code. For example, application 110 can display the conflict in card 120, such as "Conflict situation: There are two code files that conflict." The circumstances leading to a conflict can be varied. For example, after the first branch is generated, the source code is modified by other branches (e.g., the weather parameter is changed from snowy to rainy), and the first branch sets the weather parameter to sunny during processing. This means that other branches and the first branch have updated the same code, resulting in a conflict. In some embodiments, application 110 can display a more specific reason for the conflict in card 120, such as "The first branch sets the weather parameter to sunny, and the target branch sets the weather parameter to rainy." As described above, conflict determination can be accomplished, for example, using tools. In some embodiments, application 110 can use tools to obtain a discriminant file in which conflicting codes can be marked. Application 110 can use a model to analyze the marked content to determine the conflict and display it to the user.

[0038] In some embodiments, if a second interactive operation is received, application 110 can merge the first code and the second code by eliminating conflicts. In some embodiments, the conflict is displayed on a first page (e.g., ...). Figure 1BIn the page shown, the first page also includes a first component (such as the "AI Conflict Elimination" button), and the second interactive operation is a click operation on the first component. For example, application 110 can provide tab 122, which provides multiple buttons, including the "AI Conflict Elimination" button, the "Manual Conflict Elimination" button, and the "Cancel Merge" button. If the user clicks the "AI Conflict Elimination" button, the first branch and the target branch will be merged. If the user clicks the "Manual Conflict Elimination" button, application 110 can display the difference file, and the user can manually modify the code by referring to the markings to eliminate the conflict. If the user clicks the "Cancel Merge" button, the merge process can be canceled, and the process can be restored to the previous state. Figure 1A The interface shown.

[0039] In this embodiment, a machine learning model is embedded into the code merging mechanism, supporting one-click AI conflict resolution. This eliminates tedious manual interaction and information input steps, achieving automated conflict resolution and rapid code merging. Furthermore, before merging, cards visually display the changes made by the first branch relative to the target branch, the specific conflict details, and the reasons for the conflict. Users can also click on details to view comparative information about the changed code, helping them quickly and comprehensively understand the differences between branch codes, reducing errors caused by blind merging, and improving the accuracy and security of code merging.

[0040] In another scenario, these models are deployed on a server. Application 110 can send instructions for relevant actions to the server, and the corresponding model on the server will execute the corresponding action, thereby implementing the above embodiments. The user equipment communicates with the server via a network. The network may include a wired network, a wireless network, or a combination thereof, for providing communication between the user equipment and the server. In some embodiments, the user equipment may be connected to the server via a data cable; this disclosure does not limit the connection method between the user equipment and the server.

[0041] It should be understood that a server instance can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Servers can be connected directly or indirectly through wired or wireless communication methods, and this application does not impose any restrictions.

[0042] The user device can be any type of mobile computing device, including mobile computers (e.g., personal digital assistants, laptops, notebooks, tablets, netbooks, etc.), mobile phones (e.g., cellular phones, smartphones, etc.), wearable computing devices (e.g., smartwatches, head-mounted devices, including smart glasses, etc.) or other types of mobile devices. In some embodiments, the user device can also be a fixed computing device, such as a desktop computer, game console, smart TV, etc. It should be understood that the above operations can be performed jointly by the user device and the server.

[0043] It should be understood that the architecture and functionality in the example environment are described for illustrative purposes only and do not imply any limitation on the scope of this disclosure. Embodiments of this disclosure can also be applied to other environments with different structures and / or functionalities.

[0044] The processes according to embodiments of this disclosure will be described in detail below with reference to other accompanying drawings. For ease of understanding, the specific data mentioned in the following description are exemplary and not intended to limit the scope of this disclosure. It will be understood that the embodiments described below may also include additional actions not shown and / or actions shown may be omitted, and the scope of this disclosure is not limited in this respect.

[0045] Figure 2 A flowchart of a method 200 for merging code according to certain embodiments of the present disclosure is shown. In this embodiment, it can be performed by... Figure 1A The method is executed using the embodiments described above. In block 202, a first identifier and a second identifier are displayed. The second identifier is selected from a plurality of identifiers. The first identifier corresponds to the first code, and the second identifier corresponds to the second code. The first code may refer to the code branch to be merged, maintained and updated by the user in the application, also known as the first branch. This code is, for example, the product of the user copying a copy from the target code branch and then completing functional additions and code modifications in the application disclosed herein. The first branch can be a local branch or a remote branch. The second code may be the code branch that serves as the target for merging the first code, also known as the target branch. As an example, the target branch can be another local branch or a remote branch. For example, the second code may be code already released for another application. The plurality of identifiers may correspond to multiple different codes, and the user can select one identifier from the plurality of identifiers as the second identifier, as the object to be merged with the first code.

[0046] In box 204, a first interactive operation is received. This first interactive operation is used to merge the first code and the second code. The first interactive operation can refer to a user action triggered by the user in the application to start the merge process; it is the initiating action for the code merge process. For example, if the user clicks the merge button 116 set in the application 110 console, this click operation is the first interactive operation.

[0047] In box 206, a conflict between the first code and the second code is displayed. This conflict can be a description of the conflicting codes, such as human-readable text information. Application 110 can determine and display the conflict by analyzing the conflicting codes. As described above, application 110 can use a first tool to obtain a first file, wherein the first file includes a marked first code, the marked first code including a conflict marker indicating the code in the first code corresponding to the conflict, i.e., the conflicting code. Furthermore, the marked first code may also include a change marker unrelated to the conflict, indicating the code in the first code corresponding to the changed content, i.e., the change code.

[0048] In box 208, in response to receiving a second interactive operation, the first code and the second code are merged by eliminating conflicts. The second interactive operation can refer to a user action triggered after the application displays a conflict between the first and second codes, used to achieve conflict elimination and code merging. For example, this operation corresponds to a visual interactive entry point for eliminating conflicts and merging in the application. After the operation, the application can call a machine learning model to automatically eliminate conflicts and complete the merging of the first code into the second code. For example, after application 110 displays a conflict in card 120, the user clicks the "AI Conflict Elimination" button in tab 122 of the application; this click operation is the second interactive operation.

[0049] According to embodiments of this disclosure, the method can receive a first interactive operation (such as clicking a button) for merging first and second code, display conflicts between the code to the user, and upon receiving a second interactive operation, eliminate the conflicts and merge the first and second code with a single click. This method allows for flexible configuration of the code to be merged, embedding machine learning models into the code merging mechanism, and eliminating conflicts with a single click, thereby improving the efficiency of code merging.

[0050] Figure 3A schematic diagram of the interaction process according to an embodiment of this disclosure is shown. At 302, the user can provide an interactive operation to trigger a merge. At 304, the application can detect whether the changes in the first branch have been committed. In some cases, the user does not directly edit the first branch when editing it; the application can create a workspace for the user and copy the first branch into the workspace to obtain working code. The application can edit the working code in the workspace based on the dialogue with the user. After the user's final confirmation, the changes in the working code in the workspace are committed to the first branch, completing the editing of the first branch. Therefore, at 304, the application can detect whether all changes in the workspace have been committed, and should merge the first branch into the target branch after committing. If not committed, the merge operation is canceled at 306. If committed, proceed to 308. At 308, similarly, it detects whether the changes in the target branch have been committed. If not committed, the merge operation is canceled at 310. If committed, proceed to 312. As an example, the target branch could be another local branch, a remote branch, or something else entirely.

[0051] At position 312, a conflict is detected between the first branch and the target branch. For example, the application can use a tool (i.e., the first tool) to obtain a difference file (i.e., an example of the first file), where the difference file includes a marked first branch, and the marked first branch includes a marker indicating the code in the first code that corresponds to the conflict.

[0052] If a conflict exists, at point 314, a first intelligent system is created based on the analysis prompt (i.e., the first prompt), enabling this first intelligent system to know how to analyze the conflict. The intelligent system can be a system that autonomously processes tasks according to the prompt, utilizing the semantic understanding and reasoning capabilities of a trained machine learning model to independently decompose tasks, adjust strategies, and execute specific tasks without continuous human intervention. The first intelligent system can be an intelligent system with the analysis prompt. In some embodiments, the first intelligent system with the analysis prompt can be pre-defined; it can be created only upon first use and reused in subsequent uses; or it can be recreated each time it is used. At point 316, the first intelligent system is used to generate an analysis of the conflict. In some embodiments, the first branch is determined based on a session (i.e., the first session), which has a historical context (i.e., the first context), and the application can obtain an analysis report (i.e., an example of the first description, such as...). Figure 1BThe analysis report (shown in the image) is determined by a first intelligent system based on contextual analysis of the tags in the distinguishing files. The first intelligent system has analysis prompts. For example, distinguishing files can be input into the first intelligent system to obtain the analysis report. Further, the application can display this analysis report. Users can quickly understand the differences between the first branch and the target branch through this analysis report and can interactively choose whether to manually eliminate the conflict or use AI to eliminate the conflict. If the user needs a more detailed understanding of the conflict, the conflict code can be displayed. In some embodiments, if a third interactive operation (e.g., a click operation) is received, the first branch and a fourth code are merged and displayed, where the fourth code is the code in the target branch corresponding to the conflict (i.e., the conflict code). For example, assuming that the code of function A in the first branch conflicts with the code of function A in the target branch, the first branch can be displayed and the code of function A in the target branch can be displayed at the corresponding position, allowing the user to quickly understand the conflict code and easily comprehend the conflict details. In some embodiments, the application can also display a file tree, where the file tree includes a first code file, which is a code file involving a conflict among multiple code files. This allows the user to focus on the conflicting code file, making it easier to understand the conflict details. The above-described technical content can be displayed on the first page, or on a new page, and can be implemented in any embodiment of this disclosure.

[0053] If the user selects manual conflict resolution at point 318, the application can display the distinguished files and their tags for easy manual handling. In some embodiments, the first branch includes multiple code files, and the conflict is displayed on a first page. The first page also includes a component that triggers manual conflict resolution. If a third interactive action (e.g., a click) is received based on this component, the application proceeds to point 320, merging and displaying the first branch and the fourth code file. This allows the user to quickly understand the conflicting code, facilitating code comprehension and conflict resolution.

[0054] In some embodiments, a file tree is displayed, wherein the file tree includes a first code file, which is a conflicting code file among multiple code files. This allows the conflicting code file to be focused on on the first page, making it easier for the user to modify the conflicts in each code file, thereby improving the efficiency of conflict resolution.

[0055] If the user selects to use AI to resolve conflicts at point 322, the application can create a second intelligent system at point 324 based on the conflict resolution prompt (i.e., the second prompt). In some embodiments, the second intelligent system with the conflict resolution prompt can be preset; it can also be created only on the first use and reused in subsequent uses; or it can be recreated every time it is used. At point 324, the second intelligent system is created based on the conflict resolution prompt. This conflict resolution prompt is used to guide the model to resolve various types of code conflicts. At point 326, the second intelligent system is used to process the first branch, performing the conflict resolution operation to obtain a processed first branch, wherein the processed first branch is determined by the second intelligent system based on a discriminant file, and the second intelligent system has the conflict resolution prompt. At point 328, it is detected whether all conflicts have been resolved. In some embodiments, if the processed first branch indicates that the conflict has been resolved, the process proceeds to point 338, where the processed first branch and the target branch are merged to obtain merged code.

[0056] Figure 4 A schematic diagram of the interface after conflict resolution according to an embodiment of the present disclosure is shown. In some embodiments, the code segment of the processed first branch can be displayed on page 410, allowing the user to quickly view how the conflict was resolved. Furthermore, the user can adjust the code segment of the processed first branch on this page for optimization. When the user deems there are no issues, they can click button 420 to merge the processed first branch into the target branch.

[0057] In some embodiments, if the processed first branch indicates that the conflict has not been resolved, a prompt message can be provided to inform the user of the processing result. Additionally, several options can be provided, including continuing to process the conflict, reprocessing the conflict, and switching to manual conflict resolution. If the user selects the method to resolve the conflict, the program proceeds to step 320, merging and displaying the first branch and the fourth code.

[0058] After the user finishes processing, at point 330, it checks whether all conflicts have been eliminated. If not, at point 332, the merge process is canceled. The conflicts can then remain on the first and target branches. If all conflicts have been eliminated, the process proceeds to point 334, where user confirmation is received, and all modifications to the first branch are saved. At point 336, a third-party intelligent system is created based on summary prompts and used to analyze the user's manual processing to obtain an easy-to-read summary. After user confirmation, the process proceeds to point 338, where the first branch is merged into the target branch, completing the merge operation. In some cases, the target branch may be located on a remote server, making direct merging impossible. In some embodiments, a merge code generation request (i.e., a first request) is used to provide the merged code to a third party. Upon receiving the merged code, the third party can update the target branch using it, completing the merge of the target branch.

[0059] In this embodiment, dedicated intelligent systems are created for conflict analysis, elimination, and manual handling summaries. Combining prompts and conversation history context enhances the professionalism and targeting of AI in handling code conflicts. At the same time, the interactive design for manually eliminating conflicts is optimized. By focusing on conflicting files through a file tree and merging the conflicting code in the local and target branches, the time and effort costs of manual operations are significantly reduced, and the efficiency, accuracy, and security of code merging are improved.

[0060] Figure 5 A schematic diagram of the preparation process before conflict resolution according to an embodiment of this disclosure is shown. At 510, the user can trigger a merge, for example, by clicking the "Merge" button. At 512, the application can detect whether there is a conflict between the first branch and the target branch. If there is a conflict, proceed to 514 to check if there are any uncommitted changes in the workspace. If there are uncommitted changes, proceed to 516 to guide the user to commit these changes. If there are no changes, proceed to 518 to display the component for merging. If the user clicks the component, proceed to 520 to merge the working code of the work into the first branch, so that the first branch can be updated to the latest state, including all changes made in the session. At this point, the preparation process is basically complete, and proceed to 522 to resolve the conflict.

[0061] Meanwhile, at point 524, the application can use a tool to obtain a difference file. This difference file can identify changed and conflicting code in the first branch. At point 526, the application can obtain the difference code lines, which include both changed and conflicting code. At point 528, if there is no conflict between the first and target branches, the first and target branches can be displayed in parallel. If there is a conflict between the first and target branches, the difference code lines, i.e., changed and conflicting code, can be displayed, allowing users to quickly decide whether to manually resolve the conflict or use AI to resolve it.

[0062] Figure 6A A schematic diagram illustrating the process of inheriting context according to embodiments of the present disclosure is shown. In some embodiments, a user's session with an application may invoke multiple intelligent systems to perform different tasks, such as intelligent system 1, intelligent system 2, and intelligent system 3. For example, intelligent system 1, intelligent system 2, and intelligent system 3 may share a common time-related context.

[0063] At point 610, the user can trigger a merge operation. At this point, the application can obtain all the contexts involved in the session (i.e., the first context) based on the association between Intelligent System 1, Intelligent System 2, and Intelligent System 3 and the common context, for later use. At point 612, the application can detect whether there is a conflict between the first branch and the target branch. If there is no conflict, it can proceed to point 620 to directly merge the first branch and the target branch. If there is a conflict, a conflict file is generated based on the first branch and the target branch. At point 614, a conflict check and analysis are performed based on the first branch, the target branch, and the conflict file, providing and displaying an analysis report. This allows the user to quickly understand the conflict and decide whether to manually resolve it or use AI to resolve it. At point 616, the user can choose to manually resolve the conflict, and the application can display the difference file for easy modification.

[0064] At point 618, the user can choose to use AI to eliminate conflicts, and the application can eliminate conflicts according to the aforementioned embodiments. At point 620, after confirming that there are no conflicts, the application can merge the processed first branch and the target branch. Simultaneously, the application can incorporate the context generated by this merging process into a common context. For example, the contexts generated by the first intelligent system and the second intelligent system can be merged into a common context. The application can associate the contexts of intelligent system 1, intelligent system 2, and intelligent system 3 with the latest context, so that intelligent system 1, intelligent system 2, and intelligent system 3 will comprehensively process the context of the merged operation in subsequent work, making the processing result more in line with the user's intent.

[0065] Figure 6BA schematic diagram illustrating the context change process according to an embodiment of this disclosure is shown. At 630, the session may involve historical context. At 632, after the merging process is triggered, a first intelligent system is created, and system prompts and historical context are added to the context of the intelligent system. At 634, analysis prompts can be added to the context of the intelligent system, enabling the first intelligent system to analyze conflicts. At 636, the first intelligent system generates analysis context and analysis report, which constitute part of the context of the intelligent system.

[0066] At point 638, a second intelligent system is created. The entire context of the first intelligent system is retained within the second system. Conflict resolution prompts, the first branch, the target branch, and the conflict file are added to the context of the second intelligent system. The conflict resolution prompts enable the second intelligent system to resolve conflicts, while the first branch, target branch, and conflict file serve as reference materials for conflict resolution, improving accuracy. At point 640, the second intelligent system performs the conflict resolution operation and generates the processing result, which serves as the context of the intelligent system.

[0067] If no conflicts remain after the conflict resolution process, the game proceeds to point 642, where a third intelligent system is created. A summary prompt is added to the context of this third intelligent system, and the context of the second intelligent system is preserved within it. At point 644, the third intelligent system can generate a summary report, which constitutes the context of the intelligent system.

[0068] If the conflict persists after the conflict resolution process, proceed to step 646, where multiple options are provided, including a retry option and a manual resolution option. If the user selects the retry option, proceed to step 634, recreate the first intelligent system, retain the system prompts, historical context, and analysis prompts, while discarding other contexts, and then repeat the above process.

[0069] If the user abandons using AI to resolve conflicts (i.e., abandons the operation), for example, switching to manual conflict resolution, the process proceeds to step 648, restoring all conflict markers, that is, restoring the processed first code to the marked first code. At step 650, the contents of the difference file are displayed, including the first branch and conflict markers. At step 652, a fourth intelligent system is created, and its context is changed to system prompts, historical context, and summary prompts. The fourth intelligent system can analyze and summarize the user's actions, outputting an easy-to-understand processing report to help the user quickly understand what was modified. At step 654, the processed first branch and the target branch can be merged.

[0070] Figure 7A schematic diagram of an interface for manually resolving conflicting codes according to an embodiment of the present disclosure is shown. In some embodiments, a first branch includes multiple code files, and the conflict is displayed on a first page. The application can provide a component on the first page for triggering manual conflict resolution. After the user clicks on the component, the application can merge and display the first branch and a fourth code on page 710, where the fourth code is the code in the target branch corresponding to the conflict. For example, codes marked with solid lines (e.g., code 1, code 2, and code 4) can be codes in the first branch, and codes marked with dashed lines can be codes in the target branch that conflict with code 2, which can be displayed near code 2. This allows the user to see the conflicting codes at a glance and perform comparative analysis.

[0071] In some embodiments, a file tree is displayed on the first page, wherein the file tree includes a first code file (e.g., file 1, file 2, and file 3), which is a conflicting code file among multiple code files. This allows the conflicting code file to be focused on on the first page, making it easier for the user to modify the conflicts in each code file, thereby improving the efficiency of conflict resolution.

[0072] After resolving the conflict, a summary of the process can be generated. Figure 8 A schematic diagram of a summary interface according to an embodiment of the present disclosure is shown. In this embodiment, the application can use the model to summarize the editing of the first branch and display the summary on page 810. For example, the summary could be: "This processing eliminated 3 conflicting files, namely the login module, the verification module, and the connection module. The following are the specific changes..." On this page, users can quickly browse how they resolved the conflicts, whether the resolution method was correct, or how the model automatically resolved the conflicts and what content was modified. This helps improve the efficiency of users in handling conflicts.

[0073] Figure 9 A schematic block diagram of an example device 900 according to some embodiments of the present disclosure is shown. Device 900 can be implemented by software, hardware, or a combination of both. Figure 9 As shown, the device 900 includes a first display module 910, a receiving module 920, a second display module 930, and a merging module 940.

[0074] In some embodiments, the first display module 910 may be configured to display a first identifier and a second identifier, the second identifier being selected from a plurality of identifiers, the first identifier corresponding to a first code, and the second identifier corresponding to a second code. The receiving module 920 may be configured to receive a first interactive operation for merging the first code and the second code. The second display module 930 may be configured to display a conflict between the first code and the second code. The merging module 940 may be configured to merge the first code and the second code by eliminating the conflict in response to receiving a second interactive operation.

[0075] In some embodiments, the conflict is displayed on a first page, which also includes changes to the first code relative to the second code.

[0076] In some embodiments, the device 900 further includes: a third interaction module configured to display a change code in response to a third interaction operation on the changed content, wherein the change code includes the code in the first code corresponding to the changed content and the code in the second code corresponding to the changed content.

[0077] In some embodiments, the apparatus 900 further includes: a modification module configured to acquire a modification operation, wherein the modification operation is used to modify the second identifier to a third identifier, the third identifier corresponding to a third code; and an identifier update module configured to display the first identifier and the third identifier.

[0078] In some embodiments, where the first code includes multiple code files, the apparatus 900 further includes: a fusion module configured to, in response to receiving a third interactive operation, fuse and display the first code and the fourth code, wherein the fourth code is the code in the second code that corresponds to the conflict; and a file tree display module configured to display a file tree, wherein the file tree includes the first code file, which is the code file in the multiple code files that involves the conflict.

[0079] In some embodiments, the conflict is displayed on a first page, which also includes a first component, and the second interaction is a click operation on the first component.

[0080] In some embodiments, the first code is determined based on a first session having a first context, and the second display module 930 includes: a file acquisition module configured to acquire a first file using a first tool, wherein the first file includes a tagged first code, the tagged first code including a marker indicating a code in the first code corresponding to a conflict; a first intelligent system module configured to create a first intelligent system based on a first prompt word; a first description module configured to acquire a first description, wherein the first description is determined by the first intelligent system analyzing the markers of the first file based on the first context; and a description display module configured to display the first description.

[0081] In some embodiments, the merging module 940 includes: a second intelligent system module configured to create a second intelligent system based on a second prompt word; a first acquisition module configured to acquire a processed first code, wherein the processed first code is determined by the second intelligent system based on a first file; and a second merging module configured to merge the processed first code and the second code in response to the processing first code indicating that a conflict has been eliminated, to obtain a merged code.

[0082] In some embodiments, the apparatus 900 further includes a request module configured to generate a first request based on the merged code, wherein the first request is used to provide the merged code to a third party.

[0083] In some embodiments, the apparatus 900 further includes a context merging module configured to merge the contexts generated by the first intelligent system and the second intelligent system into a first context.

[0084] In some embodiments, the device 900 further includes a prompting module configured to provide a prompting message in response to a processed first code indication conflict not being resolved.

[0085] In some embodiments, the apparatus 900 further includes a recovery module configured to restore the processed first code to the marked first code in response to receiving an abandonment operation.

[0086] The division of modules or units in the embodiments of this disclosure is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods. Furthermore, the functional units in the disclosed embodiments may be integrated into one unit, exist as separate physical entities, or two or more units may be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional unit.

[0087] Figure 10 A block diagram of an example device 1000 that can be used to implement embodiments of the present disclosure is shown. It should be understood that... Figure 10 The device 1000 shown is merely an example and should not be construed as limiting the functionality and scope of the implementation described herein. For example, device 1000 may correspond to the implementation described herein. Figure 1A The user equipment described above can be used to perform the above-described... Figures 1A to 7 The process. For example, device 1000 may correspond to the electronic device of the third aspect of the invention.

[0088] like Figure 10As shown, device 1000 is in the form of a general-purpose computing device. Components of device 1000 may include, but are not limited to, one or more processors or processing units 1010, memory 1020, storage device 1030, one or more communication units 1040, one or more input devices 1050, and one or more output devices 1060. Processing unit 1010 may be a physical or virtual processor and is capable of performing various processes according to programs stored in memory 1020. In a multiprocessor system, multiple processing units execute computer-executable instructions in parallel to improve the parallel processing capability of device 1000.

[0089] Device 1000 typically includes multiple computer storage media. Such media can be any available media accessible to device 1000, including but not limited to volatile and non-volatile media, removable and non-removable media. Memory 1020 can be volatile memory (e.g., registers, cache, random access memory (RAM)), non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof). Storage device 1030 can be removable or non-removable media and may include machine-readable media, such as flash drives, disks, or any other media capable of storing information and / or data (e.g., training data for training) and accessible within device 1000.

[0090] Device 1000 may further include additional removable / non-removable, volatile / non-volatile storage media. Although not explicitly stated... Figure 10 As shown, disk drives for reading from or writing to removable, non-volatile disks (e.g., "floppy disks") and optical disk drives for reading from or writing to removable, non-volatile optical disks can be provided. In these cases, each drive can be connected to a bus (not shown) via one or more data media interfaces. Memory 1020 may include computer program product 1025 having one or more program modules configured to perform various methods or actions of various implementations of this disclosure.

[0091] The communication unit 1040 enables communication with other computing devices via a communication medium. Additionally, the components of device 1000 can function as a single computing cluster or multiple computing machines capable of communicating via communication connections. Therefore, device 1000 can operate in a networked environment using logical connections to one or more other servers, network personal computers (PCs), or another network node.

[0092] Input device 1050 can be one or more input devices, such as a mouse, keyboard, trackball, etc. Output device 1060 can be one or more output devices, such as a monitor, speaker, printer, etc. Device 1000 can also communicate with one or more external devices (not shown) via communication unit 1040 as needed. These external devices include storage devices, display devices, etc., and can communicate with one or more devices that enable user interaction with device 1000, or with any device that enables device 1000 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication can be performed via an input / output (I / O) interface (not shown).

[0093] According to an exemplary implementation of this disclosure, a computer-readable storage medium is provided that stores computer-executable instructions thereon, wherein the computer-executable instructions are executed by a processor to implement the methods described above. According to an exemplary implementation of this disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, which are executed by a processor to implement the methods described above. According to an exemplary implementation of this disclosure, a computer program product is provided that stores a computer program thereon, which, when executed by a processor, implements the methods described above.

[0094] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, devices, and computer program products implemented according to this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0095] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0096] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0097] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0098] Various implementations of this disclosure have been described above. The foregoing description is exemplary and not exhaustive, nor is it limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the various implementations disclosed herein.

Claims

1. A method for merging code, comprising: Display a first identifier and a second identifier, wherein the second identifier is selected from a plurality of identifiers, the first identifier corresponds to a first code, and the second identifier corresponds to a second code; Receive a first interactive operation, the first interactive operation being used to merge the first code and the second code; This indicates a conflict between the first code and the second code; as well as In response to receiving a second interaction, the first code and the second code are merged by eliminating the conflict.

2. The method according to claim 1, wherein the conflict is displayed on a first page, and the first page further includes changes to the first code relative to the second code.

3. The method according to claim 2, further comprising: In response to a third interactive operation on the changed content, a change code is displayed, wherein the change code includes the code in the first code corresponding to the changed content and the code in the second code corresponding to the changed content.

4. The method according to claim 1, further comprising: Obtain a modification operation, wherein the modification operation is used to modify the second identifier to a third identifier, the third identifier corresponding to a third code; as well as Display the first identifier and the third identifier.

5. The method of claim 1, wherein the first code comprises a plurality of code files, and the method further comprises: In response to receiving a third interactive operation, the first code and the fourth code are merged and displayed, wherein the fourth code is the code in the second code that corresponds to the conflict; as well as Display a file tree, wherein the file tree includes a first code file, which is the code file in the plurality of code files involved in the conflict.

6. The method of claim 1, wherein the conflict is displayed on a first page, the first page further comprising a first component, and the second interactive operation is a click operation on the first component.

7. The method of claim 1, wherein the first code is determined based on a first session having a first context, and displaying a conflict between the first code and the second code comprises: A first file is obtained using a first tool, wherein the first file includes the first code marked with a marker indicating the code in the first code that corresponds to the conflict; A first description is obtained, wherein the first description is determined by a first intelligent system based on the first context analysis of the tags of the first file, and the first intelligent system has a first prompt word; as well as The first description is displayed.

8. The method of claim 7, wherein merging the first code and the second code by eliminating the conflict comprises: The first processed code is obtained, wherein the first processed code is determined by a second intelligent system based on the first file, and the second intelligent system has a second prompt word; as well as In response to the processed first code indicating that the conflict has been eliminated, the processed first code and the second code are merged to obtain merged code.

9. The method according to claim 8, further comprising: A first request is generated based on the merged code, wherein the first request is used to provide the merged code to a third party.

10. The method of claim 8, further comprising: The contexts generated by the first intelligent system and the second intelligent system are merged into the first context.

11. The method of claim 8, further comprising: In response to the processed first code indicating that the conflict has not been resolved, a prompt message is provided.

12. The method of claim 11, further comprising: In response to receiving an abandonment operation, the processed first code is restored to the marked first code.

13. An apparatus for merging code, comprising: A first display module is configured to display a first identifier and a second identifier, wherein the second identifier is selected from a plurality of identifiers, the first identifier corresponds to a first code, and the second identifier corresponds to a second code; A receiving module is configured to receive a first interactive operation, the first interactive operation being used to merge the first code and the second code; The second display module is configured to display the conflict between the first code and the second code; as well as The merging module is configured to merge the first code and the second code by eliminating the conflict in response to receiving a second interactive operation.

14. An electronic device comprising: At least one processing unit; At least one memory is coupled to the at least one processing unit and stores operations to be performed by the at least one processing unit, the operations causing the electronic device to perform the method according to any one of claims 1 to 12 when performed by the at least one processing unit.

15. A computer program product having a computer program stored thereon, which, when executed by a processor, implements the method according to any one of claims 1 to 12.