Data matching method and apparatus, computer device, and computer-readable storage medium
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- KINGDEE SOFTWARE(CHINA) CO LTD
- Filing Date
- 2024-12-27
- Publication Date
- 2026-06-25
Smart Images

Figure CN2024143067_25062026_PF_FP_ABST
Abstract
Description
Data matching methods, apparatus, computer equipment and computer-readable storage media
[0001] This application claims priority to Chinese Patent Application No. 202411908226.1, filed on December 20, 2024, entitled “Data Matching Method, Apparatus, Computer Equipment and Computer-Readable Storage Medium”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of data processing, and in particular to a data matching method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0003] In the field of data processing, data matching is a crucial task, involving identifying and associating similar or related records from large datasets. General data matching is primarily based on the similarity between texts, evaluating the degree of match by comparing text content. Some data storage follows a specific structural framework and is accessed through encoding, such as assigning a unique long integer value to each data item, saving storage space while facilitating retrieval and access.
[0004] Data is circulated in encoded formats, while the data to be matched is often presented in text format. This difference in format makes it difficult to match data using traditional text similarity matching methods. How to achieve effective matching based on this difference has become an urgent problem to be solved in the field of data processing. Summary of the Invention
[0005] Therefore, it is necessary to provide a data matching method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can achieve the matching of data and text data, in order to address the above-mentioned technical problems.
[0006] Firstly, this application provides a data matching method, including:
[0007] Retrieve the text data to be matched;
[0008] Based on the matching results between the text data and the prompts in the preset relationship table, the business objects that match the text data are determined, and the candidate data identifiers are obtained based on the field identifiers of the business objects. The preset relationship table is used to represent the association between the prompts and the business objects.
[0009] Extract the description field of the candidate data from the candidate data data corresponding to the candidate data data identifier;
[0010] Based on the similarity between the description fields of each candidate data and the text data, target data that matches the text data is determined from the candidate data.
[0011] Secondly, this application provides a data matching device, comprising:
[0012] The text acquisition module is used to acquire the text data to be matched;
[0013] The data candidate module is used to determine the business object that matches the text data based on the matching result between the text data and the prompts in the preset relationship table, and to obtain the candidate data identifier based on the field identifier of the business object. The preset relationship table is used to represent the association between the prompts and the business objects.
[0014] The description extraction module is used to extract the description field of the candidate data from the candidate data data corresponding to the candidate data data identifier;
[0015] The data determination module is used to determine the target data that matches the text data from the candidate data based on the similarity between the description fields of each candidate data and the text data.
[0016] Thirdly, this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement:
[0017] Retrieve the text data to be matched;
[0018] Based on the matching results between the text data and the prompts in the preset relationship table, the business objects that match the text data are determined, and the candidate data identifiers are obtained based on the field identifiers of the business objects. The preset relationship table is used to represent the association between the prompts and the business objects.
[0019] Extract the description field of the candidate data from the candidate data data corresponding to the candidate data data identifier;
[0020] Based on the similarity between the description fields of each candidate data and the text data, target data that matches the text data is determined from the candidate data.
[0021] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which is implemented when executed by a processor:
[0022] Retrieve the text data to be matched;
[0023] Based on the matching results between the text data and the prompts in the preset relationship table, the business objects that match the text data are determined, and the candidate data identifiers are obtained based on the field identifiers of the business objects. The preset relationship table is used to represent the association between the prompts and the business objects.
[0024] Extract the description field of the candidate data from the candidate data data corresponding to the candidate data data identifier;
[0025] Based on the similarity between the description fields of each candidate data and the text data, target data that matches the text data is determined from the candidate data.
[0026] Fifthly, this application provides a computer program product, including a computer program, which is implemented when executed by a processor:
[0027] Retrieve the text data to be matched;
[0028] Based on the matching results between the text data and the prompts in the preset relationship table, the business objects that match the text data are determined, and the candidate data identifiers are obtained based on the field identifiers of the business objects. The preset relationship table is used to represent the association between the prompts and the business objects.
[0029] Extract the description field of the candidate data from the candidate data data corresponding to the candidate data data identifier;
[0030] Based on the similarity between the description fields of each candidate data and the text data, target data that matches the text data is determined from the candidate data.
[0031] The aforementioned data matching method, apparatus, computer equipment, computer-readable storage medium, and computer program product acquire text data to be matched; based on the matching results of the text data and prompts in a preset relationship table, determine the business object matching the text data, and obtain candidate data identifiers based on the field identifiers of the business object. The preset relationship table is used to represent the association between the prompts and the business object; extract the description field of the candidate data from the candidate data corresponding to the candidate data identifiers; and determine the target data matching the text data from the candidate data based on the similarity between the description fields of each candidate data and the text data. This application configures the association between various prompts and business objects and field identifiers through a preset relationship table, and filters candidate data identifiers from a large number of data identifiers based on the determined field identifiers. By determining the similarity between the description fields of each candidate data and the text data, matching between the description fields and the text data can be achieved. Since the description fields are the text describing the data, the matching between data and text data is transformed into matching between text and text, thereby achieving effective matching between data and text data. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1 is an application environment diagram of the data matching method in one embodiment;
[0034] Figure 2 is a flowchart illustrating a data matching method in one embodiment;
[0035] Figure 3 is a schematic diagram of the execution logic for removing stop words in one embodiment;
[0036] Figure 4 is a schematic diagram of the construction of a max-heap in one embodiment;
[0037] Figure 5 is a schematic diagram of the architecture of a data matching system in one embodiment;
[0038] Figure 6 is a flowchart of a data matching system in one embodiment;
[0039] Figure 7 is another flowchart of the data matching system in one embodiment;
[0040] Figure 8 is another flowchart of the data matching system in one embodiment;
[0041] Figure 9 is a structural block diagram of a data matching device in one embodiment;
[0042] Figure 10 is a structural block diagram of the data matching device in another embodiment;
[0043] Figure 11 is an internal structure diagram of a computer device in one embodiment;
[0044] Figure 12 is an internal structural diagram of a computer device in another embodiment. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to be used in the overall description of this application. The use of terms like "first" and "second" is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, the number of indicated technical features, or the sequential relationship between indicated technical features.
[0046] In the description of this application, unless otherwise expressly defined, terms such as "setup," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this application in conjunction with the specific content of the technical solution.
[0047] Currently, data matching is mainly based on the similarity between texts. A mathematical model is used to calculate the similarity between texts, and they are then ranked according to their similarity scores to find the text most similar to the target text. Text similarity matching methods include lexical similarity matching methods and semantic similarity matching methods.
[0048] Lexical similarity matching methods include cosine similarity matching and Jaccard similarity matching. Cosine similarity matching measures the similarity between two text vectors by calculating the cosine of the angle between them. Its advantages include computational simplicity and efficiency, but because it only considers word frequency information and neglects semantic and contextual information, it is only suitable for short texts and keyword matching scenarios. Jaccard similarity matching, based on set theory, evaluates similarity by calculating the ratio of the intersection to the union of the word sets in two texts. Jaccard similarity matching is computationally simple and easy to understand, but it also does not consider semantics and context, and has limited ability to handle synonyms and polysemous words, thus it is only suitable for simple text classification and clustering tasks.
[0049] Semantic-based similarity matching methods include latent semantic analysis (LSA) matching and pre-trained model matching. LSA matching maps text to a latent semantic space and extracts semantic information through singular value decomposition (SVD). Its advantage lies in leveraging context to improve matching accuracy, but it requires a large corpus and computational resources, and has high preprocessing requirements. Therefore, it is only suitable for text similarity matching and semantic analysis on large corpora. Pre-trained model matching, on the other hand, uses deep learning and natural language processing to extract text semantics. Its advantage lies in its ability to accurately handle complex textual relationships and semantic information, but its disadvantage is the need for large amounts of data and computational resources, and the time-consuming training process. This technique is suitable for tasks requiring high accuracy, such as information retrieval and question-answering systems.
[0050] On some business platforms, data is represented by a code that signifies a business object. This data has actual business meaning within the system and may have hierarchical relationships with other data. Key attributes include code, name, and description. The code typically uses a text field as the unique identifier for the data, while the name can be a text or multilingual text field to identify the data's name.
[0051] Data follows a specific structural framework, and its content is stored in the database in encoded form (such as long integer values). This difference makes similarity matching between data and text data particularly complex and challenging. Since text and long integer values are inherently incompatible, the aforementioned word-based or semantic matching methods are inadequate when applied to matching data and text data and cannot be directly applied.
[0052] This application provides a data matching method that transforms the matching of data and text data into matching between texts, thereby achieving effective matching of data and text data.
[0053] Please refer to Figure 1, which illustrates an application environment for the data matching method in one embodiment. The data matching method provided in this application embodiment can be applied to the application environment shown in Figure 1. In this environment, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on the cloud or other servers.
[0054] The terminal 102 can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, IoT device, or portable wearable device. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices, etc.
[0055] Server 104 can be a standalone physical server or a service node in a blockchain system. These service nodes form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP). Furthermore, server 104 can also be a server cluster composed of multiple physical servers, and can be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0056] Terminal 102 and server 104 can be connected via Bluetooth, USB (Universal Serial Bus) or network, etc., and this application does not impose any restrictions.
[0057] Both the terminal and the server can be used independently to execute the data matching method provided in the embodiments of this application.
[0058] For example, the server obtains text data to be matched, determines the business object matching the text data based on the matching results between the text data and prompts in a preset relationship table, and obtains candidate data identifiers based on the field identifiers of the business objects. The preset relationship table is used to represent the association between prompts and business objects. The server extracts the description field of the candidate data from the candidate data corresponding to the candidate data identifiers, and determines the target data matching the text data from the candidate data based on the similarity between the description fields of each candidate data and the text data.
[0059] In addition, the terminal and the server can also work together to execute the data matching method provided in the embodiments of this application.
[0060] For example, the terminal obtains the text data to be matched and sends the text data to be matched to the server.
[0061] The server determines the business object matching the text data based on the matching results with prompts in a preset relationship table. It then obtains candidate data identifiers based on the business object's field identifiers. The preset relationship table represents the association between the prompts and the business objects. The server extracts the description field of the candidate data from the candidate data corresponding to the candidate data identifiers and sends the candidate data and its description field to the terminal. The terminal determines the target data matching the text data from the candidate data based on the similarity between the description fields of each candidate data and the text data.
[0062] Please refer to Figure 2, which is a flowchart illustrating a data matching method in one embodiment. In one embodiment, as shown in Figure 2, a data matching method is provided, executed by the server in Figure 1, and includes the following steps:
[0063] Step S202: Obtain the text data to be matched.
[0064] The text data to be matched is the original text content used to compare or match with the data to find similar or related information. The text data to be matched can come from user-input query text, descriptive text in a database, or text information imported from external systems.
[0065] In one embodiment, the text data to be matched can be the text data returned by GPT (Generative Pre-trained Transformer). When using GPT to obtain the text data to be matched, we can input corresponding prompts or instructions into the GPT model according to the specific requirements of the matching task. After receiving these inputs, the GPT model uses its powerful text generation capabilities to output highly flexible and diverse text data related to the input prompts or instructions.
[0066] After obtaining the text data to be matched, the text data can be preprocessed, including removing irrelevant characters, standardizing the text format, and cleaning the text, in order to improve the quality of the text data and facilitate subsequent matching operations.
[0067] Step S204: Based on the matching results of the text data and the prompts in the preset relationship table, determine the business object that matches the text data, and obtain the candidate data identifier based on the field identifier of the business object.
[0068] Data refers to a collection of information about business objects on a business platform, uniquely identified by a specific code and stored in a database. These objects have practical business meaning and may be related to other data. In some cases, data is stored in a structured manner in the database, appearing as rows of metadata, each row containing a corresponding identifier, name, and description.
[0069] Please refer to Table 1, which lists data related to abilities and qualities.
[0070] Table 1
[0071] In the data shown in Table 1, each row of metadata includes a data identifier, a data name, a dimension to which it belongs, and a data description. The data identifier is used to uniquely identify the data in that row, and the description is used to provide a textual description of the content that the data in that row represents.
[0072] Data is stored in a database and retrieved using data identifiers. When it is necessary to match corresponding data with text data to be matched, it is difficult to determine the degree of association between each data item and the text data based solely on the data identifiers. This application provides a preset relationship table to achieve a preliminary association between text data and data.
[0073] Please refer to Table 2. Figure 2 shows an example of a preset relationship table. The preset relationship table is a pre-configured table showing the relationship between each prompt and the business object code, field identifier, etc., used to represent the association between the prompt and the business object.
[0074] Table 2
[0075] In this table, the business object is a software component or abstract entity used to identify and process business data, the prompt is text information associated with the business object, and the JSON KEY in Table 2 is the business object code. For example, the business object corresponding to the prompt "Automatically generate job description" could be a job posting.
[0076] The field identifier identifies the field corresponding to the business object. For example, the business object "Recruitment Brochure" may contain fields such as age and gender. The field type indicates the type of the field corresponding to the field identifier, which can include data type and non-data type.
[0077] After obtaining the text data to be matched, the text data is matched with prompts in a preset relationship table to determine the target prompt for the text data matching. Then, based on the target prompt, the corresponding business object is matched in the preset relationship table, and the candidate data identifier is obtained based on the field identifier of the business object.
[0078] The fields identified by the field identifiers of business objects require corresponding data to be entered. The field type corresponding to the field identifier represents the type of data to be entered into the field. When the field type corresponding to the field identifier is "data," it means that the field corresponding to that field identifier should be filled with data of the data type. Therefore, once the business object corresponding to the text data is determined, the data identifier corresponding to the field identifier of the business object can be used as a candidate data identifier, thereby filtering out data related to the text data from a large amount of data.
[0079] Step S206: Extract the description field of the candidate data from the candidate data corresponding to the candidate data identifier.
[0080] Since each data identifier uniquely identifies a data item, after determining the candidate data identifiers, the data corresponding to each candidate data identifier can be obtained as the candidate data, and the description field of each candidate data can be extracted.
[0081] Step S208: Based on the similarity between the description fields of each candidate data and the text data, determine the target data that matches the text data from the candidate data.
[0082] The description field is a text-formatted descriptive information used to describe the content of the data, as shown in Table 1 above. Since both the description field and the text data to be matched are in text format, traditional text similarity matching methods can be used to determine the similarity between the description field and the text data of each candidate data.
[0083] In determining the similarity between the description field and the text data of each candidate data, the aforementioned semantic-based matching method can be used. Alternatively, the description field and text data can be processed into word segmentation results, and the aforementioned word-based matching method can be used to determine the similarity between the word segmentation results of the description field and the word segmentation results of the text data. This application does not impose any limitations on this.
[0084] Since description fields provide descriptive information about the content of the data, the similarity between the description fields of each candidate data point and the text data can characterize the degree of association between the two. The higher the similarity of the description field, the stronger the association between the candidate data and the text data to be matched; conversely, the lower the similarity, the weaker the association. Therefore, based on the needs, the candidate data corresponding to one or more description fields with the highest similarity can be identified as the target data for matching the text data.
[0085] In one embodiment, the name field of the candidate data can be extracted from the candidate data data corresponding to the candidate data data identifier. The similarity to the text data is determined based on the description and name fields of each candidate data. For example, the name and description fields of the candidate data can be combined to obtain a combined field. Based on the similarity between the combined field of each candidate data and the text data, the target data matching the text data is determined from the candidate data. The method for determining the similarity between each combined field and the text data can be found in the description of determining the similarity between the description field and the text data, and will not be repeated here.
[0086] In the aforementioned data matching method, the text data to be matched is obtained; based on the matching results between the text data and prompts in a preset relationship table, the business object matching the text data is determined, and candidate data identifiers are obtained based on the field identifiers of the business object. The preset relationship table is used to represent the association between the prompts and the business object; from the candidate data corresponding to the candidate data identifiers, the description field of the candidate data is extracted; based on the similarity between the description field of each candidate data and the text data, the target data matching the text data is determined from the candidate data. This application configures the association between various prompts and business objects and field identifiers through a preset relationship table, and filters candidate data identifiers from a large number of data identifiers based on the determined field identifiers. By determining the similarity between the description field of each candidate data and the text data, the matching of the description field and the text data can be achieved. Since the description field is the text describing the data, the matching of data and text data is transformed into the matching between text and text, thereby achieving effective matching of data and text data.
[0087] In one embodiment, a preset relationship table includes the association between prompts and business object codes, field identifiers of business objects, and field types of field identifiers. Based on the matching results between text data and prompts in the preset relationship table, business objects matching the text data are determined, and candidate data identifiers are obtained based on the field identifiers of the business objects, including:
[0088] Identify the target prompt that matches the text data; based on the preset relationship table, determine the business object code corresponding to the target prompt; from the field identifiers corresponding to the business object code, determine the target field identifier whose field type is data; obtain the data identifier contained in the field attributes of the target field as candidate data identifiers.
[0089] After obtaining the text data to be matched, the text data is matched with prompts in a preset relation table to determine the target prompt for matching the text data. When matching the text data with prompts in the preset relation table, semantic similarity matching can be performed between the text data and each prompt, or the text data can be segmented into words, and the segmentation results can be matched with each prompt using a word similarity matching method to determine the target prompt for matching the text data.
[0090] The preset relationship table provided in this application embodiment includes the business object code, field identifier, and field type association of each business object. This preset relationship table can be dynamically maintained. When a new prompt or a new business object is introduced into the business system, a complete association between the newly introduced prompt and the business object code, field identifier, and field type is configured and added to the preset relationship table to dynamically expand the scope of use of prompts and data.
[0091] Based on this dynamically maintained preset relationship table, the corresponding business object and business object code can be matched in the preset relationship table based on the target prompt. The target field identifier with the field type of data can be obtained based on the business object code, and then the data identifier corresponding to the target field identifier can be determined as the candidate data identifier.
[0092] The data identifier corresponding to the target field identifier can be determined through the field attributes of the target field. Each field's field attributes contain the data or non-data that needs to be entered into that field, with the data being identified by a data identifier. Therefore, if a data identifier is obtained from the field attributes of the target field corresponding to the target field identifier, it can be used as a candidate data identifier, thereby filtering out data relevant to the text data from a large amount of data.
[0093] In one embodiment, determining the target field identifier whose field type is data from the field identifier corresponding to the business object code includes:
[0094] Obtain the main entity model corresponding to the business object code, and obtain the field identifiers contained in the main entity model; or, based on a preset relationship table, obtain the field identifiers corresponding to the business object code; determine the target field identifiers whose field type is data from the field identifiers.
[0095] Each business object code is associated with a master entity model for that business object. The master entity model is a data structure or framework designed for a specific business object to represent its key attributes. For example, if the business object is a job posting, the master entity model could be a job posting template. The same business object can have multiple business object codes. Please refer to Table 2. Taking Table 2 as an example, the business object "tsirm_positionir_view" is associated with four business object codes: "jobage", "jobdegree", "jobduty", and "jobrequire", each of which is associated with a master entity model.
[0096] Each main entity model of a business object is used to store a series of data related to the business object, with each location represented by a field. The main entity model contains multiple field identifiers to refer to the various fields within the main entity model. Different main entity models may contain different field identifiers.
[0097] After obtaining the main entity model, field identifiers can be retrieved from it. Alternatively, based on the associations configured in the aforementioned preset relationship table, the field identifiers corresponding to the business object codes can be directly obtained.
[0098] It should be noted that the main entity model contains numerous field identifiers. While these field identifiers can also be configured in the preset relationship table, maintaining the preset relationship table requires time and manpower, inevitably leading to omissions. Furthermore, different main entity models may contain the same field identifiers. Therefore, obtaining field identifiers through the main entity model is more accurate than obtaining them directly from the preset relationship table.
[0099] In the above embodiments, by configuring a preset relationship table, the association between prompts and business object codes, field identifiers of business objects, and field types of field identifiers can be cached, improving data query performance and quickly determining candidate data. By dynamically maintaining the preset relationship table, the scope of use of prompts and data can be quickly expanded.
[0100] In one embodiment, before obtaining the text data to be matched, the method further includes:
[0101] The description fields of each data item are segmented into words to obtain the segmentation results of the data item.
[0102] To achieve matching between description fields and text data, semantic similarity matching can be performed on the description fields and text data, or word-based similarity matching can be performed based on the word segmentation results of the description fields and text data.
[0103] Word segmentation is used to divide descriptive fields or text data into words or phrases for subsequent processing. Optionally, word segmentation can be implemented using word segmenters such as jieba and HanLP. In one embodiment, a word segmentation implementation class can be set up, with various word segmentation interfaces configured within the class to flexibly select from various open-source word segmenters and improve scalability. The output of various open-source word segmenters is set to a unified format for seamless integration. For example, the output format can be set to a List. <string>After a line of data is processed into words, the word segmentation results of the string set are obtained.
[0104] Taking the data marked as 1022_S in Table 1 as an example, the description field of this data is "Managers properly handle various relationships such as superiors, peers, and subordinates in their daily work to reduce friction." After word segmentation, the resulting word segmentation is [manager / nnt, in / p, daily / b, work / vn, in / f, properly handle / nz, good / a, superior / n,、 / w, peer / b,、 / w, subordinate / n, etc / udeng, various / rz, relationships / n,, / w, make / v, its / rz, reduce / v, friction / vn,。 / w].
[0105] Optionally, the description and name fields of the data can be segmented together to obtain the segmentation result of the data as [manager / nnt, in / p, daily / b, work / vn, in / f, properly handle / nz, good / a, superior / n,、 / w, peer / b,、 / w, subordinate / n, etc / udeng, various / rz, relationships / n,, / w, make / v, its / rz, reduce / v, friction / vn,。 / w, communication and coordination ability].
[0106] It should be noted that the word segmentation processing for the description field can be performed in advance. That is, before obtaining the text data to be matched, the description field of each data item is segmented to obtain the word segmentation results. The word segmentation results of each data item are cached along with the corresponding data item identifiers. After obtaining the text data to be matched and identifying the candidate data item identifiers, the word segmentation results corresponding to the candidate data item identifiers are directly retrieved from the cache, thereby improving data matching efficiency. On the other hand, before performing word segmentation processing on the description text of each data item, the data item identifier of that data item is cached for matching. If a matching word segmentation result is found, that data item is skipped to avoid duplicate word segmentation operations.
[0107] In one embodiment, determining the target data that matches the text data from the candidate data based on the similarity between the description fields of each candidate data and the text data includes:
[0108] Based on the word segmentation results of the description fields of each candidate data and the word segmentation results of the text data, the similarity between the description fields of each candidate data and the text data is determined; based on the similarity between the description fields of each candidate data and the text data, the target data that matches the text data is determined from the candidate data.
[0109] In some cases, text data is obtained through GPT. Instructing GPT can cause it to directly return the word segmentation results of the text data. By combining the word segmentation results of the description field of the pre-processed candidate data, rapid matching between the candidate data and the text data can be achieved.
[0110] In the above embodiments, since the description field provides a detailed description of the data, word segmentation of the description field can preserve the original semantics of the data to the greatest extent, thereby achieving higher accuracy in subsequent matching. Furthermore, the word segmentation results of the description field are cached to avoid repeated segmentation operations, significantly improving processing performance. Through the above processing, the problem of matching data with text is transformed into direct matching between texts, thereby simplifying the processing flow and improving matching efficiency.
[0111] In one embodiment, after performing word segmentation on the description fields of each data item to obtain the word segmentation results, the method further includes:
[0112] Stop words are filtered out from the word segmentation results based on a preset stop word list to obtain filtered word segmentation results; the filtered word segmentation results are vectorized to obtain vectorized first word segmentation results; the first word segmentation results of each data are cached.
[0113] Stop words refer to words that have no significant semantic meaning in language processing. Pre-defined stop word lists can be built using stop word libraries such as ChineseStopWords, stopwords-json, jieba, and HanLP. Table 3 provides an example of a stop word list.
[0114] Table 3
[0115] This application provides a convenient interface for maintaining a stop word removal list to dynamically update the list. Based on a preset stop word removal list, stop words in the word segmentation results can be filtered out, and the execution logic is shown in Figure 3.
[0116] Business personnel maintain a stop word removal table by storing stop word information in a table, which is then cached. The cached stop word removal table is updated after each maintenance. This yields a list of the word segmentation results for the data. <string>Then, read the relevant configuration information, retrieve the cached stop word list, and filter out the List using the list's removeAll function. <string>The stop words in the list are used to obtain the filtered word segmentation results. <string>。
[0117] Optionally, cache the filtered word segmentation results corresponding to the data identifiers of the materials. Before removing stop words from the word segmentation results of each item of material data, the corresponding data identifiers of the materials are marked and cached for matching. If the corresponding filtered word segmentation results are matched, the word segmentation results of the material data are skipped to avoid repeated filtering operations.
[0118] Taking the material data marked as 1022_S in Table 1 as an example, the word segmentation results of the material data are [manager / nnt, in / p, daily / b, work / vn, in / f, properly handle / nz, well / a, superior / n, / w, peer / b, / w, subordinate / n, etc. / udeng, various / rz, relationships / n, / w, make / v, it / rz, reduce / v, friction / vn,. / w, communication and coordination ability], and the word segmentation results after removing stop words are [manager, in, daily, work, in, properly handle, superior, peer, subordinate, relationship, reduce, friction, communication and coordination ability].
[0119] The stop word removal function provided by the above embodiments supports online maintenance without downtime, ensuring that the business continuity is not affected. In addition, an efficient data import function is built in, greatly simplifying the integration process of a large amount of data and making the operation more rapid and convenient. This function effectively helps to remove redundant words (such as "of", "and", "in", etc.) in the text, significantly reducing data noise and improving the accuracy and efficiency of subsequent processing and analysis.
[0120] After filtering the stop words from the word segmentation results, vectorize the filtered word segmentation results to obtain the first vectorized word segmentation results. Vectorization is used to convert text data into vector form, that is, map each filtered word segmentation result into a vector space to capture the theme and content of each filtered word segmentation result, so that the computer can understand and process the meaning of each filtered word segmentation result.
[0121] The vectorization of the word segmentation results can be achieved through word embedding techniques such as Word2Vec and BERT, mapping each filtered word segmentation result into a high-dimensional real number vector, and this high-dimensional real number vector is the first word segmentation result. The first vectorized word segmentation results can be saved to the database through structured data, and data can be queried during the matching process and then similarity calculation can be performed.
[0122] It can be understood that the stop word removal processing and vectorization processing of each word segmentation result can also be pre-performed during idle time.
[0123] In one embodiment, the word segmentation result of the text data is a vectorized second word segmentation result after filtering out stop words. For example, by issuing an instruction to GPT, GPT can directly return the word segmentation result after stop word removal and vectorization processing as the second word segmentation result. It can be understood that after obtaining the text data to be processed, the text data can also be processed for stop word removal and vectorization in accordance with the above processing method to obtain the vectorized second word segmentation result.
[0124] In one embodiment, determining the similarity between the description field of each candidate data and the text data based on the word segmentation results of the description field of each candidate data includes:
[0125] Retrieve the first word segmentation result of each candidate data from the cache; for each candidate data, use the similarity between the first word segmentation result of the candidate data and the second word segmentation result of the text data as the similarity between the description field of the candidate data and the text data.
[0126] The first word segmentation results of each candidate data are directly retrieved from the cache to speed up the data matching process and improve data matching efficiency. For the first word segmentation results of the candidate data and the second word segmentation results of the text data, the similarity between the first word segmentation results and the second word segmentation results is calculated, and the obtained similarity is taken as the similarity between the candidate data and the text data.
[0127] Optionally, the Euclidean distance between the first and second word segmentation results can be calculated, and the similarity between the first and second word segmentation results can be determined based on the calculated Euclidean distance. The smaller the Euclidean distance, the greater the similarity determined; the larger the Euclidean distance, the smaller the similarity determined.
[0128] Optionally, the cosine similarity between the first and second word segmentation results can be calculated. This is the cosine of the angle between the vectorized first and second word segmentation results. The more similar the first and second word segmentation results are, and the smaller the angle between them, the greater the cosine similarity.
[0129] In the above embodiments, an innovative active fetching and idle-time hot standby strategy is adopted. The data to be matched is pre-processed by word segmentation, stop word removal and vectorization, which significantly shortens the actual matching calculation time and greatly improves the matching performance.
[0130] In one embodiment, determining the target data that matches the text data from the candidate data based on the similarity between the description fields of each candidate data and the text data includes:
[0131] Each similarity score is used as a node in a max-heap. A similarity-based max-heap is constructed. For each similarity score determined, if the newly determined similarity score is greater than the top node of the max-heap, the newly determined similarity score is added to the max-heap, and the node order in the max-heap is updated. When the similarity scores of the description fields of all candidate data and the text data have been traversed, the top N similarity scores with the largest values are determined based on the latest node order in the max-heap, where N is a positive integer. The candidate data corresponding to the top N similarity scores are determined as the target data that matches the text data.
[0132] In this embodiment of the application, when determining the target data based on the similarity between the description field and the text data of each candidate data, a max heap is built to determine the top N data with the highest similarity from each candidate data.
[0133] A max-heap is a special binary tree structure in which the value of each parent node is greater than or equal to the value of any of its child nodes, making it suitable for implementing priority queues. In a max-heap, the largest element is always located at the root node, and the remaining elements are arranged sequentially from parent to child nodes.
[0134] In one embodiment, the similarity between the description field of the candidate data and the text data, and the corresponding candidate data identifier, are stored in a Map as key-value pairs.<Long,Double> In this context, constructing a max-heap based on similarity is equivalent to constructing a Map-based max-heap.<Long,Double> A max-heap with double values can be implemented using a combination of PriorityQueue and Map.Entry. While PriorityQueue in the Java standard library can be conveniently used to implement max-heaps or min-heaps, it does not support directly using Maps as elements. This is because PriorityQueue requires a comparator capable of comparison, while Map itself is a key-value pair and cannot be directly compared.
[0135] Therefore, this application does not directly add the Map as an element to the PriorityQueue, but instead adds the Map entries (i.e., key-value pairs) as Map.Entry.<Long,Double> The entries are extracted in the form of [map.entry] and added to PriorityQueue. A custom comparator is also provided for PriorityQueue, which compares the size of entries based on the Double value (i.e., similarity or weight) in Map.Entry.
[0136] In this way, PriorityQueue can sort Map.Entries according to the size of the Double value, thus indirectly achieving the sorting of the Map.<Long,Double> This method allows you to sort data by similarity. It's both simple and efficient because it leverages the features of PriorityQueue and Map.Entry while avoiding the complexity of directly manipulating Map.
[0137] Figure 4 shows a schematic diagram of the logical implementation of the max-heap provided in this application embodiment. When constructing a similarity-based max-heap, the max-heap structure is first constructed and initialized, and the comparator is rewritten. Then, based on the initialized max-heap, for each determined similarity, the newly determined similarity is compared with the top node of the max-heap (the smallest node in the max-heap). If the newly determined similarity is greater than the top node of the max-heap, the newly determined similarity is added to the max-heap to progressively read the similarity calculation results. By traversing each similarity and updating the node order in the max-heap after each similarity is added, dynamic sorting of nodes in the heap is achieved.
[0138] When the similarity scores of the description fields of all candidate data and the text data are added to a max-heap, the top N similarity scores with the largest values are determined based on the latest node order in the max-heap. The candidate data corresponding to the top N similarity scores are then identified as the target data matching the text data. N is a positive integer and can be flexibly set according to matching requirements.
[0139] In the above embodiments, a max heap is used to determine the Top N similarities from each similarity, so only a heap structure of size N needs to be maintained. Each time a new similarity is obtained, it only needs to be compared with the smallest similarity in the heap, without having to sort all the similarities, thereby effectively improving the data matching efficiency.
[0140] This application also provides a data matching system. Please refer to Figures 5 and 6. Figure 5 is a system architecture diagram of the data matching system provided in an embodiment of this application, and Figure 6 is a flowchart of the data matching system. Specific embodiments of this data matching system are as follows:
[0141] The overall architecture of this data matching system comprises four parts: a business logic call layer, a core processing layer, a caching layer, and a storage layer. The storage layer, deployed on the business platform, is compatible with multiple databases and serves as the core data storage container. The storage layer stores pre-defined relational tables and, to meet diverse user needs, provides customizable extension classes. These classes allow users to customize and adjust parameters for word segmentation, stop word removal, vectorization, and similarity calculation to adapt to different data characteristics and requirements. Furthermore, the storage layer also stores a stop word removal table.
[0142] The core processing layer uses five core components to complete the data matching function, including word segmentation, stop word removal, vector representation, similarity calculation, and max heap.
[0143] The execution logic of the data matching system is shown in Figure 6, including the following steps S1 to S9.
[0144] S1. Input the text data returned by GPT and output the N data IDs with the highest similarity.
[0145] S2. Convert text data into a JSON object.
[0146] S3. Obtain the key-value pairs of the JSON object, perform word segmentation using the HanLP word segmentation library, and obtain the word segmentation results.
[0147] S4. Perform stop word removal and vectorization on the word segmentation results of the text data to obtain the second word segmentation result.
[0148] Word segmentation and vectorization can be accomplished by integrating existing open-source components. This application provides an access interface and specifies the format of input and output parameters to ensure smooth integration with various open-source components.
[0149] S5. Determine the candidate data corresponding to the text data.
[0150] For a detailed implementation of S5, please refer to Figure 7. Business personnel maintain the configured relationships to form a preset relationship table of entities, and extend the implementation class configuration. The preset relationship table and the extended implementation class are stored together in the database. The preset relationship table is updated in the cache, and the cached preset relationship table is updated after each maintenance.
[0151] When determining candidate data corresponding to text data, based on the target prompt matching the text data, a cached preset relationship table is read to obtain the business object code corresponding to the text data. The main entity model is obtained based on the business object code, and the field attributes of the corresponding fields are obtained based on the field identifiers in the main entity model. The data data corresponding to the data data identifier in the field attributes is determined as candidate data. The description field and name field of the candidate data are extracted based on the candidate data data identifier.
[0152] Set the output format of the word segmenter to List. <string>During idle time, the tokenizer implementation class is read, all data is traversed and looped, and the description and name fields of each data are preprocessed into tokenization results, resulting in a List of tokenization results for each row of data. <string>.
[0153] Encapsulate each data ID and its corresponding word segmentation result into a Map. <Long,List <string>This is to achieve the corresponding storage of word segmentation results and data IDs. Before each word segmentation process, the data ID is put into a cached Map for matching. If a matching result is found in the corresponding word segmentation result List... <string>Then, do not perform word segmentation again to avoid redundant word segmentation operations.
[0154] S6. Obtain the first word segmentation result corresponding to the candidate data.
[0155] S7. Calculate the cosine similarity between the first and second word segmentation results.
[0156] S8. Construct a max-heap data structure.
[0157] S9. Output the N data IDs with the highest similarity.
[0158] Please refer to Figure 8 for the specific implementation of steps S6 to S9. Business personnel maintain relevant information about the data during their off-peak hours.
[0159] These include:
[0160] (1) Perform pre-segmentation on each data item. Process the description field (and name field) of each data item into segmentation results and maintain the relationship between the data item ID and the segmentation results.
[0161] (2) Perform stop word removal on the segmentation results of each data set. Process each segmentation result into a filtered segmentation result and maintain the relationship between the data set ID and the filtered segmentation result.
[0162] (3) Perform pre-vectorization processing on each filtered word segmentation result. Process each filtered word segmentation result into a vectorized first word segmentation result.
[0163] Based on the maintained data, the data is pre-vectorized to obtain the first word segmentation result. The data ID is then stored in the database along with the first word segmentation result, and the cache is updated.
[0164] In step S6, based on the correspondence between the maintained data and the first word segmentation result, the first word segmentation result corresponding to the candidate data is directly obtained from the cache. This result, along with the vector representation of the text returned by GPT (the second word segmentation result), is then used in steps S7 to S9 for similarity calculation.
[0165] Considering that data usually contains a certain amount of data, text similarity matching is not limited to a 1:1 comparison between individual texts, but requires N:1 similarity calculation between multiple texts and a single text. This application adopts a thread pool approach to improve the performance efficiency of text matching. Based on the pre-cached first word segmentation results, multiple threads in the thread pool can be used to calculate the similarity between the second word segmentation results and multiple first word segmentation results, as shown in Figure 8.
[0166] The calculated similarities are constructed into a max-heap, and the top N data IDs corresponding to the highest similarities are output through the max-heap. Alternatively, the corresponding similarities can also be output, resulting in a Map<row ID, similarity>. The N data IDs with the highest similarities identify the target data corresponding to the text data.
[0167] In the above embodiments, the data description field information is segmented in detail through the design of data segmentation processing, preserving the original semantics to the greatest extent. Pre-segmentation, stop word removal, and vectorization of each data item significantly shorten the actual matching calculation time and greatly improve matching efficiency. Vectorized data caching, thread pools, and max heaps further improve the performance efficiency of text matching.
[0168] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0169] Based on the same inventive concept, this application also provides a data matching apparatus for implementing the data matching method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more data matching apparatus embodiments provided below can be found in the limitations of the data matching method described above, and will not be repeated here.
[0170] In one embodiment, as shown in FIG9, a data matching device is provided, comprising: a text acquisition module 701, a data candidate module 702, a description extraction module 703, and a data determination module 704, wherein:
[0171] The text acquisition module 701 is used to acquire the text data to be matched;
[0172] The data candidate module 702 is used to determine the business object that matches the text data based on the matching result between the text data and the prompts in the preset relationship table, and to obtain the candidate data identifier based on the field identifier of the business object. The preset relationship table is used to represent the relationship between the prompts and the business objects.
[0173] The description extraction module 703 is used to extract the description field of the candidate data from the candidate data data corresponding to the candidate data data identifier;
[0174] The data determination module 704 is used to determine the target data that matches the text data from the candidate data based on the similarity between the description fields of each candidate data and the text data.
[0175] In one embodiment, the preset relationship table contains the association between prompts and business object codes, field identifiers of business objects, and field types of field identifiers. When determining the business object matching the text data based on the matching results of the prompts in the preset relationship table, and obtaining candidate data identifiers based on the field identifiers of the business objects, the data candidate module 702 is further used for:
[0176] Identify the target prompt that matches the text data;
[0177] Based on the preset relationship table, the business object code corresponding to the target prompt is determined;
[0178] From the field identifiers corresponding to the business object code, determine the target field identifier whose field type is data.
[0179] Retrieve the data identifier contained in the field attributes of the target field, and use it as the candidate data identifier.
[0180] In one embodiment, when determining the target field identifier whose field type is data from the field identifiers corresponding to the business object code, the data candidate module 702 is further configured to:
[0181] Obtain the main entity model corresponding to the business object code, and obtain the field identifiers contained in the main entity model; or obtain the field identifiers corresponding to the business object code based on a preset relationship table.
[0182] Identify the target field identifier whose field type is data from the field identifier.
[0183] Referring to Figure 10, in one embodiment, the data matching device further includes a data segmentation module 705. Before acquiring the text data to be matched, the segmentation module 705 is used for:
[0184] The description fields of each data item are segmented into words to obtain the segmentation results of the data item.
[0185] When determining the target data that matches the text data from the candidate data based on the similarity between the description fields of each candidate data data and the text data, the data determination module 704 is also used for:
[0186] Based on the word segmentation results of the description fields of each candidate data and the word segmentation results of the text data, the similarity between the description fields of each candidate data and the text data is determined.
[0187] Based on the similarity between the description fields of each candidate data and the text data, the target data that matches the text data is determined from the candidate data.
[0188] Please refer to Figure 10. In one embodiment, the data matching device further includes a stop word removal module 706, a vectorization module 707, and a word segmentation caching module 708.
[0189] The stop word removal module 706 is used to filter out stop words in the word segmentation results based on a preset stop word list, so as to obtain the filtered word segmentation results;
[0190] The vectorization module 707 is used to vectorize the filtered word segmentation results to obtain the first vectorized word segmentation result.
[0191] The word segmentation caching module 708 is used to cache the first word segmentation results of each data set.
[0192] The word segmentation result of the text data is the vectorized second word segmentation result after filtering out stop words. When determining the similarity between the description field of each candidate data and the text data based on the word segmentation result of the description field of each candidate data and the word segmentation result of the text data, the data determination module 704 is also used for:
[0193] Retrieve the first word segmentation result of each candidate data from the cache;
[0194] For each candidate data set, the similarity between the first word segmentation result of the candidate data set and the second word segmentation result of the text data is used as the similarity between the description field of the candidate data set and the text data.
[0195] In one embodiment, when determining target data matching the text data from the candidate data based on the similarity between the description fields of each candidate data and the text data, the data determination module 704 is further configured to:
[0196] Each similarity is used as a node in a max-heap to construct a similarity-based max-heap. When a similarity is determined, if the newly determined similarity is greater than the top node of the max-heap, the newly determined similarity is added to the max-heap, and the node order in the max-heap is updated.
[0197] When the similarity between the description field and the text data of all candidate data has been traversed, the top N similarity values with the largest values are determined based on the latest node order in the max heap, where N is a positive integer.
[0198] The candidate data corresponding to the top N similarities are determined as the target data that matches the text data.
[0199] In the aforementioned data matching device, the text acquisition module 701 acquires the text data to be matched; the data candidate module 702 determines the business object matching the text data based on the matching result between the text data and the prompts in the preset relationship table, and obtains candidate data identifiers based on the field identifiers of the business objects. The preset relationship table is used to represent the association between the prompts and the business objects; the description extraction module 703 extracts the description field of the candidate data from the candidate data corresponding to the candidate data identifier; and the data determination module 704 determines the target data matching the text data from the candidate data based on the similarity between the description fields of each candidate data and the text data. This application configures the association between various prompts and business objects and field identifiers through a preset relationship table, and filters candidate data identifiers from a large number of data identifiers based on the determined field identifiers. By determining the similarity between the description fields of each candidate data and the text data, the matching of description fields and text data can be achieved. Since the description field is the text describing the data, the matching of data and text data is transformed into the matching between text and text, thereby achieving effective matching of data and text data.
[0200] Each module in the aforementioned data matching device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0201] Terms such as "component," "module," and "system" are intended to refer to computer-related entities, which can be hardware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, executable code, a thread of execution, a program, and / or a computer. For illustration, a running program on a server and the server itself can both be components. One or more components may reside within a process and / or a thread of execution, and components may be located within a single computer and / or distributed across two or more computers.
[0202] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram is shown in Figure 11. The computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is connected to the system bus via the I / O interfaces. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile computer-readable storage medium and internal memory. The non-volatile computer-readable storage medium stores an operating system, computer-readable instructions, and a database. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile computer-readable storage medium. The I / O interfaces of the computer device are used for exchanging information between the processor and external devices. The communication interface of the computer device is used for communicating with external terminals via a network connection. When the computer-readable instructions are executed by the processor, they implement a data matching method.
[0203] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in Figure 12. The computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile computer-readable storage medium and internal memory. The non-volatile computer-readable storage medium stores an operating system and computer-readable instructions. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile computer-readable storage medium. The input / output interface of the computer device is used for exchanging information between the processor and external devices. The communication interface of the computer device is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer-readable instructions are executed by the processor, they implement an audio enhancement method. The display unit of the computer device is used to form a visually visible image and may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0204] Those skilled in the art will understand that the structures shown in Figures 11 and 12 are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements.
[0205] In one embodiment, a computer device is also provided, including a memory and a processor, the memory storing computer-readable instructions, the processor executing the computer-readable instructions to implement the steps in the above method embodiments.
[0206] In one embodiment, a computer-readable storage medium is provided storing computer-readable instructions that, when executed by a processor, implement the steps in the above method embodiments.
[0207] In one embodiment, a computer program product is provided, the computer program product including computer-readable instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer-readable instructions from the computer-readable storage medium, and executes the computer-readable instructions, causing the computer device to perform the steps in the above-described method embodiments.
[0208] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a non-volatile computer-readable storage medium. When executed, these computer-readable instructions can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0209] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0210] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.< / string> < / string> < / string> < / string> < / string> < / string> < / string> < / string>
Claims
1. A data matching method, characterized in that, include: Retrieve the text data to be matched; Based on the matching results between the text data and the prompts in the preset relationship table, the business objects that match the text data are determined, and the candidate data identifiers are obtained based on the field identifiers of the business objects. The preset relationship table is used to represent the association between the prompts and the business objects. Extract the description field of the candidate data from the candidate data data corresponding to the candidate data data identifier; Based on the similarity between the description fields of each candidate data and the text data, target data that matches the text data is determined from the candidate data.
2. The method according to claim 1, characterized in that, The preset relationship table contains the association between prompts and business object codes, field identifiers of business objects, and field types of field identifiers. The process of determining the business object matching the text data based on the matching results of the text data and the prompts in the preset relationship table, and obtaining candidate data identifiers based on the field identifiers of the business object, includes: Identify the target prompt that matches the text data; Based on the preset relationship table, the business object code corresponding to the target prompt is determined; From the field identifiers corresponding to the business object code, determine the target field identifier whose field type is data; Obtain the data identifier contained in the field attributes of the target field, and use it as the candidate data identifier.
3. The method according to claim 2, characterized in that, The step of determining the target field identifier whose field type is data from the field identifiers corresponding to the business object code includes: Obtain the main entity model corresponding to the business object code, and obtain the field identifiers contained in the main entity model; or obtain the field identifiers corresponding to the business object code based on the preset relationship table. The target field identifier for data type is determined from the field identifiers.
4. The method according to claim 1, characterized in that, Before obtaining the text data to be matched, the process also includes: The description fields of each data item are segmented into words to obtain the segmentation results of the data item. The step of determining target data matching the text data from the candidate data based on the similarity between the description fields of each candidate data data and the text data includes: Based on the word segmentation results of the description fields of each candidate data and the word segmentation results of the text data, the similarity between the description fields of each candidate data and the text data is determined. Based on the similarity between the description fields of each candidate data and the text data, target data that matches the text data is determined from the candidate data.
5. The method according to claim 4, characterized in that, After performing word segmentation on the description fields of each data item to obtain the word segmentation results, the process further includes: The stop words in the word segmentation results are filtered out based on a preset stop word list to obtain the filtered word segmentation results; The filtered word segmentation results are vectorized to obtain the first vectorized word segmentation result; Cache the first word segmentation results of each data set; The word segmentation result of the text data is the vectorized second word segmentation result after filtering out stop words. The determination of the similarity between the description field of each candidate data and the text data based on the word segmentation result of the description field of each candidate data and the word segmentation result of the text data includes: Retrieve the first word segmentation result of each candidate data from the cache; For each candidate data, the similarity between the first word segmentation result of the candidate data and the second word segmentation result of the text data is used as the similarity between the description field of the candidate data and the text data.
6. The method according to claim 4, characterized in that, The step of determining target data matching the text data from the candidate data based on the similarity between the description fields of each candidate data data and the text data includes: Each similarity is used as a node in a max-heap to construct a similarity-based max-heap. When a similarity is determined, if the newly determined similarity is greater than the top node of the max-heap, the newly determined similarity is added to the max-heap, and the node order in the max-heap is updated. When the similarity between the description fields of all candidate data and the text data has been traversed, the top N similarity values with the largest values are determined based on the latest node order in the max heap, where N is a positive integer. The candidate data corresponding to the first N similarities are determined as the target data that matches the text data.
7. A data matching device, characterized in that, include: The text acquisition module is used to acquire the text data to be matched; The data candidate module is used to determine the business object that matches the text data based on the matching result between the text data and the prompts in the preset relationship table, and to obtain the candidate data identifier based on the field identifier of the business object. The preset relationship table is used to represent the association between the prompts and the business objects. The description extraction module is used to extract the description field of the candidate data from the candidate data data corresponding to the candidate data data identifier; The data determination module is used to determine the target data that matches the text data from the candidate data based on the similarity between the description fields of each candidate data and the text data.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.