Number warehouse field naming method and device, electronic equipment and storage medium
By dividing and translating the data warehouse field, the target word translation is determined by the preset 词 root list, and it is used as a field name to solve the problem of the field naming in the data warehouse. sex.
Patent Information
- Application Number
- CN202310928584.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-26
- Publication Date
- 2025-01-28
AI Technical Summary
In the prior art, field naming in data warehouses lacks standardization, resulting in different field naming of fields with the same meaning, making it difficult to achieve consistency of field naming.
By obtaining the list of naming texts and presets, refer to the preset lyric root in the preset lyric list to treat the naming text to divide the word, determine the target translation corresponding to the target segmentation, and based on the target translation of the business table in the digital warehouse model The field is named.
The consistency of the naming naming of the digital section is implemented, and the accuracy of the data specifications and the field name is improved.
Smart Images

Figure CN119377210A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of computer technology, and specifically to a data warehouse field naming method, device, electronic device, and storage medium, wherein the storage medium includes a computer-readable storage medium. Background Art
[0002] As the amount of business data grows, the number of fields in the data warehouse (database of the data warehouse model) increases. Currently, the naming of fields mainly relies on the English knowledge of R&D personnel themselves, resulting in different naming of fields with the same meaning, which is not conducive to the unification of platform specifications.
[0003] However, since the data warehouse has many fields, it is not convenient for R&D personnel to find field names from the data warehouse, and it is difficult to achieve consistent field naming. Summary of the invention
[0004] The embodiments of the present application provide a data warehouse field naming method, device, electronic device and storage medium, which can quickly achieve consistency in data warehouse field names and improve data standards.
[0005] The present application embodiment provides a data warehouse field naming method, including:
[0006] Obtaining a text to be named and a preset root list, wherein the preset root list includes preset roots and preset word translations corresponding to the preset roots;
[0007] Performing word segmentation processing on the text to be named with reference to the preset word roots in the preset word root list to obtain target word segments;
[0008] Determining a target word translation corresponding to the target word segmentation according to the preset word root and the preset word translation corresponding to the preset word root;
[0009] The business table field corresponding to the to-be-named text in the target data warehouse model is named according to the target word translation.
[0010] Accordingly, the embodiment of the present application further provides a data warehouse field naming device, including:
[0011] An acquisition module, used for acquiring a text to be named and a preset root list, wherein the preset root list includes preset roots and preset word translations corresponding to the preset roots;
[0012] A word segmentation module, used for performing word segmentation processing on the text to be named with reference to the preset word roots in the preset word root list to obtain target word segments;
[0013] A translation module, used for determining a target word translation corresponding to the target word segmentation according to the preset root and the preset word translation corresponding to the preset root;
[0014] A naming module is used to name the business table field corresponding to the to-be-named text in the target data warehouse model according to the target word translation.
[0015] Optionally, in some embodiments of the present application, the target word segmentation includes at least two, and the naming module includes:
[0016] A generating unit, configured to generate a target field name according to the word order of each target word in the to-be-named text and the target word translation corresponding to each target word;
[0017] The naming unit is used to name the business table field corresponding to the to-be-named text in the target data warehouse model according to the target field name.
[0018] Optionally, in some embodiments of the present application, the word segmentation module includes:
[0019] A first determining unit, configured to determine a first word segment from the text to be named according to a preset word root in the preset word root list;
[0020] A filtering unit, used for filtering the first word segmentation from the text to be named to obtain a local naming text;
[0021] A second determining unit, configured to determine a second participle from the local naming text according to the preset root;
[0022] The third determining unit is configured to take both the first participle and the second participle as target participles.
[0023] Optionally, in some embodiments of the present application, the first determining unit includes:
[0024] A first determining subunit, configured to use the text to be named as a first word segmentation if the text to be named matches a preset root in the preset root list;
[0025] The second determination subunit is used to delete the last character of the text to be named if it does not match the preset root in the preset root list to obtain a transition matching text, and determine the first word segmentation from the transition matching text according to the preset root.
[0026] In some embodiments of the present application, the generating unit includes:
[0027] an abbreviation determination subunit, used to determine the target translation abbreviation corresponding to each target word translation;
[0028] The generating subunit is used to connect the abbreviations of the target translations in series according to the word order of the target segmented words in the text to be named by using a preset connector to obtain the target field name.
[0029] In some embodiments of the present application, the device further includes a building module, and the building module includes:
[0030] An acquisition unit, configured to acquire business table field names from a database of the target data warehouse model, and acquire Chinese annotations corresponding to the business table field names;
[0031] A processing unit, configured to perform word segmentation processing on the Chinese annotation to obtain at least two sample nouns;
[0032] A translation unit, for translating each sample noun to obtain a sample translation name;
[0033] A construction unit is used to establish a preset root list according to the sample nouns and the sample translation names, wherein the sample names correspond to preset roots in the preset root list, and the sample translation names correspond to preset word translations in the preset root list.
[0034] In some embodiments of the present application, the processing unit includes:
[0035] Get subunit, used to get business specific terms;
[0036] A word segmentation subunit is used to refer to the business-specific noun and perform word segmentation processing on the Chinese annotation through a preset word segmentation model to obtain at least two sample nouns;
[0037] The preset word segmentation model includes at least one of a maximum probability word segmentation model, a hidden Markov model or a hybrid model, wherein the hybrid model is jointly constructed based on the maximum probability word segmentation model and the hidden Markov model.
[0038] In some embodiments of the present application, the sample nouns include business proper nouns and non-business proper nouns, and the translation unit includes:
[0039] A first translation subunit is used to obtain at least two first translation results of the business proper noun from the database of the target data warehouse model, and use the first translation result greater than a preset frequency threshold as a sample translation name of the business proper noun;
[0040] The second translation subunit is used to translate the non-business proper nouns according to a preset translation tool to obtain sample translated names of the non-business proper nouns.
[0041] In a third aspect, an embodiment of the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps in the above-mentioned data warehouse field naming method when executed by the processor.
[0042] In a fourth aspect, an embodiment of the present application further provides a storage medium, the storage medium comprising a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned data warehouse field naming method are implemented.
[0043] In a fifth aspect, the embodiments of the present application further provide a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations described in the embodiments of the present application.
[0044] The embodiment of the present application obtains a text to be named and a preset root list, performs word segmentation processing on the text to be named by referring to the preset roots in the preset root list, obtains a target word segmentation, and determines the target word translation corresponding to the target word segmentation according to the preset root and the preset word translation corresponding to the preset root. Subsequently, the business table field corresponding to the text to be named in the target data warehouse model is named according to the target word translation. Among them, by referring to the preset roots and preset word translations in the preset root list to segment and translate the text to be named, and using the translation results as the names of the business table fields, the accuracy of the business table field names is improved. Among them, by referring to the preset root list for word segmentation and translation, the consistency of data warehouse field naming is also achieved, thereby improving data standardization. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0046] Figure 1 This is a scenario diagram of a data warehouse field naming method provided in an embodiment of the present application;
[0047] Figure 2 It is a flowchart of a data warehouse field naming method provided in an embodiment of the present application;
[0048] Figure 3 This is another flowchart of the data warehouse field naming method provided in an embodiment of the present application;
[0049] Figure 4 It is a structural diagram of a data warehouse field naming device provided in an embodiment of the present application;
[0050] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0052] The embodiments of the present application provide a data warehouse field naming method, device, electronic device and storage medium. Specifically, the embodiments of the present application provide a data warehouse field naming device suitable for electronic devices, wherein the electronic device includes a terminal device or a server, and the terminal device includes a laptop, a touch screen, a computer, or a personal computer (PC, Personal Computer) and other devices. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms. The server can be directly or indirectly connected via wired or wireless communication.
[0053] In the embodiment of the present application, the data warehouse field naming method can be executed by the terminal device, or by the server, or by the terminal device and the server together. For example, see Figure 1 , Figure 1 : is a schematic diagram of a scenario in which a terminal device and a server jointly execute the data warehouse field naming method provided in an embodiment of the present application, wherein the specific execution process of the terminal device and the server jointly executing the data warehouse field naming method is as follows:
[0054] The terminal device 10 receives the text to be named input through the text input interface, and then sends the text to be named to the server 11, and the server 11 performs a naming process on the text to be named, specifically:
[0055] After receiving the text to be named, the server 11 obtains a preset root list, which includes preset roots and preset word translations corresponding to the preset roots. Subsequently, the server 11 performs word segmentation on the text to be named with reference to the preset roots in the preset root list to obtain target word segmentation, and determines the target word translation corresponding to the target word segmentation according to the preset roots and the preset word translation corresponding to the preset roots. Then, the business table field corresponding to the text to be named in the target data warehouse model is named according to the target word translation.
[0056] It can be understood that in an embodiment of the present application, the target word translation can be directly named into the database field of the target data warehouse model, or the target word translation can be returned to the interface of the terminal device 10, and the user or R&D personnel can create and name a new business table field based on the target word translation.
[0057] Correspondingly, in an embodiment of the present application, the data warehouse field naming method can be executed by an application. For example, a text input window and a text output window are configured in the application, and a naming conversion button is configured. When the user enters the text to be named through the text input window and clicks the naming conversion button in the interface, the corresponding target word translation is output in the text output window.
[0058] It can be understood that the embodiment of the present application improves the accuracy of the business table field name by referring to the preset root word list and the preset word translation to segment and translate the named text, and uses the translation result as the name of the business table field. Among them, by referring to the preset root word list for segmentation and translation, the consistency of the data warehouse field naming is also achieved, and the data standardization is improved.
[0059] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.
[0060] See also Figure 2 , Figure 2 A flowchart of a data warehouse field naming method provided in an embodiment of the present application. The specific process of the data warehouse field naming method is as follows:
[0061] 101. Obtain a text to be named and a preset root list, wherein the preset root list includes preset roots and preset word translations corresponding to the preset roots.
[0062] It can be understood that in the embodiment of the present application, the text to be named is a piece of Chinese text, corresponding to the Chinese meaning expressed by the field in the data warehouse (database), for example, the name of the receiving company, the name of the receiving customer, or whether the customer has changed the consignee address, etc.
[0063] It is understandable that in the embodiment of the present application, the text to be named can be obtained by interface text input, for example, the user inputs the text to be named through the provided interface. Optionally, in the embodiment of the present application, the text to be named can also be the Chinese annotation corresponding to the field in the current database. For example, when it is necessary to unify and standardize the naming of fields in the database, the table fields corresponding to each business table in the database can be automatically obtained, and the Chinese annotation of the table field can be obtained.
[0064] It should be noted that in the embodiment of the present application, the preset root list is a pre-constructed list containing preset roots and preset word translations corresponding to the preset roots. Through this preset root list, a reference can be provided for the naming of business table fields in the database. When the names of each field refer to the preset root list, the field names can be kept consistent, thereby realizing the standardization of data warehouse naming.
[0065] 102. Perform word segmentation processing on the text to be named with reference to preset word roots in the preset word root list to obtain target word segments.
[0066] It can be understood that in the embodiment of the present application, the preset root is the smallest combination unit of naming, and the length of the Chinese root is generally 2-6 characters. For example, the preset root can be a noun such as company, customer, time, age, etc.
[0067] It should be noted that when the text to be named is segmented, nouns contained in the text to be named that are the same as the preset root word do not need to be segmented, that is, these nouns are retained and not split. Correspondingly, the target segmented words constitute the text to be named, and the corresponding target segmented words after the segmentation processing also correspond to the corresponding preset root words, that is, each target segmented word corresponds to a preset root word. That is, the text to be named is segmented with reference to the preset root word, so as to segment the text to be named into one or more preset root words.
[0068] Among them, the target segmentation is obtained by performing segmentation processing on the text to be named, so that the text to be named can be named through the minimum combination unit corresponding to the target segmentation.
[0069] 103. Determine a target word translation corresponding to the target word segmentation according to the preset word root and the preset word translation corresponding to the preset word root.
[0070] It should be noted that the preset word translation is the translation result of the corresponding preset root word. For example, in the embodiment of the present application, the preset root word mainly refers to Chinese, and the preset word translation is the corresponding English translation. Accordingly, since the database fields are mainly named in English, the target word translation determined based on the preset word translation can be directly used for the naming of the business table fields.
[0071] It can be understood that, since each target participle corresponds to a preset root word, the preset word translation corresponding to the preset root word can be used as the target word translation corresponding to the target participle.
[0072] Correspondingly, based on the correspondence between the preset word roots and the preset word translations, the target word translation corresponding to the target word segmentation can be quickly acquired.
[0073] 104. Name the business table field corresponding to the to-be-named text in the target data warehouse model according to the target word translation.
[0074] It can be understood that the data warehouse model corresponds to a database storing data, and the target data warehouse model is the database targeted by the embodiment of the present application. Correspondingly, the business table field corresponds to a data table of a business, which can be a waybill record, employee information management, etc.
[0075] Among them, based on the preset root in the preset root list and the preset word translation corresponding to the preset root as a reference, the unified naming of the business table field names in the data warehouse model can be achieved, the consistency of field naming can be improved, and the data standardization can be improved.
[0076] Optionally, the text to be named may include multiple target segmentations. Therefore, in an embodiment of the present application, a corresponding target word translation may be determined for each target segmentation, and then the business table field may be named according to each target word translation. That is, optionally, in some embodiments of the present application, the target segmentation includes at least two steps, and the step of "naming the business table field corresponding to the text to be named in the target data warehouse model according to the target word translation" includes:
[0077] Generate a target field name according to the word order of each target word in the to-be-named text and the target word translation corresponding to each target word;
[0078] The business table field corresponding to the to-be-named text in the target data warehouse model is named according to the target field name.
[0079] It can be understood that the word order is the order of the target word segments in the text to be named. For example, two target word segments are obtained from the word segmentation process in the text to be named. Then, the two target word segments have a word order based on the order in the text to be named.
[0080] Among them, since the target participle corresponds to the root word, which is the smallest combination unit, the target word translation is obtained by translating each target participle separately, thereby improving the accuracy of the translation of the text to be named. After combining the translations of each target word, the translation result corresponding to the entire text to be named (i.e., the target field result) can be obtained.
[0081] Optionally, in an embodiment of the present application, target segmented words may be determined one by one from the text to be named according to preset word roots. That is, optionally, in some embodiments of the present application, the step of "performing segmentation processing on the text to be named with reference to preset word roots in the preset word root list to obtain target segmented words" includes:
[0082] Determining a first participle from the text to be named according to a preset root in the preset root list;
[0083] Filter the first word segmentation from the text to be named to obtain a local naming text;
[0084] Determining a second participle from the local naming text according to the preset root;
[0085] The first participle and the second participle are both used as target participles.
[0086] It can be understood that by determining the segmented words in the text to be named one by one, the screening of each target segmented word in the text to be named can be achieved.
[0087] Optionally, in an embodiment of the present application, the target word segmentation can be screened from the text by a circular matching method, that is, optionally, in some embodiments of the present application, the step of "determining the first word segmentation from the text to be named according to the preset word root in the preset word root list" includes:
[0088] If the text to be named matches a preset root in the preset root list, the text to be named is used as the first participle;
[0089] If the text to be named does not match the preset root in the preset root list, the last character of the text to be named is deleted to obtain a transitional matching text, and the first word segmentation is determined from the transitional matching text according to the preset root.
[0090] For example, take the text to be named as "Number of trunk line departure delays" as an example, specifically:
[0091] Search for 'trunk departure delay times' in the preset root word. If it exists, directly use 'trunk departure delay times' as the target word. If it does not exist, search in the following order, specifically:
[0092] Search for 'number of trunk line departure delays' in the preset word roots, but there is no corresponding preset word root;
[0093] Search for 'main line departure delay times' in the preset word roots, but there is no corresponding preset word root;
[0094] Search for 'main line departure delay' in the preset root words, but there is no corresponding preset root word;
[0095] Search for 'late departure on the main line' in the preset root words, no corresponding preset root word is found;
[0096] Search for 'departure on the main line' in the preset root words, no corresponding preset root word is found;
[0097] Search for 'departure on the main line' in the preset root words, no corresponding preset root word is found;
[0098] Search for'main line' in the preset root words, found, then take'main line' as the first participle;
[0099] Search for 'number of late departures' in the preset root words, no corresponding preset root word is found;
[0100] Search for 'number of late departures' in the preset root words, no corresponding preset root word is found;
[0101] Search for 'late departure' in the preset root words, no corresponding preset root word is found;
[0102] Search for 'late departure' in the preset root words, no corresponding preset root word is found;
[0103] Search for 'departure' in the preset root words, found, then take 'departure' as the second participle;
[0104] Search for 'number of late arrivals' in the preset root words, no corresponding preset root word is found;
[0105] Search for 'number of late arrivals' in the preset root words, no corresponding preset root word is found;
[0106] Search for 'late arrival' in the preset root words, found, then take 'late arrival' as the third participle;
[0107] Search for 'number of times' in the preset root words, found, then take 'number of times' as the fourth participle;
[0108] In this way, the matching and screening of each target participle in the text to be named 'number of late departures on the main line' are realized.
[0109] Among them, through loop matching, the accuracy of root word matching hit is improved.
[0110] Correspondingly, after determining each target participle, the corresponding target word translations can be spliced according to the word order of each target participle to obtain the target field name. For example, the target word translation corresponding to'main line' is: main_trans, the target word translation corresponding to 'departure' is: depart, the target word translation corresponding to 'late arrival' is: delay, and the target word translation corresponding to 'number of times' is: cnt. Then the target field name corresponding to this text to be named, that is, the English name is: main_trans_depart_delay_cnt.
[0111] Optionally, in an embodiment of the present application, since the translated name corresponding to the root word is relatively long, the translated name may be replaced by its abbreviation to obtain a target field name with a short character structure, that is, optionally, in some embodiments of the present application, the step of "generating a target field name according to the word order of each target segmentation in the text to be named and the target word translation corresponding to each target segmentation" includes:
[0112] Determine the target translation abbreviation corresponding to each target word translation;
[0113] According to the word order of each target word segment in the to-be-named text, each target translation abbreviation is concatenated through a preset connector to obtain a target field name.
[0114] Among them, by replacing the translated text with the translated text abbreviation, a target field name with a short character structure can be obtained, which reduces the amount of data and improves the neatness and standardization of the data.
[0115] Among them, in an embodiment of the present application, the translation abbreviation corresponding to each translation can be determined by means of probability statistics. For example, an abbreviation with a higher frequency of occurrence is used as the translation abbreviation of the translation, that is, a preset word translation abbreviation is constructed for the preset word translation. Correspondingly, the preset word translation abbreviation can be stored in the preset root list.
[0116] It is understandable that before obtaining the preset root list, it is necessary to first build or update the preset root list. The preset root list can be obtained by referring to the names of existing fields in the data warehouse and the Chinese annotations corresponding to the names. For example, the names of each field and the corresponding Chinese annotations are counted to build the preset root list.
[0117] However, due to the growth of business, the amount of data is also increasing, and the number of R&D staff is also increasing. Different R&D personnel have different English reserves and naming habits, which will lead to irregular field naming and inconvenient management. Therefore, in an embodiment of the present application, it is necessary to unify the English translation corresponding to the same Chinese annotation. For example, the frequency of occurrence of the English translation corresponding to each Chinese annotation in the database is counted, and the English translation with the highest frequency of occurrence is used as the final translation of the Chinese annotation.
[0118] However, if the Chinese annotation is long and contains many root words, the translation results are likely to be different. For example, for the Chinese annotation: "Do you want to change the consignee's address?", the translation result may be: "Do you want to change therecipient's address." Since the translation result is a question sentence and obviously does not conform to the translation intention, the translation result corresponding to the Chinese annotation with more characters may not be accurate, and it is difficult to count the more concentrated or high-frequency translation results.
[0119] Therefore, in the embodiment of the present application, the Chinese annotation can be segmented to obtain multiple word roots, and the final translation corresponding to the Chinese annotation can be obtained according to the translation results of each word root. That is, optionally, in some embodiments of the present application, before the step of "obtaining the text to be named and the preset word root list", the method further includes:
[0120] Obtaining business table field names from the target data warehouse model, and obtaining Chinese annotations corresponding to the business table field names;
[0121] Performing word segmentation processing on the Chinese annotation to obtain at least two sample nouns;
[0122] For each sample noun, the sample noun is translated to obtain a sample translated name;
[0123] A preset root word list is established according to the sample nouns and the sample translation names, wherein the sample names correspond to preset roots in the preset root word list, and the sample translation names correspond to preset word translations in the preset root word list.
[0124] Among them, in the embodiment of the present application, before the Chinese annotations are segmented, the Chinese annotations can also be cleaned and numbers, English, punctuation, control and single characters can be removed to improve the accuracy of word segmentation.
[0125] It is understandable that when the sample translation name corresponding to each sample noun is ensured to be accurate, the accuracy of the overall translation result of the Chinese annotation can be improved. When translating each sample noun, there will be no interrogative sentences and the like, which has a higher accuracy. The translation results of each sample noun are also easier to count, which facilitates and speeds up the determination of the translation results corresponding to the Chinese annotation.
[0126] Among them, in the embodiment of the present application, the preset root list is not constructed directly based on the Chinese annotations, but the preset root list is constructed based on the sample nouns of the Chinese annotations after word segmentation and their corresponding sample translation names, which can facilitate the matching of roots of the text to be named after word segmentation, and then quickly realize the naming of the field name.
[0127] Optionally, based on the progress of business development, some commonly used nouns will be generated. Therefore, in order to match business needs, in an embodiment of the present application, business-specific nouns can be pre-configured, and word segmentation can be performed based on the business-specific nouns to avoid word segmentation and splitting of business-specific nouns. That is, optionally, in an embodiment of the present application, the step of "segmenting the Chinese annotation to obtain at least two sample nouns" includes:
[0128] Get business terms;
[0129] Referring to the business-specific nouns, performing word segmentation processing on the Chinese annotations through a preset word segmentation model to obtain at least two sample nouns;
[0130] The preset word segmentation model includes at least one of a maximum probability word segmentation model, a hidden Markov model or a hybrid model, wherein the hybrid model is jointly constructed based on the maximum probability word segmentation model and the hidden Markov model.
[0131] It is understandable that in the embodiments of the present application, business-specific terms include company internal product names, system names, operating procedures, conventional phrases, etc.
[0132] Among them, the Chinese annotations are segmented by business-specific nouns to ensure that the business-specific nouns in the Chinese annotations will not be split and that the splitting results meet business requirements.
[0133] Among them, maximum probability word segmentation is the most important statistical method of word segmentation. A string to be segmented has multiple word segmentation results. The principle of maximum probability word segmentation is to use the one with the highest probability as the word segmentation result of the string, that is, to select the word segmentation path with the highest probability as the optimal result.
[0134] Among them, the Hidden Markov Model (HMM) is a statistical model used to describe a Markov process with hidden unknown parameters.
[0135] Among them, the hybrid model is obtained by jointly constructing the maximum probability word segmentation model and the hidden Markov model based on business and word segmentation requirements. For example, weights are configured for the word segmentation results of the two models, and the final splitting results are determined according to the weights. For another example, nouns with higher frequency of occurrence are screened out based on the analysis results of the two models.
[0136] Accordingly, based on business proper nouns, nouns are divided into business proper nouns and common nouns (common nouns are non-business proper nouns). Therefore, based on different types of nouns, different translation methods can be selected to obtain corresponding word translations. For example, business proper nouns can be determined by the frequency of occurrence of corresponding translations in the data warehouse, and for non-business proper nouns, a translation interface can be called for translation. That is, optionally, in some embodiments of the present application, the step "sample nouns include business proper nouns and non-business proper nouns, and for each sample noun, the sample noun is translated to obtain a sample translation name" includes:
[0137] For a business proper noun, obtaining at least two first translation results of the business proper noun from the target data warehouse model, and using the first translation result greater than a preset frequency threshold as a sample translation name of the business proper noun;
[0138] For non-business proper nouns, the non-business proper nouns are translated according to a preset translation tool to obtain a second translation result, and the second translation result is used as a sample translation name of the non-business proper noun.
[0139] It can be understood that the preset frequency threshold is a pre-configured threshold. When the first translation result in the data warehouse exceeds the preset frequency threshold, it is considered that the translation result has a high frequency of occurrence and belongs to a high-frequency word, indicating that the translation result is more popular with the habits of many R&D personnel or business needs. Therefore, directly using the first translation result that is greater than the preset frequency threshold as the sample translation name of the business proper noun can improve the accuracy of the sample translation name.
[0140] For non-business specific terms, translating them through translation tools can help unify the translation results and improve data standards.
[0141] Among them, by constructing a preset root list, the preset root list can be used as a reference to standardize the naming of business table fields, and the accuracy of word segmentation can be improved by retaining business-specific nouns.
[0142] Among them, the embodiment of the present application performs word segmentation and translation of the named text by referring to the preset root words and the preset word translation in the preset root word list, and uses the translation result as the name of the business table field, thereby improving the accuracy of the business table field name. Among them, by referring to the preset root word list for word segmentation and translation, the consistency of data warehouse field naming is also achieved, improving data standardization.
[0143] See also Figure 3 , Figure 3 2 is another flowchart of the data warehouse field naming method provided in an embodiment of the present application, wherein the specific process of the data warehouse field naming includes:
[0144] 201. Obtain the English names of the fields and the corresponding Chinese comments of all business tables from the metadata database;
[0145] The metadata database index warehouse model corresponds to the database, and the business table corresponds to the hive table.
[0146] 202. Clean the Chinese comments and remove numbers, English, punctuation, null values, and single characters;
[0147] 203. Based on the word segmentation algorithm of the maximum probability word segmentation model and the hidden Markov model, the Jieba word segmentation tool is used to segment the Chinese annotations and obtain the word segmentation results;
[0148] In the embodiment of the present application, word segmentation is also performed based on business nouns (business proper nouns) to ensure that the business nouns in the Chinese annotations will not be split.
[0149] 204. Filter words whose occurrence frequency is greater than a specific threshold from the word segmentation results as Chinese word roots;
[0150] 205. Classify the Chinese word roots to obtain a first Chinese word root belonging to a business noun and a second Chinese word root belonging to a common noun;
[0151] 206. For the first Chinese root, use the internal high-frequency translation result and abbreviation result, and for the second Chinese root, use the call results of the translation tool and the abbreviation tool;
[0152] 207. Construct a root list by combining Chinese roots, root classifications, translation results and abbreviation results;
[0153] For example, please refer to Table 1, which is a schematic diagram of the data composition of the root list provided in the embodiment of the present application, wherein the Chinese root corresponds to the root list in Table 1, the translation result corresponds to the model root English name in Table 1, and the abbreviation result corresponds to the final English abbreviation in Table 1, specifically:
[0154] root Root classification Model root English name Final English abbreviation Ashura Business terms asura asura Bar gun Business terms barcode scanner bar storehouse Common Noun warehouse wh Trunk Business terms main transportation main_trans Departure Business terms departure depart late Common Noun delay delay frequency Common Noun count cnt client Common Noun customer cust
[0155] Table 1
[0156] 208. Use the root word list to replace the user dictionary of the word segmentation tool;
[0157] The role of the user dictionary is that the word segmenter will retain these words without segmenting them, which can retain the company's internal business terms.
[0158] 209. Use the word segmentation tool to segment the named text and obtain real-time word segmentation results;
[0159] 210. Match the real-time word segmentation results with the root word list one by one in order to obtain English abbreviation results;
[0160] 211. Use underscores to concatenate the English abbreviations to get the complete translation result;
[0161] 212. Use the complete translation result to name the business table fields.
[0162] It can be understood that by constructing a root list, a unified standard naming reference is provided. When R&D is naming fields, it is not necessary to rely solely on one of the translation results based on one's own English knowledge or through online search. Instead, the name can be named based on the root list, thus overcoming subjectivity and arbitrariness and improving uniformity and standardization.
[0163] At the same time, using the root list as a reference for naming also improves the efficiency of field naming and enables quick naming of field names.
[0164] In order to better implement the data warehouse field naming method of the present application, the present application also provides a data warehouse field naming device based on the above data warehouse field naming method. The meaning of the nouns is the same as that in the above data warehouse field naming method, and the specific implementation details can refer to the description in the method embodiment.
[0165] See also Figure 4 , Figure 4 : is a schematic diagram of the structure of a data warehouse field naming device provided in an embodiment of the present application, wherein the data warehouse field naming device can be specifically as follows:
[0166] An acquisition module 301 is used to acquire a text to be named and a preset root list, wherein the preset root list includes preset roots and preset word translations corresponding to the preset roots;
[0167] A word segmentation module 302 is used to perform word segmentation processing on the text to be named with reference to the preset word roots in the preset word root list to obtain target word segments;
[0168] A translation module 303, configured to determine a target word translation corresponding to the target word segmentation according to the preset root word and the preset word translation corresponding to the preset root word;
[0169] The naming module 304 is used to name the business table field corresponding to the to-be-named text in the target data warehouse model according to the target word translation.
[0170] Optionally, in some embodiments of the present application, the target segmentation includes at least two, and the naming module 304 includes:
[0171] A generating unit, configured to generate a target field name according to the word order of each target word in the to-be-named text and the target word translation corresponding to each target word;
[0172] The naming unit is used to name the business table field corresponding to the to-be-named text in the target data warehouse model according to the target field name.
[0173] Optionally, in some embodiments of the present application, the word segmentation module 302 includes:
[0174] A first determining unit, configured to determine a first word segment from the text to be named according to a preset word root in the preset word root list;
[0175] A filtering unit, used for filtering the first word segmentation from the text to be named to obtain a local naming text;
[0176] A second determining unit, configured to determine a second participle from the local naming text according to the preset root;
[0177] The third determining unit is configured to take both the first participle and the second participle as target participles.
[0178] Optionally, in some embodiments of the present application, the first determining unit includes:
[0179] A first determining subunit, configured to use the text to be named as a first word segmentation if the text to be named matches a preset root in the preset root list;
[0180] The second determination subunit is used to delete the last character of the text to be named if it does not match the preset root in the preset root list to obtain a transition matching text, and determine the first word segmentation from the transition matching text according to the preset root.
[0181] In some embodiments of the present application, the generating unit includes:
[0182] an abbreviation determination subunit, used to determine the target translation abbreviation corresponding to each target word translation;
[0183] The generating subunit is used to connect the abbreviations of the target translations in series according to the word order of the target segmented words in the text to be named by using a preset connector to obtain the target field name.
[0184] In some embodiments of the present application, the device further includes a building module, and the building module includes:
[0185] An acquisition unit, configured to acquire business table field names from a database of the target data warehouse model, and acquire Chinese annotations corresponding to the business table field names;
[0186] A processing unit, configured to perform word segmentation processing on the Chinese annotation to obtain at least two sample nouns;
[0187] A translation unit, for translating each sample noun to obtain a sample translation name;
[0188] A construction unit is used to establish a preset root list according to the sample nouns and the sample translation names, wherein the sample names correspond to preset roots in the preset root list, and the sample translation names correspond to preset word translations in the preset root list.
[0189] In some embodiments of the present application, the processing unit includes:
[0190] Get subunit, used to get business specific terms;
[0191] A word segmentation subunit is used to refer to the business-specific noun and perform word segmentation processing on the Chinese annotation through a preset word segmentation model to obtain at least two sample nouns;
[0192] The preset word segmentation model includes at least one of a maximum probability word segmentation model, a hidden Markov model or a hybrid model, wherein the hybrid model is jointly constructed based on the maximum probability word segmentation model and the hidden Markov model.
[0193] In some embodiments of the present application, the sample nouns include business proper nouns and non-business proper nouns, and the translation unit includes:
[0194] A first translation subunit is used to obtain at least two first translation results of the business proper noun from the database of the target data warehouse model, and use the first translation result greater than a preset frequency threshold as a sample translation name of the business proper noun;
[0195] The second translation subunit is used to translate the non-business proper nouns according to a preset translation tool to obtain sample translated names of the non-business proper nouns.
[0196] In the embodiment of the present application, the acquisition module 301 first acquires the text to be named and the preset root list, wherein the preset root list includes preset roots and preset word translations corresponding to the preset roots. Then, the segmentation module 302 performs segmentation processing on the text to be named with reference to the preset roots in the preset root list to obtain target segmentations. Subsequently, the translation module 303 determines the target word translation corresponding to the target segmentation according to the preset roots and the preset word translations corresponding to the preset roots. Then, the naming module 304 names the business table field corresponding to the text to be named in the target data warehouse model according to the target word translation.
[0197] It can be understood that by referring to the preset root words and the preset word translations in the preset root word list to segment and translate the named text, and using the translation results as the names of the business table fields, the accuracy of the business table field names is improved. Among them, by referring to the preset root word list for segmentation and translation, the consistency of data warehouse field naming is also achieved, which improves data standardization.
[0198] In addition, the present application also provides an electronic device, such as Figure 5 As shown, it shows a schematic diagram of the structure of the electronic device involved in this application, specifically:
[0199] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that Figure 5 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0200] The processor 401 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, the processor 401 performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.
[0201] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0202] The electronic device also includes a power supply 403 for supplying power to each component. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 403 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0203] The electronic device may further include an input unit 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0204] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically in this embodiment, the processor 401 in the electronic device will load the executable file corresponding to the process of one or more applications into the memory 402 according to the following instructions, and the processor 401 will run the application stored in the memory 402, thereby implementing the steps in any data warehouse field naming method provided in the embodiments of the present application.
[0205] The embodiment of the present application obtains a text to be named and a preset root list, performs word segmentation on the text to be named by referring to the preset roots in the preset root list to obtain a target word segmentation, and determines a target word translation corresponding to the target word segmentation according to the preset root and the preset word translation corresponding to the preset root, and then names the business table field corresponding to the text to be named in the target data warehouse model according to the target word translation.
[0206] The preset word roots and preset word translations in the preset word root list are used to segment and translate the named text, and the translation results are used as the names of the business table fields, which improves the accuracy of the business table field names. The word segmentation and translation based on the preset word root list also achieves consistency in the naming of data warehouse fields and improves data standardization.
[0207] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0208] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer storage medium and loaded and executed by a processor.
[0209] To this end, the present application provides a storage medium, which includes a computer-readable storage medium, on which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any data warehouse field naming method provided in the present application.
[0210] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0211] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0212] Since the instructions stored in the computer-readable storage medium can execute the steps in any data warehouse field naming method provided in the present application, the beneficial effects that can be achieved by any data warehouse field naming method provided in the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0213] The above is a detailed introduction to a data warehouse field naming method, device, electronic device and computer-readable storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
[0214] Among them, it should be noted that in the specific implementation of the present application, it involves data warehouse models such as the table field names of various business tables in the database (including English names and their corresponding Chinese annotations, English abbreviations, etc.), as well as company products, business aspects, etc., proper nouns, high-frequency nouns, and noun type information and other related data. When the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
Claims
1. A data warehouse field naming method, characterized in that: include: Obtaining a text to be named and a preset root list, wherein the preset root list includes preset roots and preset word translations corresponding to the preset roots; Performing word segmentation processing on the text to be named with reference to the preset word roots in the preset word root list to obtain target word segments; Determining a target word translation corresponding to the target word segmentation according to the preset word root and the preset word translation corresponding to the preset word root; The business table field corresponding to the to-be-named text in the target data warehouse model is named according to the target word translation.
2. The method according to claim 1, characterized in that The target word segmentation includes at least two, and the naming of the business table field corresponding to the to-be-named text in the target data warehouse model according to the target word translation includes: Generate a target field name according to the word order of each target word in the to-be-named text and the target word translation corresponding to each target word; The business table field corresponding to the to-be-named text in the target data warehouse model is named according to the target field name.
3. The method according to claim 2, characterized in that The step of performing word segmentation processing on the text to be named with reference to the preset word roots in the preset word root list to obtain target word segments includes: Determining a first participle from the text to be named according to a preset root in the preset root list; Filter the first word segmentation from the text to be named to obtain a local naming text; Determining a second participle from the local naming text according to the preset root; The first participle and the second participle are both used as target participles.
4. The method according to claim 3, characterized in that The step of determining the first word segment from the text to be named according to the preset word roots in the preset word root list includes: If the text to be named matches a preset root in the preset root list, the text to be named is used as the first participle; If the text to be named does not match the preset root in the preset root list, the last character of the text to be named is deleted to obtain a transitional matching text, and the first word segmentation is determined from the transitional matching text according to the preset root.
5. The method according to claim 2, characterized in that: The generating of the target field name according to the word order of each target segmentation in the to-be-named text and the target word translation corresponding to each target segmentation includes: Determine the target translation abbreviation corresponding to each target word translation; According to the word order of each target word segment in the to-be-named text, each target translation abbreviation is concatenated through a preset connector to obtain a target field name.
6. The method according to claim 1, characterized in that Before obtaining the text to be named and the preset root list, the method further includes: Obtaining business table field names from the target data warehouse model, and obtaining Chinese annotations corresponding to the business table field names; Performing word segmentation processing on the Chinese annotation to obtain at least two sample nouns; For each sample noun, the sample noun is translated to obtain a sample translated name; A preset root word list is established according to the sample nouns and the sample translation names, wherein the sample names correspond to preset roots in the preset root word list, and the sample translation names correspond to preset word translations in the preset root word list.
7. The method according to claim 6, characterized in that The Chinese annotation is segmented to obtain at least two sample nouns, including: Get business terms; Referring to the business-specific nouns, performing word segmentation processing on the Chinese annotations through a preset word segmentation model to obtain at least two sample nouns; The preset word segmentation model includes at least one of a maximum probability word segmentation model, a hidden Markov model or a hybrid model, wherein the hybrid model is jointly constructed based on the maximum probability word segmentation model and the hidden Markov model.
8. The method according to claim 6, characterized in that The sample nouns include business-specific nouns and non-business-specific nouns. For each sample noun, the sample noun is translated to obtain a sample translated name, including: For a business proper noun, obtaining at least two first translation results of the business proper noun from the target data warehouse model, and using the first translation result greater than a preset frequency threshold as a sample translation name of the business proper noun; For non-business proper nouns, the non-business proper nouns are translated according to a preset translation tool to obtain a second translation result, and the second translation result is used as a sample translation name of the non-business proper noun.
9. A data warehouse field naming device, characterized in that: include: An acquisition module, used for acquiring a text to be named and a preset root list, wherein the preset root list includes preset roots and preset word translations corresponding to the preset roots; A word segmentation module, used for performing word segmentation processing on the text to be named with reference to the preset word roots in the preset word root list to obtain target word segments; A translation module, used for determining a target word translation corresponding to the target word segmentation according to the preset root and the preset word translation corresponding to the preset root; A naming module is used to name the business table field corresponding to the to-be-named text in the target data warehouse model according to the target word translation.
10. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the data warehouse field naming method as described in any one of claims 1 to 8 when executing the computer program.
11. A storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the data warehouse field naming method according to any one of claims 1 to 8 are implemented.