Target field searching method and device, server, and computer readable storage medium
Patent Information
- Application Number
- CN202210934567.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-04
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2042-08-04
AI Technical Summary
[0004]但是,现有技术在查找目标字段时,仅能够针对单个匹配条件进行搜索,当同时要针对多个匹配条件进行数据查找时,需要进行多轮的数据匹配才能完成任务,耗费了大量的时间以及算力,查找效率低下
[0021] This invention proposes a target field lookup method. By acquiring a matching request, determining the data to be matched based on the location information in the matching request, and performing parallel data matching on the data to be matched according to the instruction set in the matching request, the method identifies matching data that meets the matching conditions. The acquired matching request includes matching instructions for multiple matching conditions. During data matching, the data to be matched can be matched against multiple matching conditions in parallel, allowing the comparison of multiple matching conditions to be completed in a single matching operation, significantly reducing the time required for data matching and improving data matching efficiency. The matching data for the matching conditions is added to a matching data set, and the matching data set is filtered to obtain a matching result set. The matching result set includes statistical information on the matching data that meets the matching conditions. The statistical information includes the number of matching data in each field group that meets each matching condition, and may also include the number of data to be matched in each field group and the matching conditions that each field group meets. Based on the statistical information, the type of the field group can be determined to obtain the target field group. By filtering and judging the matching data, the type of the field group can be confirmed, improving the filtering efficiency of the target field group.
Smart Images

Figure CN115185998B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data matching technology, and more specifically, to a method and apparatus for finding a target field, a server, and a computer-readable storage medium. Background Technology
[0002] With the advent of the big data era, data has become a crucial production factor, and the flow and transmission of data holds immeasurable value. Therefore, data mining and application are essential for enhancing data value, and discovering suitable data from massive datasets is a prerequisite for data application.
[0003] When searching for a target field in a database, existing technologies typically involve searching the database for data based on a single matching condition to find fields that meet that condition.
[0004] However, existing technologies can only search for a single matching condition when looking up a target field. When searching for data based on multiple matching conditions, multiple rounds of data matching are required to complete the task, which consumes a lot of time and computing power, resulting in low search efficiency. Summary of the Invention
[0005] The technical problem solved by this invention is how to improve data matching efficiency in order to determine the target field.
[0006] To address the aforementioned technical problems, embodiments of the present invention provide a target field lookup method, comprising: acquiring a matching request, the matching request including an instruction set and location information, the instruction set including matching instructions for multiple matching conditions, and the location information used to locate data to be matched; determining the data to be matched based on the location information; performing data matching on the data to be matched in parallel according to the multiple matching conditions based on the instruction set, so as to add matching data that meets the matching conditions to a matching data set; filtering the matching data set to obtain a matching result set, the matching result set including statistical information of matching data that meets the matching conditions, the statistical information including the number of matching data that meets each matching condition in each field group; and determining the type of the field group based on the statistical information to obtain a target field group.
[0007] Optionally, the instruction set includes a set of matching instructions for the plurality of matching conditions, each set of matching instructions including at least one matching instruction, and the step of performing data matching on the data to be matched in parallel according to the plurality of matching conditions based on the instruction set includes: for each data to be matched, performing data matching in parallel according to the set of matching instructions.
[0008] Optionally, each matching instruction corresponds to a matching character, and the parallel data matching according to the matching instruction group includes: establishing multiple threads for multiple characters to be matched in each data to be matched; sequentially executing multiple matching instructions in each matching instruction group in each thread to determine whether the character to be matched is consistent with the matching character corresponding to the matching instruction.
[0009] Optionally, the step of sequentially executing multiple matching instructions in each matching instruction group in each thread includes: if the current character to be matched in the current thread is consistent with the matching character corresponding to the current matching instruction, then select the next character to be matched in the data to be matched in the current thread and check whether it is consistent with the matching character corresponding to the next matching instruction of the current matching instruction; if the current character to be matched in the current thread is inconsistent with the matching character corresponding to the current matching instruction, then close the current thread.
[0010] Optionally, determining the type of the field group based on the statistical information includes: determining the proportion of the number of matching data that meet the matching conditions in each field group to the number of data to be matched in the field group, so as to obtain the matching degree of the matching conditions; determining the matching degree of the type of the field group based on the matching degree of the matching conditions, and taking the type with the highest matching degree and a matching degree greater than a preset proportion as the type of the field group, wherein the type of the field group corresponds to at least one matching condition.
[0011] Optionally, the location information includes a library identifier and a table identifier, and determining the data to be matched based on the location information includes: obtaining the names and annotation information of each field group in the table based on the library identifier and the table identifier, and using the names and annotation information of the field groups as the data to be matched.
[0012] Optionally, the location information includes a library identifier and a table identifier, and determining the data to be matched based on the location information includes: determining the storage location of the data to be matched based on the library identifier and the table identifier; and obtaining the data to be matched using the storage location of the data to be matched.
[0013] This invention also provides another method for finding a target field, the method comprising: generating a matching request, the matching request including an instruction set and location information, the instruction set including matching instructions for multiple matching conditions, the location information being used to locate the data to be matched; sending the matching request so that a server can determine the data to be matched based on the location information; performing data matching on the data to be matched in parallel according to the multiple matching conditions according to the instruction set; adding the matching data that meets the matching conditions to a matching data set; filtering the matching data set to obtain a matching result set; and determining the type of the field group based on statistical information in the matching result set to obtain the target field group.
[0014] Optionally, generating a matching request includes: obtaining multiple matching conditions; obtaining matching instruction groups corresponding to the multiple matching conditions from a rule base to obtain the instruction set, wherein the rule base includes multiple matching conditions and their corresponding matching instruction groups.
[0015] This invention also discloses a target field lookup device, comprising: an acquisition module for acquiring a matching request, the matching request including an instruction set and location information, the instruction set including matching instructions for multiple matching conditions, and the location information for locating data to be matched; a location module for determining the data to be matched based on the location information; a matching module for performing data matching on the data to be matched in parallel according to the instruction set and the multiple matching conditions, so as to add the matching data that meets the matching conditions to a matching data set; a filtering module for filtering the matching data set to obtain a matching result set, the matching result set including statistical information of the matching data that meets the matching conditions, the statistical information including the number of matching data that meets each matching condition in each field group; and a target field group confirmation module for determining the type of the field group based on the statistical information to obtain a target field group.
[0016] This invention also discloses another target field lookup device, comprising: a generation module for generating a matching request, the matching request including an instruction set and location information, the instruction set including matching instructions for multiple matching conditions, and the location information for locating data to be matched; and a sending module for sending the matching request so that a server can determine the data to be matched based on the location information, perform data matching on the data to be matched in parallel according to the multiple matching conditions according to the instruction set, add matching data that meets the matching conditions to a matching data set, and filter the matching data set to obtain a matching result set, and determine the type of field group based on statistical information in the matching result set to obtain a target field group.
[0017] This invention also discloses a server, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the computer program is executed by the processor to perform the steps of any of the target field lookup methods described above.
[0018] This invention also discloses a client, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the computer program is executed by the processor to perform the steps of any of the target field lookup methods described above.
[0019] This invention also discloses a computer-readable storage medium storing a computer program thereon. The computer-readable storage medium is a non-volatile storage medium or a non-transient storage medium. When the computer program is run by a processor, it executes the steps of any of the target field lookup methods described above.
[0020] Compared with the prior art, the technical solution of the embodiments of the present invention has the following beneficial effects:
[0021] This invention proposes a target field lookup method. By acquiring a matching request, determining the data to be matched based on the location information in the matching request, and performing parallel data matching on the data to be matched according to the instruction set in the matching request, the method identifies matching data that meets the matching conditions. The acquired matching request includes matching instructions for multiple matching conditions. During data matching, the data to be matched can be matched against multiple matching conditions in parallel, allowing the comparison of multiple matching conditions to be completed in a single matching operation, significantly reducing the time required for data matching and improving data matching efficiency. The matching data for the matching conditions is added to a matching data set, and the matching data set is filtered to obtain a matching result set. The matching result set includes statistical information on the matching data that meets the matching conditions. The statistical information includes the number of matching data in each field group that meets each matching condition, and may also include the number of data to be matched in each field group and the matching conditions that each field group meets. Based on the statistical information, the type of the field group can be determined to obtain the target field group. By filtering and judging the matching data, the type of the field group can be confirmed, improving the filtering efficiency of the target field group.
[0022] Furthermore, the storage location of the data to be matched is determined based on the library identifier and table identifier in the location information, and the data to be matched is directly retrieved from the storage location of the data to be matched, eliminating the process of searching data in the database and greatly shortening the time spent on data matching.
[0023] Furthermore, the names and comments of field groups are also used as data to be matched, and the names and comments of field groups are used as the basis for judging the type of field groups, thereby improving the accuracy of judging the type of field groups and making the classification of field groups more accurate. Attached Figure Description
[0024] Figure 1 This is an overall flowchart of a target field search method provided in an embodiment of the present invention;
[0025] Figure 2 This is an overall flowchart of another target field search method provided in an embodiment of the present invention;
[0026] Figure 3 This is a flowchart illustrating a target field lookup method provided in an embodiment of the present invention.
[0027] Figure 4 This is a schematic diagram illustrating a specific application scenario provided by an embodiment of the present invention;
[0028] Figure 5 This is a schematic diagram of the structure of a target field search device provided in an embodiment of the present invention;
[0029] Figure 6 This is a schematic diagram of another target field search device provided in an embodiment of the present invention. Detailed Implementation
[0030] As described in the background section, with the advent of the big data era, data has become a crucial production factor. Data mining and application are essential for enhancing data value, and discovering matching data from massive datasets is a prerequisite for data application. Current technologies for matching data in databases typically involve searching the database based on matching criteria to find data that meets those criteria. However, existing technologies can only search based on a single matching criterion. When multiple matching criteria need to be applied simultaneously, multiple rounds of data matching are required to complete the task, consuming significant time and computing power.
[0031] In this embodiment of the invention, a matching request is obtained, and the data to be matched is determined based on the location information in the matching request. The data to be matched is then matched in parallel according to the instruction set in the matching request to determine the matching data that meets the matching conditions. The obtained matching request includes matching instructions for multiple matching conditions. During data matching, the data to be matched can be matched with multiple matching conditions in parallel, allowing the data to be matched to complete the comparison of multiple matching conditions in a single matching operation, greatly reducing the time required for data matching and improving data matching efficiency. The matching data for the matching conditions is added to a matching data set, and the matching data set is filtered to obtain a matching result set. The matching result set includes statistical information on the matching data that meets the matching conditions. The statistical information includes the number of matching data that meets each matching condition in each field group, and may also include the number of data to be matched in each field group and the matching conditions that each field group meets. Based on the statistical information, the type of field group can be determined to obtain the target field group. By filtering and judging the matching data, the type of field group can be confirmed, improving the filtering efficiency of the target field group.
[0032] Furthermore, the storage location of the data to be matched is determined based on the library identifier and table identifier in the location information, and the data to be matched is directly retrieved from the storage location of the data to be matched, eliminating the process of searching data in the database and greatly shortening the time spent on data matching.
[0033] Furthermore, the names and comments of field groups are also used as data to be matched, and the names and comments of field groups are used as the basis for judging the type of field groups, thereby improving the accuracy of judging the type of field groups and making the classification of field groups more accurate.
[0034] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0035] Figure 1 This is an overall flowchart of a target field search method provided in an embodiment of the present invention.
[0036] In specific implementations, the target field lookup method described in steps 101 to 105 below can be used in a server. These steps can be executed by the server, by a chip with data processing capabilities within the server, or by a chip module within the server that includes a chip with data processing capabilities. In one specific embodiment, the server can execute each step of the target field lookup method.
[0037] Specifically, such as Figure 1 As shown, the target field lookup method may include the following steps:
[0038] In step 101, a matching request is obtained;
[0039] In step 102, the data to be matched is determined based on the location information;
[0040] In step 103, the data to be matched is matched in parallel according to the set of instructions and the multiple matching conditions, so as to add the matching data that meets the matching conditions to the matching data set;
[0041] In step 104, the matching data set is filtered to obtain a matching result set;
[0042] In step 105, the type of the field group is determined based on the statistical information to obtain the target field group.
[0043] In practice, the server receives a matching request from the client. The matching request includes a set of instructions and location information. The set of instructions includes matching instructions for multiple matching conditions, and the location information is used to locate the data to be matched.
[0044] In practice, the target field group includes multiple matching data, which can be sensitive data. For example, the matching data can be sensitive data such as ID card numbers, phone numbers, or names.
[0045] In practice, the instruction set includes a set of matching instructions for multiple matching conditions. Each matching condition corresponds to a set of matching instructions, and each set of matching instructions includes at least one matching instruction.
[0046] It should be noted that the target field lookup method can be used on the Hadoop platform or any other implementable platform, and this application does not impose any restrictions on it.
[0047] It should also be noted that the matching condition can be a regular expression, and the instruction set can be a non-deterministic finite automaton (NFA) generated by compiling multiple regular expressions. Alternatively, the matching condition and instruction set can be determined by other feasible technical solutions, and this application does not impose any restrictions on this.
[0048] In a non-limiting embodiment, the location information includes a library identifier and a table identifier. The storage location of the data to be matched in the database can be determined based on the location information, and the data to be matched can be retrieved from that storage location within the database. Retrieving the data to be matched directly from its storage location eliminates the need for a database search, significantly improving the efficiency of data retrieval.
[0049] In a non-limiting embodiment, when determining the data to be matched, the server can also obtain the names and annotation information of each field group in the table based on the library identifier and table identifier, and use the names and annotation information of the field groups as the data to be matched. When the names and annotation information of the field groups meet the matching conditions in the instruction set, the names and annotation information of the field groups are added to the matching result set as the basis for judging the classification of field groups, thereby improving the accuracy of field group classification.
[0050] In practice, the server performs data matching on the data nodes containing the data to be matched in parallel. The database comprises multiple data nodes, each storing multiple data sets to be matched. Parallel matching on each data node allows for simultaneous matching of multiple data sets, improving matching efficiency. Specifically, a matching process can run on each data node. This process matches the data to be matched according to instructions in a set of instructions. The matching process can be pre-developed and deployed on the server by the developers.
[0051] In a non-limiting embodiment, the server performs data matching in parallel according to the matching instruction group for each piece of data to be matched. Specifically, multiple threads are created for multiple characters in each piece of data to be matched, with each character corresponding to one thread and each matching instruction corresponding to one matching character. In each thread, multiple matching instructions in each matching instruction group are executed sequentially to determine whether the character to be matched matches the matching character corresponding to the matching instruction.
[0052] Furthermore, if the character to be matched in the current thread is the same as the matching character corresponding to the current matching instruction, then the next character to be matched in the data to be matched is selected in the current thread, and it is compared with the matching character corresponding to the next matching instruction of the current matching instruction; if the character to be matched in the current thread is not the same as the matching character corresponding to the current matching instruction, then the current thread is closed.
[0053] In practice, the matching request can also include a preset matching quantity. When the number of data to be matched exceeds the preset matching quantity, data matching is performed on only the preset matching quantity. By setting a preset matching quantity, data matching can be performed on only a portion of the data to be matched when the quantity of data is very large, thereby shortening the data matching completion time.
[0054] It should be noted that the data to be matched can be a string or other data format that can be matched, and this application does not impose any restrictions on this.
[0055] In a non-limiting embodiment, after obtaining the data to be matched, the server matches each character in the data against each matching condition in sequence. Specifically, a thread is created for each character, and each thread compares the character against each matching condition in parallel. A quintuple (s, h, i, j, k) is used to represent the matching status of each thread against each matching condition, where s represents the sequence number of the matching instruction, h represents the sequence number of the character, i represents the sequence number of the character indicated when the matching condition is successfully matched, j represents the sequence number of the character indicated when the matching condition is successfully matched, and k represents the index of the matching condition. After all threads have finished processing, the quintuple corresponding to the matching data that meets the matching conditions is added to the matching data set.
[0056] Furthermore, the server executes multiple matching instructions in parallel in each thread, closes the thread when all matching instructions in the thread have been executed, and completes the data matching of the data to be matched after all threads have been closed.
[0057] In a non-limiting embodiment, after completing data matching, the server adds the matching data that meets the matching criteria to the matching data set. Specifically, the location information of the matching data and the 5-tuple can be added to the matching data set. The location information is used to locate the specific location of the matching data, and the location information may include the identifier of the table to which the matching data belongs and the identifier of the field group to which the matching data belongs.
[0058] Furthermore, the server performs statistical analysis on the matching data set to obtain a matching result set. This set can include statistical information on the matching data that meets the matching conditions. This statistical information can include the number of matching data items in each field group that meet each matching condition, the number of data items to be matched in each field group, and the matching conditions that each field group meets. Based on the statistical information, the matching degree of each matching condition can be calculated. The matching degree represents the proportion of matching data items that meet the matching condition to the number of data items to be matched. For example, the statistical information could include: in field group A (identified as field group A), the number of data items to be matched is 200, the number of matching data items that meet matching condition 1 is 10, and the number of matching data items that meet matching condition 2 is 100. Therefore, the matching degree of matching condition 1 is 5%, and the matching degree of matching condition 2 is 50%. Specifically, the matching conditions corresponding to each matching data item in the matching data set are first determined, and the number of matching data items matched by each matching condition in each field group is statistically analyzed and added to the statistical information. The MapReduce algorithm can be used to perform a merge sort (shuffle) process on the matching dataset. This splits the dataset into multiple independent matching data sets, determining the matching conditions for each matching data set based on the mapping relationship between each matching data set and the matching conditions. After determining the matching conditions for each matching data set, the matching data under each matching condition is merged and shuffled to determine the matching data corresponding to each matching condition. Finally, the number of matching data sets corresponding to each matching condition is counted to obtain the number of matching data sets in each field group that meet each matching condition.
[0059] In a specific application scenario, the matching conditions are the regular expression a(bd)+ and the regular expression abc. The regular expression a(bd)+ indicates that when 'a' is conjugated with at least one 'bd', the matching condition is met. For example, the strings 'abd', 'abdbd', and 'abdbdbd' match the regular expression a(bd)+. The regular expression abc indicates that the string 'abc' matches the matching condition. The instruction sets corresponding to the regular expressions a(bd)+ and abc are shown in Table 1.
[0060] 0 char'a' 1 fork 6 2 char'b' 3 char'd' 4 match 0 5 jump2 6 char'b' 7 char'c' 8 match 1 9 stop
[0061] Table 1
[0062] The content executed by each matching instruction is shown in Table 2:
[0063]
[0064] Table 2
[0065] Furthermore, the input string "qabckabdbd" is matched against the regular expressions "a(bd)+" and "abc". "a(bd)+" represents matching condition 0, and "abc" represents matching condition 1. The specific matching process is explained in detail below with reference to Table 1.
[0066] Create thread 0 to process the 0th character "q" in the string to be matched; execute the matching instruction 0 "char 'a'" in thread 0 to match "q" with "a". If the match fails, close thread 0.
[0067] Create thread 1 to process the first character "a" in the string to be matched; execute matching instruction 0 "char 'a'" in thread 1 to match "a" with "a". If the match is successful, record the index of the character indicated when the matching condition is successful, i.e., i=1; pause thread 1 and prepare to execute matching instruction 1 "fork 6".
[0068] Thread 2 is created to process the second character "b" in the string to be matched. In thread 2, matching instruction 0 "char 'a'" is executed, matching "b" with "a". The match fails, and thread 2 is closed. Simultaneously, thread 1 executes matching instruction 1 "fork6", creating a new thread 3. Thread 3 prepares to execute matching instruction 6 "char 'b'". Thread 1 continues executing matching instruction 2 "char 'b'", processing the second character "b" in the string to be matched, matching "b" with "b". The match is successful, thread 1 is paused, and it prepares to execute matching instruction 3 "char 'd'". Thread 3 executes matching instruction 6 "char 'b'", matching the second character "b" in the string to be matched with "b". The match is successful, thread 3 is paused, and it prepares to execute matching instruction 7 "char 'c'". The execution of matching instruction 2 "char 'b'" by thread 1 and the execution of matching instruction 6 "char 'b'" by thread 3 can occur concurrently.
[0069] Create thread 4 to process the third character "c" in the string to be matched. In thread 4, execute matching instruction 0 "char 'a'", matching "c" with "a". The match fails, and thread 4 is closed. Simultaneously, thread 1 continues executing matching instruction 3 "char 'd'", processing the third character "c" in the string to be matched. Matching "c" with "d" fails, and thread 1 is closed. Meanwhile, thread 3 continues executing matching instruction 7 "char 'c'", processing the third character "c" in the string to be matched. Matching "c" with "c" succeeds, thread 3 is paused, and preparation begins for executing matching instruction 8 "match 1".
[0070] Thread 5 is created to process the fourth character "k" in the string to be matched. In thread 5, matching instruction 0 "char 'a'" is executed, attempting to match "k" with "a". The match fails, and thread 5 is closed. Simultaneously, thread 3 successfully matches matching condition 1 "abc", recording the character indicated when the match with matching condition 1 ended, i.e., j=4, k=1. Thread 3 then continues executing matching instruction 9 "stop", stopping data matching. Thread 3 is closed, and the quintuple (9,4,1,4,1) is recorded.
[0071] Create thread 6 to process the 5th character "a" in the string to be matched; execute matching instruction 0 "char 'a'" in thread 6 to match "a" with "a". If the match is successful, record the sequence number of the character indicated when the matching condition was successfully matched, i.e., i=1. Pause thread 6 and prepare to execute matching instruction 1 "fork 6".
[0072] Thread 7 is created to process the 6th character "b" in the string to be matched. In thread 7, matching instruction 0 "char 'a'" is executed, matching "b" with "a". The match fails, and thread 7 is shut down. Simultaneously, thread 6 executes matching instruction 1 "fork6", creating a new thread 8. Thread 8 prepares to execute matching instruction 6 "char 'b'". Thread 6 continues executing matching instruction 2 "char 'b'", processing the 6th character "b" in the string to be matched, matching "b" with "b". The match is successful, thread 6 is paused, and it prepares to execute matching instruction 3 "char 'd'". Thread 8 executes matching instruction 6 "char 'b'", matching the 6th character "b" in the string to be matched with "b". The match is successful, thread 8 is paused, and it prepares to execute matching instruction 7 "char 'c'". The execution of matching instruction 2 "char 'b'" by thread 6 and the execution of matching instruction 6 "char 'b'" by thread 8 can occur concurrently.
[0073] Thread 9 is created to process the 7th character "d" in the string to be matched. In thread 9, matching instruction 0 "char 'a'" is executed, attempting to match "d" with "a". The match fails, and thread 9 is shut down. Simultaneously, thread 6 continues executing matching instruction 3 "char 'd'" to process the 7th character "d" in the string to be matched. "d" is matched with "d", and the match succeeds. Thread 6 is paused and prepares to execute matching instruction 4 "match 0". Meanwhile, thread 8 continues executing matching instruction 7 "char 'c'" to process the 7th character "d" in the string to be matched. "d" is matched with "c", and the match fails, so thread 8 is shut down.
[0074] Thread 10 is created to process the 8th character "b" in the string to be matched. In thread 10, matching instruction 0 "char 'a'" is executed, attempting to match "b" with "a". The match fails, and thread 10 is closed. Simultaneously, thread 6 continues executing matching instruction 4 "match 0". Thread 6 successfully matches matching condition 0 "a(bd)+", and records the character indicated when the match with matching condition 0 ended, i.e., j=8, k=0. Thread 6 then continues executing matching instruction 5 "jump 2", jumping to matching instruction 2 "char 'b'" and executing it, matching the 8th character "b" with "b". The match succeeds, thread 6 is paused, and preparation begins for executing matching instruction 3 "char 'd'".
[0075] Thread 11 is created to process the 9th character "d" in the string to be matched. In thread 11, matching instruction 0 "char 'a'" is executed, attempting to match "d" with "a". The match fails, and thread 11 is shut down. Simultaneously, thread 6 executes matching instruction 3 "char 'd'", attempting to match the 9th character "d" with "d". The match succeeds, thread 6 is paused, and preparation begins for executing matching instruction 4 "match0".
[0076] At this point, there are no more characters to match in the string to be matched, so no new thread is created. Thread 6 continues to execute matching instruction 4 "match 0". Thread 6 successfully matches matching condition 0 "a(bd)+", and records the character indicated when the match with matching condition 0 ended, i.e., j=10, k=0. Thread 6 continues to execute matching instruction 5 "jump 2", jumps to matching instruction 2 "char'b'" and executes matching instruction 2. Since there are no more characters to match "b", the match fails, thread 6 is shut down, and the quintuple (2,10,5,10,0) is recorded. At this point, no threads are alive, and the data matching ends.
[0077] It should be noted that the creation of threads 0, 1, 2, 4, 5, 6, 7, 9, 10, and 11 is performed simultaneously.
[0078] Furthermore, the positions of the quintuples (9,4,1,4,1) and (2,10,5,10,0) and the string to be processed are recorded. The quintuple (9,4,1,4,1) indicates that the thread ended when matching instruction 9 "stop" was executed, and at this time, the 4th character "k" in the string to be processed is being processed. The characters in the string to be matched that successfully match the matching condition "abc" are the 1st to 4th characters. The quintuple (2,10,5,10,0) indicates that the thread ended when matching instruction 2 "char'b'" was executed, and at this time, the 10th character, the null character, in the string to be processed is being processed. The characters in the string to be matched that successfully match the matching condition "a(bd)+" are the 5th to 10th characters. After the data matching is completed, the position information of the string to be matched "qabckabdbd" that meets the matching conditions and the quintuples are added to the matching data set for statistical analysis, resulting in a matching result set.
[0079] In a non-limiting embodiment, the type of a field group can correspond to at least one matching condition, and the type of the field group can be determined based on the matching degree of each matching condition. Specifically, the matching degree of the field group type is determined based on the matching degree of the matching conditions, and the type with the highest matching degree (greater than a preset ratio) is taken as the type of the field group. For example, the total number of data in field group A is 100, of which 80 match data meet matching condition 1 and 70 match data meet matching condition 2. The type of the field group corresponding to matching condition 1 is "ID card" and the type of the field group corresponding to matching condition 2 is "name". If the matching degree of matching condition 1 is 80% and the matching degree of matching condition 2 is 70%, then the matching degree of type "ID card" is 80% and the matching degree of type "name" is 70%. When the preset ratio is 60%, the type with the highest matching degree is selected, and type "ID card" is taken as the type of field group A.
[0080] Furthermore, the name and comments of the field group can be combined to determine if it is the target field group. The type matching degree of the field group can be calculated using the following formula:
[0081] P(O i |C j )=α×P(O i |C j .M T )+β×P(O i |C j .D T (1)
[0082]
[0083]
[0084] Among them, P(O) i |C j ) indicates field group C j Corresponding type O i The matching degree, P(O) i |C j .M T ) indicates field group C j The name and comment information match the corresponding type O. i The matching degree, P(O) i |C j .M T ) by type O i The corresponding k matching conditions R l The weighted sum of matching degrees is used to obtain P(O) i |C j .D T ) indicates field group C j The type O corresponding to the matching conditions that each matching data in the middle meets. i The matching degree, P(O) i |C j .D T ) by type O i The corresponding k matching conditions R l The weighted sum of matching degrees is obtained, where α is P(O) i |C j .M T The first weight of P(O) is β. i |C j .D T The second weight of ) is ω1, which represents the matching conditions R. l The third weight, ω2, is the weight of each matching condition R. l The fourth weight.
[0085] In obtaining type O i Matching degree P(O) i |C j After that, the matching degree P(O) will be... i |C j Maximum and matching degree P(O) i |C j Type O greater than the preset threshold i As the type of the field group.
[0086] In this embodiment, the data to be matched is determined by location information, and data matching is performed in parallel on each data node. This allows for simultaneous matching of multiple data sets, improving the matching speed. Furthermore, matching is performed according to a set of matching instructions, which are executed in parallel across threads. This enables the data to be matched against multiple conditions simultaneously, significantly improving matching efficiency. Retrieving the data directly from its storage location shortens the time spent on database data searches, further enhancing matching efficiency.
[0087] Figure 2 This is an overall flowchart of another target field search method provided in an embodiment of the present invention.
[0088] In specific implementation, the target field lookup method described in steps 201 to 202 below can be used in a client. These steps can be executed by the client, by a chip with data processing capabilities within the client, or by a chip module within the client that includes a chip with data processing capabilities. In one specific embodiment, the client can execute each step of the target field lookup method.
[0089] In step 201, a matching request is generated;
[0090] In step 202, the matching request is sent.
[0091] In a non-limiting embodiment, the matching request includes a set of instructions. The client can obtain multiple matching conditions and obtain matching instruction groups corresponding to the multiple matching conditions from the rule base to obtain the instruction set. The rule base includes multiple matching conditions and their corresponding matching instruction groups.
[0092] In practice, matching conditions can be regular expressions. The client can compile multiple regular expressions into a nondeterministic finite automaton, and the matching set corresponding to multiple regular expressions can be obtained from the rule base based on the correspondence between regular expressions and matching instructions. Users can set different matching conditions according to different requirements to meet various data matching needs.
[0093] In practice, the matching request may also include location information. The client can obtain the location information input by the user to perform data matching on the data to be matched at the location specified by the user. The location information may include library identifier and table identifier.
[0094] In practice, the matching request generated by the client may also include a preset number of matches, so that the server can perform data matching on the preset number of data to be matched.
[0095] In practice, after the client generates a matching request, it sends the request to the server. The server then determines the data to be matched based on the location information and performs data matching on the data according to multiple matching conditions in parallel, following a set of instructions. Furthermore, after the server determines the target field groups and their types, the client can receive a set of search results sent by the server. This set of search results includes each target field group and its type, allowing the client to display the search results for the target fields to the user.
[0096] In this embodiment, a set of corresponding instructions is selected based on multiple matching conditions. The server then performs data matching on the data to be matched according to these instructions in parallel, and sends a matching request containing the instruction set to the server. The user receives the search result set from the server. Users no longer need to judge the content of the matched data themselves; they can directly view the target field group and its type displayed on the client, improving the user experience.
[0097] Figure 3 This is a flowchart illustrating a target field lookup method provided in an embodiment of the present invention.
[0098] In step 301, the client generates a matching request;
[0099] In step 302, the client sends a matching request to the server, and the server receives the matching request accordingly.
[0100] In practice, a matching request may include a set of instructions and location information. The set of instructions includes matching instructions for multiple matching conditions, which can be obtained from the rule base according to the matching conditions. The location information is used to locate the data to be matched.
[0101] In step 303, the server determines the location of the data to be matched based on the location information in the matching request. Specifically, the data node where the data to be matched is stored can be determined based on the library identifier and table identifier in the location information.
[0102] In step 304, each data node in the server runs a matching process to perform data matching on the data to be matched in parallel, and generates a set of matching results after the data matching is completed. Specifically, the matching process can run on the data nodes. The matching process is used to match the data to be matched according to the instructions in the instruction set. The matching process can be developed in advance by the developers and deployed on the server.
[0103] In practice, data files larger than a preset size can be split into multiple memory files, and data matching can be performed on these multiple memory files in parallel to improve the efficiency of matching large files. For specific steps regarding data matching, please refer to [link / reference needed]. Figure 1 The relevant descriptions in the document will not be repeated here.
[0104] In step 305, the server determines the target field group based on the matching result set. For detailed steps on determining the target field group, please refer to [link / reference needed]. Figure 2 The relevant descriptions in the document will not be repeated here.
[0105] In practice, each target field group and its type can be added to the search results set.
[0106] In step 306, the server sends the search result set to the client; correspondingly, the client receives the search result set. The client can display the target field group or save the target field group and its type as needed.
[0107] Figure 4 This is a schematic diagram of a specific application scenario provided by an embodiment of the present invention.
[0108] like Figure 4 As shown, in a specific application scenario, after obtaining multiple matching conditions, client 41 retrieves the matching instruction groups corresponding to the multiple matching conditions from the rule base 40 to obtain an instruction set, and obtains the location information input by the user. Client 41 generates a matching request based on the instruction set and the location information, and sends the matching request to the communication module 421 in server 42. Specifically, the server can be a Hadoop cluster.
[0109] Furthermore, upon receiving a matching request, the communication module 421 controls the query module 422 to perform a query based on the location information in the matching request. This determines the data nodes indicated by the library identifier and table identifier, allowing the acquisition of data to be matched from the data nodes corresponding to the location information. The module also determines the names and comment information of each field group in the table based on the library identifier and table identifier, using these as the data to be matched. Specifically, the query module can be a Hive tool within a Hadoop cluster.
[0110] Furthermore, the communication module 421 controls the processing modules 423 on each data node to perform data matching on the data to be matched according to the instruction set. After completing the data matching, the communication module 421 statistically analyzes the matching data sets generated by each processing module 423 to form a matching result set. Specifically, the processing modules can be developed in advance by the developers and deployed on the server.
[0111] Furthermore, the communication module 421 determines the target field groups and their types based on the matching result set, adds each target field group and its type to the search result set, and sends the search result set to the client 41.
[0112] Furthermore, after receiving the search result set, client 41 saves the search result set or displays it to the user.
[0113] like Figure 5 As shown, this embodiment of the invention also discloses a target field lookup device. The target field lookup device 50 includes:
[0114] The acquisition module 501 is used to acquire a matching request, the matching request including an instruction set and location information, the instruction set including matching instructions for multiple matching conditions, and the location information used to locate the data to be matched;
[0115] Positioning module 502 is used to determine the data to be matched based on the positioning information;
[0116] The matching module 503 is used to perform data matching on the data to be matched in parallel according to the instruction set and the multiple matching conditions, so as to add the matching data that meets the matching conditions to the matching data set;
[0117] The filtering module 504 is used to filter the matching data set to obtain a matching result set. The matching result set includes statistical information of the matching data that meets the matching conditions. The statistical information includes the number of matching data that meets each matching condition in each field group.
[0118] The target field group confirmation module 505 is used to determine the type of the field group based on the statistical information in order to obtain the target field group.
[0119] In specific implementations, the aforementioned target field lookup device may correspond to a chip with data processing capabilities in a server, such as a System-On-a-Chip (SOC), a baseband chip, etc.; or to a chip module in a server that includes a chip with data processing capabilities; or to a chip module with a chip having data processing capabilities; or to a server.
[0120] For more information on the working principle and operation mode of the target field lookup device 50, please refer to [link / reference needed]. Figure 1 , Figure 3 and Figure 4 The relevant descriptions in the text will not be repeated here.
[0121] like Figure 6 As shown, this embodiment of the invention also discloses another target field lookup device. The target field lookup device 60 includes:
[0122] Generation module 601 is used to generate a matching request, the matching request including a set of instructions and location information, the set of instructions including matching instructions for multiple matching conditions, and the location information used to locate the data to be matched.
[0123] The sending module 602 is used to send the matching request so that the server can determine the data to be matched based on the location information, perform data matching on the data to be matched in parallel according to the multiple matching conditions according to the instruction set, add the matching data that meets the matching conditions to the matching data set, and filter the matching data set to obtain the matching result set, so as to determine the type of the field group based on the statistical information in the matching result set to obtain the target field group.
[0124] In specific implementations, the aforementioned data matching device may correspond to a chip with data processing capabilities in the client, such as a System-On-a-Chip (SOC), a baseband chip, etc.; or to a chip module in the client that includes a chip with data processing capabilities; or to a chip module with a chip having data processing capabilities; or to the client itself.
[0125] For more information on the working principle and operation mode of the target field lookup device 60, please refer to [link / reference needed]. Figure 2 , Figure 3 and Figure 4 The relevant descriptions in the text will not be repeated here.
[0126] Regarding the modules / units included in the various devices and products described in the above embodiments, they can be software modules / units, hardware modules / units, or a combination of both. For example, for various devices and products applied to or integrated into a chip, all of their modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs that run on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits; for various devices and products applied to or integrated into a chip module, all of their modules / units can be implemented using hardware methods such as circuits, and different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware methods such as circuits. The components can be implemented using software programs that run on the processor integrated within the chip module. The remaining (if any) modules / units can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into the terminal, each of its components / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or in different components within the terminal. Alternatively, at least some modules / units can be implemented using software programs that run on the processor integrated within the terminal, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits.
[0127] This invention also discloses a storage medium, wherein the computer-readable storage medium is a non-volatile storage medium or a non-transient storage medium, and the storage medium stores a computer program thereon, which can be executed when the computer program is run. Figures 1 to 4 The steps of the method shown are illustrated. The storage medium may include ROM, RAM, disk, or optical disk, etc. The storage medium may also include non-volatile memory or non-transitory memory, etc.
[0128] This invention also discloses a server, which may include a memory and a processor. The memory stores a computer program that can run on the processor, and the processor can execute the computer program. Figure 1 , Figure 3 and Figure 4 The steps of the method shown are as follows.
[0129] This invention also discloses a client, which may include a memory and a processor. The memory stores a computer program that can run on the processor, and the processor can execute the computer program. Figure 2 , Figure 3 and Figure 4 The steps of the method shown are as follows.
[0130] In the embodiments of this application, "multiple" refers to two or more.
[0131] The descriptions of "first," "second," etc., appearing in the embodiments of this application are for illustrative purposes and to distinguish the objects being described. They have no order and do not indicate any special limitation on the number of devices in the embodiments of this application, nor do they constitute any limitation on the embodiments of this application.
[0132] It should be understood that in the embodiments of this application, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0133] It should also be understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0134] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0135] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0136] In the several embodiments provided in this application, it should be understood that the disclosed methods, apparatuses, and systems can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for example, the division of units is merely a logical functional division, and other division methods may exist in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0137] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0138] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can be physically comprised separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or in the form of hardware plus software functional units.
[0139] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute some steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0140] While the present invention has been disclosed above, it is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of the invention; therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.
Claims
1. A method for searching a target field, characterized in that, include: A matching request is obtained, which includes a set of instructions and location information. The set of instructions includes a group of matching instructions for multiple matching conditions. Each group of matching instructions includes at least one matching instruction, and each matching instruction corresponds to a matching character. The location information is used to locate the data to be matched. The data to be matched is determined based on the location information; wherein, the location information includes a library identifier and a table identifier; the step of determining the data to be matched based on the location information includes: obtaining the name and comment information of each field group in the table based on the library identifier and the table identifier, and using the name and comment information of the field group as the data to be matched; The data to be matched is matched in parallel according to the instruction set and the multiple matching conditions, so as to add the matching data that meets the matching conditions to the matching data set; the parallel matching of the data to be matched according to the instruction set and the multiple matching conditions includes: for each data to be matched, a corresponding matching thread is established for each of the multiple characters to be matched, so that each matching thread starts from a different character position of the data to be matched and executes multiple matching instructions in the same matching instruction group in parallel, and sequentially determines whether the character to be matched is consistent with the matching character corresponding to the matching instruction; wherein, the parallel execution of multiple matching instructions in the same matching instruction group by each matching thread starting from a different character position of the data to be matched and sequentially determining whether the character to be matched is consistent with the matching character corresponding to the matching instruction includes: if the current character to be matched is consistent with the matching character corresponding to the current matching instruction in the current thread, then the next character to be matched in the data to be matched is selected in the current thread, and it is determined whether the character is consistent with the matching character corresponding to the next matching instruction of the current matching instruction; if the current character to be matched is inconsistent with the matching character corresponding to the current matching instruction in the current thread, then the current thread is closed; The matching request also includes a preset matching quantity. When the number of data to be matched is greater than the preset matching quantity, the data matching is performed on the preset matching quantity of data to be matched. The matching data set is filtered to obtain a matching result set, which includes statistical information on the matching data that meets the matching conditions. The statistical information includes the number of matching data that meets each matching condition in each field group. The type of the field group is determined based on the statistical information to obtain the target field group; The step of determining the type of the field group based on the statistical information includes: determining the proportion of the number of matching data that meets the matching conditions in each field group to the number of data to be matched in the field group, so as to obtain the matching degree of each matching condition; determining at least one matching condition corresponding to each candidate type according to a preset correspondence between field group types and matching conditions; for each candidate type, determining the matching degree of the candidate type according to the matching degree of its corresponding at least one matching condition; and determining the candidate type with the highest matching degree greater than a preset threshold as the type of the field group.
2. The target field lookup method according to claim 1, characterized in that, The step of determining the data to be matched based on the location information includes: The storage location of the data to be matched is determined based on the library identifier and the table identifier; The data to be matched is obtained using the storage location of the data to be matched.
3. A method for searching a target field, characterized in that, include: A matching request is generated, which includes a set of instructions and location information. The set of instructions includes a group of matching instructions for multiple matching conditions. Each group of matching instructions includes at least one matching instruction, and each matching instruction corresponds to a matching character. The location information is used to locate the data to be matched. Send the matching request so that the server can perform the following operations: determine the data to be matched based on the location information; wherein the location information includes a library identifier and a table identifier; determining the data to be matched based on the location information includes: obtaining the names and annotation information of each field group in the table based on the library identifier and the table identifier, and using the names and annotation information of the field groups as the data to be matched; performing data matching on the data to be matched in parallel according to the multiple matching conditions according to the instruction set, so as to add the matching data that meets the matching conditions to the matching data set, and filtering the matching data set to obtain a matching result set, wherein the matching result set includes statistical information of the matching data that meets the matching conditions, so as to determine the type of the field group based on the statistical information in the matching result set to obtain the target field group; The step of performing data matching on the data to be matched in parallel according to the instruction set and the multiple matching conditions includes: for each data to be matched, establishing a corresponding matching thread for each of the multiple characters to be matched, so that each matching thread starts from a different character position in the data to be matched and executes multiple matching instructions in the same matching instruction group in parallel, and sequentially determines whether the character to be matched is consistent with the matching character corresponding to the matching instruction; wherein, the step of each matching thread starting from a different character position in the data to be matched and executing multiple matching instructions in the same matching instruction group in parallel, and sequentially determining whether the character to be matched is consistent with the matching character corresponding to the matching instruction includes: if the current character to be matched is consistent with the matching character corresponding to the current matching instruction in the current thread, then selecting the next character to be matched in the data to be matched in the current thread, and determining whether the character is consistent with the matching character corresponding to the next matching instruction of the current matching instruction; if the current character to be matched is inconsistent with the matching character corresponding to the current matching instruction in the current thread, then closing the current thread; The step of determining the type of the field group based on the statistical information in the matching result set includes: determining the proportion of the number of matching data that meets the matching conditions in each field group to the number of data to be matched in the field group, so as to obtain the matching degree of each matching condition; determining at least one matching condition corresponding to each candidate type according to the preset correspondence between field group types and matching conditions; for each candidate type, determining the matching degree of the candidate type according to the matching degree of its corresponding at least one matching condition; and determining the candidate type with the highest matching degree greater than a preset threshold as the type of the field group. The matching request also includes a preset matching quantity. The matching request is sent so that when the number of data to be matched is greater than the preset matching quantity, the server performs the data matching on the preset matching quantity of data to be matched.
4. The target field lookup method according to claim 3, characterized in that, The generation of the matching request includes: Retrieve multiple matching conditions; The matching instruction groups corresponding to the multiple matching conditions are obtained from the rule base to obtain the instruction set. The rule base includes multiple matching conditions and their corresponding matching instruction groups.
5. A target field lookup device, characterized in that, include: The acquisition module is used to acquire a matching request. The matching request includes a set of instructions and location information. The set of instructions includes a group of matching instructions for multiple matching conditions. Each group of matching instructions includes at least one matching instruction, and each matching instruction corresponds to a matching character. The location information is used to locate the data to be matched. The positioning module is used to determine the data to be matched based on the positioning information; A matching module is configured to perform data matching on the data to be matched in parallel according to the instruction set and the multiple matching conditions, so as to add the matching data that meets the matching conditions to the matching data set; wherein, when the matching module performs data matching on the data to be matched in parallel according to the instruction set and the multiple matching conditions, the matching module is specifically configured to: for each data to be matched, establish a corresponding matching thread for the multiple characters to be matched, so that each matching thread starts from a different character position of the data to be matched and executes multiple matching instructions in the same matching instruction group in parallel, and sequentially determines whether the character to be matched is consistent with the matching character corresponding to the matching instruction; The matching request also includes a preset matching quantity. The matching module is further configured to perform data matching on the preset matching quantity of data to be matched when the number of data to be matched is greater than the preset matching quantity. The filtering module is used to filter the matching data set to obtain a matching result set. The matching result set includes statistical information on the matching data that meets the matching conditions. The statistical information includes the number of matching data that meets each matching condition in each field group. The target field group confirmation module is used to determine the type of the field group based on the statistical information in order to obtain the target field group; When determining the type of the field group based on the statistical information, the target field group confirmation module is specifically used to: determine the proportion of the number of matching data that meet the matching conditions in each field group to the number of data to be matched in the field group, so as to obtain the matching degree of each matching condition; determine at least one matching condition corresponding to each candidate type according to the preset correspondence between field group types and matching conditions; for each candidate type, determine the matching degree of the candidate type according to the matching degree of its corresponding at least one matching condition; and determine the candidate type with the highest matching degree greater than a preset threshold as the type of the field group. The location information includes a library identifier and a table identifier; the location module is specifically used to: obtain the name and comment information of each field group in the table according to the library identifier and the table identifier, and use the name and comment information of the field group as the data to be matched; When each matching thread starts from a different character position in the data to be matched and executes multiple matching instructions in the same matching instruction group in parallel, and sequentially determines whether the character to be matched is consistent with the matching character corresponding to the matching instruction, the matching module is specifically used for: if the current character to be matched is consistent with the matching character corresponding to the current matching instruction in the current thread, then selecting the next character to be matched in the data to be matched in the current thread, and determining whether the character is consistent with the matching character corresponding to the next matching instruction of the current matching instruction; if the current character to be matched is inconsistent with the matching character corresponding to the current matching instruction in the current thread, then closing the current thread.
6. A target field lookup device, characterized in that, include: A generation module is used to generate a matching request. The matching request includes a set of instructions and location information. The set of instructions includes a group of matching instructions for multiple matching conditions. Each group of matching instructions includes at least one matching instruction, and each matching instruction corresponds to a matching character. The location information is used to locate the data to be matched. A sending module is configured to send the matching request so that the server can perform the following operations: determine the data to be matched based on the location information; wherein the location information includes a library identifier and a table identifier; determining the data to be matched based on the location information includes: obtaining the names and annotation information of each field group in the table based on the library identifier and the table identifier, and using the names and annotation information of the field groups as the data to be matched; performing data matching on the data to be matched in parallel according to the instruction set according to the multiple matching conditions, so as to add the matching data that meets the matching conditions to the matching data set, and filtering the matching data set to obtain a matching result set, wherein the matching result set includes statistical information of the matching data that meets the matching conditions, so as to determine the type of the field group based on the statistical information in the matching result set to obtain the target field group; The step of performing data matching on the data to be matched in parallel according to the instruction set and the multiple matching conditions includes: for each data to be matched, establishing a corresponding matching thread for each of the multiple characters to be matched, so that each matching thread starts from a different character position in the data to be matched and executes multiple matching instructions in the same matching instruction group in parallel, and sequentially determines whether the character to be matched is consistent with the matching character corresponding to the matching instruction; wherein, the step of each matching thread starting from a different character position in the data to be matched and executing multiple matching instructions in the same matching instruction group in parallel, and sequentially determining whether the character to be matched is consistent with the matching character corresponding to the matching instruction includes: if the current character to be matched is consistent with the matching character corresponding to the current matching instruction in the current thread, then selecting the next character to be matched in the data to be matched in the current thread, and determining whether the character is consistent with the matching character corresponding to the next matching instruction of the current matching instruction; if the current character to be matched is inconsistent with the matching character corresponding to the current matching instruction in the current thread, then closing the current thread; The step of determining the type of the field group based on the statistical information in the matching result set includes: determining the proportion of the number of matching data that meets the matching conditions in each field group to the number of data to be matched in the field group, so as to obtain the matching degree of each matching condition; determining at least one matching condition corresponding to each candidate type according to the preset correspondence between field group types and matching conditions; for each candidate type, determining the matching degree of the candidate type according to the matching degree of its corresponding at least one matching condition; and determining the candidate type with the highest matching degree greater than a preset threshold as the type of the field group. The matching request also includes a preset matching quantity, and the sending module is further configured to send the matching request so that the server can perform the data matching on the preset matching quantity of the data to be matched when the number of data to be matched is greater than the preset matching quantity.
7. A server comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor runs the computer program, it performs the steps of the target field lookup method according to any one of claims 1 or 2.
8. A client comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor runs the computer program, it performs the steps of the target field lookup method according to any one of claims 3 or 4.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer-readable storage medium is a non-volatile or non-transient storage medium, and the computer program, when executed by a processor, performs the steps of the target field lookup method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Method and device for inquiring data in database
CN103984695A
Equipment data query method and device, server and computer readable storage medium
CN114356958A
Data query method and device, electronic equipment and storage medium
CN114741392A