Data migration path acquisition method, device and computer equipment

By automatically extracting feature words and ending words in database cluster path statements, it solves the problem of long time and low efficiency of manual analysis of data migration paths, and achieves efficient and accurate acquisition of data migration paths.

CN110134664BActive Publication Date: 2024-10-18CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201910295665.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-04-12
Publication Date
2024-10-18
Estimated Expiration
2039-04-12

AI Technical Summary

Technical Problem

When dealing with big data platforms, manually parsing the data migration path from the HQL code of the database cluster is time-consuming and inefficient, especially when the path statement task volume is large.

Method used

By obtaining the path statement, determining the feature words and end words, automatically extracting the source address and destination address, thereby determining the data migration path, using the feature words and end words to match the path words, split the statement to obtain the source address and destination address, and realize automatic analysis.

Benefits of technology

When the path statement task volume is large, the speed and efficiency of obtaining data migration paths are improved, high accuracy is ensured, and the time consumption of manual analysis is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110134664B_ABST
    Figure CN110134664B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for obtaining a data migration path, the method comprising: obtaining a path statement; determining a first characteristic word and a first end word in the path statement, and obtaining a source address statement in the path statement according to the first characteristic word and the first end word; determining a second characteristic word and a second end word in the path statement, and obtaining a destination address statement in the path statement according to the second characteristic word and the second end word; extracting a source address from the source address statement, and using the destination address statement as the destination address; and obtaining a data migration path according to the source address and the destination address. The scheme of the present invention can automatically extract the source address and the destination address from the path statement, thereby determining the data migration path, with high efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device and computer equipment for acquiring a data migration path. Background Art

[0002] When processing data on a big data platform, it is necessary to clearly understand the origins and development of each data. Therefore, during the data processing process, the source and destination information of the data, that is, the migration path of the data, needs to be filled in the scheduling document, and then the scheduling document is read to execute the task when the platform is deployed.

[0003] Traditional technology uses manual parsing of the data migration path from the HQL code corresponding to the database cluster and fills it into the document. When the HQL task volume is large, manual parsing is time-consuming and inefficient. Summary of the invention

[0004] The purpose of the present invention is to provide a method, device, computer equipment and readable storage medium for obtaining a data migration path, which can solve the problem that manual parsing of the data migration path is time-consuming and inefficient when the path statement task volume is large.

[0005] The purpose of the present invention is achieved through the following technical solutions:

[0006] A method for acquiring a data migration path, the method comprising:

[0007] Get path statement;

[0008] Determine a first characteristic word and a first end word in the path statement, and obtain a source address statement in the path statement according to the first characteristic word and the first end word; determine a second characteristic word and a second end word in the path statement, and obtain a destination address statement in the path statement according to the second characteristic word and the second end word;

[0009] Extracting a source address from the source address statement, and using the destination address statement as the destination address; the source address and the destination address are used to determine a data migration path;

[0010] A data migration path is obtained according to the source address and the destination address.

[0011] In one embodiment, the determining the first characteristic word and the first end word in the path statement includes:

[0012] Matching the path words in the path statement with pre-stored feature words to obtain the first feature words;

[0013] The path words in the path statement are matched with the pre-stored end words to obtain the first end word.

[0014] In one embodiment, acquiring the source address statement in the path statement according to the first characteristic word and the first end word includes:

[0015] A plurality of path words between the first characteristic word and the first end word are extracted to obtain the source address sentence.

[0016] In one embodiment, determining the second characteristic word and the second end word in the path statement includes:

[0017] Matching the path words in the path statement with pre-stored feature words to obtain the second feature words;

[0018] The path term in the path statement is matched with a pre-stored end word to obtain the second end word.

[0019] In one embodiment, acquiring the destination address statement in the path statement according to the second characteristic word and the second end word includes:

[0020] A plurality of path words between the second characteristic word and the second end word are extracted to obtain the destination address sentence.

[0021] In one embodiment, extracting the source address from the source address statement includes:

[0022] Matching multiple path words in the source address sentence with pre-stored feature words;

[0023] When the source address statement includes a target path word that matches the feature word, the path words between the target path word and the end symbol of the source address statement are continuously extracted to obtain source address sub-statements, until the source address sub-statement does not include a target path word that matches the feature word, and the source address sub-statement is used as the source address.

[0024] In one embodiment, it also includes:

[0025] The source address and the destination address are stored in text form, and the storage path is recorded.

[0026] A device for acquiring a data migration path, the device comprising:

[0027] A path statement acquisition module, used to acquire path statements;

[0028] A statement extraction module, used to determine a first characteristic word and a first end word in the path statement, and obtain a source address statement in the path statement according to the first characteristic word and the first end word; determine a second characteristic word and a second end word in the path statement, and obtain a destination address statement in the path statement according to the second characteristic word and the second end word;

[0029] A mobile path extraction module, used to extract a source address from the source address statement, and use the destination address statement as the destination address;

[0030] The migration path acquisition module is used to acquire the data migration path according to the source address and the destination address.

[0031] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0032] Get path statement;

[0033] Splitting the path statement to obtain a source address statement and a destination address statement;

[0034] Extracting a source address from the source address statement, and extracting a destination address from the destination address statement; the source address and the destination address are used to determine a data migration path;

[0035] A data migration path is obtained according to the source address and the destination address.

[0036] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0037] Get path statement;

[0038] Splitting the path statement to obtain a source address statement and a destination address statement;

[0039] Extracting a source address from the source address statement, and extracting a destination address from the destination address statement; the source address and the destination address are used to determine a data migration path;

[0040] A data migration path is obtained according to the source address and the destination address.

[0041] The method for obtaining a data migration path provided by the present invention obtains a path statement; determines a first feature word and a first end word in the path statement, and obtains a source address statement in the path statement according to the first feature word and the first end word; determines a second feature word and a second end word in the path statement, and obtains a destination address statement in the path statement according to the second feature word and the second end word; extracts a source address from the source address statement, and uses the destination address statement as the destination address; obtains a data migration path according to the source address and the destination address, and can automatically extract the source address and the destination address from the path statement, thereby determining the data migration path. When the path statement task volume is large, the speed is fast, the efficiency is high, and the accuracy is high. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 An application environment diagram of a method for obtaining a data migration path in an embodiment;

[0043] Figure 2 A schematic diagram of a flow chart of a method for obtaining a data migration path in one embodiment;

[0044] Figure 3 is a structural block diagram of a device for acquiring a data migration path in one embodiment;

[0045] Figure 4 is an internal structure diagram of a computer device in one embodiment;

[0046] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0048] The method for obtaining the data migration path provided by the present invention can be applied to Figure 1 In the application environment shown. Specifically, the server obtains a path statement; the server determines the first feature word and the first end word in the path statement, and obtains the source address statement in the path statement according to the first feature word and the first end word; determines the second feature word and the second end word in the path statement, and obtains the destination address statement in the path statement according to the second feature word and the second end word; the server extracts the source address from the source address statement, and uses the destination address statement as the destination address; the server obtains the data migration path according to the source address and the destination address. Among them, the server can be implemented as an independent server or a server cluster composed of multiple servers.

[0049] In one embodiment, Figure 2 As shown, a method for obtaining a data migration path is provided, and the method is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0050] Step S201, obtaining a path statement;

[0051] The path statement refers to the statement for processing data, specifically the query language corresponding to the database cluster, for example, the fully object-oriented HQL (Hibernate Query Language) query statement. The database cluster uses at least two or more database servers to form a virtual single database logical image to provide transparent data services to the client.

[0052] The path statement is composed of multiple path words, and the multiple path words include the source address and destination address of the data.

[0053] During the specific implementation process, the server can obtain the corresponding path statement from the database cluster.

[0054] Step S202, determine the first feature word and the first end word in the path statement, and obtain the source address statement in the path statement according to the first feature word and the first end word; determine the second feature word and the second end word in the path statement, and obtain the destination address statement in the path statement according to the second feature word and the second end word.

[0055] Among them, the source address statement refers to a statement including a data source address, and the destination address statement refers to a statement including a destination address of data; the first feature word refers to a feature word associated with the source address statement, and the first end word refers to a feature word associated with the source address statement.

[0056] In the specific implementation process, there are multiple feature words in the path statement, and different feature words represent different behaviors. By splitting the path statement according to the feature words, multiple statements can be obtained, and each statement processes the data differently.

[0057] For example, "select from" means to obtain data, "insert" means to output data to the destination address, "delete" means to delete data, and so on;

[0058] Step S203: extracting the source address from the source address statement, and using the destination address statement as the destination address.

[0059] The source address in the source address sentence is associated with a specific feature word, for example, the source address is connected with the specific feature word.

[0060] In the specific implementation process, the source address can be extracted by searching for feature words corresponding to the source address in the source address sentence.

[0061] For example, the source address statement is "select X from A", where "X" represents the selected data, then the source address "A" can be queried based on the feature word "from".

[0062] Likewise, the destination address in the destination address statement is also associated with another specific feature word, for example, the destination address is connected with the feature word corresponding to the destination address.

[0063] In the specific implementation process, the destination address can be extracted by searching for a feature word corresponding to the destination address in the destination address statement.

[0064] For example, if the destination address statement is "insert overwrite B", then the destination address "B" can be searched based on the feature word "insert overwrite".

[0065] Step S204: obtaining a data migration path according to the source address and the destination address.

[0066] The data migration path refers to the path along which data is migrated from a source address before processing to a destination address after processing.

[0067] In a specific implementation process, there may be a variety of different migration paths from the source address to the destination address, but once the source address and the destination address are determined, the set of all migration paths from the source address to the destination address is determined.

[0068] For example, if the source address is "A" and the destination address is "B", then the data migration path is the set of all paths from "A" to "B".

[0069] In the above-mentioned method for obtaining the data migration path, the path statement is obtained and split to obtain the source address statement and the destination address statement; the source address is extracted from the source address statement, and the destination address is extracted from the destination address statement; the source address and the destination address are used to determine the data migration path; then the data migration path is obtained according to the source address and the destination address, and the source address and the destination address can be automatically extracted from the path statement to determine the data migration path. When the path statement task volume is large, the efficiency is high and the accuracy is high.

[0070] In one embodiment, determining a first characteristic word and a first end word in a path statement includes:

[0071] Matching the path words in the path statement with the pre-stored feature words to obtain the first feature word;

[0072] In the specific implementation process, the server pre-stores feature words associated with the source address, matches multiple path words in the path statement with the pre-stored feature words respectively, and searches for the path word that is the same as the pre-stored feature word as the first feature word.

[0073] For example, the path word in the path statement is matched with the pre-stored "from" to obtain the position of "from" in the path word; and the matched "from" is used as the first feature word.

[0074] The path words in the path statement are matched with the pre-stored end words to obtain the first end word.

[0075] The server pre-stores an end word associated with the destination address, matches multiple path words in the path statement with the pre-stored end words respectively, and searches for the path word that is the same as the pre-stored end word as the first end word.

[0076] In the specific implementation process, after the first feature word is queried, the next path word of the first feature word is matched with at least one pre-stored end word respectively. If a path word identical to the pre-stored end word is queried, the path word identical to the pre-stored end word is used as the first end word. If the path word identical to the pre-stored end word is not queried, the next path word is continued to be matched with the pre-stored end word until a path word matching the pre-stored end word is obtained.

[0077] For example, the next path word of "from" is matched with pre-stored end words such as "delect", "and", and "on". If they do not match, the next path word of the unmatched path word is matched with pre-stored end words such as "delect", "and", and "on" until a word matching "delect" is obtained. The matched "delect" is used as the first end word, and "A" between "from" and "delect" is extracted. "A" is the source address statement.

[0078] Similarly, determining the second characteristic word and the second end word in the path statement includes:

[0079] Matching the path words in the path statement with the pre-stored feature words to obtain the second feature words;

[0080] In the specific implementation process, the server pre-stores feature words associated with the destination address, matches multiple path words in the path statement with the pre-stored feature words respectively, and searches for the path word that is the same as the pre-stored feature word as the second feature word.

[0081] For example, the path term in the path statement is matched with the pre-stored "insert overwrite" to obtain the position of "insert overwrite" in the path term; and the matched "insert overwrite" is used as the second characteristic word.

[0082] The path term in the path statement is matched with the pre-stored end word to obtain a second end word.

[0083] In the specific implementation process, after the second feature word is queried, the next path word of the second feature word is matched with at least one pre-stored end word respectively. If a path word identical to the pre-stored end word is queried, the path word identical to the pre-stored end word is used as the second end word. If the path word identical to the pre-stored end word is not queried, the next path word is continued to be matched with the pre-stored end word until a path word matching the pre-stored end word is obtained.

[0084] In a specific implementation process, the first end word and the second end word may be the same or different.

[0085] For example, the position of "insert overwrite" in the query path statement is selected, and "insert overwrite" is used as the first feature word; then the next path word path of "insert overwrite" is matched with pre-stored end words such as "left join". If there is no match, the next path word path of the unmatched path word is continued to be matched with pre-stored end words such as "leftjoin" until a path word matching "left join" is obtained, and "left join" is used as the first end word to extract "B" between "insert overwrite" and "left join". "B" is the destination address statement.

[0086] In one embodiment, obtaining a source address statement in the path statement according to the first characteristic word and the first end word includes:

[0087] A plurality of path words between the first characteristic word and the first end word are extracted to obtain the source address sentence.

[0088] Specifically, the first feature word indicates that the source address statement is about to begin, and the source address statement is connected to the first feature word; the first end word refers to the feature word associated with the source address statement, and the first end word indicates the beginning of the next statement, that is, the source address statement has ended, and the first end word is connected to the source address statement; therefore, you only need to query the positions of the first feature word and the first end word, and extract multiple path words between the first feature word and the first end word to obtain the source address statement.

[0089] In the specific implementation process, there are multiple feature words in the path statement, and different feature words represent different behaviors. For example, "select from" represents obtaining data, "insert overwrite" represents outputting data to the destination address, "delect" represents deleting data, and so on.

[0090] For example, the path statement is:

[0091] “select X from A

[0092] delect Y of X

[0093] insert overwrite B

[0094] left join…”

[0095] Then determine the position of "from" in the path statement, and use "from" as the first feature word; determine the position of "delect" in the path statement, and use "delect" as the first end word.

[0096] The second characteristic word and the second end word in the path statement are determined, and a plurality of path words between the second characteristic word and the second end word are extracted to obtain a destination address statement.

[0097] Similarly, the second feature word refers to the feature word associated with the destination address statement. The second feature word indicates that the destination address statement is about to begin, and the destination address statement is connected to the second feature word; the second end word refers to the feature word associated with the destination address statement. The second end word indicates the beginning of the next statement, that is, the destination address statement has ended, and the second end word is connected to the destination address statement.

[0098] Therefore, the destination address statement can be obtained by only searching for the positions of the second feature word and the second end word and extracting a plurality of path words between the second feature word and the second end word.

[0099] Similarly, determine the position of "insert overwrite" in the path statement, and use "insertoverwrite" as the second feature word; determine the position of "left join" in the path statement, and use "left join" as the second end word, extract the path words between "insert overwrite" and "left join", and you can get the destination address statement.

[0100] In one embodiment, extracting the source address from the source address statement includes:

[0101] Match multiple path words in the source address statement with pre-stored feature words.

[0102] In the specific implementation process, since the source address statement may have further restrictions on the source address, it is necessary to query whether the source address statement also includes feature words.

[0103] For example, the path statement is:

[0104] “select X from……(……from A)

[0105] delect Y of X

[0106] insert overwrite B

[0107] left join…”

[0108] Then the corresponding source address statement is "...(...from A)".

[0109] When the source address statement includes a target path word that matches the feature word, the path words between the target path word and the end symbol of the source address statement are continuously extracted to obtain the source address sub-statements, until the source address sub-statements do not include the target path word that matches the feature word, and the source address sub-statements are used as the source address.

[0110] In the specific implementation process, when the source address statement includes a target path word that matches the feature word, it means that the source address statement has further limitations on the source address. Therefore, the source address statement needs to be further split, and the path words between the target path word and the end symbol of the source address statement are continuously extracted to obtain the source address sub-statements until the source address sub-statements do not include the target path word that matches the feature word.

[0111] For example, when the source address statement is "...(...from A)", the path terms that match "from" in the source address statement are queried, and the path terms between "from" and the end symbol are further extracted to obtain the source address sub-statement "A". When "A" does not include the path terms that match "from", "A" is used as the source address.

[0112] This embodiment describes the situation where the source address is not accompanied by an owner, wherein the owner refers to the specific owner of the file corresponding to the source address. When the source address is accompanied by an owner, the path words between the target path words and the end symbol of the source address statement are continuously extracted to obtain source address sub-statements, until the source address sub-statement does not include the target path word that matches the feature word, and the source address sub-statement is split to obtain the owner and the source address.

[0113] In one embodiment, extracting the destination address from the destination address statement includes:

[0114] Use the destination address statement as the destination address.

[0115] In a specific implementation process, since the destination address statement usually does not further limit the destination address, the destination address statement is directly used as the destination address.

[0116] For example, if the destination address statement obtained is "B", then "B" is directly used as the destination address.

[0117] In one embodiment, the method further comprises:

[0118] Store the source address and destination address in text form and record the storage path.

[0119] In the specific implementation process, since it is necessary to read the scheduling document filled with the source address and the destination address to execute the platform deployment task, the acquired source address and the destination address need to be stored in text form and the storage path is recorded.

[0120] For example, a source address "A" and a destination address "B" are obtained, "A", "B" and the corresponding relationship between "A" and "B" are stored in text form, and the storage path is recorded.

[0121] It should be understood that although Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0122] In one embodiment, if Figure 3 As shown, a device for obtaining a data migration path is provided, and the device includes:

[0123] A path statement acquisition module 301 is used to acquire a path statement;

[0124] The sentence extraction module 302 is used to determine the first characteristic word and the first end word in the path sentence, and obtain the source address sentence in the path sentence according to the first characteristic word and the first end word; determine the second characteristic word and the second end word in the path sentence, and obtain the destination address sentence in the path sentence according to the second characteristic word and the second end word;

[0125] A moving path extraction module 303, used to extract a source address from the source address statement, and use the destination address statement as the destination address;

[0126] The migration path acquisition module 304 is used to acquire the data migration path according to the source address and the destination address.

[0127] In one embodiment, the sentence extraction module 302 includes:

[0128] A first feature word determination unit, configured to match the path words in the path statement with pre-stored feature words to obtain the first feature word;

[0129] The first end word determining unit is used to match the path words in the path statement with the pre-stored end words to obtain the first end word.

[0130] In one embodiment, the sentence extraction module 302 further includes:

[0131] The source address sentence obtaining unit is used to extract a plurality of path words between the first feature word and the first end word to obtain the source address sentence.

[0132] In one embodiment, the sentence extraction module 302 further includes:

[0133] A second feature word determination unit, configured to match the path words in the path sentence with pre-stored feature words to obtain the second feature words;

[0134] The second end word determining unit is used to match the path term in the path statement with a pre-stored end word to obtain the second end word.

[0135] In one embodiment, the sentence extraction module 302 further includes:

[0136] The destination address sentence obtaining unit is used to extract a plurality of path words between the second feature word and the second end word to obtain the destination address sentence.

[0137] In one embodiment, the moving path extraction module includes:

[0138] A matching unit, used for matching a plurality of path words in a source address sentence with pre-stored feature words;

[0139] The source address acquisition unit is used to continuously extract the path words between the target path words and the end symbol of the source address sentence when the source address sentence includes the target path words that match the feature words, and obtain the source address sub-sentences, until the source address sub-sentence does not include the target path words that match the feature words, and the source address sub-sentences are used as the source address.

[0140] In one embodiment, it also includes:

[0141] The storage module is used to store the source address and the destination address in text form and record the storage path.

[0142] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a device bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating device, a computer program and a database. The internal memory provides an environment for the operation of the operating device and the computer program in the non-volatile storage medium. The database of the computer device is used to store data involved in the acquisition of the data migration path. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for acquiring a data migration path is implemented.

[0143] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 5As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for obtaining a data migration path is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0144] Those skilled in the art will understand that Figure 4-5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0145] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: obtaining a path statement; determining a first feature word and a first end word in the path statement, and obtaining a source address statement in the path statement according to the first feature word and the first end word; determining a second feature word and a second end word in the path statement, and obtaining a destination address statement in the path statement according to the second feature word and the second end word; extracting a source address from the source address statement, and using the destination address statement as the destination address; and obtaining a data migration path according to the source address and the destination address.

[0146] In one embodiment, when the processor executes a computer program, determining the first feature word and the first end word in the path statement includes: matching the path words in the path statement with pre-stored feature words to obtain the first feature word; matching the path words in the path statement with pre-stored end words to obtain the first end word.

[0147] In one of the embodiments, when the processor executes the computer program, obtaining the source address statement in the path statement according to the first feature word and the first end word includes: extracting multiple path words between the first feature word and the first end word to obtain the source address statement.

[0148] In one embodiment, when the processor executes a computer program, it determines the second characteristic word and the second end word in the path statement, including: matching the path word in the path statement with a pre-stored characteristic word to obtain the second characteristic word; matching the path word in the path statement with a pre-stored end word to obtain the second end word.

[0149] In one embodiment, when the processor executes the computer program, obtaining the destination address statement in the path statement according to the second feature word and the second end word includes: extracting multiple path words between the second feature word and the second end word to obtain the destination address statement.

[0150] In one of the embodiments, when the processor executes the computer program, extracting the source address from the source address statement includes: matching multiple path terms in the source address statement with pre-stored feature terms; when the source address statement includes a target path term that matches the feature term, continuously extracting the path terms between the target path term and the end symbol of the source address statement to obtain source address sub-sentences, until the source address sub-sentence does not include the target path term that matches the feature term, and using the source address sub-sentence as the source address.

[0151] In one of the embodiments, when the processor executes the computer program, the process further includes: storing the source address and the destination address in text form, and recording the storage path.

[0152] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining a path statement; determining a first feature word and a first end word in the path statement, and obtaining a source address statement in the path statement based on the first feature word and the first end word; determining a second feature word and a second end word in the path statement, and obtaining a destination address statement in the path statement based on the second feature word and the second end word; extracting a source address from the source address statement, and using the destination address statement as the destination address; and obtaining a data migration path based on the source address and the destination address.

[0153] In one embodiment, when the computer program is executed by the processor, determining the first feature word and the first end word in the path statement includes: matching the path words in the path statement with pre-stored feature words to obtain the first feature word; matching the path words in the path statement with pre-stored end words to obtain the first end word.

[0154] In one embodiment, when the computer program is executed by the processor, obtaining the source address statement in the path statement according to the first feature word and the first end word includes: extracting multiple path words between the first feature word and the first end word to obtain the source address statement.

[0155] In one embodiment, when the computer program is executed by the processor, the second characteristic word and the second end word in the path statement are determined, including: matching the path word in the path statement with the pre-stored characteristic word to obtain the second characteristic word; matching the path word in the path statement with the pre-stored end word to obtain the second end word.

[0156] In one embodiment, when the computer program is executed by the processor, obtaining the destination address statement in the path statement according to the second feature word and the second end word includes: extracting multiple path words between the second feature word and the second end word to obtain the destination address statement.

[0157] In one embodiment, when the computer program is executed by the processor, the source address is extracted from the source address statement, including: matching multiple path terms in the source address statement with pre-stored feature terms; when the source address statement includes a target path term that matches the feature term, continuously extracting the path terms between the target path term and the end symbol of the source address statement to obtain source address sub-sentences, until the source address sub-sentence does not include the target path term that matches the feature term, and using the source address sub-sentence as the source address.

[0158] In one of the embodiments, when the computer program is executed by the processor, it also includes: storing the source address and the destination address in text form, and recording the storage path.

[0159] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0160] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0161] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for those of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A method for obtaining a data migration path, characterized in that: The method comprises: Obtain a path statement; the path statement is a query language corresponding to the database cluster, the path statement is composed of a plurality of path terms, and the plurality of path terms include a source address and a destination address of the data; Match the path words in the path statement with pre-stored feature words to obtain a first feature word in the path statement; match the path words in the path statement with pre-stored end words to obtain a first end word in the path statement, and obtain a source address statement in the path statement according to the first feature word and the first end word; match the path words in the path statement with pre-stored feature words to obtain a second feature word in the path statement; match the path words in the path statement with pre-stored end words to obtain a second end word in the path statement, and obtain a destination address statement in the path statement according to the second feature word and the second end word; the source address statement is a statement including the source address of the data, and the destination address statement is a statement including the destination address of the data; Matching multiple path terms in the source address statement with pre-stored feature terms; when the source address statement includes a target path term that matches the feature term, continuously extracting the path term between the target path term and the end symbol of the source address statement to obtain a source address sub-statement, until the source address sub-statement does not include a target path term that matches the feature term, using the source address sub-statement as the source address, and using the destination address statement as the destination address; A data migration path is acquired according to the source address and the destination address; the data migration path is a path for the data to be migrated from the source address before processing to the destination address after processing.

2. The method according to claim 1, characterized in that The acquiring the source address statement in the path statement according to the first characteristic word and the first end word includes: A plurality of path words between the first characteristic word and the first end word are extracted to obtain the source address sentence.

3. The method according to claim 1, characterized in that The acquiring the destination address statement in the path statement according to the second characteristic word and the second end word includes: A plurality of path words between the second characteristic word and the second end word are extracted to obtain the destination address sentence.

4. The method according to claim 1, characterized in that: Also includes: The source address and the destination address are stored in text form, and the storage path is recorded.

5. A device for acquiring a data migration path, characterized in that: The device comprises: A path statement acquisition module, used to acquire a path statement; the path statement is a query language corresponding to a database cluster, the path statement is composed of a plurality of path terms, and the plurality of path terms include a source address and a destination address of data; A statement extraction module, used for matching the path words in the path statement with pre-stored feature words to obtain a first feature word in the path statement; matching the path words in the path statement with pre-stored end words to obtain a first end word in the path statement, and obtaining a source address statement in the path statement according to the first feature word and the first end word; matching the path words in the path statement with pre-stored feature words to obtain a second feature word in the path statement; matching the path words in the path statement with pre-stored end words to obtain a second end word in the path statement, and obtaining a destination address statement in the path statement according to the second feature word and the second end word; the source address statement is a statement including the source address of the data, and the destination address statement is a statement including the destination address of the data; A mobile path extraction module, used for matching multiple path words in the source address statement with pre-stored feature words; when the source address statement includes a target path word matching the feature word, continuously extracting the path words between the target path word and the end symbol of the source address statement to obtain a source address sub-statement, until the source address sub-statement does not include the target path word matching the feature word, using the source address sub-statement as the source address, and using the destination address statement as the destination address; The migration path acquisition module is used to acquire a data migration path according to the source address and the destination address; the data migration path is a path for the data to migrate from the source address before processing to the destination address after processing.

6. The device according to claim 5, characterized in that The sentence extraction module also includes: The source address sentence obtaining unit is used to extract a plurality of path words between the first feature word and the first end word to obtain the source address sentence.

7. The device according to claim 5, characterized in that The sentence extraction module also includes: The destination address sentence obtaining unit is used to extract a plurality of path words between the second feature word and the second end word to obtain the destination address sentence.

8. The device according to claim 5, characterized in that The device also includes: The storage module is used to store the source address and the destination address in text form and record the storage path.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Place name and address extraction method and apparatus

    CN105068989A