Data processing method and device
By calculating the prefix, suffix and keyword matching of search terms and data table fields, the problem of inaccurate search results in the prior art is solved, and more accurate data table field matching and search results are achieved to meet user needs.
Patent Information
- Application Number
- CN202411525018.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-25
AI Technical Summary
In the data table, when calculating the similarity between the search terms entered by the user and the fields in the data table, it is difficult for the prior art to accurately match, resulting in the search results that do not meet user needs, especially when there are a large number of fields.
By obtaining the search terms entered by the user and the fields in the target data table, calculating their prefix and suffix matching, and combining the keyword matching degree, the similarity between the fields and the search terms is determined to match the fields in the target data table more accurately.
Improve the accuracy of the search results, making the output search results more in line with user needs, especially when there are many fields in the data table.
Smart Images

Figure CN119513230A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a data processing method and device. Background Art
[0002] Users can search for the data they want to view in the data table by entering search terms. Currently, the Jaro-Winkler algorithm can be used to calculate the similarity between the search terms entered by the user and the fields in the data table, and the fields with similarity to the search terms above a certain threshold are fed back to the user as search results.
[0003] However, in this way, the search results fed back to the user cannot meet the user's needs. In particular, in the scenario where the aforementioned data table includes a large number of fields, the user often cannot obtain the search results he or she wants.
[0004] Therefore, a solution is urgently needed to solve the above problems. Summary of the invention
[0005] In order to solve or at least partially solve the above technical problems, the present application provides a data processing method and device.
[0006] In a first aspect, the present application provides a data processing method, the method comprising:
[0007] Obtaining a search term input by a user, wherein the search term is used to search for fields in a target data table;
[0008] Acquire a first field to be matched, where the first field is a field related to the target data table;
[0009] Determining a first prefix matching degree between the search term and the first field, and a first suffix matching degree between the search term and the first field;
[0010] Based on the first prefix matching degree and the first suffix matching degree, a similarity between the first field and the search term is determined.
[0011] Optionally, the method further includes:
[0012] Determining keywords of the search term and keywords of the first field;
[0013] Determining a degree of matching between the search term and the keyword of the first field according to the keyword of the search term and the keyword of the first field;
[0014] The determining the similarity between the first field and the search term based on the first prefix matching degree and the first suffix matching degree includes:
[0015] Based on the first prefix matching degree, the first suffix matching degree, and the keyword matching degree, the similarity between the first field and the search term is determined.
[0016] Optionally, the first field is a field included in the target data table.
[0017] Optionally, the method further includes:
[0018] If the similarity between the first field and the search term is greater than or equal to a preset threshold, the first field is output.
[0019] Optionally, the method further includes:
[0020] If the similarity between the first field and the search term is less than a preset threshold, obtaining an alias of the first field as the second field;
[0021] Determining a second prefix matching degree between the search term and the second field, and a second suffix matching degree between the search term and the second field;
[0022] Determining the similarity between the second field and the search term based on the second prefix matching degree and the second suffix matching degree;
[0023] If the similarity between the second field and the search term is greater than or equal to the preset threshold, the first field is output.
[0024] Optionally, the first field is an alias of a third field, and the third field is a field included in the target data table.
[0025] Optionally, the method further includes:
[0026] If the similarity between the first field and the search term is greater than or equal to a preset threshold, the first field is output as a recommended search term.
[0027] Optionally, the method further includes:
[0028] If the similarity between the first field and the search term is greater than or equal to a preset threshold, the third field is output.
[0029] Optionally, the method further includes:
[0030] Inputting a prompt word into the large model, the prompt word at least including a target field and an association relationship between the target field and other fields in the target data table, wherein the target field is a field in the target data table, the target field includes the first field or the third field, and the prompt word is used to prompt the large model to generate an alias for the target field based on the association relationship and / or the target field;
[0031] Get the alias of the target field output by the large model.
[0032] In a second aspect, the present application provides a data processing device, the device comprising:
[0033] A first acquisition unit, used to acquire a search term input by a user, wherein the search term is used to search for a field in a target data table;
[0034] A second acquisition unit, configured to acquire a first field to be matched, where the first field is a field related to the target data table;
[0035] A first determining unit, configured to determine a first prefix matching degree between the search term and the first field, and a first suffix matching degree between the search term and the first field;
[0036] The second determining unit is configured to determine the similarity between the first field and the search term based on the first prefix matching degree and the first suffix matching degree.
[0037] Optionally, the device further comprises:
[0038] A third determining unit, configured to determine a keyword of the search term and a keyword of the first field;
[0039] a fourth determining unit, configured to determine a matching degree between the search term and the keyword of the first field according to the keyword of the search term and the keyword of the first field;
[0040] The second determining unit is specifically configured to:
[0041] Based on the first prefix matching degree, the first suffix matching degree, and the keyword matching degree, the similarity between the first field and the search term is determined.
[0042] Optionally, the first field is a field included in the target data table.
[0043] Optionally, the device further comprises:
[0044] The first output unit is configured to output the first field if the similarity between the first field and the search term is greater than or equal to a preset threshold.
[0045] Optionally, the device further comprises:
[0046] A third acquisition unit, configured to acquire an alias of the first field as a second field if the similarity between the first field and the search term is less than a preset threshold;
[0047] a fifth determining unit, configured to determine a second prefix matching degree between the search term and the second field, and a second suffix matching degree between the search term and the second field;
[0048] a sixth determining unit, configured to determine a similarity between the second field and the search term based on the second prefix matching degree and the second suffix matching degree;
[0049] The second output unit is configured to output the first field if the similarity between the second field and the search term is greater than or equal to the preset threshold.
[0050] Optionally, the first field is an alias of a third field, and the third field is a field included in the target data table.
[0051] Optionally, the device further comprises:
[0052] The third output unit is configured to output the first field as a recommended search term if the similarity between the first field and the search term is greater than or equal to a preset threshold.
[0053] Optionally, the device further comprises:
[0054] The fourth output unit is configured to output the third field if the similarity between the first field and the search term is greater than or equal to a preset threshold.
[0055] Optionally, the device further comprises:
[0056] An input unit, used for inputting a prompt word into the large model, wherein the prompt word at least includes a target field and an association relationship between the target field and other fields in the target data table, wherein the target field is a field in the target data table, the target field includes the first field or the third field, and the prompt word is used to prompt the large model to generate an alias for the target field based on the association relationship and / or the target field;
[0057] The fourth acquisition unit is used to acquire the alias of the target field output by the large model.
[0058] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a processor and a memory;
[0059] The processor is used to execute instructions stored in the memory so that the electronic device performs the method as described in any one of the first aspects above.
[0060] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, wherein the instructions instruct a device to execute a method as described in any one of the above first aspects.
[0061] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute any of the methods described in the first aspect above.
[0062] Compared with the prior art, the embodiments of the present application have the following advantages:
[0063] The present application provides a data processing method, which includes: obtaining a search term input by a user, the search term being used to retrieve a field in a target data table. Obtaining a first field to be matched, the first field being a field related to the target data table. Further, determining the similarity between the first field and the search term, so as to further determine the field in the target data table that matches the search term. In the present application, when determining the similarity between the first field and the search term, the first prefix matching degree between the search term and the first field can be determined, and the first suffix matching degree between the search term and the first field can be determined, so as to determine the similarity between the first field and the search term based on the first prefix matching degree and the first suffix matching degree. That is, when determining the similarity between the first field and the search term, not only the matching degree between the first field and the search term in the prefix is considered, but also the matching degree between the first field and the search term in the suffix is considered, so that the similarity between the determined first field and the search term is more accurate, and accordingly, based on the similarity between the first field and the search term, the field in the target data table that matches the search term can be more accurately determined, so that the output search result is more in line with user needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0065] Figure 1 A flowchart of a data processing method provided in an embodiment of the present application;
[0066] Figure 2 A flowchart of another data processing method provided in an embodiment of the present application;
[0067] Figure 3 A flowchart of another data processing method provided in an embodiment of the present application;
[0068] Figure 4 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0069] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0070] The inventor of the present application has found through research that in the conventional technology, the Jaro-Winkler algorithm can be used to calculate the similarity between the search term input by the user and the fields in the data table. Among them:
[0071] The principle of using the Jaro-Winkler algorithm to calculate the similarity of two texts (text 1 and text 2) is as follows:
[0072] First, the Jaro distance between the two texts is calculated based on Formula 1.
[0073]
[0074] In formula (1):
[0075] sim represents the Jaro distance between text 1 and text 2;
[0076] S1 represents the number of characters included in text 1;
[0077] S2 represents the number of characters included in text 2;
[0078] m means that text 1 and text 2 have a character length of The number of characters that match in the window;
[0079] Express Round down; t is the number of transpositions.
[0080] Furthermore, based on Formula 2, the similarity between the two texts is obtained by using the Jaro distance and the prefix matching degree of the two texts.
[0081] J=sim+p* (1-sim) Formula (2)
[0082] In formula (2):
[0083] J represents the similarity between text 1 and text 2;
[0084] sim is the Jaro distance between text 1 and text 2 calculated using formula (1);
[0085] p is the prefix matching degree between text 1 and text 2.
[0086] The current Jaro-Winkler algorithm is relatively accurate in calculating the similarity of names. However, in data table retrieval scenarios, its calculation results are often not very accurate. Especially in scenarios where there are many fields in the data table and the user is not particularly familiar with the names of the fields in the data table, the Jaro-Winkler algorithm is used to calculate the similarity of two texts and output retrieval results for the user based on the calculation results. The output retrieval results often cannot meet the user's needs.
[0087] In view of this, the present application provides a data processing method and device, which can more accurately determine the fields in the data table that match the search term in the scenario of data table retrieval, so that the output search results are more in line with user needs.
[0088] Various non-limiting implementations of the present application are described in detail below in conjunction with the accompanying drawings.
[0089] Exemplary Methods
[0090] See also Figure 1 , which is a flow chart of a data processing method provided in an embodiment of the present application.
[0091] The data processing method provided in the embodiment of the present application can be applied to the client or the server, and the embodiment of the present application does not make any specific limitation. In the following description, the method is applied to the client as an example for explanation.
[0092] In this embodiment, the method may include the following steps: S101-S104.
[0093] S101: Acquire a search term input by a user, where the search term is used to search for fields in a target data table.
[0094] In one example, the user may input the search term in a search term input area provided by the client.
[0095] As an example, after the user triggers a preset operation in the display page of the target data table, the client displays the search term input area in response to the preset operation, and further, the user can enter the search term in the search term input area. The preset operation mentioned here can be a triggering search operation (for example, triggering a search operation by using the shortcut key "ctrl+F").
[0096] As another example, the search term input area may also be directly displayed on the display page of the client without the user triggering the aforementioned preset operation, which is not specifically limited in the embodiments of the present application.
[0097] The embodiment of the present application does not specifically limit the search term, and the search term may include one or more characters. The characters mentioned here include but are not limited to one or more characters such as Chinese characters, English characters, Korean characters, and Japanese characters.
[0098] S102: Acquire a first field to be matched, where the first field is a field related to the target data table.
[0099] In one example, after obtaining the search term, the first field to be matched can be further obtained to further calculate the similarity between the first field and the search term, thereby further determining the field in the target data table that matches the search term based on the similarity between the first field and the search term.
[0100] In the present application, the first field is a field related to the target data table. The field related to the target data table may be a field in the target data table, or may be another field derived from a field in the target data table. In other words, in a specific example, the first field is a field included in the target data table. In another specific example, the first field may be a field derived from a third field in the target data table, for example, the first field may be an alias of the third field.
[0101] In the present application, the similarity between the first field and the search term may be determined through S103 - S104 .
[0102] S103: Determine a first prefix matching degree between the search term and the first field, and a first suffix matching degree between the search term and the first field.
[0103] In the present application, considering that the field naming in the data table may follow the paradigm of "prefix+**" or "**+suffix", the similarity between the search term and the first field can be determined by combining the first prefix matching degree between the search term and the first field, as well as the first suffix matching degree between the search term and the first field.
[0104] In one example, the search term and the first field may be matched to obtain a common prefix length of the search term and the first field, and the first prefix matching degree may be obtained based on the common prefix length of the search term and the first field. As a specific example, the common prefix length may be multiplied by a first scaling factor to obtain the first common prefix length. For example, if the common prefix length is 4 and the first scaling factor is 0.1, the first prefix matching degree is 0.4.
[0105] In one example, in order to avoid the first prefix matching being too large and affecting the accuracy of the calculated similarity result between the first field and the search term, an upper limit may be set for the first prefix matching, and when the prefix matching calculated based on the common prefix length and the first scaling factor is greater than the upper limit, the upper limit is used as the first prefix matching. Alternatively, an upper limit (e.g., 4) may be set for the aforementioned common prefix length, and when the common prefix length obtained by matching is greater than the upper limit, the first prefix matching is calculated based on the upper limit of the common prefix length and the first scaling factor.
[0106] In one example, the search term and the first field may be matched to obtain a common suffix length of the search term and the first field, and the first suffix matching degree may be obtained based on the common suffix length of the search term and the first field. As a specific example, the common suffix length and the second scaling factor may be multiplied to obtain the first suffix matching degree. For example, if the common suffix length is 4 and the second scaling factor is 0.1, the first suffix matching degree is 0.4.
[0107] In one example, in order to avoid the first suffix matching degree being too large and affecting the accuracy of the calculated similarity result between the first field and the search term, an upper limit can be set for the first suffix matching degree, and when the suffix matching degree calculated based on the common suffix length and the second scaling factor is greater than the upper limit, the upper limit is used as the first suffix matching degree. Alternatively, an upper limit (for example, 4) can be set for the aforementioned common suffix length, and when the common suffix length obtained by matching is greater than the upper limit, the first suffix matching degree is calculated based on the upper limit of the common suffix length and the second scaling factor.
[0108] S104: Determine the similarity between the first field and the search term based on the first prefix matching degree and the first suffix matching degree.
[0109] After obtaining the first prefix matching degree and the first suffix matching degree, the similarity between the first field and the search term may be determined based on the first prefix matching degree and the first suffix matching degree.
[0110] As an example, the first prefix matching degree and the first suffix matching degree may be weightedly calculated to obtain the similarity between the first field and the search term.
[0111] As another example, the first prefix matching degree, the first suffix matching degree, and the Jaro distance between the first field and the search term may be combined to obtain the similarity between the first field and the search term. As a specific example, the first prefix matching degree, the first suffix matching degree, and the Jaro distance between the first field and the search term may be weighted to obtain the similarity between the first field and the search term. For example, the similarity between the first field and the search term may be obtained based on the following formula (3).
[0112] J1=J+S* (1-J) Formula (3)
[0113] In formula (3):
[0114] J1 represents the similarity between the first field and the search term, that is, the calculation result of S104;
[0115] J is the similarity calculated between the first field and the search term using formula (2);
[0116] S is the first suffix matching degree.
[0117] As another example, considering that the fields in the target data table may not follow the paradigm of "prefix+**" and "**+suffix", in this case, in order to accurately determine the similarity between the first field and the search term, the client may also execute Figure 2 S201-S202 shown. Figure 2 A flowchart of another data processing method provided in an embodiment of the present application.
[0118] S201: Determine keywords of the search term and keywords of the first field.
[0119] In one example, a keyword extraction algorithm may be used to extract keywords of the search term and keywords of the first field.
[0120] In another example, a model (e.g., a large language model) may be used to determine the keywords of the search term and the keywords of the first field. For example, the search term and the first field may be respectively input into the model to use the model to determine the keywords of the search term and the keywords of the first field.
[0121] S202: Determine a matching degree between the search term and the keyword of the first field according to the keyword of the search term and the keyword of the first field.
[0122] After determining the keywords of the search term and the keywords of the first field, the keyword matching degree between the search term and the first field can be determined based on the keywords of the search term and the keywords of the first field. As a specific example, the similarity between the keywords of the search term and the keywords of the first field can be calculated, and the similarity between the keywords of the search term and the keywords of the first field can be used as the keyword matching degree between the search term and the first field.
[0123] In one example, when calculating the similarity between the keywords of the search term and the keywords of the first field, for example, the first word embedding of the keywords of the search term and the second word embedding of the keywords of the first field can be calculated, and the cosine similarity of the first word embedding and the second word embedding can be calculated, so as to obtain the similarity between the keywords of the search term and the keywords of the first field.
[0124] Correspondingly, in a scenario where the client further executes S201-S202 to determine the keyword matching degree, S104, when implemented specifically, may determine the similarity between the first field and the search term based on the first prefix matching degree, the first suffix matching degree, and the keyword matching degree.
[0125] As a specific example, weighted calculation may be performed on the first prefix matching degree, the first suffix matching degree, and the keyword matching degree to obtain the similarity between the first field and the search term.
[0126] As another specific example, the first prefix matching degree, the first suffix matching degree, the keyword matching degree, and the Jaro distance between the first field and the search term may be combined to obtain the similarity between the first field and the search term. As an example, the first prefix matching degree, the first suffix matching degree, the keyword matching degree, and the Jaro distance between the first field and the search term may be weighted to obtain the similarity between the first field and the search term. For example, the similarity between the first field and the search term may be obtained based on the following formula (4).
[0127] J2=J+S*(1-J)+k*(1-J) Formula (4)
[0128] In formula (4):
[0129] J2 represents the similarity between the first field and the search term, that is, the calculation result of S104;
[0130] J is the similarity calculated between the first field and the search term using formula (2);
[0131] S is the first suffix matching degree;
[0132] k is the keyword matching degree.
[0133] Regarding the above formula (4), let’s take the search term “first-level track” and the first field “first-level sub-track” as an example for explanation.
[0134] The common prefix length of "first-level track" and "first-level sub-track" is 2, so the first prefix matching degree is 0.2;
[0135] The common suffix length of "first-level track" and "first-level sub-track" is 2, so the first suffix matching degree is 0.2;
[0136] The keywords of "first-level track" include "first-level" and "track", and the keywords of "first-level sub-track" include "first-level" and "sub-track". Calculate the similarity of the keywords {first-level, track} and {first-level, sub-track}. Assuming that the calculated similarity of the keywords {first-level, track} and {first-level, sub-track} is 0.8, then the keyword matching degree of "first-level track" and "first-level sub-track" is 0.8.
[0137] In addition, the Jaro distance between the “first-level track” and the “first-level sub-track” is calculated in combination with formula (1).
[0138] in:
[0139] S1 equals 4, S2 equals 5, m equals 4, and t equals 0.
[0140] Substituting into formula (1), we get the Jaro distance between the “first-level track” and the “first-level sub-track”:
[0141] Substituting the Jaro distance calculated based on formula (1) into formula (2), we obtain J=0.9333+0.2*(1-0.9333)=0.94664.
[0142] Furthermore, by substituting J, S and K calculated based on formula (2) into formula (4), we can obtain the similarity between the "first-level track" and the "first-level sub-track": 0.94664+0.2*(1-94664)+0.8*(1-94664)=1.
[0143] In some scenarios, the result calculated based on formula (4) may be greater than 1. In this case, it can be considered that the similarity between the first field and the search term is 1.
[0144] From the above description, it can be seen that, using the solution provided in the embodiment of the present application, when determining the similarity between the first field and the search term, not only the matching degree between the first field and the search term in the prefix is considered, but also the matching degree between the first field and the search term in the suffix is considered. In some scenarios, the keyword matching degree between the first field and the search term is also considered, so that the determined similarity between the first field and the search term is more accurate. Accordingly, based on the similarity between the first field and the search term, the field in the target data table that matches the search term can be more accurately determined, so that the output search results are more in line with user needs.
[0145] As can be seen from the above description, the first field may be a field in the target data table, or may be an alias of a third field in the target data table.
[0146] If the first field is a field in the target data table, then in one example, if the similarity between the first field and the search term is greater than or equal to a preset threshold, the client can output the first field. Specifically, the client can output the first field as a search result. The first field can be output as a search result. For example, the first field can be displayed in a specific style on a page displaying the target data table, or the first field can be displayed in the central area of the page displayed on the client. The embodiments of the present application do not make specific limitations.
[0147] The embodiment of the present application does not specifically limit the preset threshold value, and the preset threshold value may be set according to actual conditions. For example, the preset threshold value may be 0.8.
[0148] If the first field is a field in the target data table, then in another example, if the similarity between the first field and the search term is less than the preset threshold, the client may further perform Figure 3 S301-S304 shown. Figure 3 A flowchart of another data processing method provided in an embodiment of the present application.
[0149] S301: Obtain an alias of the first field as a second field.
[0150] In the present application, each of the at least one field in the target data table may have at least one alias. When the first field is a field in the target data table, the at least one field mentioned here may at least include the first field. When the first field is an alias of the third field, the at least one field mentioned here may at least include the third field.
[0151] S302: Determine a second prefix matching degree between the search term and the second field, and a second suffix matching degree between the search term and the second field.
[0152] S303: Determine the similarity between the second field and the search term based on the second prefix matching degree and the second suffix matching degree.
[0153] The implementation principle of S302-S303 is the same as that of S103-S104. For the specific implementation of S302-S303, please refer to the description of S103-S104 in the previous text, and no repeated description will be made here.
[0154] S304: If the similarity between the second field and the search term is greater than or equal to the preset threshold, output the first field.
[0155] In one example, if the similarity between the second field and the search term is greater than or equal to the preset threshold, it means that the similarity between the search term and the second field is high. In this case, since the second field is an alias of the first field, the first field can be output, for example, the first field can be output as a search result. For the specific implementation of outputting the first field, please refer to the relevant description in the previous text, and no repeated description will be made here.
[0156] From S301-S304, it can be known that even if the similarity between the search term input by the user and the first field in the target data table is low, by matching the search term with the alias of the first field, the first field can be retrieved from the target data table as the search result. That is, with this solution, when the user is not clear about the field name in the target data table, if the user knows the information of the field he wants to search, the search result can be accurately output to the user by matching the search term with the alias. For example:
[0157] Assume that the field in the target database is "customer_address". This field has an alias "client_location". The search term entered by the user is "customer_location". Then:
[0158] First, "customer_address" can be used as the first field to calculate the similarity between the first field and the search term. Assume that the calculated similarity is low, i.e., 0.6.
[0159] Furthermore, "client_location" is used as the second field, and the similarity between the second field and the search term is calculated. It is assumed that the calculated similarity is 1.0.
[0160] Since the similarity between the second field and the search term is greater than or equal to a preset threshold (assuming it is 0.8), the first field "customer_address" can be output as a search result.
[0161] If the first field is an alias of the third field, then if the similarity between the first field and the search term is greater than or equal to a preset threshold, then;
[0162] In a specific example, the client may output the third field. Specifically, the client may output the third field as a search result. For the specific implementation of outputting the third field as a search result, please refer to the specific description of "outputting the first field as a search result" above, and no repeated description is given here.
[0163] In another specific example, the first field can be output as a recommended search term. For example, in addition to the search term input area, the page displayed by the client also includes a search term recommendation area, which is used to display the search terms recommended by the client. In this case, the client can display the first field in the aforementioned search term recommendation area, and the user can trigger the selection operation through the recommended search term, thereby quickly inputting the recommended search term into the search term input area, thereby optimizing the search term input by the user himself, which is conducive to providing the user with more accurate search results. In this scenario, the client can search based on the aforementioned search terms and recommended search terms (i.e., the first field). Since the first field is an alias of the third field, the client can accurately output the third field as the search result, so that the output search result better meets the user's needs.
[0164] Next, we will introduce how to obtain the alias of the field.
[0165] For the convenience of description, any field with an alias in the data table is referred to as a "target field", and the target field may be the third field or the first field. In one example, the alias of the target field may be set by a user. In another example, the alias of the target field may be obtained through the following steps A1-A2.
[0166] A1: Input a prompt word into the large model, wherein the prompt word at least includes a target field and an association relationship between the target field and other fields in a target data table, and the prompt word is used to prompt the large model to generate an alias for the target field based on the association relationship and / or the target field.
[0167] A2: Obtain the alias of the target field output by the large model.
[0168] The large model mentioned in steps A1-A2 may be, for example, a large language model, or a model that at least has the function of generating aliases for fields, which is not specifically limited in the embodiments of the present application.
[0169] In some scenarios, the association relationship between the target field and other fields can also be referred to as the blood relationship between the template field and other fields. In a specific example, the association relationship may at least include the target field and the upstream field of the target field, wherein the target field can be obtained based on the upstream field of the target field. Of course, the association relationship may also include the target field and the downstream field of the target field, wherein the downstream field of the target field refers to the field obtained after processing the target field.
[0170] After the target field and the aforementioned association relationship are input into the big model, the big model can generate an alias for the target field based on the target field and / or the aforementioned association relationship. For example, the big model can generate an alias with similar semantics for the target field based on the semantics of the target field. For another example, the big model can generate an alias for the target field based on the aforementioned association relationship (e.g., the name of the upstream field). For another example, the big model can generate an alias for the target field in combination with the semantics of the target field and the aforementioned association relationship.
[0171] Exemplary Devices
[0172] Based on the method provided in the above embodiment, the embodiment of the present application further provides a device, which is described below in conjunction with the accompanying drawings.
[0173] See also Figure 4 , Figure 4 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application. Figure 4 The device 400 shown is used to execute the data processing method provided by the above method embodiment.
[0174] The apparatus 400 may specifically include, for example: a first acquiring unit 401 , a second acquiring unit 402 , a first determining unit 403 , and a second determining unit 404 .
[0175] The first acquisition unit 401 is used to acquire a search term input by a user, where the search term is used to search for fields in a target data table.
[0176] The second acquisition unit 402 is used to acquire a first field to be matched, where the first field is a field related to the target data table.
[0177] The first determining unit 403 is configured to determine a first prefix matching degree between the search term and the first field, and a first suffix matching degree between the search term and the first field.
[0178] The second determining unit 404 is configured to determine a similarity between the first field and the search term based on the first prefix matching degree and the first suffix matching degree.
[0179] Optionally, the device further comprises:
[0180] A third determining unit, configured to determine a keyword of the search term and a keyword of the first field;
[0181] a fourth determining unit, configured to determine a matching degree between the search term and the keyword of the first field according to the keyword of the search term and the keyword of the first field;
[0182] The second determining unit 404 is specifically configured to:
[0183] Based on the first prefix matching degree, the first suffix matching degree, and the keyword matching degree, the similarity between the first field and the search term is determined.
[0184] Optionally, the first field is a field included in the target data table.
[0185] Optionally, the device further comprises:
[0186] The first output unit is configured to output the first field if the similarity between the first field and the search term is greater than or equal to a preset threshold.
[0187] Optionally, the device further comprises:
[0188] A third acquisition unit, configured to acquire an alias of the first field as a second field if the similarity between the first field and the search term is less than a preset threshold;
[0189] a fifth determining unit, configured to determine a second prefix matching degree between the search term and the second field, and a second suffix matching degree between the search term and the second field;
[0190] a sixth determining unit, configured to determine a similarity between the second field and the search term based on the second prefix matching degree and the second suffix matching degree;
[0191] The second output unit is configured to output the first field if the similarity between the second field and the search term is greater than or equal to the preset threshold.
[0192] Optionally, the first field is an alias of a third field, and the third field is a field included in the target data table.
[0193] Optionally, the device further comprises:
[0194] The third output unit is configured to output the first field as a recommended search term if the similarity between the first field and the search term is greater than or equal to a preset threshold.
[0195] Optionally, the device further comprises:
[0196] The fourth output unit is configured to output the third field if the similarity between the first field and the search term is greater than or equal to a preset threshold.
[0197] Optionally, the device further comprises:
[0198] An input unit, used for inputting a prompt word into the large model, wherein the prompt word at least includes a target field and an association relationship between the target field and other fields in the target data table, wherein the target field is a field in the target data table, the target field includes the first field or the third field, and the prompt word is used to prompt the large model to generate an alias for the target field based on the association relationship and / or the target field;
[0199] The fourth acquisition unit is used to acquire the alias of the target field output by the large model.
[0200] Since the device 400 is a device corresponding to the data processing method provided by the above method embodiment, the specific implementation of each unit of the device 400 is based on the same concept as the above method embodiment. Therefore, regarding the specific implementation of each unit of the device 400, please refer to the relevant description part of the above method embodiment, which will not be repeated here.
[0201] The embodiment of the present application also provides an electronic device, the electronic device comprising a processor and a memory;
[0202] The processor is used to execute the instructions stored in the memory, so that the electronic device executes the data processing method provided by the above method embodiment.
[0203] An embodiment of the present application provides a computer-readable storage medium, including instructions, wherein the instructions instruct a device to execute the data processing method provided by the above method embodiment.
[0204] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the data processing method provided by the above method embodiment.
[0205] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0206] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0207] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A data processing method, characterized in that: The method comprises: Obtaining a search term input by a user, wherein the search term is used to search for fields in a target data table; Acquire a first field to be matched, where the first field is a field related to the target data table; Determining a first prefix matching degree between the search term and the first field, and a first suffix matching degree between the search term and the first field; Based on the first prefix matching degree and the first suffix matching degree, a similarity between the first field and the search term is determined.
2. The method according to claim 1, characterized in that The method further comprises: Determining keywords of the search term and keywords of the first field; Determining a degree of matching between the search term and the keyword of the first field according to the keyword of the search term and the keyword of the first field; The determining the similarity between the first field and the search term based on the first prefix matching degree and the first suffix matching degree includes: Based on the first prefix matching degree, the first suffix matching degree, and the keyword matching degree, the similarity between the first field and the search term is determined.
3. The method according to claim 1, characterized in that The first field is a field included in the target data table.
4. The method according to claim 3, characterized in that The method further comprises: If the similarity between the first field and the search term is greater than or equal to a preset threshold, the first field is output.
5. The method according to claim 3, characterized in that: The method further comprises: If the similarity between the first field and the search term is less than a preset threshold, obtaining an alias of the first field as the second field; Determining a second prefix matching degree between the search term and the second field, and a second suffix matching degree between the search term and the second field; Determining the similarity between the second field and the search term based on the second prefix matching degree and the second suffix matching degree; If the similarity between the second field and the search term is greater than or equal to the preset threshold, the first field is output.
6. The method according to claim 1, characterized in that The first field is an alias of a third field, and the third field is a field included in the target data table.
7. The method according to claim 6, characterized in that The method further comprises: If the similarity between the first field and the search term is greater than or equal to a preset threshold, the first field is output as a recommended search term.
8. The method according to claim 6, characterized in that The method further comprises: If the similarity between the first field and the search term is greater than or equal to a preset threshold, the third field is output.
9. The method according to any one of claims 5 to 8, characterized in that: The method further comprises: Inputting a prompt word into the large model, the prompt word at least including a target field and an association relationship between the target field and other fields in the target data table, wherein the target field is a field in the target data table, the target field includes the first field or the third field, and the prompt word is used to prompt the large model to generate an alias for the target field based on the association relationship and / or the target field; Get the alias of the target field output by the large model.
10. A data processing device, characterized in that: The device comprises: A first acquisition unit, used to acquire a search term input by a user, wherein the search term is used to search for a field in a target data table; A second acquisition unit, configured to acquire a first field to be matched, where the first field is a field related to the target data table; A first determining unit, configured to determine a first prefix matching degree between the search term and the first field, and a first suffix matching degree between the search term and the first field; The second determining unit is configured to determine the similarity between the first field and the search term based on the first prefix matching degree and the first suffix matching degree.
11. An electronic device, characterized in that: The electronic device comprises a processor and a memory; The processor is used to execute instructions stored in the memory so that the electronic device executes the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The method comprises instructions, wherein the instructions instruct the device to execute the method according to any one of claims 1 to 9.