File merging method, device, equipment, storage medium and product

By recording and automatically merging the repository file modification operations of the development branch, the inefficiency problem caused by manual merging is solved, and efficient file merging and integration testing are achieved.

CN114428739BActive Publication Date: 2025-09-16BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210085887.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-25
Publication Date
2025-09-16
Estimated Expiration
2042-01-25

AI Technical Summary

Technical Problem

During the software development process, manually merging repository files from different development branches is too inefficient, resulting in insufficient merging efficiency for integration test branches.

Method used

By recording the modification operations of the warehouse files of the development branch, the modification records are generated, and the target warehouse files are automatically merged according to these records, and the modification instructions are generated for merging processing to improve the merging efficiency.

Benefits of technology

It realizes the automated file merging process, improves the efficiency and accuracy of integration testing, and reduces the workload of manual merging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114428739B_ABST
    Figure CN114428739B_ABST
Patent Text Reader

Abstract

The present disclosure provides a file merging method, apparatus, device, storage medium and product, which relate to the field of computer technology, and in particular to the field of the Internet of Things. The specific implementation scheme is: for any development branch, obtain the modification operation of the warehouse file of the development branch, obtain the modification record of the warehouse file, and store the modification record in the modification file; in response to the merge test request triggered by the user, read at least one modification record from the modification file; according to at least one modification record, determine the target modification record for the target warehouse file; according to the target modification record of the target warehouse file, merge and modify the target warehouse file to obtain the modified target warehouse file. The technical solution of the present disclosure improves the merging efficiency of warehouse files.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet of Things in the field of computer technology, and in particular to a file merging method, apparatus, device, storage medium and product. Background Art

[0002] During application development, development branches can be divided into development branches, integration testing branches, and official release branches, depending on the development stage. To improve development efficiency, multiple development branches can be set up. Each development branch can be responsible for the development and testing of corresponding program functions. Each development branch can modify the repository files that implement the corresponding functions. Repository files can store the application program code. The integration testing branch can merge repository files from multiple development branches. During merging, modifications to the same repository file from different branches are usually manually merged. However, manual merging is labor-intensive, resulting in low efficiency in merging the same repository files from different development branches in the integration testing branch during software development. Summary of the Invention

[0003] The present disclosure provides a file merging method, apparatus, device, storage medium, and product for integration testing of an application program.

[0004] According to a first aspect of the present disclosure, a file merging method is provided, comprising:

[0005] For any development branch, obtain the modification operation of the warehouse file of the development branch, obtain the modification record of the warehouse file, and store the modification record in the modification file;

[0006] In response to a merge test request triggered by a user, reading at least one modification record from the modification file;

[0007] Determining a target modification record for a target repository file based on at least one of the modification records;

[0008] According to the target modification record of the target warehouse file, the target warehouse file is merged and modified to obtain the modified target warehouse file.

[0009] According to a second aspect of the present disclosure, a file merging device is provided, comprising:

[0010] An operation detection unit is used to detect, for any development branch, a modification operation on a repository file of the development branch, obtain a modification record of the repository file, and store the modification record in a modification file;

[0011] a record reading unit, configured to read at least one modification record from the modification file in response to a merge test request triggered by a user;

[0012] a record determining unit, configured to determine a target modification record for a target repository file based on at least one modification record;

[0013] The file modification unit is used to merge and modify the target warehouse file according to the target modification record of the target warehouse file to obtain the modified target warehouse file.

[0014] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0015] at least one processor; and

[0016] a memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method according to the first aspect.

[0018] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect.

[0019] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising: a computer program, wherein the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program so that the electronic device executes the method described in the first aspect.

[0020] The technology disclosed in the present invention solves the problem of low efficiency in merging multiple warehouse files in integration testing due to manual merging. By recording the modifications to the warehouse files, the modifications to the warehouse files can be accurately recorded. The records of the warehouse files can be used to automatically complete the merging of the application and obtain accurate merging results. By automatically executing the merging of files, the efficiency of file merging can be improved.

[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0023] Figure 1This is a schematic diagram of an application of a file merging method provided by an embodiment of the present disclosure;

[0024] Figure 2 This is a flowchart of an embodiment of a file merging method provided by an embodiment of the present disclosure;

[0025] Figure 3 is a flowchart of another embodiment of a file merging method provided by an embodiment of the present disclosure;

[0026] Figure 4 is a flowchart of another embodiment of a file merging method provided by an embodiment of the present disclosure;

[0027] Figure 5a This is an example diagram of a warehouse file of a module provided by an embodiment of the present disclosure;

[0028] Figure 5b This is an example diagram of a warehouse file of another module provided by an embodiment of the present disclosure;

[0029] Figure 6 is an example diagram of a modified warehouse file provided by an embodiment of the present disclosure;

[0030] Figure 7 This is a structural diagram of an embodiment of a file merging device provided by an embodiment of the present disclosure;

[0031] Figure 8 It is a block diagram of an electronic device used to implement the file merging method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0032] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0033] The technical solution disclosed herein can be applied to software integration testing scenarios. When multiple development branches test different modules of the same software, the modified contents of multiple development branches can be recorded, and the recorded modified contents can be used to automatically merge files, thereby improving the efficiency of file merging.

[0034] In related art, the program development process can be divided into development branches, integration testing branches, and official release branches based on different development stages. To improve development efficiency, multiple development branches can be set up, with each development branch responsible for the development and testing of its own development functions. Different development branches can each obtain and modify corresponding functional modules. In actual applications, different development branches can reuse the same module. A module actually refers to a warehouse file that can implement the corresponding function at runtime. Different development branches can modify the warehouse files under their respective development branches. Therefore, different development branches can modify copies of the same warehouse file during development, and the same warehouse file may correspond to multiple modified copies. After development is completed in each development branch, the integration testing branch can merge the modifications made to the same warehouse file by different development branches. For example, in branch A, file a1 is modified to a1', and in branch B, file a1 is moved from branch A to branch B. The integration testing branch merges the modifications and moves made to file a1 by branches A and B, resulting in file a1' located in branch B.

[0035] In real-world applications, due to the reusability of program code, different development branches may independently modify the same repository file. After testing, the integration test branch merges the modifications made by different development branches. This is typically done manually. However, manual merging is labor-intensive, resulting in low efficiency for integration test branches in merging the same repository file from different development branches during software development.

[0036] In order to solve the above technical problems, in an embodiment of the present disclosure, for any development branch, the modification operation of the warehouse file of the development branch can be detected, the modification record of the warehouse file can be obtained, and the modification record can be stored in the modification file. The modification record can be used as a reference basis for the modification. After obtaining a merge test request triggered by the user, at least one modification record can be read from the modification file in response to the merge test request, and the target modification record for the target warehouse file can be determined according to the at least one modification record. The target warehouse file is merged and modified according to the target modification record of the target warehouse file to obtain the modified target warehouse file. By recording the modification of the warehouse file, the modification of the warehouse file can be accurately recorded, and the record of the warehouse file can be used to automatically complete the merging work of the application to obtain an accurate merging result. By automatically executing the merging work of the files, the efficiency of file merging can be improved.

[0037] The embodiments of the present disclosure provide a file merging method, apparatus, device, storage medium, and product, which are applied to the field of the Internet of Things in the field of computer technology to automatically merge modifications made to corresponding target warehouse files by multiple development branches, thereby improving merging efficiency.

[0038] The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0039] For ease of understanding, Figure 1 , which is a schematic diagram of an application of a file merging method provided by an embodiment of the present disclosure.

[0040] During application development, the various functions of the application can be divided into different development branches. A development device in each development branch, such as laptop 1, can obtain the repository file corresponding to the assigned development function from electronic device 2 upon a developer's request. Development device 1 can detect the developer's modification operations and obtain a modification record of the repository file. Development device 1 can send the detected modification operations and the modification record to an electronic device, such as computer 2. This electronic device can be used for integration testing.

[0041] The electronic device, i.e., computer 2, can obtain the modification operations of any development branch on the corresponding warehouse file and obtain the modification record of the warehouse file. Computer 2 can also respond to the merge test request triggered by the integration test user based on the file merging method provided in the embodiment of the present disclosure, perform modification processing on the target warehouse file, and obtain the modified target warehouse file. By automatically merging and modifying the target warehouse file, there is no need to manually merge and modify the warehouse file, which improves the modification efficiency of the warehouse file and ultimately effectively improves the integration test efficiency of the application.

[0042] like Figure 2 FIG. 1 is a flowchart of an embodiment of a file merging method provided by an embodiment of the present disclosure. The method can be configured as a file merging device, which can be located in an electronic device. The file merging method can include the following steps:

[0043] 201: For any development branch, obtain the modification operation of the warehouse file of the development branch, obtain the modification record of the warehouse file, and store the modification record in the modification file.

[0044] During the development of an application (full name: Application, abbreviated as: APP), the code is relatively complex. For example, a super APP can be composed of multiple lines of code, and the number of codes can be in the order of tens of thousands. In order to improve the efficiency of code management, the code can be divided into multiple modules, and the number of modules is in the order of hundreds. During the development of the APP, R&D personnel can modify one or more modules at the same time, and modify or improve the functions corresponding to the modules. In order to improve development efficiency, multiple development branches can be used to modify the corresponding functional modules. Any development branch in the embodiment of the present disclosure may refer to a module corresponding to a certain function of the application, and the module may include at least one warehouse file. The warehouse file of the development branch may include at least one. The R&D personnel can modify at least one warehouse file of the development branch through the user device, and provide the modification operation of at least one warehouse file to the electronic device configured with the file merging method of the embodiment of the present disclosure.

[0045] Therefore, the user device can detect the modification operation of the warehouse file of the development branch by the user corresponding to the development branch, and send the modification operation of the warehouse file to the electronic device. The electronic device can receive the modification operation of the warehouse file of the development branch sent by the user device. The modification operation may include the modification content of the warehouse file. Among them, obtaining the modification record of the warehouse file may include: determining the modification content in the modification operation, and generating a modification record of the warehouse file based on the modification content. The modification record may include: modification information such as the modification content, modification type, modification time, and file name of the modified warehouse file.

[0046] The development branch may include at least one, and a modification operation on a warehouse file corresponding to the at least one development branch may be obtained to obtain a modification record of the warehouse file corresponding to the at least one development branch.

[0047] 202: In response to a merge test request triggered by a user, read at least one modification record from the modification file.

[0048] Optionally, the electronic device may detect a user-triggered merge test request. The user may be a user who manages code merges. The electronic device may display a merge control for the merge test to the user. The user triggers the merge control. Upon detecting that the user has triggered the merge control, the electronic device may generate a user-triggered merge test request.

[0049] The at least one modification record read from the modification file may be a modification record of at least one development branch. A development branch may provide one or more modification records.

[0050] 203: Determine a target modification record for the target repository file according to the at least one modification record.

[0051] Optionally, the target warehouse file may be any modified warehouse file in the application.

[0052] To enable users to control modifications to repository files, a target repository file selected by the user from at least one repository file can be detected to obtain the target repository file. The at least one repository file can be all repository files of the application. Of course, to improve selection efficiency, the at least one repository file can also be all modified repository files in the application.

[0053] To improve modification efficiency, the target warehouse file can also be automatically selected. The target warehouse file can be selected from at least one warehouse file. To facilitate file management, each warehouse file can be assigned a file name, and different warehouse files can have different file names.

[0054] Determining a target modification record for a target repository file based on the at least one modification record may include: determining the file name of the modified repository file corresponding to each of the at least one modification record; and selecting a modification record having the same target file name as the target repository file from the file names corresponding to the at least one modification record to obtain the target modification record. The target repository file may include at least one target modification record. The at least one target modification record of the target repository file may be obtained for a modification operation provided by one or more development branches.

[0055] 204: performing a merge modification process on the target warehouse file according to the target modification record of the target warehouse file to obtain a modified target warehouse file.

[0056] Optionally, the target warehouse file may be merged according to at least one target modification record of the target warehouse file to obtain a modified target warehouse file.

[0057] Merging and modifying the target warehouse file according to the target modification record to obtain the modified target warehouse file may include: determining the modification content in the target warehouse file, merging and modifying the target warehouse file according to the modification content, and obtaining the modified target warehouse file.

[0058] In the embodiment of the present disclosure, for any development branch, the modification operation of the warehouse file of the development branch can be detected, the modification record of the warehouse file can be obtained, and the modification record can be stored in the modification file. The modification record can be used as a reference basis for the modification. After obtaining a merge test request triggered by the user, at least one modification record can be read from the modification file in response to the merge test request, and the target modification record for the target warehouse file can be determined based on the at least one modification record. The target warehouse file is merged and modified according to the target modification record of the target warehouse file to obtain the modified target warehouse file. By recording the modifications to the warehouse file, the modifications to the warehouse file can be accurately recorded, and the records of the warehouse file can be used to automatically complete the merging work of the application and obtain accurate merging results. By automatically executing the merging work of the files, the efficiency of file merging can be improved.

[0059] As an embodiment, after the modification record is stored in the modification file, the following steps are further included:

[0060] Generate a modification instruction corresponding to the modification record according to the modification operation corresponding to the modification record;

[0061] According to the target modification record of the target warehouse file, the target warehouse file is merged and modified to obtain the modified target warehouse file, including:

[0062] Get the modification instructions corresponding to the target modification record;

[0063] Run the modification instructions corresponding to the target modification record, merge and modify the target warehouse file, and obtain the modified target warehouse file.

[0064] Optionally, generating a modification instruction corresponding to the modification record based on the modification operation corresponding to the modification record may include: obtaining the modification operation corresponding to the modification record, obtaining the modification content and modification type corresponding to the modification record, and generating the modification instruction corresponding to the modification record based on the modification content and modification type. The modification content may include additions or deletions to the repository file, and the modification type may include the modification type corresponding to the modification operation on the repository file, such as addition, deletion, or modification.

[0065] In the disclosed embodiment, after a modification record is stored in a modification file, a modification instruction corresponding to the modification record can be generated according to the modification operation corresponding to the modification record. When modifying a target warehouse file, the modification instruction corresponding to the target modification record can be obtained, and the modification instruction corresponding to the target modification record can be executed to merge and modify the target warehouse file to obtain the modified target warehouse file. By automatically generating corresponding modification instructions according to the modification record, when the target warehouse file needs to be modified, the modification instruction can be directly executed, thereby improving modification efficiency.

[0066] like Figure 3 FIG. 1 is a flowchart of an embodiment of a file merging method provided by an embodiment of the present disclosure. The method can be configured as a file merging device, which can be located in an electronic device. The file merging method can include the following steps:

[0067] 301: For any development branch, obtain the modification operation of the warehouse file of the development branch, obtain the modification record of the warehouse file, and store the modification record in the modification file.

[0068] Some steps in the embodiments of the present disclosure are the same as some steps in the aforementioned embodiments. For the sake of brevity, they are not repeated here.

[0069] 302: In response to a merge test request triggered by a user, read at least one modification record from the modification file.

[0070] 303: According to the modification objects corresponding to the at least one modification record, modification records with the same modification object are divided into the same modification group to obtain at least one modification group.

[0071] The modification object of a modification record may refer to the modified repository file. The modification record may include the file name of the modified repository file. The modification object may be identified using the file name of the repository file. Grouping modification records with the same modification object into the same modification group may include grouping modification records with the same file name into the same modification group. A modification group may include at least one modification record that modifies the same repository file.

[0072] 304: Determine a target modification group from the at least one modification group, and obtain a modification object corresponding to the target modification group as a target warehouse file.

[0073] To improve modification efficiency, a target modification group may be determined from at least one modification group in sequence, and for each target modification group, a target warehouse file corresponding to a modification object may be obtained. The target file name of the warehouse file corresponding to at least one modification record in the target modification group may be obtained to determine the target warehouse file corresponding to the target file name.

[0074] 305: Read at least one modification record in the target modification group as a target modification record.

[0075] The target modification record may be composed of at least one modification record in the target modification group.

[0076] 306: According to the target modification record of the target warehouse file, the target warehouse file is merged and modified to obtain a modified target warehouse file.

[0077] Optionally, the target warehouse file may be merged and modified according to at least one modification record corresponding to the target modification record to obtain a modified target warehouse file. After merging and modifying the target warehouse file according to the target modification record of the target warehouse file to obtain the modified target warehouse file, the process may return to the step of determining the target modification group from the at least one modification group and continue until the at least one modification group traversal is completed.

[0078] In the embodiment of the present disclosure, for any development branch, the modification operation of the warehouse file of the development branch can be obtained, the modification record of the warehouse file can be obtained, and the modification record can be stored in the modification file. The corresponding user triggers a merge test request to read at least one modification record from the modification file. According to the modification object corresponding to at least one modification record, the modification records with the same modification object can be divided into the same modification group to obtain at least one modification group. By dividing the objects, the modification records of the same object can be uniformly determined. By determining the target modification group from at least one modification group, the modification object corresponding to the target modification group can be obtained as the target warehouse file. By determining the target modification group, the target warehouse file corresponding to the modification object of the modification group can be obtained, thereby obtaining the modified warehouse object, and by determining at least one modification record in the target modification group as the target modification record, obtaining the modification record of the same modification object. Improve the accuracy of obtaining the modification object. According to the target modification record of the target warehouse file, the target warehouse file is merged and modified to obtain the merged and modified target warehouse file, thereby improving the accuracy and efficiency of merging and modifying the target warehouse file.

[0079] As an embodiment, determining the target modification group from the at least one modification group may include:

[0080] sorting the at least one modification group to obtain the at least one sorted modification group;

[0081] According to the sorting order of the at least one modification group, a target modification group is determined from the at least one modification group in sequence.

[0082] When determining a target modification group for at least one modification group, the at least one modification group may be sorted, and a modification order of the modification groups may be confirmed to avoid missing modifications of the modification groups.

[0083] Sorting the at least one modification group may include randomly sorting the at least one modification group. The at least one modification group may also be sorted in chronological order of modification time. The modification time of the modification group may include the modification time of the last modification record in the modification group or the modification time of the first modification record.

[0084] In the disclosed embodiment, when determining a target modification group, at least one modification group may be sorted first, and then the target modification group may be determined from the at least one modification group in the order in which the at least one modification group is sorted. This sorting can make the selection of the target modification group more regular, avoid missing modification groups, and improve the efficiency and accuracy of determining the target modification group.

[0085] In some embodiments, the target modification record of the target repository file may include at least one. Figure 4 FIG. 1 is a flowchart of an embodiment of a file merging method provided by an embodiment of the present disclosure. The method can be configured as a file merging device, which can be located in an electronic device. The file merging method can include the following steps:

[0086] 401: For any development branch, obtain the modification operation of the warehouse file of the development branch, obtain the modification record of the warehouse file, and store the modification record in the modification file.

[0087] Some steps in the embodiment of the present disclosure are the same as some steps in the aforementioned embodiment, and are not repeated here for the sake of accuracy of description.

[0088] 402: In response to a merge test request triggered by a user, read at least one modification record from the modification file.

[0089] 403: Determine at least one target modification record for the target repository file according to the at least one modification record.

[0090] The target modification record of the target warehouse file may include at least one target modification record. The at least one target modification record may be a modification record for the target warehouse file.

[0091] 404: Determine a modification order corresponding to at least one target modification record.

[0092] At least one target modification record of the target repository file may be randomly determined. The modification order corresponding to each of the at least one target modification record may be randomly determined.

[0093] Optionally, the target modification records may be used in sequence to modify the warehouse file according to the modification order corresponding to at least one target modification record, to obtain a modified target warehouse file.

[0094] 405: Determine the current target modification record according to the modification order corresponding to at least one target modification record. If a previous target modification record exists for the current target modification record, use the current target modification record to modify the modification result of the previous target modification record on the target warehouse file again to obtain the modification result of the current target modification record, until the last target modification record is modified and the modified target warehouse file is obtained.

[0095] According to the modification order corresponding to at least one target modification record, the warehouse file is modified in sequence using the target modification records to obtain the modified target warehouse file, which may include: determining the current target modification record according to the modification order corresponding to at least one target modification record, if there is a previous target modification record for the current target modification record, then using the current target modification record to modify the modification result of the previous target modification record on the target warehouse file again to obtain the modification result of the current target modification record, until the modification of the last target modification record is completed to obtain the modified target warehouse file.

[0096] When merging and modifying the target warehouse file corresponding to at least one modification record according to the modification order corresponding to at least one target modification record, the modification result of the warehouse file by the previous target modification record can be used as the basis for modifying the warehouse file by the next target modification record.

[0097] According to the modification order corresponding to at least one target modification record, starting from the first target modification record, the current target modification record is determined in sequence. If a previous target modification record exists for the current target modification record, the modification result of the target warehouse file is modified again using the previous target modification record to obtain the modification result of the target warehouse file by the current target modification record, and the process returns to the step of determining the current target modification record and continues until the last target modification record is modified, thereby obtaining the modified target warehouse file. The modification result obtained by modifying the modification result of the previous modification record by the last modification record is the modified target warehouse file.

[0098] In the embodiment of the present disclosure, according to the target modification record of the target warehouse file, the target warehouse file is merged and modified, and the modification order corresponding to at least one target modification record can be determined. According to the modification order corresponding to at least one target modification record, the current target modification record is determined. If there is a previous target modification record for the current target modification record, the modification result of the previous target modification record on the target warehouse file is modified again using the current target modification record to obtain the modification result of the current target modification record, until the last target modification record is modified, and the final modified target warehouse file is obtained. Through the modification effect of the target warehouse file, the modification result of the previous target modification record is used as the modification basis for the next modification record, so as to achieve accurate merge modification, avoid missed modifications or invalid modifications, and improve the efficiency and accuracy of merge modification.

[0099] As an embodiment, any target modification record includes a modification time;

[0100] Determining a modification order corresponding to at least one target modification record includes:

[0101] Determine a modification time corresponding to at least one target modification record of the target warehouse file;

[0102] Determine a modification order corresponding to each of the at least one target modification record according to a modification time corresponding to each of the at least one target modification record.

[0103] Optionally, the target modification record may include a modification time.

[0104] As a possible implementation method, when determining the modification order corresponding to at least one target modification record based on the modification time corresponding to at least one target modification record, if the modification time corresponding to any two target modification records is the same, the modification order corresponding to the two target modification records with the same modification time is randomly determined.

[0105] In an embodiment of the present disclosure, the modification time corresponding to at least one target modification record of the target warehouse file is determined, and the modification order corresponding to at least one modification record can be determined based on the modification time corresponding to the at least one target modification record. By using the modification time as the basis for determining the modification order, the modification order can be accurately determined.

[0106] In some embodiments, the target warehouse file includes a program module where the warehouse is located; the at least one target modification record includes: a file migration record that changes the program module where the target warehouse file is located, and a content modification record of the file content of the target warehouse file;

[0107] Determining a modification order corresponding to at least one target modification record according to a modification time corresponding to at least one target modification record includes:

[0108] If it is determined that the modification time of the file migration record is before the content modification record, then the modification order of the file migration record is determined to be before the content modification record;

[0109] If it is determined that the modification time of the file migration record is later than the content modification record, then the modification order of the content modification record is determined to be earlier than the file migration record.

[0110] When the modification order of the file migration record is before the content modification record, the target warehouse file can be migrated using the file migration record first, and then the content modification record can be used to modify the migrated target warehouse file to obtain the modified target warehouse file.

[0111] When the modification record of the content modification record is located before the file migration record, you can first use the content modification record to modify the target warehouse file to obtain the modification result, and then use the file migration record to migrate the modification result to obtain the modified target warehouse file.

[0112] For ease of understanding, Figure 5a Module A in may include warehouse file a1 and warehouse file a2, Figure 5b Module B in the example can include repository files b1 and b2. Assume that user U1 submits a file migration operation on repository file a1, generating a corresponding file migration record, migrating from module A to module B. User U2 submits a modification operation on repository file a1, generating a corresponding content modification record, with a1 becoming a1'.

[0113] If the time of the file migration record is before the time of the content modification record, the warehouse file a1 can be migrated to module B according to the file migration record. Then, according to the content modification record, the modified content from a1 to a1' is obtained, and the modified content is used to modify the warehouse file a1 in module B to obtain the warehouse file a1' in module B.

[0114] If the content modification record is before the file migration record, the warehouse file a1 can be modified to a1' in module A according to the content modification record. Then, according to the file migration record, the warehouse file a1' is migrated to module B to obtain the warehouse file a1' in module B.

[0115] refer to Figure 6After modifying the warehouse file a1 in module A using the file migration record and content modification record, the obtained module A includes warehouse file a2, and module B includes warehouse file a1', warehouse file b1, and warehouse file b2.

[0116] In an embodiment of the present disclosure, when determining the modification order corresponding to at least one target modification record based on the modification time corresponding to at least one target modification record, if the modification time of the file migration record is determined to be before the content modification record, then the modification order of the file migration record is determined to be before the content modification record; if the modification time of the file migration record is determined to be after the content modification record, then the modification order of the content modification record is determined to be before the file migration record. By sequentially confirming the modification times of the file migration record and the file modification record, the order of the file migration record and the file modification record can be accurately confirmed.

[0117] As an embodiment, for any development branch, detecting modification operations on the repository file of the development branch, obtaining modification records of the repository file, and storing the modification records in a modification file may include:

[0118] A first commit request submitted to at least one development branch belonging to the same development group is detected.

[0119] In response to the first submission request, the modification operation of the warehouse file corresponding to at least one development branch transmitted by the development team is obtained, the modification record of the warehouse file corresponding to at least one development branch is obtained, and the modification record of the warehouse file corresponding to at least one development branch is stored in the modification file.

[0120] The modification operations submitted by at least one development branch in the same development group can be uploaded in a unified manner. In a possible design, the modification time of the modification record can be the submission time when the modification operation is submitted by the development branch.

[0121] In the disclosed embodiments, the development group is used as the submission unit, and modification records submitted by at least one development branch of the same development group can be included in the modification file. Using the development group as the unit can improve the efficiency of modification record submission, prevent conflicts or overlaps in modifications within the same group, and improve the accuracy of modification record submission.

[0122] As another embodiment, for any development branch, detecting modification operations on the repository file of the development branch, obtaining modification records of the repository file, and storing the modification records in a modification file include:

[0123] Detects the second pull request submitted to any development branch.

[0124] In response to the second submission request, the modification operation on the corresponding warehouse file submitted by the development branch is obtained, the modification record of the warehouse file is obtained, and the modification record is stored in the modification file.

[0125] Optionally, any development branch can submit modification operations separately to generate corresponding modification records.

[0126] In the disclosed embodiments, development branches are used as the unit of interaction. Any development branch can directly submit a second submission request. In response to this second submission request, the modification operations submitted by the development branch for the repository file can be obtained, and the modification record of the repository file can be obtained and stored in the modification file. By using the development branch as the submission unit for modification records, the accuracy of the modification records can be ensured, personalized submission of development branches can be achieved, and the effectiveness of interaction can be improved.

[0127] like Figure 7 FIG. 1 is a schematic diagram of a structure of an embodiment of a file merging device provided by an embodiment of the present disclosure. The device may be located in an electronic device. The file merging device 700 may include the following units:

[0128] The operation detection unit 701 is used to detect the modification operation on the warehouse file of any development branch, obtain the modification record of the warehouse file, and store the modification record in the modification file.

[0129] The record reading unit 702 is configured to read at least one modification record from a modification file in response to a merge test request triggered by a user.

[0130] The record determining unit 703 is configured to determine a target modification record for a target repository file according to at least one modification record.

[0131] The file modification unit 704 is configured to perform a merge modification process on the target warehouse file according to the target modification record of the target warehouse file to obtain a modified target warehouse file.

[0132] As an embodiment, it also includes:

[0133] An instruction generating unit, configured to generate a modification instruction corresponding to the modification record according to the modification operation corresponding to the modification record;

[0134] File modification unit, including:

[0135] An instruction acquisition module is used to obtain the modification instruction corresponding to the target modification record;

[0136] The instruction running module is used to run the modification instruction corresponding to the target modification record, merge and modify the target warehouse file, and obtain the modified target warehouse file.

[0137] In certain embodiments, comprising:

[0138] The object division module is used to divide the modification records with the same modification object into the same modification group according to the modification objects respectively corresponding to at least one modification record, so as to obtain at least one modification group.

[0139] The target acquisition module is used to determine a target modification group from at least one modification group, and obtain a modification object corresponding to the target modification group as a target warehouse file.

[0140] The record reading module is used to read at least one modification record in the target modification group as a target modification record.

[0141] As an embodiment, the target acquisition module includes:

[0142] a sorting submodule, configured to sort at least one modification group to obtain at least one sorted modification group;

[0143] The sequence determination submodule is used to determine the target modification group from the at least one modification group in sequence according to the sorting order of the at least one modification group.

[0144] In some embodiments, the target modification record of the target repository file includes at least one;

[0145] File modification unit, including:

[0146] An order determination module, configured to determine a modification order corresponding to at least one target modification record;

[0147] The sequential modification module is used to determine the current target modification record according to the modification sequence corresponding to at least one target modification record. If there is a previous target modification record for the current target modification record, the modification result of the target warehouse file on the previous target modification record is modified again using the current target modification record to obtain the modification result of the current target modification record, until the last target modification record is modified, and the target warehouse file obtained by modifying the previous modification result is obtained.

[0148] In one possible design, any target modification record includes the modification time;

[0149] Sequence determination module, including:

[0150] A time determination submodule, configured to determine a modification time corresponding to at least one target modification record of a target repository file;

[0151] The sequence determination submodule is used to determine the modification sequence corresponding to at least one target modification record according to the modification time corresponding to at least one target modification record.

[0152] In some embodiments, the target warehouse file includes a program module where the warehouse is located; the at least one target modification record includes: a file migration record that changes the program module where the target warehouse file is located, and a content modification record of the file content of the target warehouse file;

[0153] Determine the submodules in order, specifically for:

[0154] If it is determined that the modification time of the file migration record is before the content modification record, then the modification order of the file migration record is determined to be before the content modification record;

[0155] If it is determined that the modification time of the file migration record is later than the content modification record, then the modification order of the content modification record is determined to be earlier than the file migration record.

[0156] As an embodiment, the operation detection unit includes:

[0157] A first detection module is used to detect a first submission request submitted by at least one development branch belonging to the same development group;

[0158] The first acquisition module is used to respond to the first submission request, obtain the modification operations of the corresponding warehouse files respectively transmitted by at least one development branch of the development group, obtain the modification records of the warehouse files respectively corresponding to at least one development branch, and store the modification records of the warehouse files respectively corresponding to at least one development branch in the modification file.

[0159] As yet another embodiment, the operation detection unit includes:

[0160] A second detection module is used to detect a second submission request submitted by any development branch;

[0161] The second acquisition module is used to respond to the first submission request, obtain the modification operation submitted by the development branch to its corresponding warehouse file, obtain the modification record of the warehouse file, and store the modification record in the modification file.

[0162] The file merging device in the embodiment of the present disclosure can execute the file merging method in the above embodiment. For the specific steps executed by each unit, module, and sub-module, please refer to the content recorded in the method and will not be repeated here.

[0163] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0164] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0165] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.

[0166] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0167] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. Various programs and data required for the operation of the device 800 can also be stored in the RAM 803. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0168] Various components in device 800 are connected to I / O interface 805, including an input unit 806, such as a keyboard, mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, optical disk, etc.; and a communication unit 809, such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0169] The computing unit 801 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the file merging method. For example, in some embodiments, the file merging method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the file merging method described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform the file merging method by any other appropriate means (e.g., by means of firmware).

[0170] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0171] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0172] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0173] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0174] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0175] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. This client-server relationship is established by computer programs running on the respective computers, establishing a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosts and VPS services ("Virtual Private Servers" or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.

[0176] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.

[0177] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A file merging method, comprising: For any development branch, obtain the modification operation of the warehouse file of the development branch, obtain the modification record of the warehouse file, and store the modification record in the modification file; In response to a merge test request triggered by a user, reading at least one modification record from the modification file; Determining a target modification record for a target warehouse file according to at least one modification record; wherein the target modification record for the target warehouse file includes at least one; Determining a modification order corresponding to at least one of the target modification records; Performing a merge and modification process on the target warehouse file according to the modification order corresponding to at least one target modification record to obtain the modified target warehouse file; The target warehouse file includes a program module where the warehouse is located; any target modification record includes a modification time, a file migration record of changing the program module where the target warehouse file is located, and a content modification record of the file content of the target warehouse file; and determining a modification order corresponding to at least one of the target modification records includes: If the modification time of the file migration record is before the content modification record, then determining that the modification order of the file migration record is before the content modification record; If it is determined that the modification time of the file migration record is later than that of the content modification record, then it is determined that the modification order of the content modification record is earlier than that of the file migration record.

2. The method according to claim 1, wherein After storing the modification record in the modification file, the method further includes: Generating a modification instruction corresponding to the modification record according to the modification operation corresponding to the modification record; The step of performing a merging and modification process on the target warehouse file according to the target modification record of the target warehouse file to obtain the modified target warehouse file includes: Obtaining a modification instruction corresponding to the target modification record; Run the modification instruction corresponding to the target modification record, perform a merge modification process on the target warehouse file, and obtain the modified target warehouse file.

3. The method according to claim 1, wherein Determining a target modification record for a target repository file based on at least one modification record includes: According to the modification objects respectively corresponding to at least one of the modification records, modification records with the same modification object are divided into the same modification group to obtain at least one modification group; Determine a target modification group from at least one of the modification groups, and obtain a modification object corresponding to the target modification group as the target repository file; At least one modification record in the target modification group is read as the target modification record.

4. The method according to claim 3, wherein: Determining a target modification group from at least one of the modification groups includes: sorting at least one of the modification groups to obtain at least one sorted modification group; According to the sorting order of at least one of the modification groups, a target modification group is determined from the at least one modification group in sequence.

5. The method according to claim 1, wherein The merging and modifying processing of the target warehouse file according to the modification order corresponding to at least one target modification record to obtain the modified target warehouse file includes: According to the modification order corresponding to at least one of the target modification records, the current target modification record is determined. If there is a previous target modification record for the current target modification record, the modification result of the previous target modification record on the target warehouse file is modified again using the current target modification record to obtain the modification result of the current target modification record pair, until the modification of the last target modification record is completed, and the modified target warehouse file is obtained.

6. The method according to claim 5, wherein: The determining of the modification order corresponding to at least one target modification record further includes: Determine a modification time corresponding to at least one target modification record of the target warehouse file; Determine a modification order corresponding to at least one target modification record according to a modification time corresponding to at least one target modification record.

7. The method according to claim 1, wherein The method of detecting, for any development branch, a modification operation on a repository file of the development branch, obtaining a modification record of the repository file, and storing the modification record in a modification file includes: Detecting a first commit request submitted by at least one development branch belonging to the same development group; In response to the first submission request, obtain the modification operations of the corresponding warehouse files respectively transmitted by at least one of the development branches of the development group, obtain the modification records of the warehouse files respectively corresponding to at least one of the development branches, and store the modification records of the warehouse files respectively corresponding to at least one of the development branches in the modification files.

8. The method according to any one of claims 1 to 6, wherein: The method of detecting, for any development branch, a modification operation on a repository file of the development branch, obtaining a modification record of the repository file, and storing the modification record in a modification file includes: Detect the second pull request submitted to any development branch; In response to the second submission request, the modification operation submitted by the development branch to the corresponding warehouse file is obtained, a modification record of the warehouse file is obtained, and the modification record is stored in a modification file.

9. A file merging device, comprising: An operation detection unit is used to detect, for any development branch, a modification operation on a repository file of the development branch, obtain a modification record of the repository file, and store the modification record in a modification file; a record reading unit, configured to read at least one modification record from the modification file in response to a merge test request triggered by a user; a record determining unit, configured to determine a target modification record for a target repository file based on at least one modification record; wherein the target modification record for the target repository file includes at least one; The file modification unit includes a sequence determination module and a sequence modification module, wherein the sequence determination module is used to determine the modification sequence corresponding to at least one target modification record; the sequence modification module is used to merge and modify the target warehouse file according to the modification sequence corresponding to at least one target modification record to obtain the modified target warehouse file; Wherein, the target warehouse file includes the program module where the warehouse is located; Any target modification record includes the modification time, the file migration record of the program module where the target warehouse file is located, and the content modification record of the file content of the target warehouse file. The sequence determination module includes a sequence determination submodule, which is specifically used to: if the modification time of the file migration record is before the content modification record, then determine that the modification order of the file migration record is before the content modification record; if it is determined that the modification time of the file migration record is after the content modification record, then determine that the modification order of the content modification record is before the file migration record.

10. The apparatus according to claim 9, further comprising: An instruction generating unit, configured to generate a modification instruction corresponding to the modification record according to the modification operation corresponding to the modification record; The file modification unit includes: An instruction acquisition module, used to acquire the modification instruction corresponding to the target modification record; The instruction execution module is used to execute the modification instruction corresponding to the target modification record, merge and modify the target warehouse file, and obtain the modified target warehouse file.

11. The apparatus according to claim 9, wherein the record determination unit comprises: An object division module is configured to divide modification records with the same modification object into the same modification group according to the modification object corresponding to at least one modification record, thereby obtaining at least one modification group; a target acquisition module, configured to determine a target modification group from at least one of the modification groups, and obtain a modification object corresponding to the target modification group as the target repository file; The record reading module is configured to read at least one modification record in the target modification group as the target modification record.

12. The device according to claim 11, wherein the target acquisition module comprises: a sorting submodule, configured to sort at least one of the modification groups to obtain at least one sorted modification group; The sequence determination submodule is configured to determine a target modification group from at least one of the modification groups in sequence according to the sorting order of the at least one modification group.

13. The device according to any one of claims 9, wherein: The sequential modification module is specifically used to determine the current target modification record according to the modification sequence corresponding to at least one of the target modification records. If there is a previous target modification record for the current target modification record, the current target modification record is used to modify the modification result of the previous target modification record on the target warehouse file again to obtain the modification result of the current target modification record, until the last target modification record is modified, and the target warehouse file obtained by modifying the previous modification result again is obtained.

14. The device according to claim 13, wherein The sequence determination module further includes a time determination submodule: The time determination submodule is used to determine the modification time corresponding to at least one target modification record of the target warehouse file; The sequence determination submodule is further configured to determine a modification sequence corresponding to at least one target modification record according to a modification time corresponding to at least one target modification record.

15. The device according to claim 9, wherein The operation detection unit includes: A first detection module is used to detect a first submission request submitted by at least one development branch belonging to the same development group; The first acquisition module is used to respond to the first submission request, obtain the modification operations of at least one development branch transmitted by the development group on the corresponding warehouse file, obtain the modification records of the warehouse file corresponding to at least one development branch, and store the modification records of the warehouse file corresponding to at least one development branch in the modification file.

16. The device according to claim 15, wherein The operation detection unit includes: A second detection module is used to detect a second submission request submitted by any development branch; The second acquisition module is used to respond to the first submission request, obtain the modification operation submitted by the development branch to its corresponding warehouse file, obtain the modification record of the warehouse file, and store the modification record in a modification file.

17. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.

18. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-8.

19. A computer program product comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Automatic code merging method and system

    CN104461578A