CN113110868A - File merging method and device, computer equipment and storage medium - Google Patents

File merging method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113110868A
CN113110868A CN202110374489.9A CN202110374489A CN113110868A CN 113110868 A CN113110868 A CN 113110868A CN 202110374489 A CN202110374489 A CN 202110374489A CN 113110868 A CN113110868 A CN 113110868A
Authority
CN
China
Prior art keywords
data
file
version file
type
version
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110374489.9A
Other languages
Chinese (zh)
Other versions
CN113110868B (en
Inventor
王忠攀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202110374489.9A priority Critical patent/CN113110868B/en
Publication of CN113110868A publication Critical patent/CN113110868A/en
Application granted granted Critical
Publication of CN113110868B publication Critical patent/CN113110868B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/72Code refactoring

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a file merging method and device, computer equipment and a storage medium. Acquiring related merged files, wherein the related merged files comprise a father version file, a first version file and a second version file, the first version file comprises a file formed by executing a first operation based on the father version file, and the second version file comprises a file formed by executing a second operation based on the father version file; according to the comparison result of the father version file, the first version file and the second version file, acquiring first type data and second type data in the first version file and/or the second version file; obtaining a source file based on the relevant merged file; and executing the first target operation to write the first type of data in the source file, and executing the second target operation to write the second type of data in the source file to form a target file. The method and the device enable the combination of the files to be more efficient and faster, and ensure the correctness of the combination of the files.

Description

File merging method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer software technologies, and in particular, to a file merging method, an apparatus, a computer device, and a storage medium.
Background
In the software development process, in order to improve the efficiency of multi-person collaborative development, development programs and/or related files can be shared among team members, so that version management tools such as SVN and Git are indispensable. The version management tool can realize the backup of files and codes, record the modification condition and the historical version of each version of file, and realize the synchronization of a plurality of terminals, so that a plurality of users can obtain all versions of the files by using different terminals and modify the versions. However, when two users modify respective files based on the same version file to obtain a new file, if the two users upload the modified files to the version management tool in sequence, a version conflict may occur, and at this time, the two modified files need to be merged. When files of multiple versions are merged manually, all similarities and differences of the files need to be found out from a large amount of data, so that the files are modified and merged, errors are easy to make, and the efficiency is low.
Disclosure of Invention
The embodiment of the application provides a file merging method, a file merging device, computer equipment and a storage medium, different files can be merged conveniently and rapidly, and merging efficiency and correctness are improved.
The embodiment of the application provides a file merging method, which comprises the following steps:
acquiring related merged files, wherein the related merged files comprise a father version file, a first version file and a second version file, the first version file comprises a file formed by executing a first operation based on the father version file, and the second version file comprises a file formed by executing a second operation based on the father version file;
according to the comparison result of the father version file, the first version file and the second version file, acquiring first type data and second type data in the first version file and/or the second version file;
obtaining a source file based on the relevant merged file;
and executing a first target operation to write the first type of data in the source file, and executing a second target operation to write the second type of data in the source file to form a target file.
Correspondingly, an embodiment of the present application further provides a file merging device, including:
a merged file acquiring unit configured to acquire a related merged file including a parent version file, a first version file including a file formed by performing a first operation based on the parent version file, and a second version file including a file formed by performing a second operation based on the parent version file;
a data obtaining unit, configured to obtain first type data and second type data in the first version file and/or the second version file according to a comparison result between the parent version file and the first version file;
a source file obtaining unit configured to obtain a source file based on the relevant merged file;
and the forming unit is used for executing a first target operation to write the first type of data in the source file, and executing a second target operation to write the second type of data in the source file to form a target file.
Optionally, the data obtaining unit is further configured to:
comparing the first version file with the second version file;
acquiring first data at a first position in the first version file and second data at a second position in the second version file, wherein the first data content is different from the second data content, and a first position relation of the first data in the first version file corresponds to a second position relation of the second data in the second version file;
acquiring third data at a third position in the parent version file, wherein the third data has a third position relationship in the parent version file, and the third position relationship, the first position relationship and the second position relationship correspond to each other;
comparing the first data content with the third data content to obtain a first comparison result, and comparing the second data content with the third data content to obtain a second comparison result;
and acquiring the first type data and the second type data according to the first comparison result and the second comparison result.
Optionally, the data obtaining unit is further configured to:
if the first data content is different from the third data content and the second data content is the same as the third data content, determining that the first data belongs to the first type data;
if the first data content is the same as the third data content and the second data content is different from the third data content, determining that the second data belongs to the first type of data;
and if the first data content is different from the third data content and the second data content is different from the third data content, determining that the first data and the second data belong to the second type of data.
Optionally, the first version file includes a first ordered two-dimensional data table and a first unordered two-dimensional data table, the second version file includes a second ordered two-dimensional data table and a second unordered two-dimensional data table, data formats of the first ordered two-dimensional data table and the second ordered two-dimensional data table are the same, and the data obtaining unit is further configured to:
comparing the first ordered two-dimensional data table with the second ordered two-dimensional data table;
and comparing the first unordered two-dimensional data table with the second unordered two-dimensional data table.
Optionally, the first ordered two-dimensional data table includes first header data and first content data, the second ordered two-dimensional data table includes second header data and second content data, and the data obtaining unit is further configured to:
comparing the first header data and the second header data;
comparing the first content data and the second content data.
Optionally, the source file includes the parent version file, the first version file or the second version file, and the forming unit is further configured to:
writing the first type data in the source file according to the first target operation to form an initial file;
acquiring target data in the second type data;
and writing the target data in the initial file according to the second target operation to form a target file.
Optionally, the forming unit is further configured to:
determining a first target location of the first type of data in the first version file and/or the second version file;
acquiring the first target operation executed by the first type of data in the first version file and/or the second version file, wherein the first target operation comprises the first operation and/or the second operation;
and if the first corresponding position of the source file does not have the first type of data, executing the first target operation at the first corresponding position, and writing the first type of data, wherein the first corresponding position is the same as the first target position.
Optionally, the forming unit is further configured to:
determining a second target location of the second type of data in the first version file and/or the second version file;
acquiring a third target operation executed by the second type of data, wherein the third target operation comprises the first operation and/or the second operation;
feeding back the second target position and the third target operation to a user;
receiving the target data selected by the user.
Optionally, the forming unit is further configured to:
determining a third target location of the target data in the first version file and/or the second version file;
acquiring the second target operation executed by the target data, wherein the second target operation comprises the first operation and/or the second operation;
and if the second corresponding position of the initial file does not have the target data, executing the second target operation at the second corresponding position, and writing the target data, wherein the second corresponding position is the same as the third target position.
Optionally, the data obtaining unit is further configured to:
comparing the first version file with the parent version file;
acquiring first change data at a first change position in the first version file and third change data at a third change position in the parent version file, wherein the data content of the first change data is different from that of the third change data, and the first change position relationship of the first change data in the first version file corresponds to the third change position relationship of the third change data in the parent version file;
comparing the second version file with the parent version file;
acquiring second change data at a second change position in the second version file and third substitute data at a third substitute position in the parent version file, wherein the data content of the second change data is different from that of the third substitute data, and a second change position relationship of the second change data in the second version file corresponds to a third substitute position relationship of the third substitute data in the parent version file;
and comparing the first change data with the second change data, and if the data content of the first change data is the same as that of the second change data, determining that the first change data and/or the second change data belong to the second type data.
Optionally, the first version file includes a first ordered two-dimensional data table and a first unordered two-dimensional data table, the parent version file includes a third ordered two-dimensional data table and a third unordered two-dimensional data table, and the data obtaining unit is further configured to:
comparing the first ordered two-dimensional data table with the third ordered two-dimensional data table;
comparing the first unordered two-dimensional data table with the third unordered two-dimensional data table.
Optionally, the first ordered two-dimensional data table includes first header data and first content data, the third ordered two-dimensional data table includes third header data and third content data, and the data obtaining unit is further configured to:
comparing the first header data and the third header data;
comparing the first content data and the third content data.
Optionally, the second version file includes a second ordered two-dimensional data table and a second unordered two-dimensional data table, the parent version file includes a third ordered two-dimensional data table and a third unordered two-dimensional data table, and the data obtaining unit is further configured to:
comparing the second ordered two-dimensional data table with the third ordered two-dimensional data table;
and comparing the second unordered two-dimensional data table with the third unordered two-dimensional data table.
Optionally, the second ordered two-dimensional data table includes second header data and second content data, the third ordered two-dimensional data table includes third header data and third content data, and the data obtaining unit is further configured to:
comparing the second header data and the third header data;
comparing the second content data with the third content data.
Optionally, the source file includes the parent version file, and the forming unit is further configured to:
determining a fourth target location of the second type of data in the first version file and/or the second version file;
acquiring the second target operation executed by the first type data in the first version file and/or the second version file, wherein the second target operation comprises the first operation and/or the second operation;
and executing the second target operation at a third corresponding position of the source file, and writing the second type data, wherein the third corresponding position is the same as the fourth target position.
Optionally, the first operation and the second operation include a data adding operation, a data deleting operation, and/or a data modifying operation.
Similarly, an embodiment of the present application further provides a computer device, including:
a memory for storing a computer program;
a processor for performing the steps of any of the file merging methods.
In addition, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps of any one of the file merging methods.
The embodiment of the application provides a file merging method and device, computer equipment and a storage medium, wherein the computer equipment can find different data at the same position in a file to be merged, acquire first type data which can be directly merged and second type data which needs to be merged according to user feedback, execute different operations according to different types of data characteristics, and write the two types of data in a source file, so that a merged target file is obtained, merging of a plurality of different versions of files is processed in batch, merging of the plurality of different versions of files is more efficient and faster, and meanwhile merging correctness of the plurality of different versions of files is guaranteed.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a system diagram of a document merge device according to an embodiment of the present application;
FIG. 2 is a schematic flowchart of a file merging method according to an embodiment of the present application;
FIG. 3 is another schematic flowchart of a file merging method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a parent version file provided by an embodiment of the present application;
FIG. 5 is a schematic illustration of a first version of this document provided by an embodiment of the present application;
FIG. 6 is a diagram of a second version of a file provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of an object file provided by an embodiment of the present application;
FIG. 8 is a relational diagram illustrating a file merge comparison provided by an embodiment of the present application;
FIG. 9 is a schematic structural diagram of a document merging device according to an embodiment of the present application;
FIG. 10 is a schematic structural diagram of a computer device provided in an embodiment of the present application;
fig. 11 is a schematic diagram of a first version of the content data 4014 modified based on the parent version of the file in fig. 4 according to an embodiment of the present application;
fig. 12 is a schematic diagram of a second version file after content data 4014 is modified based on the parent version file in fig. 4 according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the application provides a file merging method and device, computer equipment and a storage medium. Specifically, the file merging method according to the embodiment of the present application may be executed by a computer device, where the computer device may be a terminal or a server. The terminal may be a terminal device such as a smart phone, a tablet Computer, a notebook Computer, a touch screen, a game machine, a Personal Computer (PC), a Personal Digital Assistant (PDA), and the like, and may further include a client, which may be a game application client, a browser client carrying a game program, or an instant messaging client, and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, content distribution network service, big data and an artificial intelligence platform.
Referring to fig. 1, fig. 1 is a system schematic diagram of a file merging device according to an embodiment of the present disclosure. The system may include at least one terminal and at least one server. The terminal held by the user can be connected to different servers through different networks, for example, the network can be a wireless network or a wired network, the wireless network can be a Wireless Local Area Network (WLAN), a Local Area Network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, etc., and the terminal is configured to obtain a relevant merged file from the server, wherein the relevant merged file includes a parent version file, a first version file and a second version file, the first version file includes a file formed by performing a first operation based on the parent version file, and the second version file includes a file formed by performing a second operation based on the parent version file; then, the terminal acquires first type data and second type data in the first version file and/or the second version file according to the comparison result of the father version file, the first version file and the second version file; then, the terminal acquires a source file based on the relevant merged file; finally, the terminal performs a first target operation to write the first type of data in the source file and performs a second target operation to write the second type of data in the source file, thereby forming a target file. The server is used for storing the relevant merging files for merging.
The following are detailed below. It should be noted that the following description of the embodiments is not intended to limit the preferred order of the embodiments.
The embodiment will be described from the perspective of a file merging device, which may be specifically integrated in a terminal, and the terminal may include a smart phone, a notebook computer, a tablet computer, a personal computer, and other devices.
The file merging method provided in the embodiment of the present application may be executed by a processor of a terminal, as shown in fig. 2, a specific flow of the file merging method mainly includes steps 201 to 204, which are described in detail as follows:
step 201, obtaining a related merged file, where the related merged file includes a parent version file, a first version file and a second version file, the first version file includes a file formed by executing a first operation based on the parent version file, and the second version file includes a file formed by executing a second operation based on the parent version file.
In the embodiment of the application, a user can collaboratively manage and write files by multiple persons through the version control tool, when the user submits updated files to the server through the version control tool, if version conflict occurs, the terminal can acquire the relevant merged files with the version conflict, a series of operations are automatically performed on the relevant merged files, merging of files of different versions is achieved, the condition of the version conflict is solved, manual comparison and search of the files of the multiple different versions are avoided, and therefore the efficiency and the accuracy of file merging are improved.
In one embodiment of the present application, the parent version file, the first version file, and the second version file may be files of the same type that describe the same item or the same theme, and the data formats of the parent version file, the first version file, and the second version file are the same. The data format of the parent version file, the first version file and the second version file is not limited, and may be tables, characters, codes and the like. The parent version file may be the latest version file of a certain type of file at a certain time stored in the server. The first version file and the second version file are two different files formed by different users executing different operations based on the parent version file, when the first version file and the second version file are submitted to the server at different times, version conflict occurs, and the first version file and the second version file can be merged, so that the version conflict is solved.
For example, a plurality of users collaboratively write a file describing the subject A, when the user P wants to modify the file describing the subject A, the latest version file M describing the subject A is downloaded from the server by using the version management tool, and the user P adds, deletes and/or modifies part of data in the file M to form a file R modified by the user P. When the user Q also wants to modify the file recording the theme A, the user Q downloads the latest version file N of the theme A from the server, and the user Q performs addition, deletion and/or modification operations on the file N to form a file T modified by the user Q. When the file M downloaded by the user P and the file N downloaded by the user Q are the same file, if the user P uploads the modified file R to the server before the user Q, the version conflict occurs when the user Q uploads the modified file T to the server. In order to resolve the version conflict, the terminal may acquire the file M and/or the file N as a parent version file, acquire the file T as a first version file, acquire the file R as a second version file, and then merge the first version file and the second version file.
In one or more embodiments of the present application, the "first operation" and the "second operation" in step 201 include a data adding operation, a data deleting operation, and/or a data modifying operation.
Step 202, according to the comparison result of the parent version file, the first version file and the second version file, obtaining the first type data and the second type data in the first version file and/or the second version file.
In the embodiment of the present application, since the parent version file, the first version file, and the second version file have the same data format, and the first version file and the second version file are files obtained by performing operations of adding, deleting, and/or modifying data based on the parent version file, the first version file, and the second version file include partially the same data, and the first version file and the second version file may have partially different data. If the first version file and the second version file are to be merged, different data of the first version file and the second version file can be obtained through comparison, and partial data are selected to be concentrated into the source file according to the generation condition of the different data, so that the merging of the files is realized.
In the embodiment of the present application, the different data of the first version file and the second version file may include the first type data and the second type data based on the difference of the generation situation. The first type data may be data in which the first version file or the second version file is added, deleted, and/or modified based on the parent version file at a certain position, and the second type data may be data in which the first version file and the second version file are both added, deleted, and/or modified based on the parent version file at a certain position.
For example, when the parent version file, the first version file and the second version file are tables with three rows and three columns, the data content of the first row and the first column and the data content of the second row and the second column in the parent version file are modified to obtain the first version file, and the data content of the third row and the second column and the data content of the second row and the second column in the parent version file are modified to obtain the second version file. Since only the first version file modifies the data content of the first row and the first column and only the second version file modifies the data content of the third row and the second column, the data of the first row and the first column in the first version file is the first type data, and the data of the third row and the second column in the second version file is also the first type data. Because the first version file and the second version file modify the data content of the second row and the second column, and the modified data content of the first version file and the modified data content of the second version file are different, the data of the second row and the second column in the first version file and the data of the second row and the second column in the second version file are the second type data.
In one or more embodiments of the present application, since data characteristics of the first type data and the second type data are different, the first type data and the second type data may be acquired separately, so as to perform different merging operations. The above step 202 "acquiring the first type data and the second type data in the first version file and/or the second version file according to the comparison result of the parent version file, the first version file and the second version file" can be realized by the following steps S2021 to S2025:
step S2021: the first version file and the second version file are compared.
In the embodiment of the present application, because the first type data and the second type data are the distinguishing data of the first version file and the second version file, the distinguishing data can be obtained by comparing the first version file with the second version file, and then the distinguishing data is compared with the data at the corresponding position in the parent version file, so as to obtain the first type data and the second type data.
In this embodiment of the application, the first type of data may be data that is added, deleted, and/or modified based on a parent version file in a certain position, the second type of data may be data that is added, deleted, and/or modified based on a parent version file in a certain position, and the first version file and the second version file are both added, deleted, and/or modified based on a parent version file.
In this embodiment of the application, if the first version file and the second version file are compared with the parent version file respectively, the data a and the positional relationship between the data a and the file to which the first version file and the parent version file are distinguished may be obtained, the data B and the positional relationship between the data B and the file to which the second version file and the parent version file are distinguished may be obtained, the positional relationship between the data a and the positional relationship between the data B may be compared, the data a and the data B that are in the same positional relationship and have different data contents may be set to belong to the second type data, and the rest of the data a and the data B that have different positional relationships belong to the first type data.
Step S2022: and acquiring first data at a first position in the first version file and second data at a second position in the second version file, wherein the first data content is different from the second data content, and the first position relation of the first data in the first version file corresponds to the second position relation of the second data in the second version file.
In the embodiment of the present application, since the first version file and the second version file are both files obtained by adding, deleting and/or modifying data according to the parent version file, the data formats and the data logical relations of the first version file and the second version file are the same, and when the first location relation corresponds to the second location relation, the meaning of the first data having the first location relation with the first version file and the meaning of the second data having the second location relation with the second version file are the same. In order to maintain the data logical relationship of the target file after merging, the data logical relationship is the same as that of the first version file and the second version file before merging, so that two data with the same position relationship in the two files can be compared one by one, and first data and second data with the same position relationship and different data contents are obtained.
Step S2023: and acquiring third data at a third position in the parent version file, wherein the third data has a third position relationship in the parent version file, and the third position relationship, the first position relationship and the second position relationship correspond to each other.
Step S2024: and comparing the first data content with the third data content to obtain a first comparison result, and comparing the second data content with the third data content to obtain a second comparison result.
Step S2025: and acquiring the first type data and the second type data according to the first comparison result and the second comparison result.
In the embodiment of the present application, in order to confirm whether first data and second data different in data content belong to first type data or second type data, the first data and the second data may be compared with data in a parent version file, respectively. Because the data formats and the data logical relations of the parent version file, the first version file and the second version file are the same, the meanings represented by the three data of the three files in the same position relation are the same, in order to enable the data in different files to have comparative meanings, third data with the same position relation with the first data and the second data can be obtained, and then the third data is compared with the first data and the second data respectively.
In one or more embodiments of the present application, the above-mentioned "acquiring the first type data and the second type data according to the first comparison result and the second comparison result" in step S2025 may be implemented by steps S20251 to S20253 as follows:
step S20251: and if the first data content is different from the third data content and the second data content is the same as the third data content, determining that the first data belongs to the first type data.
In the embodiment of the present application, if the first data content and the third data content are different, it indicates that the first data having a first positional relationship with the first version file is subjected to the first operation with respect to the parent version file, and if the second data content and the third data content are the same, it indicates that the second data having a second positional relationship with the second version file is not subjected to the second operation with respect to the parent version file. Since the first type data may be data at a position where the first version file or the second version file is added, deleted, and/or modified based on the parent version file, in this case, it may be determined that the first data is the first type data.
Step S20252: and if the first data content is the same as the third data content and the second data content is different from the third data content, determining that the second data belongs to the first type data.
In the embodiment of the present application, if the first data content and the third data content are the same, it is indicated that the first data having the first positional relationship with the first version file is not subjected to the first operation with respect to the parent version file, and if the second data content and the third data content are different, it is indicated that the second data having the second positional relationship with the second version file is subjected to the second operation with respect to the parent version file, so in this case, it can be determined that the first data is the first type data.
Step S20253: and if the first data content is different from the third data content and the second data content is different from the third data content, determining that the first data and the second data belong to the second type of data.
In the embodiment of the present application, if the first data content and the third data content are different, it is indicated that the first data having a first positional relationship with the first version file is executed with respect to the parent version file, and if the second data content and the third data content are different, it is indicated that the second data having a second positional relationship with the second version file is executed with respect to the parent version file. Since the second type data may be data in a position where the first version file and the second version file are added, deleted, and/or modified based on the parent version file, in this case, it may be determined that the first data and the second data both belong to the second type data.
In one or more embodiments of the present application, the associated merged file may have a plurality of subfiles, and the data format of each subfile may be the same or different. When the related merged file is a table, in order to better divide subfiles of different data formats, subfiles with the same data format can be used as an ordered two-dimensional data table, and subfiles with other data formats which are not fixed can be used as an unordered two-dimensional data table. The first version file includes a first ordered two-dimensional data table and a first unordered two-dimensional data table, and the second version file includes a second ordered two-dimensional data table and a second unordered two-dimensional data table, and because the data formats of the first version file and the second version file are the same, the data formats of the first ordered two-dimensional data table and the second ordered two-dimensional data table are also the same, and the "comparing the first version file and the second version file" in the above step S2021 may be implemented by the following steps S20211 to S20212:
step S20211: and comparing the first ordered two-dimensional data table with the second ordered two-dimensional data table.
Step S20212: and comparing the first unordered two-dimensional data table with the second unordered two-dimensional data table.
In the embodiment of the application, the two-dimensional data table is a relational data management mode and can be made by spreadsheet software such as Excel. The dimension refers to the dimension of data, and taking a table made by Excel as an example, the data representing the same index in the two-dimensional data table can have multiple columns, and the data representing the same index in the one-dimensional data table has only one column.
In the embodiment of the application, in order to implement one-to-one comparison of two data having the same positional relationship in two files and avoid omission of part of the data during comparison, the first version file and the second version file may be compared by using subfiles of different data formats as a unit, that is, the ordered two-dimensional data table and the unordered two-dimensional data table included in the two files are compared respectively. The comparison of the ordered two-dimensional data table and the unordered two-dimensional data table is independent.
In one or more embodiments of the present application, the data format of the ordered two-dimensional data table is fixed, and the data of the ordered two-dimensional data table may be divided into different data categories according to the data position, the data role and/or the data representation meaning in the ordered two-dimensional data table, for example, the data may include header data and content data. The first ordered two-dimensional data table includes first header data and first content data, and the second ordered two-dimensional data table includes second header data and second content data, and the "comparing the first ordered two-dimensional data table and the second ordered two-dimensional data table" in the above step S20211 can be implemented by the following steps S202111 to S202112:
step S202111: the first header data and the second header data are compared.
Step S202112: the first content data and the second content data are compared.
In the embodiment of the application, in order to implement one-to-one comparison of two data having the same positional relationship in the first ordered two-dimensional data table and the second ordered two-dimensional data table, and when comparing the two ordered two-dimensional data tables, to avoid part of the data from being omitted, the first ordered two-dimensional data table and the second ordered two-dimensional data table may be compared, that is, the header data and the content data included in the two files are compared respectively, by using the data types divided in the ordered two-dimensional data tables as units. Thereby high-efficient swiftly obtain two version files in the different data of ordered two-dimensional data table and/or unordered two-dimensional data table same position, finally write in the different data that the contrast gained on the corresponding position of ordered two-dimensional data table and/or unordered two-dimensional data table that the source file contains, not only can realize handling the combination of a plurality of different version files in batches, and can realize handling the combination of a plurality of two-dimensional data tables in different version files in batches, promote a plurality of different version files and contain efficiency and the degree of accuracy that a plurality of two-dimensional data tables carry out the combination. Wherein the contrast of the header data and the content data is independent of each other.
In the embodiment of the present application, when the header data and the content data include more different categories, in order to more conveniently compare the header data and the content data at the same position in the two files, keywords may be set for the header data and the content data, respectively, and the keywords may be used to identify whether the header data or the content data is changed. If the keyword included in the header data or the content data is changed, the header data or the content data is changed in the file even if the other type of data included in the header data or the content data is not changed, and if the keyword included in the header data or the content data is not changed, the header data or the content data is not changed in the file even if the other type of data included in the header data or the content data is changed. Therefore, the header data and the content data can be respectively compared by taking the keywords as the identifiers, and whether the whole header data or the content data to which the keywords belong is added, deleted and/or modified in the two-dimensional data table is judged.
Step 203, obtaining the source file based on the relevant merged file.
In one or more embodiments of the present application, part of the different data of the first version file and the second version file is concentrated on the source file to form a merged target file, so that the source file has not only part of the different data of the first version file and the second version file but also the same data of the first version file and the second version file, and the source file has the same data format as the first version file and the second version file, so that the source file includes a parent version file, the first version file, or the second version file.
In the embodiment of the present application, two or three of the parent version file, the first version file and the second version file may also be selected as the source file, so as to generate the same two or three target files, that is, the source file includes the parent version file, the first version file and/or the second version file. Wherein, one of the two or three same target files can be selected to be uploaded to the server as the latest version file with the same theme as the related merged file record.
And 204, executing the first target operation to write the first type of data in the source file, executing the second target operation to write the second type of data in the source file, and forming a target file.
In the embodiment of the present application, because the first type data and the second type data are generated differently, the first type data is at the same position of the first version file and the second version file, only one of the files has data addition, deletion and/or modification operations performed relative to the parent version file at the same position, and the second type data is at the same position of the first version file and the second version file, and both files have data addition, deletion and/or modification operations performed relative to the parent version file at the same position. In order to write two types of data in the source file more quickly, different operations may be performed according to the generation conditions of the two types of data, thereby forming a merged target file.
In the embodiment of the application, if the parent version file is used as the source file and indicates that the first type data and the second type data do not exist in the source file, the first target operation and the second target operation are executed to write target data in part of the first type data and the second type data in the source file.
In the embodiment of the application, after the target file is formed, the first version file, the second version file and the parent version file may be backed up, and the file in which the first type data and the second type data are written each time is saved, and if a problem occurs in the process of merging the files, an error may be found according to the backed-up first version file, the second version file, the parent version file, the generated target file, and the file in each writing process of the first type data and the second type data.
In the embodiment of the application, after the target file is formed, the code cache for executing the merging process of the target file can be cleared, partial memory space of the terminal is released, and the operation efficiency of the terminal is improved.
In one or more embodiments of the present application, in the step 204, "performing the first targeting operation to write the first type of data in the source file, performing the second targeting operation to write the second type of data in the source file, and forming the target file" may be implemented by the following steps S2041 to S2043:
step S2041: and writing the first type data in the source file according to the first target operation to form an initial file.
In the embodiment of the application, the first type data and the second type data can be written in the source file in sequence, and the writing sequence of the first type data and the second type data in the source file is not limited. That is, the second type data may also be written in the source file according to the second target operation to form an initial file.
Step S2042: and acquiring target data in the second type of data.
In an embodiment of the present application, the target data is a second type of data included in the target file. The second type data is at the same position of the first version file and the second version file, and both files have data adding, deleting and/or modifying operation executed relative to the parent version file at the same position.
Step S2043: and writing the target data in the initial file according to the second target operation to form a target file.
In one or more embodiments of the present application, the above-mentioned "writing the first type data in the source file according to the first target operation" in step S2041 may be implemented by steps S20411 to S20413 as follows:
step S20411: a first target location of the first type of data in the first version file and/or the second version file is determined.
In an embodiment of the present application, the first target location includes a location where the first type of data is located in the first version file and/or the second version file. Since the first type data is located in the same position in the first version file and/or the second version file as the first type data is located in the source file, the position of the first type data in the source file can be obtained according to the first target position.
Step S20412: and acquiring a first target operation executed by the first type of data in the first version file and/or the second version file, wherein the first target operation comprises the first operation and/or the second operation.
In an embodiment of the present application, the first target operation includes an operation performed when the first type data is formed. The first type data may be data in the first version file after the first operation is performed based on the parent version file, or may be data in the second version file after the second operation is performed based on the parent version file, so that it is possible to determine whether the first target operation is the first operation or the second operation according to the file to which the first type data belongs. Since the first operation and the second operation include a data adding operation, a data deleting operation and/or a data modifying operation, the specific type of the first target operation can be determined according to the comparison between the file to which the first type data belongs and the parent version file, so that the corresponding operation is executed in the source file to write the first type data.
Step S20413: and if the first corresponding position of the source file does not have the first type data, executing a first target operation at the first corresponding position, and writing the first type data, wherein the first corresponding position is the same as the first target position.
In this embodiment of the application, the first corresponding location includes a location where the first type data is located in the initial file, and if the first version file or the second version file is used as the source file and indicates that a part of the first type data may already exist in the source file, in order to improve the formation efficiency of the target file, it may be determined in advance whether the first type data exists in the first corresponding location, and if not, the first target operation is executed to write the first type data that is not included in the source file.
In one or more embodiments of the present application, the above-mentioned "acquiring the target data in the second type of data" in step S2042 may be implemented by steps S20421 to S20424 as follows:
step S20421: a second target location of the second type of data in the first version file and/or the second version file is determined.
In an embodiment of the application, the second target location comprises a location where the second type of data is located in the first version file and/or the second version file. Since the second type data is located in the same position in the first version file and/or the second version file as the second type data is located in the source file, the position of the second type data in the source file can be obtained according to the second target position.
Step S20422: and acquiring a third target operation executed by the second type data, wherein the third target operation comprises the first operation and/or the second operation.
In an embodiment of the application, the third target operation comprises an operation performed when the second type of data is formed. The second type of data may be data in the first version file after the first operation is performed based on the parent version file, or may be data in the second version file after the second operation is performed based on the parent version file, and therefore it is possible to determine whether the third target operation is the first operation or the second operation according to the file to which the second type of data belongs. Since the first operation and the second operation include a data adding operation, a data deleting operation and/or a data modifying operation, the specific type of the third target operation can be determined according to the comparison between the file to which the second type of data belongs and the parent version file.
Step S20423: and feeding back the second target position and the third target operation to the user.
In this embodiment of the application, the second type data may be data added, deleted, and/or modified at a certain position based on the parent version file in both the first version file and the second version file, and one of the second type data may be selected from the first version file and the second version file as the target data. Because the second type data in different files may be data subjectively modified by two different users according to the file record content, the terminal cannot select the target data from the two corresponding second type data, and the two corresponding second type data and the positions of the two second type data in the files need to be fed back to the users, so that the users subjectively select the target data.
Step S20424: target data selected by a user is received.
In one or more embodiments of the present application, the "writing target data according to the second target operation in the initial file" in the step S2043 may be implemented by the following steps S20431 to S20433:
step S20431: a third target location of the target data in the first version file and/or the second version file is determined.
In an embodiment of the application, the third target location comprises a location where the target data is located in the first version file and/or the second version file. Since the target data is located in the same position in the first version file and/or the second version file as the target data is located in the initial file, the position of the target data in the initial file can be obtained according to the third target position.
Step S20432: and acquiring a second target operation executed by the target data, wherein the second target operation comprises the first operation and/or the second operation.
In an embodiment of the present application, the second target operation includes an operation performed when the target data is formed. After the target data is obtained according to the second type of data, a corresponding second target operation may be obtained according to a third target operation executed when the second type of data is formed, so that the corresponding operation is executed in the initial file to write the target data.
Step S20433: and if the second corresponding position of the initial file has no target data, executing a second target operation at the second corresponding position, and writing the target data, wherein the second corresponding position is the same as the third target position.
In this embodiment of the application, the second corresponding location includes a location where the target data is located in the target file, and if the first version file or the second version file is used as the source file and the initial file is formed according to the source file, and then a part of the target data may already exist in the initial file, in order to improve the efficiency of forming the target file, it may be determined in advance whether the target data exists in the second corresponding location, and if not, the second target operation is executed to write the target data that is not included in the initial file.
In this embodiment of the application, if the first version file and the second version file both modify data at the same position, and the two modified data contents of the first version file and the second version file are the same, the type of data needs to be obtained as the second type of data, and the step 202 "obtaining the second type of data in the first version file and/or the second version file according to the comparison result between the parent version file and the first version file and the second version file" may be implemented by the following steps S2026 to S2030:
step S2026: and comparing the first version file with the parent version file.
Step S2027: acquiring first change data at a first change position in the first version file and third change data at a third change position in the parent version file, wherein the data content of the first change data is different from that of the third change data, and the first change position relationship of the first change data in the first version file corresponds to the third change position relationship of the third change data in the parent version file.
For example, referring to fig. 4 and fig. 11 together, the first version file 1100 shown in fig. 11 is modified based on the parent version file 400 shown in fig. 4, the content data 1114 of the first version file 1100 modifies the data E into the data D based on the content data 4014 of the parent version file 400, the data D is the first variation data, the data E is the third variation data, and the position relationship of the data D in the first version file is the same as the position relationship of the data E in the parent version file.
Step S2028: and comparing the second version file with the parent version file.
Step S2029: and acquiring second change data at a second change position in the second version file and third substitute data at a third substitute position in the parent version file, wherein the data content of the second change data is different from that of the third substitute data, and the second change position relationship of the second change data in the second version file corresponds to the third substitute position relationship of the third substitute data in the parent version file.
In the embodiment of the present application, in order to obtain second type data that is modified at the same position in the first version file and the second version file and has the same data content, the first version file and the second version file need to be compared with the parent version file, after the first version file and the parent version file are compared, first change data that is in the same position relationship with the parent version file and has different data content in the first version file is obtained, and after the second version file and the parent version file are compared, second change data that is in the same position relationship with the parent version file and has different data content in the second version file is obtained.
For example, referring to fig. 4 and 12 together, the second version file 1200 shown in fig. 12 is modified based on the parent version file 400 shown in fig. 4, the content data 1214 of the second version file 1200 modifies the data E into the data D and modifies the data F into the data S based on the content data 4014 of the parent version file 400, the data D and the data F are second variation data, the data E and the data F are third variation data, the positional relationship of the data D in the second version file is the same as the positional relationship of the data E in the parent version file, and the positional relationship of the data F in the second version file is the same as the positional relationship of the data S in the parent version file.
Step S2030: and comparing the first change data with the second change data, and if the data content of the first change data is the same as that of the second change data, determining that the first change data and/or the second change data belong to the second type data.
For example, referring to fig. 4, 11 and 12 together, the first variation data includes data D, and the second variation data includes data D and data F, and it can be seen by comparison that the data content in the first variation data and the second variation data is the same as data D, so that the data D can be determined to be the second type data.
In the embodiment of the present application, the first version file includes a first ordered two-dimensional data table and a first unordered two-dimensional data table, the parent version file includes a third ordered two-dimensional data table and a third unordered two-dimensional data table, because the data formats of the first version file and the parent version file are the same, the data formats of the first ordered two-dimensional data table and the third ordered two-dimensional data table are also the same, and the above step 2026 "comparing the first version file and the parent version file" may be implemented by the following steps S20261 to S20262:
step S20261: and comparing the first ordered two-dimensional data table with the third ordered two-dimensional data table.
Step S20262: comparing the first unordered two-dimensional data table with the third unordered two-dimensional data table.
In the embodiment of the application, in order to implement one-to-one comparison of two data having the same positional relationship in two files and avoid omission of part of the data during comparison, the first version file and the second version file may be compared by using subfiles of different data formats as a unit, that is, the ordered two-dimensional data table and the unordered two-dimensional data table included in the two files are compared respectively. The comparison of the ordered two-dimensional data table and the unordered two-dimensional data table is independent.
In this embodiment of the present application, the data format of the ordered two-dimensional data table is fixed, and the data of the ordered two-dimensional data table may be divided into different data categories according to the data position, the data role, and/or the data representation meaning in the ordered two-dimensional data table, that is, the first ordered two-dimensional data table includes first header data and first content data, the third ordered two-dimensional data table includes third header data and third content data, and the step 20261 "comparing the first ordered two-dimensional data table with the third ordered two-dimensional data table" may be implemented by steps S202611 to S202612:
step S202611: comparing the first header data and the third header data;
step S202612: comparing the first content data and the third content data.
In the embodiment of the application, in order to implement one-to-one comparison of two data having the same positional relationship in the first ordered two-dimensional data table and the second ordered two-dimensional data table, and when comparing the two ordered two-dimensional data tables, to avoid part of the data from being omitted, the first ordered two-dimensional data table and the second ordered two-dimensional data table may be compared, that is, the header data and the content data included in the two files are compared respectively, by using the data types divided in the ordered two-dimensional data tables as units.
In this embodiment of the application, the second version file includes a second ordered two-dimensional data table and a second unordered two-dimensional data table, the parent version file includes a third ordered two-dimensional data table and a third unordered two-dimensional data table, and the step 2026 "comparing the second version file with the parent version file" may be implemented by the following steps S20263 to S20264:
step S20263: and comparing the second ordered two-dimensional data table with the third ordered two-dimensional data table.
Step S20264: and comparing the second unordered two-dimensional data table with the third unordered two-dimensional data table.
In the embodiment of the present application, because the data formats of the first version file, the second version file and the parent version file are the same, the comparison manner between the second version file and the parent version file is the same as that between the first version file and the parent version file, and the comparison manner is the corresponding comparison between the ordered two-dimensional data table and the unordered two-dimensional data table.
In this embodiment of the application, the second ordered two-dimensional data table includes second header data and second content data, the third ordered two-dimensional data table includes third header data and third content data, and the step 20263 "comparing the first ordered two-dimensional data table with the third ordered two-dimensional data table" may have the following steps:
comparing the second header data and the third header data.
Comparing the second content data with the third content data.
Similarly, the comparison mode of the ordered two-dimensional data table in the second version file and the ordered two-dimensional data table in the parent version file is the same as that of the ordered two-dimensional data table in the first version file and the ordered two-dimensional data table in the parent version file, and header data and content data are correspondingly compared.
In this embodiment of the application, the first version file is modified at a certain position to obtain first variation data, the second version file is modified at the same position to obtain second variation data, the data content of the first variation data and the data content of the second variation data are the same, when the first variation data and/or the second variation data are the second type data, since the second type data are included in both the first version file and the second version file, when the source file is the first version file and/or the second version file, there is no need to write the second type data, therefore, in this case, the source file includes a parent version file, and the above step 204 "performing the second target operation to write the second type data in the source file" can be implemented by the following steps S2044 to S2046:
step S2044: determining a fourth target location of the second type of data in the first version file and/or the second version file.
In an embodiment of the application, the fourth target location includes a location where the second type of data is located in the first version file and/or the second version file. Since the second type data is located in the same position in the first version file and/or the second version file as the second type data is located in the source file, the position of the second type data in the source file can be obtained according to the fourth target position.
Step S2045: acquiring the second target operation executed by the first type data in the first version file and/or the second version file, wherein the second target operation comprises the first operation and/or the second operation.
In an embodiment of the application, the second target operation comprises an operation performed when the second type of data is formed. Determining a specific type of a second target operation executed when the first version file and/or the second version file are/is written with second type data based on the parent version file, and executing a corresponding operation in the source file to write the second type data.
Step S2046: and executing the second target operation at a third corresponding position of the source file, and writing the second type data, wherein the third corresponding position is the same as the fourth target position.
In this embodiment of the application, the third corresponding location includes a location where the second type data is located in the finally formed target file, and after acquiring a specific operation performed when the second type data is written in the first version file and/or the second version file, the specific operation may be performed at a third corresponding location in the source file that has the same relationship with the fourth target location, and the second type data is written.
All the above technical solutions can be combined arbitrarily to form the optional embodiments of the present application, and are not described herein again.
The embodiment of the application provides a file merging method, which can find out different data at the same position in files needing to be merged, acquire first type data which can be directly merged and second type data which needs to be merged according to user feedback, execute different operations according to different types of data characteristics, write two types of data in a source file, obtain a merged target file, realize the merging of a plurality of files of different versions through batch processing, enable the merging of the files of the plurality of different versions to be more efficient and faster, and simultaneously ensure the merging correctness of the files of the plurality of different versions.
Referring to fig. 3, fig. 3 is another schematic flow chart of a file merging method according to an embodiment of the present application. The data formats of the parent version file, the first version file and the second version file are exemplified by tables, and the specific flow of the method can be as follows:
step 301, acquiring a related merged file, wherein the related merged file includes a parent version file, a first version file and a second version file.
In an embodiment of the present application, the first version file includes a file formed by performing a first operation based on a parent version file, and the second version file includes a file formed by performing a second operation based on the parent version file. For example, as shown in fig. 4, a schematic diagram of a parent version file is shown, the parent version file 400 includes an ordered two-dimensional data table 401, an ordered two-dimensional data table 402, and an unordered two-dimensional data table 403, the ordered two-dimensional data table 401 includes header data 4011, header data 4012, content data 4013, and content data 4014, the header data 4011 includes three parts, a field description, a field type, and a header, the header can be set as a key word of the header data 4011, the content data 4012 can set, in units of rows, a key word numbered as the content data 4012, and the number of columns included in the content data 4012 is the same as the sum of the numbers of columns of all the header data 4011. As shown in fig. 5, the first version file 500 includes an ordered two-dimensional data table 501, an ordered two-dimensional data table 502, and an unordered two-dimensional data table 503, the ordered two-dimensional data table 501 includes header data 5011, header data 5012, content data 5013, and content data 5014, and the first version file 500 modifies the first column and the second column of the content data 4012 numbered 1 based on the parent version file 400 to form the content data 5012. As shown in fig. 6, the second version file 600 includes an ordered two-dimensional data table 601, an ordered two-dimensional data table 602, and an unordered two-dimensional data table 603, the ordered two-dimensional data table 601 includes header data 6011, header data 6012, content data 6013, and content data 6014, and the first version file 600 modifies the second column and the third column of the content data 4012 numbered 1 based on the parent version file 400 to form content data 6012.
And step 302, comparing the first version file with the second version file.
For example, please refer to fig. 4, 5 and 6 together. The ordered two-dimensional data table 501 of the first version file 500 and the ordered two-dimensional data table 601 of the second version file 600 are correspondingly compared, the ordered two-dimensional data table 502 and the ordered two-dimensional data table 602 are correspondingly compared, the unordered two-dimensional data table 503 and the unordered two-dimensional data table 603 are correspondingly compared, in the comparison process of the ordered two-dimensional data table 501 and the ordered two-dimensional data table 601, the head data of two version files with the same head content in the comparison table, namely the head data 5011 and the head data 6011, the head data 5012 and the head data 6012 are correspondingly compared, the content data of the two version files with the same number are compared, the content data 5013 and the content data 6013 are correspondingly compared, and the content data 5014 and the content data 6014 are correspondingly compared.
And step 303, acquiring the difference data of the first version file and the second version file and the position relationship of the first version file and the second version file.
For example, the data distinguished between the first version file 500 and the second version file 600 are data a included in the first column, data B included in the second column, and data C included in the third column of the content data 5013 numbered 1, and data P included in the first column, data Q included in the second column, and data R included in the third column of the content data 6013 numbered 1.
And 304, acquiring corresponding data with the same position relation with the distinguishing data in the parent version file, and comparing the distinguishing data with the corresponding data in the parent version file.
For example, because the distinguishing data and the belonging file are all in the first column, the second column, and the third column of the content data whose number is 1, the data T of the first column, the data M of the second column, and the data N of the third column of the content data 4013 whose number is 1 in the parent version file 400 are acquired, and the data a and the data P are respectively compared with the data T, the data B and the data Q are respectively compared with the data M, and the data C and the data R are respectively compared with the data N.
And 305, acquiring the first type data and the second type data according to the comparison result.
For example, it can be seen by comparison that data a is different from data T and data P is the same as data T, so data a belongs to a first type of data, data B is different from data M and data Q is different from data M, so data B and data Q belong to a second type of data, data C is the same as data N and data R is different from data N, so data R belongs to the first type of data.
Step 306, obtaining the source file based on the relevant merged file.
For example, the first version file 500 is obtained as the source file.
Step 307, a first target position of the first type data in the first version file and/or the second version file is obtained.
For example, a first column of content data 5013 in which data a is located at number 1 in the first version file and a third column of content data 6013 in which data R is located at number 1 in the second version file are acquired.
And 308, acquiring a first target operation executed by the first type of data in the first version file and/or the second version file.
For example, it is determined that data a is formed by data T performing a first operation and data R is formed by data N performing a second operation.
Step 309, if the first corresponding position of the source file has no first type data, executing a first target operation at the first corresponding position, and writing in the first type data.
For example, the source file has data a therein, so the source file need not form data a, and the third column of the content data 5013 whose source file number is 1 has no data R, so data R is written in the source file.
And step 310, acquiring target data in the second type of data.
For example, because the data B and the data Q may be obtained by modifying two different users based on the data M, the terminal cannot objectively determine the specific numerical value of the target data, so the data B and the data Q and the positions thereof are displayed to the users, the user feedback is received, and the target data is determined to be the data B.
And 311, determining a third target position of the target data in the first version file and/or the second version file.
For example, the second column of the content data 5013 whose position in the first version file 500 is number 1 is determined as the target data.
Step 312, obtain a second target operation that the target data is executed.
For example, it is determined that data B is formed by data M performing the first operation.
Step 313, if there is no target data in the second corresponding location of the source file, executing a second target operation in the second corresponding location, and writing the target data.
For example, the source file has data B in it, so the source file does not need to write data B.
And step 314, forming a target file.
For example, as shown in fig. 7, which is a schematic diagram of the target file, the first column, the second column, and the third column of the data content 7013 of the target file 700 with the number 1 are data a, data B, and data R, respectively.
Please refer to fig. 8, fig. 8 is a diagram illustrating a relationship between file merging comparison. Acquiring all files with conflicts, namely a first version file, a second version file and a parent version file before modification of the first version file and the second version file, wherein the first version file, the second version file and the parent version file are files containing a two-dimensional data table, and can be Excel files for example. All files which have conflicts have the same data format and are provided with an ordered two-dimensional data table and an unordered two-dimensional data table, when conflict resolution is carried out, all unordered two-dimensional data tables in a first version file and all unordered two-dimensional data tables in a second version file can be compared in a concentrated mode, if first type data are obtained through detection, merging of the first type data is carried out by the terminal, if second type data are obtained through detection, the second type data and the positions where the second type data are located are displayed to a user through the terminal, and the second type data are merged according to user feedback. And then, the ordered two-dimensional data tables in the first version file and the second version file are in one-to-one correspondence and are compared with each other, if the first type data is detected, the terminal executes the combination of the first type data, if the second type data is detected, the terminal displays the second type data and the position of the second type data to a user, and the second type data is combined according to the feedback of the user. And when all detection and combination are finished, the terminal performs combination post-processing, reserves the generated combined file and the two version files which are not subjected to combination processing, clears codes for executing the conflict resolution step in the terminal and releases the corresponding memory. In addition, the comparison of all unordered two-dimensional data tables and the comparison of each ordered two-dimensional data table are independent of each other, can be carried out simultaneously or sequentially, and the order of carrying out the comparison is not limited. The detection times of all files with conflicts are the number of the ordered two-dimensional data tables plus one detection of all unordered two-dimensional data tables, namely N plus 1.
All the above technical solutions can be combined arbitrarily to form the optional embodiments of the present application, and are not described herein again.
According to the file merging method provided by the embodiment of the application, different data at the same position can be found out from files needing to be merged, the first type data which can be directly merged and the second type data which needs to be merged according to user feedback are obtained, different operations are executed according to different types of data characteristics, and the two types of data are written in the source file, so that the merged target file is obtained, merging of a plurality of different versions of files is processed in batch, merging of the plurality of different versions of files is more efficient and faster, and meanwhile merging accuracy of the plurality of different versions of files is guaranteed.
In order to better implement the file merging method of the embodiment of the present application, an embodiment of the present application further provides a file merging device. Referring to fig. 9, fig. 9 is a schematic structural diagram of a file merging device according to an embodiment of the present application. The file merge device may include a merge file acquisition unit 901, a data acquisition unit 902, a source file acquisition unit 903, and a forming unit 904.
A merged file acquiring unit 901 configured to acquire related merged files, where the related merged files include a parent version file, a first version file, and a second version file, the first version file includes a file formed by performing a first operation based on the parent version file, and the second version file includes a file formed by performing a second operation based on the parent version file;
a data obtaining unit 902, configured to obtain first type data and second type data in the first version file and/or the second version file according to a comparison result between the parent version file and the first version file;
a source file obtaining unit 903 configured to obtain a source file based on the relevant merged file;
a forming unit 904, configured to execute a first target operation to write the first type of data in the source file, and execute a second target operation to write the second type of data in the source file, so as to form a target file.
Optionally, the data obtaining unit 902 is further configured to:
comparing the first version file with the second version file;
acquiring first data at a first position in the first version file and second data at a second position in the second version file, wherein the first data content is different from the second data content, and a first position relation of the first data in the first version file corresponds to a second position relation of the second data in the second version file;
acquiring third data at a third position in the parent version file, wherein the third data has a third position relationship in the parent version file, and the third position relationship, the first position relationship and the second position relationship correspond to each other;
comparing the first data content with the third data content to obtain a first comparison result, and comparing the second data content with the third data content to obtain a second comparison result;
and acquiring the first type data and the second type data according to the first comparison result and the second comparison result.
Optionally, the data obtaining unit 902 is further configured to:
if the first data content is different from the third data content and the second data content is the same as the third data content, determining that the first data belongs to the first type data;
if the first data content is the same as the third data content and the second data content is different from the third data content, determining that the second data belongs to the first type of data;
and if the first data content is different from the third data content and the second data content is different from the third data content, determining that the first data and the second data belong to the second type of data.
Optionally, the first version file includes a first ordered two-dimensional data table and a first unordered two-dimensional data table, the second version file includes a second ordered two-dimensional data table and a second unordered two-dimensional data table, data formats of the first ordered two-dimensional data table and the second ordered two-dimensional data table are the same, and the data obtaining unit 902 is further configured to:
comparing the first ordered two-dimensional data table with the second ordered two-dimensional data table;
and comparing the first unordered two-dimensional data table with the second unordered two-dimensional data table.
Optionally, the first ordered two-dimensional data table includes first header data and first content data, the second ordered two-dimensional data table includes second header data and second content data, and the data obtaining unit 902 is further configured to:
comparing the first header data and the second header data;
comparing the first content data and the second content data.
Optionally, the source file includes the parent version file, the first version file or the second version file, and the forming unit 904 is further configured to:
writing the first type data in the source file according to the first target operation to form an initial file;
acquiring target data in the second type data;
and writing the target data in the initial file according to the second target operation to form a target file.
Optionally, the forming unit 904 is further configured to:
determining a first target location of the first type of data in the first version file and/or the second version file;
acquiring the first target operation executed by the first type of data in the first version file and/or the second version file, wherein the first target operation comprises the first operation and/or the second operation;
and if the first corresponding position of the source file does not have the first type of data, executing the first target operation at the first corresponding position, and writing the first type of data, wherein the first corresponding position is the same as the first target position.
Optionally, the forming unit 904 is further configured to:
determining a second target location of the second type of data in the first version file and/or the second version file;
acquiring a third target operation executed by the second type of data, wherein the third target operation comprises the first operation and/or the second operation;
feeding back the second target position and the third target operation to a user;
receiving the target data selected by the user.
Optionally, the forming unit 904 is further configured to:
determining a third target location of the target data in the first version file and/or the second version file;
acquiring the second target operation executed by the target data, wherein the second target operation comprises the first operation and/or the second operation;
and if the second corresponding position of the initial file does not have the target data, executing the second target operation at the second corresponding position, and writing the target data, wherein the second corresponding position is the same as the third target position.
Optionally, the data obtaining unit 902 is further configured to:
comparing the first version file with the parent version file;
acquiring first change data at a first change position in the first version file and third change data at a third change position in the parent version file, wherein the data content of the first change data is different from that of the third change data, and the first change position relationship of the first change data in the first version file corresponds to the third change position relationship of the third change data in the parent version file;
comparing the second version file with the parent version file;
acquiring second change data at a second change position in the second version file and third substitute data at a third substitute position in the parent version file, wherein the data content of the second change data is different from that of the third substitute data, and a second change position relationship of the second change data in the second version file corresponds to a third substitute position relationship of the third substitute data in the parent version file;
and comparing the first change data with the second change data, and if the data content of the first change data is the same as that of the second change data, determining that the first change data and/or the second change data belong to the second type data.
Optionally, the first version file includes a first ordered two-dimensional data table and a first unordered two-dimensional data table, the parent version file includes a third ordered two-dimensional data table and a third unordered two-dimensional data table, and the data obtaining unit 902 is further configured to:
comparing the first ordered two-dimensional data table with the third ordered two-dimensional data table;
comparing the first unordered two-dimensional data table with the third unordered two-dimensional data table.
Optionally, the first ordered two-dimensional data table includes first header data and first content data, the third ordered two-dimensional data table includes third header data and third content data, and the data obtaining unit 902 is further configured to:
comparing the first header data and the third header data;
comparing the first content data and the third content data.
Optionally, the second version file includes a second ordered two-dimensional data table and a second unordered two-dimensional data table, the parent version file includes a third ordered two-dimensional data table and a third unordered two-dimensional data table, and the data obtaining unit 902 is further configured to:
comparing the second ordered two-dimensional data table with the third ordered two-dimensional data table;
and comparing the second unordered two-dimensional data table with the third unordered two-dimensional data table.
Optionally, the second ordered two-dimensional data table includes second header data and second content data, the third ordered two-dimensional data table includes third header data and third content data, and the data obtaining unit is further configured to:
comparing the second header data and the third header data;
comparing the second content data with the third content data.
Optionally, the source file includes the parent version file, and the forming unit 904 is further configured to:
determining a fourth target location of the second type of data in the first version file and/or the second version file;
acquiring the second target operation executed by the first type data in the first version file and/or the second version file, wherein the second target operation comprises the first operation and/or the second operation;
and executing the second target operation at a third corresponding position of the source file, and writing the second type data, wherein the third corresponding position is the same as the fourth target position.
Optionally, the first operation and the second operation include a data adding operation, a data deleting operation, and/or a data modifying operation.
All the above technical solutions can be combined arbitrarily to form the optional embodiments of the present application, and are not described herein again.
The file merging device provided in the embodiment of the present application may utilize the merged file obtaining unit 901 to obtain a related merged file, then utilize the data obtaining unit 902 to find out different data in the same location in the related merged file, and obtain a first type of data that can be directly merged and a second type of data that needs to be merged according to user feedback, then utilize the source file obtaining unit 903 to select a source file in the related merged file, and finally utilize the forming unit 904 to execute different operations according to different types of data characteristics, and write two types of data in the source file, thereby obtaining a merged target file, and implementing merging of multiple different version files in batch processing, so that merging of multiple different version files is more efficient and faster, and meanwhile, accuracy of merging of multiple different version files is ensured.
Correspondingly, the embodiment of the application also provides a computer device, which can be a terminal, and the terminal can be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game machine, a personal computer, a personal digital assistant and the like. As shown in fig. 10, fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application. The computer device 1000 includes a processor 1001 with one or more processing cores, a memory 1002 with one or more computer-readable storage media, and a computer program stored on the memory 1002 and executable on the processor. The processor 1001 is electrically connected to the memory 1002. Those skilled in the art will appreciate that the computer device configurations illustrated in the figures are not meant to be limiting of computer devices and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The processor 1001 is a control center of the computer apparatus 1000, connects various parts of the entire computer apparatus 1000 using various interfaces and lines, performs various functions of the computer apparatus 1000 and processes data by running or loading software programs and/or modules stored in the memory 1002, and calling data stored in the memory 1002, thereby performing overall monitoring of the computer apparatus 1000.
In this embodiment of the application, the processor 1001 in the computer device 1000 loads instructions corresponding to processes of one or more applications into the memory 1002, and the processor 1001 runs the applications stored in the memory 1002 according to the following steps, so as to implement various functions:
acquiring related merged files, wherein the related merged files comprise a father version file, a first version file and a second version file, the first version file comprises a file formed by executing a first operation based on the father version file, and the second version file comprises a file formed by executing a second operation based on the father version file;
according to the comparison result of the father version file, the first version file and the second version file, acquiring first type data and second type data in the first version file and/or the second version file;
obtaining a source file based on the relevant merged file;
and executing a first target operation to write the first type of data in the source file, and executing a second target operation to write the second type of data in the source file to form a target file.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Optionally, as shown in fig. 10, the computer device 1000 further includes: touch-sensitive display screen 1003, radio frequency circuit 1004, audio circuit 1005, input unit 1006 and power 1007. The processor 1001 is electrically connected to the touch display screen 1003, the radio frequency circuit 1004, the audio circuit 1005, the input unit 1006, and the power supply 1007, respectively. Those skilled in the art will appreciate that the computer device architecture illustrated in FIG. 10 is not intended to be limiting of computer devices and may include more or less components than those illustrated, or combinations of certain components, or different arrangements of components.
The touch display screen 1003 can be used for displaying a graphical user interface and receiving an operation instruction generated by a user acting on the graphical user interface. The touch display screen 1003 may include a display panel and a touch panel. The display panel may be used, among other things, to display information entered by or provided to a user and various graphical user interfaces of the computer device, which may be made up of graphics, text, icons, video, and any combination thereof. Alternatively, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations of a user on or near the touch panel (for example, operations of the user on or near the touch panel using any suitable object or accessory such as a finger, a stylus pen, and the like), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 1001, and can receive and execute commands sent by the processor 1001. The touch panel may cover the display panel, and when the touch panel detects a touch operation thereon or nearby, the touch panel transmits the touch operation to the processor 1001 to determine the type of the touch event, and then the processor 1001 provides a corresponding visual output on the display panel according to the type of the touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 1003 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two separate components to perform the input and output functions. That is, the touch display 1003 may also be used as a part of the input unit 1006 to implement an input function.
In this embodiment of the present application, when a user submits a file and a version conflict occurs, the processor 1001 acquires a relevant merged file in which the version conflict occurs from a server by using a version acquisition tool, and since the relevant merged file has a similar structure, the processor 1001 may divide the relevant merged file into several parts, for example, an ordered two-dimensional data table, an unordered two-dimensional data table, a header data part and/or a content data part, and then compare the same parts of the relevant merged files respectively, find out different data in the same position, determine whether to merge directly or merge according to user feedback according to the type characteristics of the data, and finally form the merged file.
The radio frequency circuit 1004 may be used for transceiving radio frequency signals to establish wireless communication with a network device or other computer device through wireless communication, and for transceiving signals with the network device or other computer device.
Audio circuitry 1005 may be used to provide an audio interface between a user and a computer device through speakers and microphones. The audio circuit 1005 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts a collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 1005, and outputs the audio data to the processor 1001 for processing, for example, to another computer device via the radio frequency circuit 1004, or outputs the audio data to the memory 1002 for further processing. The audio circuitry 1005 may also include an earbud jack to provide communication of a peripheral headset with the computer device.
The input unit 1006 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The power supply 1007 is used to power the various components of the computer device 1000. Optionally, the power supply 1007 may be logically connected to the processor 1001 through a power management system, so as to implement functions of managing charging, discharging, power consumption management, and the like through the power management system. The power supply 1007 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown in fig. 10, the computer device 1000 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which are not described in detail herein.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
As can be seen from the above, the computer device provided in this embodiment can find out different data at the same position in a file to be merged, obtain first type data that can be directly merged and second type data that needs to be merged according to user feedback, execute different operations according to different types of data characteristics, and write two types of data in a source file, thereby obtaining a merged target file, implementing merging of multiple different versions of files by batch processing, so that merging of multiple different versions of files is more efficient and faster, and meanwhile, accuracy of merging of multiple different versions of files is ensured.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored, and the computer programs can be loaded by a processor to execute the steps in any of the file merging methods provided by the embodiments of the present application. For example, the computer program may perform the steps of:
acquiring related merged files, wherein the related merged files comprise a father version file, a first version file and a second version file, the first version file comprises a file formed by executing a first operation based on the father version file, and the second version file comprises a file formed by executing a second operation based on the father version file;
according to the comparison result of the father version file, the first version file and the second version file, acquiring first type data and second type data in the first version file and/or the second version file;
obtaining a source file based on the relevant merged file;
and executing a first target operation to write the first type of data in the source file, and executing a second target operation to write the second type of data in the source file to form a target file.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the computer program stored in the storage medium can execute the steps in any of the file merging methods provided in the embodiments of the present application, beneficial effects that can be achieved by any of the file merging methods provided in the embodiments of the present application can be achieved, and detailed descriptions are omitted here for the sake of detail in the foregoing embodiments.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The foregoing describes in detail a file merging method, apparatus, computer device, and storage medium provided in the embodiments of the present application, and a specific example is applied in the present application to explain the principle and implementation manner of the present invention, and the description of the foregoing embodiments is only used to help understand the technical solutions and core ideas of the present invention; those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (19)

1. A method for merging files, comprising:
acquiring related merged files, wherein the related merged files comprise a father version file, a first version file and a second version file, the first version file comprises a file formed by executing a first operation based on the father version file, and the second version file comprises a file formed by executing a second operation based on the father version file;
according to the comparison result of the father version file, the first version file and the second version file, acquiring first type data and second type data in the first version file and/or the second version file;
obtaining a source file based on the relevant merged file;
and executing a first target operation to write the first type of data in the source file, and executing a second target operation to write the second type of data in the source file to form a target file.
2. The method according to claim 1, wherein the obtaining of the first type data and the second type data in the first version file and/or the second version file according to the comparison result of the parent version file, the first version file and the second version file comprises:
comparing the first version file with the second version file;
acquiring first data at a first position in the first version file and second data at a second position in the second version file, wherein the first data content is different from the second data content, and a first position relation of the first data in the first version file corresponds to a second position relation of the second data in the second version file;
acquiring third data at a third position in the parent version file, wherein the third data has a third position relationship in the parent version file, and the third position relationship, the first position relationship and the second position relationship correspond to each other;
comparing the first data content with the third data content to obtain a first comparison result, and comparing the second data content with the third data content to obtain a second comparison result;
and acquiring the first type data and the second type data according to the first comparison result and the second comparison result.
3. The method of claim 2, wherein obtaining the first type of data and the second type of data according to the first comparison result and the second comparison result comprises:
if the first data content is different from the third data content and the second data content is the same as the third data content, determining that the first data belongs to the first type data;
if the first data content is the same as the third data content and the second data content is different from the third data content, determining that the second data belongs to the first type of data;
and if the first data content is different from the third data content and the second data content is different from the third data content, determining that the first data and the second data belong to the second type of data.
4. The method of claim 2, wherein the first version file comprises a first ordered two-dimensional data table and a first unordered two-dimensional data table, wherein the second version file comprises a second ordered two-dimensional data table and a second unordered two-dimensional data table, wherein the first ordered two-dimensional data table and the second ordered two-dimensional data table have the same data format, and wherein comparing the first version file and the second version file comprises:
comparing the first ordered two-dimensional data table with the second ordered two-dimensional data table;
and comparing the first unordered two-dimensional data table with the second unordered two-dimensional data table.
5. The method of claim 4, wherein the first ordered two-dimensional data table comprises first header data and first content data, wherein the second ordered two-dimensional data table comprises second header data and second content data, and wherein comparing the first ordered two-dimensional data table to the second ordered two-dimensional data table comprises:
comparing the first header data and the second header data;
comparing the first content data and the second content data.
6. The method of claim 2, wherein the source file comprises the parent version file, the first version file, or the second version file, wherein the performing the first target operation writes the first type of data in the source file, and wherein the performing the second target operation writes the second type of data in the source file to form a target file comprises:
writing the first type data in the source file according to the first target operation to form an initial file;
acquiring target data in the second type data;
and writing the target data in the initial file according to the second target operation to form a target file.
7. The method of claim 6, wherein writing the first type of data in the source file according to the first target operation comprises:
determining a first target location of the first type of data in the first version file and/or the second version file;
acquiring the first target operation executed by the first type of data in the first version file and/or the second version file, wherein the first target operation comprises the first operation and/or the second operation;
and if the first corresponding position of the source file does not have the first type of data, executing the first target operation at the first corresponding position, and writing the first type of data, wherein the first corresponding position is the same as the first target position.
8. The method of claim 6, wherein the obtaining target data in the second type of data comprises:
determining a second target location of the second type of data in the first version file and/or the second version file;
acquiring a third target operation executed by the second type of data, wherein the third target operation comprises the first operation and/or the second operation;
feeding back the second target position and the third target operation to a user;
receiving the target data selected by the user.
9. The method of claim 6, wherein writing the target data in the initial file according to the second target operation comprises:
determining a third target location of the target data in the first version file and/or the second version file;
acquiring the second target operation executed by the target data, wherein the second target operation comprises the first operation and/or the second operation;
and if the second corresponding position of the initial file does not have the target data, executing the second target operation at the second corresponding position, and writing the target data, wherein the second corresponding position is the same as the third target position.
10. The method according to claim 1, wherein the obtaining of the second type data in the first version file and/or the second version file according to the comparison result of the parent version file, the first version file and the second version file comprises:
comparing the first version file with the parent version file;
acquiring first change data at a first change position in the first version file and third change data at a third change position in the parent version file, wherein the data content of the first change data is different from that of the third change data, and the first change position relationship of the first change data in the first version file corresponds to the third change position relationship of the third change data in the parent version file;
comparing the second version file with the parent version file;
acquiring second change data at a second change position in the second version file and third substitute data at a third substitute position in the parent version file, wherein the data content of the second change data is different from that of the third substitute data, and a second change position relationship of the second change data in the second version file corresponds to a third substitute position relationship of the third substitute data in the parent version file;
and comparing the first change data with the second change data, and if the data content of the first change data is the same as that of the second change data, determining that the first change data and/or the second change data belong to the second type data.
11. The method of claim 10, wherein the first version file comprises a first ordered two-dimensional data table and a first unordered two-dimensional data table, wherein the parent version file comprises a third ordered two-dimensional data table and a third unordered two-dimensional data table, and wherein comparing the first version file and the parent version file comprises:
comparing the first ordered two-dimensional data table with the third ordered two-dimensional data table;
comparing the first unordered two-dimensional data table with the third unordered two-dimensional data table.
12. The method of claim 11, wherein the first ordered two-dimensional data table comprises first header data and first content data, wherein the third ordered two-dimensional data table comprises third header data and third content data, and wherein comparing the first ordered two-dimensional data table to the third ordered two-dimensional data table comprises:
comparing the first header data and the third header data;
comparing the first content data and the third content data.
13. The method of claim 10, wherein the second version file comprises a second ordered two-dimensional data table and a second unordered two-dimensional data table, wherein the parent version file comprises a third ordered two-dimensional data table and a third unordered two-dimensional data table, and wherein comparing the second version file to the parent version file comprises:
comparing the second ordered two-dimensional data table with the third ordered two-dimensional data table;
and comparing the second unordered two-dimensional data table with the third unordered two-dimensional data table.
14. The method of claim 13, wherein the second ordered two-dimensional data table comprises second header data and second content data, wherein the third ordered two-dimensional data table comprises third header data and third content data, and wherein comparing the second ordered two-dimensional data table to the third ordered two-dimensional data table comprises:
comparing the second header data and the third header data;
comparing the second content data with the third content data.
15. The method of claim 10, wherein the source file comprises the parent version file, and wherein said performing the second target operation writes the second type of data in the source file comprises:
determining a fourth target location of the second type of data in the first version file and/or the second version file;
acquiring the second target operation executed by the first type data in the first version file and/or the second version file, wherein the second target operation comprises the first operation and/or the second operation;
and executing the second target operation at a third corresponding position of the source file, and writing the second type data, wherein the third corresponding position is the same as the fourth target position.
16. The method of any of claims 1 to 15, wherein the first operation and the second operation comprise a data add operation, a data delete operation, and/or a data modify operation.
17. A file merging apparatus, comprising:
a merged file acquiring unit configured to acquire a related merged file including a parent version file, a first version file including a file formed by performing a first operation based on the parent version file, and a second version file including a file formed by performing a second operation based on the parent version file;
a data obtaining unit, configured to obtain first type data and second type data in the first version file and/or the second version file according to a comparison result between the parent version file and the first version file;
a source file obtaining unit configured to obtain a source file based on the relevant merged file;
and the forming unit is used for executing a first target operation to write the first type of data in the source file, and executing a second target operation to write the second type of data in the source file to form a target file.
18. A computer device, comprising:
a memory for storing a computer program;
a processor for implementing the steps in the file merging method according to any one of claims 1 to 16 when executing the computer program.
19. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the file merging method according to any one of claims 1 to 16.
CN202110374489.9A 2021-04-07 2021-04-07 File merging method, device, computer equipment and storage medium Active CN113110868B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110374489.9A CN113110868B (en) 2021-04-07 2021-04-07 File merging method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110374489.9A CN113110868B (en) 2021-04-07 2021-04-07 File merging method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113110868A true CN113110868A (en) 2021-07-13
CN113110868B CN113110868B (en) 2023-08-08

Family

ID=76714218

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110374489.9A Active CN113110868B (en) 2021-04-07 2021-04-07 File merging method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113110868B (en)

Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040177343A1 (en) * 2002-11-04 2004-09-09 Mcvoy Lawrence W. Method and apparatus for understanding and resolving conflicts in a merge
US20060106889A1 (en) * 2004-11-12 2006-05-18 Mannby Claes-Fredrik U Method, system, and program for managing revisions to a file
CN101375280A (en) * 2006-01-27 2009-02-25 艾尔弗莱斯科技术有限公司 Event structured file system (ESFS)
US20140006352A1 (en) * 2012-06-27 2014-01-02 Dropbox, Inc. Determining a preferred modified version from among multiple modified versions for synchronized files
CN104123126A (en) * 2013-04-26 2014-10-29 阿里巴巴集团控股有限公司 Method and device for generating merge conflict record list
CN105183789A (en) * 2015-08-21 2015-12-23 福建天晴数码有限公司 File merging method and system based on git source code confliction
US9430229B1 (en) * 2013-03-15 2016-08-30 Atlassian Pty Ltd Merge previewing in a version control system
US9471304B1 (en) * 2015-06-18 2016-10-18 Sap Se Tree-based versioning and merging
CN107329765A (en) * 2017-07-04 2017-11-07 武汉斗鱼网络科技有限公司 Program file processing method and processing device
CN107665227A (en) * 2017-04-10 2018-02-06 平安科技(深圳)有限公司 A kind of data version control method and versions of data controller
CN109582726A (en) * 2018-12-18 2019-04-05 网易(杭州)网络有限公司 The treating method and apparatus of tables of data
CN109670151A (en) * 2018-12-06 2019-04-23 网易(杭州)网络有限公司 File mergences method, apparatus and storage medium
CN109670222A (en) * 2018-12-07 2019-04-23 广联达科技股份有限公司 A kind of model or the online contrast difference's methods, devices and systems of drawing
CN110069455A (en) * 2017-09-21 2019-07-30 北京华为数字技术有限公司 A kind of file mergences method and device
US20190303135A1 (en) * 2018-03-30 2019-10-03 International Business Machines Corporation Intelligent discovery and application of api changes for application migration
US20190332699A1 (en) * 2018-04-27 2019-10-31 Sap Se Conflict resolution for database file merge
US10769130B1 (en) * 2018-05-23 2020-09-08 Databricks Inc. Update and query of a large collection of files that represent a single dataset stored on a blob store
CN111796855A (en) * 2020-07-22 2020-10-20 大箴(杭州)科技有限公司 Incremental version updating method and device, storage medium and computer equipment

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040177343A1 (en) * 2002-11-04 2004-09-09 Mcvoy Lawrence W. Method and apparatus for understanding and resolving conflicts in a merge
US20060106889A1 (en) * 2004-11-12 2006-05-18 Mannby Claes-Fredrik U Method, system, and program for managing revisions to a file
CN101375280A (en) * 2006-01-27 2009-02-25 艾尔弗莱斯科技术有限公司 Event structured file system (ESFS)
US20140006352A1 (en) * 2012-06-27 2014-01-02 Dropbox, Inc. Determining a preferred modified version from among multiple modified versions for synchronized files
US9430229B1 (en) * 2013-03-15 2016-08-30 Atlassian Pty Ltd Merge previewing in a version control system
CN104123126A (en) * 2013-04-26 2014-10-29 阿里巴巴集团控股有限公司 Method and device for generating merge conflict record list
US9471304B1 (en) * 2015-06-18 2016-10-18 Sap Se Tree-based versioning and merging
CN105183789A (en) * 2015-08-21 2015-12-23 福建天晴数码有限公司 File merging method and system based on git source code confliction
CN107665227A (en) * 2017-04-10 2018-02-06 平安科技(深圳)有限公司 A kind of data version control method and versions of data controller
CN107329765A (en) * 2017-07-04 2017-11-07 武汉斗鱼网络科技有限公司 Program file processing method and processing device
CN110069455A (en) * 2017-09-21 2019-07-30 北京华为数字技术有限公司 A kind of file mergences method and device
US20190303135A1 (en) * 2018-03-30 2019-10-03 International Business Machines Corporation Intelligent discovery and application of api changes for application migration
US20190332699A1 (en) * 2018-04-27 2019-10-31 Sap Se Conflict resolution for database file merge
US10769130B1 (en) * 2018-05-23 2020-09-08 Databricks Inc. Update and query of a large collection of files that represent a single dataset stored on a blob store
CN109670151A (en) * 2018-12-06 2019-04-23 网易(杭州)网络有限公司 File mergences method, apparatus and storage medium
CN109670222A (en) * 2018-12-07 2019-04-23 广联达科技股份有限公司 A kind of model or the online contrast difference's methods, devices and systems of drawing
CN109582726A (en) * 2018-12-18 2019-04-05 网易(杭州)网络有限公司 The treating method and apparatus of tables of data
CN111796855A (en) * 2020-07-22 2020-10-20 大箴(杭州)科技有限公司 Incremental version updating method and device, storage medium and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
GITEE: "Gitee在线解决代码冲突功能上线,无需手动修改轻松解决冲突", Retrieved from the Internet <URL:《https://blog.gitee.com/2020/06/17/code-confl ict/ 1》> *

Also Published As

Publication number Publication date
CN113110868B (en) 2023-08-08

Similar Documents

Publication Publication Date Title
US11216480B2 (en) System and method for querying data points from graph data structures
US10901604B2 (en) Transformation of data object based on context
US9633107B2 (en) Mobile metadata model repository
CN112015412A (en) Device and method for generating business model based on form engine
CN112870724B (en) Resource management method and device, storage medium and electronic equipment
CN112882764B (en) Component loading method and device, computer equipment and storage medium
US9026643B2 (en) Contents&#39; relationship visualizing apparatus, contents&#39; relationship visualizing method and its program
KR101266132B1 (en) Method of making digital comtents using social network, method of sharing note, and system thereof
KR102525315B1 (en) User recommendation method using production data and usage data and apparatus therefor
US11847145B2 (en) Aliased data retrieval for key-value stores
CN114237743B (en) Interface loading method and device, electronic equipment and storage medium
CN110688145A (en) Android MVP code automatic generation method, device, medium and electronic equipment
CN113110868B (en) File merging method, device, computer equipment and storage medium
CN114637866B (en) Information management method and device for digitalized new media
CN114579136A (en) Code processing method and device, computer equipment and storage medium
EP4053713A1 (en) Question and answer method and apparatus based on knowledge graph
CN115686506A (en) Data display method and device, electronic equipment and storage medium
CN111523294A (en) PDF file-based comment separation processing method and device
CN110765237A (en) Document processing method, document processing device, storage medium and electronic equipment
CN115253302A (en) Preform replacing method, preform replacing device, electronic equipment and storage medium
JP6703698B1 (en) Information provision system
US20230054774A1 (en) User constrained process mining
CN114691145A (en) Code processing method and device, computer equipment and storage medium
CN117009696A (en) Information issuing method, device, computer equipment and storage medium
CN114064001A (en) Webpage saving method and device, storage medium and server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant