A data copying method and apparatus

By modularizing the data copy mapping rules, the initial mapping rules are obtained based on user needs and pre-defined copy modes, which solves the problems of high development and maintenance costs and error-proneness in the data copy process, and achieves a more efficient and reliable data copy process.

CN115756313BActive Publication Date: 2026-11-10CHINA CONSTRUCTION BANK +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211382506.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-07
Publication Date
2026-11-10
Estimated Expiration
2042-11-07

Smart Images

  • Figure CN115756313B_ABST
    Figure CN115756313B_ABST
Patent Text Reader

Abstract

This application provides a data copying method and apparatus, relating to the field of data storage technology. The method includes: acquiring a copy instruction input by a user, the copy instruction including a data copying mode and a first mapping rule, the first mapping rule being a copy rule set by the user according to current copying needs; acquiring an initial mapping rule corresponding to the copying mode, wherein different copying modes correspond to different initial mapping rules, the initial mapping rule being a copy rule pre-set based on the copying mode; determining a second mapping rule for data copying based on the initial mapping rule and the first mapping rule; and executing data copying according to the second mapping rule. The mapping rules executed during data copying are modularized, avoiding full modification of the original mapping rules, which reduces development and maintenance costs, and controls error risks separately in the newly generated mapping rules.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data storage technology, and in particular to a data copying method and apparatus. Background Technology

[0002] Data copying, also known as object copying, refers to the process of copying the fields of a source object to a target object according to mapping rules. Regardless of whether the fields of the source object are value types or reference types, an independent copy is made to the target object.

[0003] Currently, during the data copying process, if any of the source object, target object, or mapping rules changes, the mapping rules need to be completely modified. This is especially true when there are many fields and complex mapping rules, resulting in high development and maintenance costs and a high risk of errors. Summary of the Invention

[0004] This application provides a data copying method and apparatus. By modularizing the mapping rules executed during data copying, the original mapping rules are not fully modified, which can reduce the development and maintenance costs.

[0005] In a first aspect, embodiments of this application provide a data copying method, including:

[0006] Obtain a copy instruction input by the user, the copy instruction including a data copy mode and a first mapping rule, the first mapping rule being a copy rule set by the user according to the current copy requirements;

[0007] Obtain the initial mapping rule corresponding to the copy mode, wherein different copy modes correspond to different initial mapping rules, and the initial mapping rule is a copy rule pre-set based on the copy mode;

[0008] Based on the initial mapping rule and the first mapping rule, a second mapping rule for the data copy is determined, and the data copy is performed according to the second mapping rule.

[0009] Optionally, the copy mode is a first mode, and determining the second mapping rule for the data copy based on the initial mapping rule and the first mapping rule includes:

[0010] The initial mapping rule and the first mapping rule are merged to obtain the second mapping rule.

[0011] Optionally, the copy mode is a second mode, and determining the second mapping rule for the data copy based on the initial mapping rule and the first mapping rule includes:

[0012] Obtain the target sub-rule in the first mapping rule that is mutually exclusive with the initial mapping rule;

[0013] The initial mapping rule and the first mapping rule are merged, and the rules in the initial mapping rule that are mutually exclusive with the target sub-rule are deleted to obtain the second mapping rule.

[0014] Optionally, the copy mode is a third mode, and determining the second mapping rule for the data copy based on the initial mapping rule and the first mapping rule includes:

[0015] Obtain the target sub-rule of the same type as the initial mapping rule from the first mapping rule;

[0016] The initial mapping rule and the first mapping rule are merged, and the target sub-rule is used to replace the rule of the same type in the initial mapping rule to obtain the second mapping rule.

[0017] Optionally, performing the data copy according to the second mapping rule includes:

[0018] The data in the source node is filtered according to the second mapping rule to obtain the target data to be copied;

[0019] The storage fields in the target node are filtered according to the second mapping rule to obtain the target fields used to store the target data;

[0020] If the target data matches the target field, then the target data is copied to the target field.

[0021] Optionally, before filtering the data in the source node according to the second mapping rule, the method further includes:

[0022] Based on the address information of the source node and the address information of the target node in the second mapping rule, the source node and the target node are queried. The address information of the source node and the address information of the target node are determined according to the first mapping rule.

[0023] The source node and the target node are parsed to obtain the data of the source node and the storage fields of the target node.

[0024] Optionally, obtaining the initial mapping rule corresponding to the copy mode includes:

[0025] The corresponding configuration file is read according to the identifier of each copy mode, where the data mode corresponds one-to-one with the configuration file;

[0026] Based on the configuration file, obtain the initial mapping rules corresponding to the copy mode.

[0027] Secondly, embodiments of this application also provide a data copying device, comprising:

[0028] The first acquisition module is used to acquire the copy instruction input by the user. The copy instruction includes a data copy mode and a first mapping rule. The first mapping rule is a copy rule set by the user according to the current copy requirements.

[0029] The second acquisition module is used to acquire the initial mapping rule corresponding to the copy mode, wherein different copy modes correspond to different initial mapping rules, and the initial mapping rule is a copy rule pre-set based on the copy mode;

[0030] The determining module is configured to determine a second mapping rule for the data copy based on the initial mapping rule and the first mapping rule, and to perform the data copy according to the second mapping rule.

[0031] Optionally, the data copying device may perform the data copying method described in any of the first aspects.

[0032] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0033] The memory is used to store computer instructions; the processor is used to execute the computer instructions stored in the memory to implement the method of any one of the first aspects.

[0034] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method of any of the first aspects.

[0035] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the method of any one of the first aspects.

[0036] The data copying method and apparatus provided in this application obtain a copy command input by the user. The copy command includes a data copying mode and a first mapping rule. The first mapping rule is a copying rule set by the user according to the current copying requirements. An initial mapping rule corresponding to the copying mode is obtained, wherein different copying modes correspond to different initial mapping rules. The initial mapping rule is a copying rule pre-set based on the copying mode. A second mapping rule for data copying is determined based on the initial mapping rule and the first mapping rule, and data copying is performed according to the second mapping rule. The mapping rules executed during data copying are modularized, avoiding a full modification of the original mapping rules. This reduces development and maintenance costs and controls error risks separately in the newly generated mapping rules. Attached Figure Description

[0037] Figure 1 This is a schematic diagram of a scenario provided for an embodiment of this application;

[0038] Figure 2 Flowchart of the data copying method provided in the embodiments of this application Figure 1 ;

[0039] Figure 3 Flowchart of the data copying method provided in the embodiments of this application Figure 2 ;

[0040] Figure 4 A schematic diagram illustrating the data copying process provided in this application embodiment;

[0041] Figure 5 A schematic diagram of the structure of the data copying device provided in the embodiments of this application;

[0042] Figure 6 This is a schematic diagram of the structure of the data copying electronic device provided in the embodiments of this application. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0044] In the embodiments of this application, the terms "first" and "second" are used to distinguish identical or similar items with essentially the same function and effect, without limiting their order. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that the terms "first" and "second" do not necessarily imply that they are different.

[0045] It should be noted that, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0046] In some existing transaction and information maintenance systems, there is a need for interaction between the front-end page, the back-end program, and the database. This means that data transfer is required between the front-end page, the back-end program, and the database; this data transfer process is also known as data copying.

[0047] Data copying, also known as object copying, refers to the process of copying the fields of a source object to a target object according to mapping rules. Regardless of whether the fields of the source object are value types or reference types, an independent copy is made to the target object.

[0048] Currently, during the data copying process, if any of the source object, target object, or mapping rules changes, the mapping rules need to be completely modified. This is especially true when there are many fields and complex mapping rules, resulting in high development and maintenance costs and a high risk of errors.

[0049] In view of this, embodiments of this application provide a data copying method and apparatus. By setting different mapping rules and processing modes for different copying scenarios, and executing corresponding processing rules according to the copying requirements input by the user, the processing rules are new processing rules generated based on the pre-set mapping rules and the user's copying requirements. The original mapping rules are not fully modified, which can reduce the development and maintenance costs and control the error risk in the newly generated processing rules.

[0050] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be implemented independently or in combination with each other. The same or similar concepts or processes may not be described again in some embodiments.

[0051] Figure 1 This is a schematic diagram illustrating an application scenario of an embodiment of this application, such as... Figure 1 As shown, it includes: user 101 and data platform 102.

[0052] The data platform 102 can be any platform capable of data copying, such as a bank's transaction platform or information maintenance platform. This application embodiment does not limit the type of data platform.

[0053] In this embodiment of the application, the data platform 102 includes a source node, a target node, and a server. The source node is a node that provides target data for data copying, the target node is a node that receives target data for data copying, and the server is used to maintain the normal operation of the data platform and execute various instructions received by the data platform 102.

[0054] In this embodiment of the application, after the data platform 102 receives the copy instruction input by the user, the server parses the copy instruction to obtain the user's data copying requirements. For example, the user needs to copy data from node A to a certain data at node B according to a certain rule, such as regular expression matching. Then the server will copy the data that meets the user's requirements from the source node (at node A) to the target node (at node B) according to the parsed copy instruction.

[0055] Optionally, in this embodiment of the application, after the server executes the user's copy instruction, or if an error occurs during the execution process, the server can display relevant reminder messages on the display interface of the data platform 102 to provide feedback to the user.

[0056] The application scenarios of the embodiments of this application have been briefly described above. The following will use... Figure 1 Taking the server in the data platform shown as an example, the data copying method provided in this application embodiment will be described.

[0057] Figure 2 Flowchart of the data copying method provided in the embodiments of this application Figure 1 ,like Figure 2 As shown, it includes the following steps:

[0058] S201. Obtain the copy instruction input by the user. The copy instruction includes the data copy mode and the first mapping rule. The first mapping rule is the copy rule set by the user according to the current copy requirements.

[0059] In this embodiment of the application, the copy instruction refers to an instruction generated based on the copy request input by the user. For example, when the data platform receives the copy request input or selected by the user on the display interface, it generates a copy instruction to execute the user's copy request.

[0060] In this embodiment, the copy mode refers to the different data copying processing methods selected by the user according to different copying needs, such as flexible copy mode, strict copy mode, etc. The copy mode can be pre-set in the storage and data platform according to the user's common copying needs. When data copying is required, the user can trigger the corresponding copy mode control to input the required copy mode.

[0061] For example, the flexible copy mode allows users to simply complete the copy command they input without specifying the exact execution method, while the strict copy mode allows users to execute the copy command they input in the exact way they require.

[0062] Mapping rules refer to the copying rules that map data from the source node to the target node during data copying. The first mapping rule refers to the copying rule that the user sets additionally according to the copying requirements. For example, if the user needs to filter the data in the source node according to a certain rule, such as regular expression matching, during data copying, then this rule can be used as the first mapping rule. The first mapping rule can be input in the form of a configuration file, that is, a corresponding configuration file is generated according to the first mapping rule input by the user.

[0063] In this embodiment of the application, the server can obtain the copy command input by the user based on the copy control related to the data platform triggered by the user.

[0064] S202. Obtain the initial mapping rule corresponding to the copy mode. Different copy modes correspond to different initial mapping rules. The initial mapping rule is a copy rule that is set in advance based on the copy mode.

[0065] In this embodiment of the application, the initial mapping rule refers to the basic rule corresponding to the data copy, such as the functional interface or encapsulated utility class during data copying. Different copying modes correspond to different initial mapping rules.

[0066] In this embodiment of the application, the initial mapping rule is a copy rule preset by the user based on the set copy mode and stored in the server. Different initial mapping rules include different basic mapping rules. For example, the initial mapping rule corresponding to the flexible copy mode may only include the general mapping rules when copying data, without including the rules for data filtering or matching. The initial mapping rule corresponding to the strict mode may include some mapping rules other than the general mapping rules.

[0067] In this embodiment, the initial mapping rules can be stored in the configuration file of the data platform. The server can look up the corresponding initial mapping rule in the configuration file based on the acquired copy mode. For example, each copy mode has a corresponding field flag, and the server queries the configuration file for the initial mapping rule corresponding to that field flag.

[0068] S203. Based on the initial mapping rule and the first mapping rule, determine the second mapping rule for data copying, and perform data copying according to the second mapping rule.

[0069] In this embodiment of the application, the server determines the first mapping rule input by the user and the initial mapping rule for performing data copying determined according to the copy mode, and can determine the second mapping rule for performing data copying.

[0070] For example, the initial mapping rule and the first mapping rule can be merged to obtain the second mapping rule, or some sub-mapping rules in the first mapping rule can be replaced with some sub-mapping rules in the initial mapping rule, and then the remaining rules can be merged to obtain the second mapping rule.

[0071] In this embodiment of the application, after the server determines the second mapping rule, it copies data from the source node to the target node according to the second mapping rule.

[0072] It is understood that in the embodiments of this application, only one data copy mapping rule is executed when performing data copying.

[0073] The data copying method provided in this application involves obtaining a copy command input by the user. This command includes a copy mode and a first mapping rule. The first mapping rule is a copy rule set by the user based on the current copying requirements. The method then obtains the initial mapping rule corresponding to the copy mode. Different copy modes correspond to different initial mapping rules, which are pre-defined based on the copy mode. Based on the initial mapping rule and the first mapping rule, a second mapping rule for data copying is determined, and the data copying is performed according to the second mapping rule. This modular approach to the mapping rules used during data copying avoids a complete modification of the original mapping rules, reducing development and maintenance costs and controlling error risks within the newly generated mapping rules.

[0074] Figure 3 A flowchart illustrating the data copying method provided in this application embodiment. Figure 2 ,exist Figure 2 Based on the illustrated embodiments, the data copying method provided in this application will be further described, such as... Figure 3 As shown, it includes the following steps:

[0075] S301. Obtain the copy instruction input by the user. The copy instruction includes the data copy mode and the first mapping rule. The first mapping rule is the copy rule set by the user according to the current copy requirements.

[0076] In the embodiments of this application, the specific implementation method shown in S301 and Figure 2 The specific implementation of S201 shown is similar, and will not be described in detail here.

[0077] It is understandable that different copying requirements correspond to different first mapping rules.

[0078] S302. Obtain the corresponding initial mapping rule according to the copy mode.

[0079] In this embodiment, the initial mapping rule is a copy rule set according to a pre-defined copy mode. The initial mapping rule is written into the relevant configuration file of the data platform, and the server can obtain the corresponding initial mapping rule according to the configuration file.

[0080] Specifically, the corresponding configuration file is read according to the identifier of each copy mode. The data mode corresponds one-to-one with the configuration file. Based on the configuration file, the initial mapping rule corresponding to the copy mode is obtained.

[0081] For example, the server reads the configuration file corresponding to the copy mode from the storage space of the data platform according to the identifier carried in the copy mode in the user's copy instruction, and parses the configuration file to obtain the initial mapping rule corresponding to the copy mode.

[0082] Understandably, each initial mapping rule corresponds to a configuration file.

[0083] S303. Determine the second mapping rule for data copying based on the initial mapping rule and the first mapping rule.

[0084] In this embodiment of the application, the initial mapping rules for different copy modes in the copy command input by the user are different. Therefore, the second mapping rule for data copying can be determined in the following ways based on the initial mapping rule and the first mapping rule:

[0085] The first possible implementation:

[0086] If the copy mode is mode one, then the second mapping rule for data copying is determined as follows:

[0087] The initial mapping rule and the first mapping rule are merged to obtain the second mapping rule.

[0088] In this embodiment of the application, the first mode can be a flexible configuration mode, and the corresponding initial mapping rule can be a basic mapping rule. The flexible configuration mode can mean that the user can adjust the copy rules at any time according to the needs, and the corresponding basic mapping rule can be a rule that only includes the minimum necessary conditions required to execute the copy instruction, such as function interfaces, encapsulation tools, etc.

[0089] After the server determines the initial mapping rule and the first mapping rule based on the copy instruction, it merges the initial mapping rule and the first mapping rule. That is, it merges the initial mapping rule and the first mapping rule according to the logical order of the copy rules, without making any other modifications, to obtain the second mapping rule.

[0090] The second possible implementation:

[0091] If the copy mode is the second mode, then the second mapping rule for data copying is determined as follows:

[0092] Obtain the target sub-rule that is mutually exclusive with the initial mapping rule in the first mapping rule; merge the initial mapping rule and the first mapping rule, and delete the rule in the initial mapping rule that is mutually exclusive with the target sub-rule to obtain the second mapping rule.

[0093] In this embodiment of the application, the second mode can be an incremental configuration mode, and the corresponding initial mapping rule can be a historical existing configuration rule. The incremental configuration mode can be a copy rule executed when adding or deleting, and the historical existing configuration rule can be a corresponding rule that includes the necessary conditions for performing the add or delete operation.

[0094] In this embodiment, when the server obtains the first mapping rule and the historical existing configuration rule, it retrieves the mutually exclusive rules in the first mapping rule and the historical existing configuration rule, merges the first mapping rule and the historical existing configuration rule, and deletes the sub-rules in the historical existing configuration rule that are mutually exclusive with the first mapping rule to obtain the second mapping rule. That is, the sub-rules in the historical existing configuration rule are replaced by the mutually exclusive sub-rules in the first mapping rule.

[0095] The third possible implementation:

[0096] If the copy mode is the third mode, then the second mapping rule for data copying is determined as follows:

[0097] Obtain the target sub-rule of the same type as the initial mapping rule in the first mapping rule; merge the initial mapping rule and the first mapping rule, and replace the rule of the same type as the target sub-rule in the initial mapping rule with the target sub-rule to obtain the second mapping rule.

[0098] In this embodiment of the application, the third mode can be a strict mode, and the corresponding initial mapping rule can be a raw mapping rule. The strict mode can be the processing mode required to fully execute the user's copy instruction, and the raw mapping rule can be an existing general copy rule.

[0099] In this embodiment of the application, when the server obtains the first mapping rule and the original mapping rule, it obtains the mapping sub-rules of the same type in the first mapping rule and the original mapping rule, deletes the mapping sub-rules of the same type as the first mapping rule in the original mapping rule, merges the remaining mapping sub-rules, and obtains the second mapping rule. That is, the strict mode uses the mapping rule input by the user to replace the rule of the same type in the basic mapping rule, without considering whether the content of the rule is the same or contradictory. As long as there is a rule of the same type, the replacement operation is performed.

[0100] Optionally, in this embodiment, the copy command input by the user may not include a copy mode or may be a traditional mode, i.e., a general copy rule. In this case, the server can execute the original mapping rule to execute the copy command. The overall schematic diagram of the data copying method provided in this embodiment can be referred to Figure 4 As shown.

[0101] Optionally, in this embodiment, the copy mode and the corresponding initial copy rules can be set and written in the storage and data platform according to actual needs. This embodiment does not restrict the copy mode and the corresponding initial copy rules.

[0102] S304. Obtain the corresponding source node information and target node information according to the second mapping rule.

[0103] In this embodiment, source node information refers to the data (or object) in the source node, including data name, data attributes, data value, etc., while target node information refers to the attribute information, storage field, etc., of the data (or object) to be written in the target node.

[0104] In this embodiment of the application, the server can obtain the corresponding source node information and target node information according to the second mapping rule.

[0105] Specifically, based on the address information of the source node and the address information of the target node in the second mapping rule, the source node and the target node are queried. The address information of the source node and the address information of the target node are determined according to the first mapping rule. The source node and the target node are parsed to obtain the data of the source node and the storage field of the target node.

[0106] For example, the address information of the source node and the address information of the target node can be carried by the first mapping rule in the copy instruction input by the user. The second mapping rule is determined according to the first mapping rule. Then the second mapping rule includes the address information of the source node and the address information of the target node. The server queries the corresponding source node and target node in the data platform according to the address information of the source node and the address information of the target node. Data parsing of the source node and the target node can obtain the corresponding source node information and target node information, that is, the data in the source node and the storage field of the object to be written in the target node.

[0107] Optionally, the target node can be an existing node or a new storage address. If the target node is a new storage address, the server can create a new node at that storage address and create the object to be written according to the mapping rules.

[0108] S305. Perform data copying according to the second mapping rule.

[0109] In this embodiment of the application, after the server obtains the information of the source node and the target node based on the address information, it can perform data copying according to the second mapping rule.

[0110] Specifically, the data in the source node is filtered according to the second mapping rule to obtain the target data to be copied; the storage fields in the target node are filtered according to the second mapping rule to obtain the target fields used to store the target data; if the target data matches the target field, the target data is copied to the target field.

[0111] In this embodiment of the application, the server filters the data in the source node and the storage field of the object to be written in the target node according to the filtering rules or copy requirements input by the user in the second mapping rules and the copy requirements corresponding to the copy mode, so as to obtain the target data and the target field. For example, the target data is obtained by performing regular expression matching on the data in the source node, and the storage field of the object in the target node is filtered to determine that there is a target storage field that meets the requirements.

[0112] In this embodiment, the server matches the target data with the target field, that is, whether the target data can be written to the corresponding target field. If it can, the target data is copied to the target field. The matching of the target data with the target field can be done using a general matching method, and this embodiment does not limit this.

[0113] The data copying method provided in this application involves obtaining a copy command input by the user, which includes a copy mode and a first mapping rule. Based on the copy mode, a corresponding initial mapping rule is obtained. Based on the initial mapping rule and the first mapping rule, a second mapping rule for data copying is determined. Based on the second mapping rule, corresponding source node information and target node information are obtained. Finally, data copying is executed according to the second mapping rule. By setting different copy modes and corresponding initial mapping rules, the processing rules for data copying are modularized. Users can select different processing rules according to different needs without having to completely modify existing rules, reducing operation and maintenance costs and controlling processing risks within the newly added configurations.

[0114] Based on the above-described data copying method embodiments, this application also provides a data copying device.

[0115] Figure 5 This is a schematic diagram of the structure of the data copying device 50 provided in the embodiments of this application, as shown below. Figure 5 As shown, it includes:

[0116] The first acquisition module 501 is used to acquire the copy instruction input by the user. The copy instruction includes the data copy mode and the first mapping rule. The first mapping rule is the copy rule set by the user according to the current copy requirements.

[0117] The second acquisition module 502 is used to acquire the initial mapping rule corresponding to the copy mode. Different copy modes correspond to different initial mapping rules, and the initial mapping rule is a copy rule set in advance based on the copy mode.

[0118] The determination module 503 is used to determine the second mapping rule for data copying based on the initial mapping rule and the first mapping rule, and to perform data copying according to the second mapping rule.

[0119] Optionally, the second acquisition module 502 is further configured to query the source node and the target node according to the address information of the source node and the address information of the target node in the second mapping rule, wherein the address information of the source node and the address information of the target node are determined according to the first mapping rule; and to parse the source node and the target node to obtain the data of the source node and the storage field of the target node.

[0120] Optionally, the second acquisition module 502 is also used to read the corresponding configuration file according to the identifier of each copy mode, wherein the data mode corresponds one-to-one with the configuration file; and to obtain the initial mapping rule corresponding to the copy mode according to the configuration file.

[0121] Optionally, the second acquisition module 502 is further configured to filter the data in the source node according to the second mapping rule to obtain the target data to be copied; filter the storage fields in the target node according to the second mapping rule to obtain the target fields used to store the target data; and if the target data matches the target field, copy the target data to the target field.

[0122] Optionally, the determining module 503 is also used to copy the mode to the first mode, merge the initial mapping rule and the first mapping rule to obtain the second mapping rule.

[0123] Optionally, the determination module 503 is also used to copy the mode to the second mode, obtain the target sub-rule that is mutually exclusive with the initial mapping rule in the first mapping rule; merge the initial mapping rule and the first mapping rule, and delete the rule that is mutually exclusive with the target sub-rule in the initial mapping rule to obtain the second mapping rule.

[0124] Optionally, the determination module 503 is also used to copy the mode to the third mode, obtain the target sub-rule of the same type as the initial mapping rule in the first mapping rule; merge the initial mapping rule and the first mapping rule, and replace the rule of the same type as the target sub-rule in the initial mapping rule with the target sub-rule to obtain the second mapping rule.

[0125] The data copying device provided in this application embodiment can achieve the above-mentioned functionality. Figure 2 and Figure 3 The technical solutions of the data copying method embodiments shown are similar in principle and technical effect, and will not be described again here.

[0126] Figure 6 This is a schematic diagram of the structure of the data copying electronic device provided in an embodiment of this application. Figure 6 As shown, the data copying electronic device 60 provided in this embodiment may include:

[0127] Processor 601.

[0128] Memory 602 is used to store executable instructions for the terminal device.

[0129] The processor is configured to execute the technical solution of the above data copying method embodiment by executing executable instructions. Its implementation principle and technical effect are similar, and will not be described again here.

[0130] This application also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements the technical solution of the above-described data copying method embodiment. Its implementation principle and technical effect are similar, and will not be repeated here.

[0131] In one possible implementation, a computer-readable medium may include random access memory (RAM), read-only memory (ROM), compact discread-only memory (CD-ROM) or other optical disc storage, disk storage or other magnetic storage devices, or any other medium targeted to carry or to store the required program code in the form of instructions or data structures, and accessible by a computer. Furthermore, any connection is appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. As used herein, disks and optical discs include optical discs, laser discs, optical discs, Digital Versatile Discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. The above combinations should also be included within the scope of computer-readable media.

[0132] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the technical solution of the above-described data copying method embodiment. Its implementation principle and technical effects are similar, and will not be repeated here.

[0133] In the specific implementation of the aforementioned terminal device or server, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0134] Those skilled in the art will understand that all or part of the steps in any of the above method embodiments can be implemented by hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium, and when the program is executed, all or part of the steps in the above method embodiments are performed.

[0135] If the technical solution of this application is implemented in software form and sold or used as a product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the technical solution of this application can be embodied in the form of a software product, which is stored in a storage medium and includes a computer program or several instructions. This computer software product causes a computer device (which may be a personal computer, server, network device, or similar electronic device) to execute all or part of the steps of the method described in the embodiments of this application.

[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A data copying method, characterized in that, include: The system obtains a copy instruction input by the user, which includes a data copy mode and a first mapping rule. The first mapping rule is a copy rule set by the user according to the current copy requirements; different copy requirements correspond to different first mapping rules. Obtain the initial mapping rule corresponding to the copy mode, wherein different copy modes correspond to different initial mapping rules, and the initial mapping rule is a copy rule pre-set based on the copy mode; the copy mode includes: a first mode, a second mode, and a third mode; the first mode is a flexible configuration mode, the second mode is an incremental configuration mode, and the third mode is a strict mode; Based on the initial mapping rule and the first mapping rule, a second mapping rule for the data copy is determined, and the data copy is performed according to the second mapping rule; Wherein, when the copy mode is the second mode, the step of determining the second mapping rule for data copying according to the initial mapping rule and the first mapping rule includes: obtaining the target sub-rule in the first mapping rule that is mutually exclusive with the initial mapping rule; merging the initial mapping rule and the first mapping rule, and deleting the rule in the initial mapping rule that is mutually exclusive with the target sub-rule to obtain the second mapping rule; Wherein, when the copy mode is the third mode, the step of determining the second mapping rule for the data copy according to the initial mapping rule and the first mapping rule includes: obtaining a target sub-rule of the same type as the initial mapping rule in the first mapping rule; merging the initial mapping rule and the first mapping rule, and replacing the rule of the same type as the target sub-rule in the initial mapping rule with the target sub-rule to obtain the second mapping rule.

2. The method according to claim 1, characterized in that, in, When the copy mode is the first mode, determining the second mapping rule for the data copy based on the initial mapping rule and the first mapping rule includes: The initial mapping rule and the first mapping rule are merged to obtain the second mapping rule.

3. The method according to claim 1 or 2, characterized in that, The step of performing the data copy according to the second mapping rule includes: The data in the source node is filtered according to the second mapping rule to obtain the target data to be copied; The storage fields in the target node are filtered according to the second mapping rule to obtain the target fields used to store the target data; If the target data matches the target field, then the target data is copied to the target field.

4. The method according to claim 3, characterized in that, Before filtering the data in the source node according to the second mapping rule, the method further includes: Based on the address information of the source node and the address information of the target node in the second mapping rule, the source node and the target node are queried. The address information of the source node and the address information of the target node are determined according to the first mapping rule. The source node and the target node are parsed to obtain the data of the source node and the storage fields of the target node.

5. The method according to claim 1 or 2, characterized in that, The step of obtaining the initial mapping rule corresponding to the copy mode includes: The corresponding configuration file is read according to the identifier of each copy mode, where the data mode corresponds one-to-one with the configuration file; Based on the configuration file, obtain the initial mapping rules corresponding to the copy mode.

6. A data copying device, characterized in that, include: The first acquisition module is used to acquire the copy instruction input by the user. The copy instruction includes a data copy mode and a first mapping rule. The first mapping rule is a copy rule set by the user according to the current copy requirements. Different copy requirements correspond to different first mapping rules. The second acquisition module is used to acquire the initial mapping rule corresponding to the copy mode, wherein different copy modes correspond to different initial mapping rules, and the initial mapping rule is a copy rule pre-set based on the copy mode; the copy mode includes: a first mode, a second mode and a third mode; the first mode is a flexible configuration mode, the second mode is an incremental configuration mode, and the third mode is a strict mode; The determining module is configured to determine a second mapping rule for the data copy based on the initial mapping rule and the first mapping rule, and to perform the data copy according to the second mapping rule; The determining module is further configured to, when the copy mode is the second mode, obtain the target sub-rule that is mutually exclusive with the initial mapping rule in the first mapping rule; merge the initial mapping rule and the first mapping rule, and delete the rule in the initial mapping rule that is mutually exclusive with the target sub-rule to obtain the second mapping rule; The determining module is further configured to, when the copy mode is the third mode, obtain a target sub-rule of the same type as the initial mapping rule in the first mapping rule; merge the initial mapping rule and the first mapping rule, and replace the rule of the same type as the target sub-rule in the initial mapping rule with the target sub-rule to obtain the second mapping rule.

7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the method of any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, It stores a computer program, which is executed by a processor to implement the method of any one of claims 1-5.

9. A computer program product, characterized in that, The invention includes a computer program, characterized in that the computer program, when executed by a processor, implements the method of any one of claims 1-5.

Citation Information

Patent Citations

  • Reusable mapping rules for data to data transformation

    US20100057673A1