Structured data merging processing method, device and storage medium

By obtaining the differential data of structured data and determining conflicting information, the problem that traditional methods cannot merge structured data is solved, and effective merging and processing of structured data is realized.

CN119739701APending Publication Date: 2025-04-01ZTE CORP
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311248808.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-25
Publication Date
2025-04-01

Smart Images

  • Figure CN119739701A_ABST
    Figure CN119739701A_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a method, device and storage medium for merging structured data, which belongs to the field of data processing technology. The method includes: obtaining the reference party structured data and the merged party structured data to be merged; determining the difference data between the reference party structured data and the merged party structured data; determining the conflict information corresponding to the reference party structured data and the merged party structured data according to the difference data; and merging the reference party structured data and the merged party structured data based on the conflict information. The technical solution of the embodiment of the present invention realizes the merging of structured data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a structured data merging processing method, device and storage medium. Background Art

[0002] With the development of science and technology, a lot of software data is stored and iterated using structured data. Like code, these structured data also need to be compared, conflict resolved and merged. Traditional comparisons are generally performed based on text lines, but structured data and text lines have no direct relationship. Therefore, comparing text lines cannot obtain conflict information of structured data, and thus cannot achieve the merging of structured data.

[0003] Therefore, how to merge structured data becomes an urgent problem to be solved. Summary of the invention

[0004] The main purpose of the embodiments of the present application is to provide a structured data merging processing method, device and storage medium, aiming to realize the merging of structured data.

[0005] In a first aspect, an embodiment of the present application provides a structured data merging processing method, comprising:

[0006] Obtaining the reference party structured data and the merged party structured data to be merged;

[0007] Determining difference data between the reference party structured data and the merged party structured data;

[0008] Determining conflict information corresponding to the reference-party structured data and the merged-party structured data according to the difference data;

[0009] Based on the conflict information, the reference-side structured data and the merged-side structured data are merged.

[0010] In a second aspect, an embodiment of the present application provides a structured data merging and processing device, the structured data merging and processing device comprising:

[0011] A processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of the structured data merging processing method as described above are realized.

[0012] In a third aspect, an embodiment of the present application provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the structured data merging processing method as described above.

[0013] The embodiments of the present application provide a method, device and storage medium for merging and processing structured data. The method obtains the base party structured data and the merged party structured data to be merged, determines the difference data between the base party structured data and the merged party structured data, and then determines the conflict information corresponding to the base party structured data and the merged party structured data based on the difference data. Based on the conflict information, the base party structured data and the merged party structured data are merged. The conflicts of the structured data are summarized and the structured data are merged based on the conflicts. Thus, the merging of the structured data is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0015] Figure 1 A schematic diagram of a flow chart of a structured data merging and processing method provided by an embodiment of the present invention;

[0016] Figure 2 A schematic diagram of a process of merging the reference party structured data and the merged party structured data based on the conflict information provided by an embodiment of the present invention;

[0017] Figure 3 A schematic diagram of another process of merging the reference party structured data and the merged party structured data based on the conflict information provided by an embodiment of the present invention;

[0018] Figure 4 A flowchart of conflict handling between structured data of a reference party and structured data of a merged party provided by an embodiment of the present invention;

[0019] Figure 5 A schematic block diagram of the structure of a structured data merging and processing device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0021] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0022] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0023] The embodiments of the present invention provide a structured data merging processing method, device and storage medium, aiming to realize merging of structured data.

[0024] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0025] Please refer to Figure 1 , Figure 1 A flow chart of a structured data merging processing method provided by an embodiment of the present invention. The structured data merging processing method can be applied in a structured data merging processing device, or in other devices such as a computer device, to realize merging of structured data.

[0026] like Figure 1 As shown, the structured data merging processing method includes steps S101 to S104.

[0027] S101: Obtain reference-side structured data and merge-side structured data to be merged.

[0028] Take the merging of two structured data as an example, one of which is used as the reference party structured data and the other is used as the merged party structured data. To perform data merging, first obtain the reference party structured data and the merged party structured data. For example, the reference party structured data and the merged party structured data are stored in corresponding databases, and the reference party structured data and the merged party structured data are obtained by querying the database.

[0029] S102: Determine difference data between the reference structured data and the merged structured data.

[0030] After obtaining the reference party structured data and the merged party structured data, the reference party structured data is compared with the merged party structured data to obtain difference data of the merged party structured data relative to the reference party structured data.

[0031] It can be understood that the difference data between the merged-party structured data and the reference-party structured data is different from the difference data between the reference-party structured data and the merged-party structured data.

[0032] S103: Determine conflict information corresponding to the reference-side structured data and the merged-side structured data according to the difference data.

[0033] In actual application scenarios, as the structured data of the baseline party and the structured data of the merged party change, various conflicts may exist between the structured data of the baseline party and the structured data of the merged party. For example, the structured data of the baseline party and the structured data of the merged party may have attribute conflicts, multi-line text conflicts, path change conflicts, structure change conflicts, etc.

[0034] For example, if the changes of the structured data of the base party and the structured data of the merged party are as follows, there is a conflict of attributes between the structured data of the base party and the structured data of the merged party: both parties add at the same time, both parties modify a single line of text at the same time, both parties modify black box attributes at the same time, one party deletes and the other party modifies, one party deletes the parent attribute and the other party modifies the child attribute to retain the parent attribute, etc. It should be noted that if both parties delete at the same time, it does not belong to a conflict of attributes.

[0035] For another example, if both parties modify the same line of text, there is a conflict of multiple lines of text between the base party structured data and the merged party structured data. It should be noted that if both parties modify but not the same line of text, it does not constitute a conflict of multiple lines of text.

[0036] For another example, if both parties modify the path, there will be a conflict in the path change between the structured data of the base party and the structured data of the merged party.

[0037] For example, there is a conflict in structural changes between the baseline party's structured data and the merged party's structured data if the changes in the baseline party's structured data and the merged party's structured data are as follows: both parties add nodes, delete nodes, or change node positions at the same time; one party deletes a node and the other party modifies the node's sub-attributes, etc.

[0038] Exemplarily, the change information of the baseline party's structured data and the merged party's structured data is saved, for example, the change information of the baseline party's structured data and the merged party's structured data is saved in the form of an array [left, right], where left represents the change information of the baseline party's structured data and right represents the change information of the merged party's structured data.

[0039] S104: Based on the conflict information, merge the reference-side structured data and the merged-side structured data.

[0040] For various conflicts such as multi-line text conflict, attribute conflict, path conflict, structure conflict, etc., the corresponding methods of data merging processing for the structured data of the base party and the structured data of the merged party are also different.

[0041] In some embodiments, Figure 2 As shown, step S104 may include sub-steps S1041 to S1044.

[0042] S1041, performing conflict classification on the reference party structured data and the merged party structured data according to the difference data;

[0043] S1042: If the conflict is classified as a multi-line text conflict, obtaining the merged text content of the reference-side structured data and the merged-side structured data;

[0044] S1043, storing the merged text content into a modification list;

[0045] S1044: Perform data merging processing based on the modification list to obtain merged structured data.

[0046] By classifying the conflicts between the structured data of the base party and the structured data of the merged party, it is determined whether it is a two-choice conflict or a multi-line text conflict. If it is a multi-line text conflict, the user does not need to make a selection operation, but the user needs to edit the text modifications of the structured data of the base party and the merged party. That is, if the structured data of the base party and the merged party are multi-line text conflicts, the user can edit the text modifications of the structured data of the base party and the merged party to obtain the merged text content of the structured data of the base party and the merged party after editing.

[0047] After obtaining the merged text content of the base party structured data and the merged party structured data, the merged text content is stored in the modification list. Afterwards, by querying the modification list, the merged text content of the base party structured data and the merged party structured data is obtained, and the merged text content is used as the structured data after the base party structured data and the merged party structured data are merged.

[0048] In some embodiments, Figure 3 As shown, step S104 may include sub-steps S1045 to S1048.

[0049] S1045, performing conflict classification on the reference-side structured data and the merged-side structured data according to the difference data;

[0050] S1046: If the conflict classification is a one-or-two conflict, determine the target party from the reference party structured data and the merged party structured data;

[0051] S1047: If the target party is the reference party structured data, the reference party structured data is maintained unchanged as the merged structured data;

[0052] S1048: If the target party is the merging party structured data, merge the reference party structured data and the merging party structured data.

[0053] For the conflict between the two, the user needs to make a choice, select the reference party structured data or select the merged party structured data. That is, if the reference party structured data and the merged party structured data are in a conflict between the two, the user selects the reference party structured data or the merged party structured data, and the selected reference party structured data is used as the target party, or the selected merged party structured data is used as the target party.

[0054] If the reference party structured data is selected, that is, the target party is the reference party structured data, then the reference party structured data is maintained unchanged and the reference party structured data is used as the merged structured data.

[0055] If the merging party structured data is selected, that is, the target party is the merging party structured data, at this time, according to the base party structured data and the merging party structured data, the base party structured data and the merging party structured data are merged in a corresponding manner.

[0056] In some embodiments, the merging of the reference party structured data and the merged party structured data includes:

[0057] Determine a conflict type corresponding to the reference-side structured data and the merged-side structured data, wherein the conflict type includes at least one of an attribute conflict, a path conflict, and a structure conflict;

[0058] According to the conflict type, storing the change information corresponding to the merged-party structured data into a type list, wherein the type list includes at least one of an addition list, a modification list, and a deletion list;

[0059] Data merging processing is performed based on the type list to obtain merged structured data.

[0060] For various conflict types such as attribute conflict, path conflict, and structure conflict, corresponding type lists are configured, wherein the type lists include but are not limited to add lists, modify lists, and delete lists. If the user selects the structured data of the merging party, that is, the target party is the structured data of the merging party, the conflict types such as attribute conflict / path conflict / structure conflict corresponding to the structured data of the base party and the structured data of the merging party are determined, and then the corresponding conflict processing is performed, and the change information corresponding to the structured data of the merging party is stored in the corresponding type lists such as add lists, modify lists, and delete lists. Then, based on the type lists such as add lists, modify lists, and delete lists, the data merging processing of the structured data of the base party and the structured data of the merging party is performed to obtain the merged structured data.

[0061] In some embodiments, storing the change information corresponding to the merged-in party structured data in a type list according to the conflict type includes:

[0062] If the conflict type is an attribute conflict, determine the attribute conflict mode of the structured data of the reference party and the structured data of the merged party, and store the change information corresponding to the structured data of the merged party into the type list according to the attribute conflict mode; wherein the attribute conflict mode includes simultaneous addition, simultaneous modification, and one party modifying and the other party deleting;

[0063] If the conflict type is a path conflict, storing the path change information of the merged-in structured data in a modification list;

[0064] If the conflict type is a structural conflict, the structural change information of the merged-in structured data is stored in a modification list.

[0065] As can be seen from the previous introduction, there are many different modes of attribute conflict, including but not limited to simultaneous addition, simultaneous modification, one party modifying and the other party deleting, etc. Therefore, if it is determined that the base party structured data and the merged party structured data correspond to attribute conflicts, the attribute conflict modes of the base party structured data and the merged party structured data are further determined, and then according to the attribute conflict modes, the change information corresponding to the merged party structured data is stored in the corresponding type list.

[0066] In some embodiments, storing the change information corresponding to the merged-in party structured data in the type list according to the attribute conflict mode includes:

[0067] If the attribute conflict mode is simultaneous addition, the added information of the merged party structured data is stored in the added list;

[0068] If the attribute conflict mode is simultaneous modification, the modification information of the merged-in party structured data is stored in a modification list;

[0069] If the attribute conflict mode is one party modifying and the other party deleting, the modification information of the structured data of the merging party is stored in a modification list, or the deletion information of the structured data of the merging party is stored in a deletion list.

[0070] For various attribute conflict modes such as simultaneous addition, simultaneous modification, one party modifying and the other party deleting, if the attribute conflict mode of the base party structured data and the merged party structured data is simultaneous addition, for this case, the change information of the merged party structured data, that is, the addition information of the merged party structured data, is stored in the addition list. If the attribute conflict mode of the base party structured data and the merged party structured data is simultaneous modification, for this case, the change information of the merged party structured data, that is, the modification information of the merged party structured data, is stored in the modification list. If the attribute conflict mode of the base party structured data and the merged party structured data is one party modifying and the other party deleting, for this case, the change information of the merged party structured data is stored in the modification list, or the change information of the merged party structured data is stored in the deletion list. For example, if the base party structured data is deleted and the merged party structured data is modified, the modification information of the merged party structured data is stored in the modification list. For another example, if the base party structured data is modified and the merged party structured data is deleted, the deletion information of the merged party structured data is stored in the deletion list.

[0071] If the conflict type between the reference party structured data and the merged party structured data is a path conflict, the change information of the merged party structured data, that is, the path change information of the merged party structured data, is stored in the modification list.

[0072] If the conflict type between the base party structured data and the merged party structured data is a structural conflict, the change information of the merged party structured data, that is, the structural change information of the merged party structured data, is stored in the modification list.

[0073] For example, Figure 4 As shown, the conflict between the base party structured data and the merged party structured data is handled as follows:

[0074] If the structured data of the base party and the structured data of the merged party are in a one-or-the-other conflict, determine the specific conflict type: attribute conflict, path conflict, structure conflict; if it is a structure conflict, determine whether to select the structured data of the merged party, if not, directly delete the conflicting information without any other processing, if yes, add the change information of the structured data of the merged party to the modification list; if it is an attribute conflict, determine the specific attribute conflict mode: add at the same time, modify at the same time, one party modifies and the other party deletes; if the structured data of the base party deletes the structured data of the merged party and modifies it, determine whether to select the structured data of the merged party, if not, directly delete the conflicting information without any other processing, if yes, add the change information of the structured data of the merged party to the modification list; if the structured data of the base party modifies the structured data of the merged party and deletes it, determine whether to select the structured data of the merged party, if If no, the conflicting information will be deleted directly without any other processing. If yes, the change information of the merged party's structured data will be added to the deletion list; if the base party's structured data and the merged party's structured data are modified at the same time, determine whether to select the merged party's structured data. If not, the conflicting information will be deleted directly without any other processing. If yes, the change information of the merged party's structured data will be added to the modification list; if the base party's structured data and the merged party's structured data are added at the same time, determine whether to select the merged party's structured data. If not, the conflicting information will be deleted directly without any other processing. If yes, the change information of the merged party's structured data will be added to the addition list; if the base party's structured data and the merged party's structured data are multi-line text conflicts, the text content will be manually merged by the user, and the merged text content will be added to the modification list as the modified content.

[0075] In some embodiments, performing data merging processing based on the type list to obtain merged structured data includes:

[0076] Querying the modification list to determine whether there is any structural change information of the structured data of the merged party;

[0077] If the structure change information exists and the structure change information is file-level information, the target party is exchanged, the difference data is correspondingly exchanged into reverse difference data, and data merging processing is performed based on the reverse difference data to obtain merged structured data;

[0078] If there is structural change information and the structural change information is attribute-level information, then the attributes of the baseline structured data and the merged structured data are swapped, the attribute difference data in the difference data is replaced with reverse attribute difference data, and data merging processing is performed based on the reverse attribute difference data to obtain merged structured data.

[0079] Based on the list of added lists, modified lists, deleted lists and other types of lists, the modification list is queried to determine whether there is structural change information of the merged party's structured data in the modification list. One situation is that there is structural change information of the merged party's structured data and the structural change information is file-level information. At this time, the base party's structured data and the merged party's structured data are swapped, that is, if the merged party's structured data was originally selected as the target party, then the base party's structured data is replaced as the target party. After swapping the target party, the difference data is replaced with the reverse difference data. For example, if the original difference data is the difference data of the merged party's structured data relative to the base party's structured data, then the reverse difference data is the difference data of the base party's structured data relative to the merged party's structured data. In addition, the user's target party selection is reversed, the modification list is updated based on the reverse difference data, and then the target party's data is modified based on the updated modification list, and the modified target party's data is determined as the merged structured data.

[0080] Another situation is that there is structural change information of the merged party's structured data and the structural change information is attribute-level information. For example, if there are node additions, node deletions, and position changes inside the tree-like attributes, then the structural change information is determined to be attribute-level information. At this time, the attributes of the base party's structured data and the merged party's structured data are swapped, and the attribute difference data contained in the difference data is replaced with the reverse attribute difference data. In addition, the user's target party selection for this attribute is reversed, the modification list is updated based on the reverse attribute difference data, and then the target party's data is modified based on the updated modification list, and the modified target party's data is determined as the merged structured data.

[0081] By querying the addition list, it is determined whether there is addition information of the structured data of the merging party. If there is addition information of the structured data of the merging party, the structured data of the base party is modified based on the addition information to obtain the merged structured data.

[0082] By querying the deletion list, it is determined whether there is deletion information of the structured data of the merging party. If there is deletion information of the structured data of the merging party, the structured data of the base party is modified based on the deletion information to obtain the merged structured data.

[0083] By querying the modification list, determine whether there is path change information of the merged party's structured data in the modification list. If there is path change information of the merged party's structured data, modify the path of the entity corresponding to the reference party's structured data according to the path change information to obtain the merged structured data.

[0084] The data is merged by first processing conflict information, then processing entity structure changes, then processing attribute changes, and finally processing entity additions, deletions, and change paths to obtain merged structured data.

[0085] For example, a structured data file includes data of an original node O1, a branch A1, and a branch B1, wherein the original node O1 is as follows:

[0086]

[0087] Branch A1 is as follows:

[0088]

[0089]

[0090] Branch B1 is as follows:

[0091]

[0092]

[0093] The attribute routers is a tree-like routing configuration, which needs to reflect the hierarchical relationship. The order between the same level does not need to be concerned. The attribute guards is a guard configuration list, which does not need to be concerned about the order. Type and name are used as the identifier of each item.

[0094] The difference information between branch B1 and branch A1 includes:

[0095] Branch B1 adds a routing page3 and a guard guard2;

[0096] Branch A1 modifies routing page2, while branch B1 deletes routing page2;

[0097] Branch A1 modifies the script property of guard1, which is a multi-line text. Branch B1 also modifies the script property of guard1, but there is a conflict because they modify the same line at the same time.

[0098] The data merging process of branch A1 and branch B1 is as follows:

[0099] 1. Deal with conflicts, including:

[0100] Conflict 1: If you choose to merge the changes of the merged party, that is, delete route page2, then add the deletion information to the deletion list;

[0101] Conflict 2: Multi-line text conflict, the text needs to be merged. Assume that the merged text is "xxxx11\nyyyy1122\nzzzz22", reorganize it into modification information and add it to the modification list;

[0102] The final processed difference information is as follows:

[0103]

[0104]

[0105] 2. Perform data merging processing, including:

[0106] (1) Modify the script value of guard1: According to the type and name identifiers of guard1, find guard1 in the data of branch A1 and replace its script attribute value with "xxxx11\nyyyy1122\nzzzz22".

[0107] (2) Delete route page 2: In the data of branch A1, find route page 2 according to the path and delete it.

[0108] (3) Adding route page3: The route entities belong to the tree nodes of the same level and do not care about the order. First, find the route page3 to be added in branch B1 according to the path; in the branch A1 data, find the route page1 according to the path, and append the route page3 to its children.

[0109] (4) Add guard guard2: First, find the guard guard2 to be added in branch B1 according to the type and name attributes; in branch A1, directly append guard guard2 after guards.

[0110] The merged data is as follows:

[0111]

[0112]

[0113] For another example, a component layout information file includes nodes of various components in a tree format, including layout components and functional components. It is necessary to be able to compare the layout changes between functional components and the attribute configuration changes within functional components. The node information includes the data of the original node O2, branch A2 and branch B2, where the original node O2 is as follows:

[0114]

[0115]

[0116] Branch A2 is as follows:

[0117]

[0118]

[0119] Branch B2 is as follows:

[0120]

[0121] The difference information of branch B2 relative to branch A2 is as follows:

[0122] The entities a0fa4ee3-3b0e-44a7-8dde-8275d2f85884 and 1d4ca148-74ac-489c-bea4-5fa535abedb5 have undergone structural changes, in effect swapping their positions.

[0123] The difference information of branch A2 relative to branch B2 is as follows:

[0124] The value of an input attribute of entity a0fa4ee3-3b0e-44a7-8dde-8275d2f85884 has changed.

[0125] Assume that the merge base is branch B2 merged into branch A2, so the main difference information is the difference information between branch B2 and branch A2.

[0126] If it is detected that the entity structure of the merging party has changed and it is a file-level structural change, the merge base is converted, branch B2 is used as the base party data, branch A2 is used as the merging party data, and the reverse difference information, that is, the difference information of branch A2 relative to branch B2, is merged as the main difference information.

[0127] The difference information of branch A2 relative to branch B2, that is, the reverse difference information, is that the value of a certain input attribute of the above-mentioned entity a0fa4ee3-3b0e-44a7-8dde-8275d2f85884 has changed. First, find the entity a0fa4ee3-3b0e-44a7-8dde-8275d2f85884 according to the unique identifier in branch A2. Its internal inputs attribute is an array, and the identifier of each item is the property attribute. Find the sub-item of inputs through the property attribute in the difference information, and then find its value.internal attribute value; then find the inputs sub-item in branch B2 using the same method, and then modify its value.internal attribute value according to the value obtained in branch A2.

[0128] The merged data is as follows:

[0129]

[0130]

[0131] In the above embodiment, by acquiring the baseline party structured data and the merging party structured data to be merged, the difference data between the baseline party structured data and the merging party structured data is determined, and then the conflict information corresponding to the baseline party structured data and the merging party structured data is determined based on the difference data. Based on the conflict information, the baseline party structured data and the merging party structured data are merged, and by summarizing the conflicts of the structured data, the structured data are merged based on the conflicts, thereby achieving the merging of the structured data.

[0132] The present invention also provides a structured data merging and processing device. Figure 5 , Figure 5 It is a schematic block diagram of a structured data merging and processing device provided in one embodiment of the present application.

[0133] like Figure 5 As shown, the structured data merging processing device 200 may include a processor 210 and a memory 220, wherein the processor 210 and the memory 220 are connected via a bus, such as an I2C (Inter-integrated Circuit) bus.

[0134] Specifically, the processor 210 may be a micro-controller unit (MCU), a central processing unit (CPU), or a digital signal processor (DSP).

[0135] Specifically, the memory 220 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB disk, or a mobile hard disk, etc. The memory 220 stores various computer programs for the processor 210 to execute.

[0136] The processor 210 is used to run a computer program stored in the memory, and implements the following steps when executing the computer program:

[0137] Obtaining the base party structured data and the merged party structured data to be merged;

[0138] Determining difference data between the reference party structured data and the merged party structured data;

[0139] Determining conflict information corresponding to the reference-party structured data and the merged-party structured data according to the difference data;

[0140] Based on the conflict information, the reference-side structured data and the merged-side structured data are merged.

[0141] In some embodiments, when implementing the merging process of the reference party structured data and the merged party structured data based on the conflict information, the processor 210 is configured to implement:

[0142] According to the difference data, conflict classification is performed on the reference party structured data and the merged party structured data;

[0143] If the conflict is classified as a multi-line text conflict, then obtaining the merged text content of the reference party structured data and the merged party structured data;

[0144] Storing the merged text content in a modification list;

[0145] Data merging processing is performed based on the modification list to obtain merged structured data.

[0146] In some embodiments, when implementing the merging process of the reference party structured data and the merged party structured data based on the conflict information, the processor 210 is configured to implement:

[0147] According to the difference data, conflict classification is performed on the reference party structured data and the merged party structured data;

[0148] If the conflict classification is a one-or-two conflict, determining the target party from the reference party structured data and the merged party structured data;

[0149] If the target party is the merged party structured data, the reference party structured data and the merged party structured data are merged.

[0150] In some embodiments, after determining the target party from the reference party structured data and the merged party structured data, the processor 210 is configured to implement:

[0151] If the target party is the reference party structured data, the reference party structured data is maintained unchanged as the merged structured data.

[0152] In some embodiments, when implementing the merging process of the reference party structured data and the merged party structured data, the processor 210 is configured to implement:

[0153] Determine a conflict type corresponding to the reference-side structured data and the merged-side structured data, wherein the conflict type includes at least one of an attribute conflict, a path conflict, and a structure conflict;

[0154] According to the conflict type, storing the change information corresponding to the merged-party structured data into a type list, wherein the type list includes at least one of an addition list, a modification list, and a deletion list;

[0155] Data merging processing is performed based on the type list to obtain merged structured data.

[0156] In some embodiments, when implementing storing the change information corresponding to the merged-party structured data into the type list according to the conflict type, the processor 210 is configured to implement:

[0157] If the conflict type is an attribute conflict, determining the attribute conflict mode of the reference party structured data and the merged party structured data, and storing the change information corresponding to the merged party structured data in the type list according to the attribute conflict mode; wherein the attribute conflict mode includes at least one of simultaneous addition, simultaneous modification, and one party modifying and the other party deleting;

[0158] If the conflict type is a path conflict, storing the path change information of the merged-in structured data in a modification list;

[0159] If the conflict type is a structural conflict, the structural change information of the merged-in structured data is stored in a modification list.

[0160] In some embodiments, when implementing the storing, according to the attribute conflict mode, the change information corresponding to the merged-in party structured data into the type list, the processor 210 is configured to implement:

[0161] If the attribute conflict mode is simultaneous addition, the added information of the merged party structured data is stored in the added list;

[0162] If the attribute conflict mode is simultaneous modification, the modification information of the merged-in party structured data is stored in a modification list;

[0163] If the attribute conflict mode is one party modifying and the other party deleting, the modification information of the structured data of the merging party is stored in a modification list, or the deletion information of the structured data of the merging party is stored in a deletion list.

[0164] In some embodiments, when the processor 210 performs data merging processing based on the type list to obtain merged structured data, it is configured to implement:

[0165] Querying the modification list to determine whether there is any structural change information of the structured data of the merged party;

[0166] If the structure change information exists and the structure change information is file-level information, the target party is exchanged, the difference data is correspondingly exchanged into reverse difference data, and data merging processing is performed based on the reverse difference data to obtain merged structured data;

[0167] If there is structural change information and the structural change information is attribute-level information, then the attributes of the baseline structured data and the merged structured data are swapped, the attribute difference data in the difference data is replaced with reverse attribute difference data, and data merging processing is performed based on the reverse attribute difference data to obtain merged structured data.

[0168] The structured data merging and processing device 200 can execute the structured data merging and processing method provided in the embodiment of the present application, and therefore can achieve the beneficial effects that can be achieved by the structured data merging and processing method provided in the embodiment of the present application. Please refer to the previous embodiment for details and will not be repeated here.

[0169] The embodiment of the present application also provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any data merging processing method provided in the description of the embodiment of the present application.

[0170] The storage medium may be an internal storage unit of the structured data merging and processing device described in the above embodiments, such as a hard disk or memory of the structured data merging and processing device. The storage medium may also be an external storage device of the structured data merging and processing device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the structured data merging and processing device.

[0171] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware embodiment, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0172] It should be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0173] The serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments. The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for merging structured data, the method comprising: Obtaining the base party structured data and the merged party structured data to be merged; Determining difference data between the reference party structured data and the merged party structured data; Determining conflict information corresponding to the reference party structured data and the merged party structured data according to the difference data; Based on the conflict information, the reference-side structured data and the merged-side structured data are merged.

2. The method according to claim 1, characterized in that The merging of the reference-side structured data and the merged-side structured data based on the conflict information includes: According to the difference data, conflict classification is performed on the reference party structured data and the merged party structured data; If the conflict is classified as a multi-line text conflict, then obtaining the merged text content of the reference party structured data and the merged party structured data; Storing the merged text content in a modification list; Data merging processing is performed based on the modification list to obtain merged structured data.

3. The method according to claim 1, characterized in that The merging of the reference-side structured data and the merged-side structured data based on the conflict information includes: According to the difference data, conflict classification is performed on the reference party structured data and the merged party structured data; If the conflict classification is a one-or-two conflict, determining the target party from the reference party structured data and the merged party structured data; If the target party is the merged party structured data, the reference party structured data and the merged party structured data are merged.

4. The method according to claim 3, characterized in that After determining the target party from the reference party structured data and the merged party structured data, the method further includes: If the target party is the reference party structured data, the reference party structured data is maintained unchanged as the merged structured data.

5. The method according to claim 3, characterized in that: The merging process of the reference party structured data and the merged party structured data includes: Determine a conflict type corresponding to the reference-side structured data and the merged-side structured data, wherein the conflict type includes at least one of an attribute conflict, a path conflict, and a structure conflict; According to the conflict type, storing the change information corresponding to the merged-party structured data into a type list, wherein the type list includes at least one of an addition list, a modification list, and a deletion list; Data merging processing is performed based on the type list to obtain merged structured data.

6. The method according to claim 5, characterized in that According to the conflict type, storing the change information corresponding to the merged-in party structured data into a type list includes: If the conflict type is an attribute conflict, determining the attribute conflict mode of the reference party structured data and the merged party structured data, and storing the change information corresponding to the merged party structured data in the type list according to the attribute conflict mode; wherein the attribute conflict mode includes at least one of simultaneous addition, simultaneous modification, and one party modifying and the other party deleting; If the conflict type is a path conflict, storing the path change information of the merged-in structured data in a modification list; If the conflict type is a structural conflict, the structural change information of the merged-in structured data is stored in a modification list.

7. The method according to claim 6, characterized in that According to the attribute conflict mode, storing the change information corresponding to the merged-in party structured data into the type list includes: If the attribute conflict mode is simultaneous addition, the added information of the merged party structured data is stored in the added list; If the attribute conflict mode is simultaneous modification, the modification information of the merged-in party structured data is stored in a modification list; If the attribute conflict mode is one party modifying and the other party deleting, the modification information of the structured data of the merging party is stored in a modification list, or the deletion information of the structured data of the merging party is stored in a deletion list.

8. The method according to claim 4, characterized in that The data merging process is performed based on the type list to obtain merged structured data, including: Querying the modification list to determine whether there is any structural change information of the structured data of the merged party; If the structure change information exists and the structure change information is file-level information, the target party is exchanged, the difference data is correspondingly exchanged into reverse difference data, and data merging processing is performed based on the reverse difference data to obtain merged structured data; If there is structural change information and the structural change information is attribute-level information, then the attributes of the baseline structured data and the merged structured data are swapped, the attribute difference data in the difference data is replaced with reverse attribute difference data, and data merging processing is performed based on the reverse attribute difference data to obtain merged structured data.

9. A structured data merging and processing device, characterized in that: The structured data merging and processing device comprises: A processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of the structured data merging processing method as described in any one of claims 1 to 8 are realized.

10. A storage medium for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the structured data merging processing method as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Long text processing method and device based on large model, electronic equipment and medium

    CN120910269A

  • Large model-based long text processing method and device, electronic equipment and medium

    CN120910269B