Data element processing method, device, electronic device and storage medium
By building data structure model and mutual information value analysis, the problem of inefficiency of the data storage system is solved, and an efficient management and fast response data storage system is realized.
Patent Information
- Application Number
- CN202411540587.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2044-10-31
AI Technical Summary
In the prior art, the organizational efficiency of data elements is low when storing data elements, resulting in slow response speed of data storage systems and inability to flexibly respond to market changes and business needs.
Build a data structure model, identify entities and their relationships by listening to data update events, analyzing related entities using mutual information values, perform text matching and data storage, and establish target data relationships.
Improve the accuracy and speed of data storage and retrieval, reduce the complexity and maintenance costs of data management, and can flexibly adapt to business needs.
Smart Images

Figure CN119474234B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data element processing method, device, electronic device and storage medium. Background Art
[0002] As a new production factor, data forms the foundation of digitalization, networking, and intelligentization. It has been rapidly integrated into every aspect of production, distribution, circulation, consumption, and social service management, profoundly transforming production methods, lifestyles, and social governance. Data elements refer to data resources that exist in electronic form and participate in production and business activities through computational means, generating significant value.
[0003] In different business scenarios, such as production, distribution, circulation, consumption, and social service management, different types of raw data forms have different business scenarios and contain different information. These data forms may contain some common information, such as those involving the same objects, but also have their own unique information, such as information on different attribute categories related to the same objects. In the existing technology, the system will establish a separate data table for each data form type. Although this approach is simple and direct, it leads to a lot of duplication of work and complexity in system maintenance when adding new raw data form types or modifying existing types. As the business develops, the increase in raw data forms will cause the number of data tables to expand rapidly. Every time the object-related information is changed in a certain form, the data in other data forms may not have been updated yet. This will make the data of some interfaces or business calls not up to date.
[0004] Typically, changes to data in a form object require updating multiple different data tables related to that object, increasing the system's processing workload. Furthermore, when data outside of a form is updated, its data labels differ from those in the stored data, making management of the updated data chaotic and impossible to quickly locate based on data labels. In this case, the complexity of the data element structure and the high workload required for modification slow the data storage system's response time, making it unable to flexibly adapt to market changes and business needs. Summary of the Invention
[0005] The present invention provides a data element processing method, device, electronic device and storage medium to solve the defect of low organizational efficiency when storing data elements in the existing technology, and to improve the storage and response efficiency of the data storage system.
[0006] The present invention provides a data element processing method, comprising:
[0007] Constructing a data structure model and storing data based on the data structure model; the data structure model is used to define data labels of entities in the data and data relationships between entities;
[0008] When a data update event is detected, identify the entities in the updated data, the data relationships between the entities, and the data labels;
[0009] Perform text matching between entities in the updated data and entities under corresponding data labels;
[0010] In the case where no corresponding target entity is matched, determining an entity associated with the entity in the updated data from the stored data based on the mutual information value;
[0011] A target data relationship is established between the entity in the updated data and the associated entity, and the entity in the updated data is stored according to the target data relationship.
[0012] According to a data element processing method provided by the present invention, determining an entity associated with an entity in updated data from stored data based on a mutual information value includes:
[0013] Determining a strong entity and a weak entity corresponding to the strong entity from the stored data;
[0014] respectively determining a first mutual information value between the entity in the updated data and the strong entity and a second mutual information value between the entity in the updated data and the weak entity;
[0015] Based on the first mutual information value with the strong entity and the second mutual information value between each weak entity corresponding to the strong entity, an entity associated with the entity in the updated data is determined from among the strong entities and the weak entities.
[0016] According to a data element processing method provided by the present invention, determining an entity associated with an entity in updated data from among the strong entities and the weak entities based on a first mutual information value with the strong entity and a second mutual information value between the weak entities corresponding to the strong entity, includes:
[0017] When the first mutual information value between the strong entity and the weak entity is less than a first threshold and the second mutual information value between the weak entity and the strong entity is greater than a second threshold, the weak entity is determined to be an entity associated with the entity in the updated data.
[0018] According to a data element processing method provided by the present invention, the second mutual information value between the entity and the weak entity in the updated data is determined by:
[0019] Based on the data relationship between the weak entity and the corresponding strong entity, generating a text corpus containing the weak entity and the corresponding strong entity according to the corpus;
[0020] Based on the text corpus, a second mutual information value between the entity and the weak entity in the updated data is determined.
[0021] According to a data element processing method provided by the present invention, after performing text matching on entities in the updated data and entities under corresponding data tags, the method further includes:
[0022] In the event that an entity in the updated data matches a corresponding target entity, the data of the target entity is updated based on the updated data.
[0023] According to a data element processing method provided by the present invention, the monitoring of data update events includes: monitoring at least one of user data modification input, external data update push messages, and internal data change tasks.
[0024] According to a data element processing method provided by the present invention, constructing a data structure model includes:
[0025] Define entities and data labels in relational databases;
[0026] Establish data relationships between entities through primary keys and foreign keys;
[0027] The data structure model is constructed based on data relationships.
[0028] The present invention also provides a data element processing device, comprising:
[0029] A construction module is used to construct a data structure model and store data based on the data structure model; the data structure model is used to define data labels of entities in the data and data relationships between entities;
[0030] A monitoring module is used to identify entities in the updated data, data relationships between entities, and data labels when a data update event is monitored;
[0031] A matching module is used to perform text matching between entities in the updated data and entities under corresponding data labels;
[0032] A first processing module is configured to determine, from the stored data, an entity associated with the entity in the updated data based on the mutual information value if no corresponding target entity is matched;
[0033] The second processing module is used to establish a target data relationship between the entity in the updated data and the associated entity, and store the entity in the updated data according to the target data relationship.
[0034] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the program, it implements any of the data element processing methods described above.
[0035] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements any of the data element processing methods described above.
[0036] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the data element processing methods described above.
[0037] The present invention provides a data element processing method, device, electronic device and storage medium, which realize efficient management of updated data by constructing a flexible data structure model, can timely identify and process entities and their relationships in data elements, and can effectively associate entities under different labels through text matching and mutual information value analysis, reducing data identification confusion caused by inconsistent labels, thereby improving the accuracy and speed of data storage and retrieval responses, being able to more flexibly adapt to business needs, and reducing the complexity and maintenance costs of data management. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0039] Figure 1 This is one of the flow charts of a data element processing method provided by the present invention;
[0040] Figure 2 This is the second flow chart of a data element processing method provided by the present invention;
[0041] Figure 3 It is a structural diagram of a data element processing device provided by the present invention;
[0042] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0043] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0044] The following combination Figure 1-Figure 4 Describe a data element processing method, device, electronic device and storage medium of the present invention.
[0045] like Figure 1 As shown, a data element processing method of an embodiment of the present invention mainly includes step 110, step 120, step 130, step 140 and step 150.
[0046] Step 110: construct a data structure model and store data based on the data structure model.
[0047] The data structure model is used to define the data labels of entities in the data and the data relationships between entities.
[0048] In this implementation, a data structure model is created to systematically store and manage data. This model first defines the entities in the data and their attributes (data labels). These entities can be users, products, events, and so on, and each entity has specific characteristics or information. Secondly, the model also describes the relationships between entities, such as "a user purchased a product" or "an event occurred at a certain location."
[0049] In this way, the data structure model not only provides a clear framework to make data storage more orderly and efficient, but also enables more complex data query and analysis through clear relationship mapping.
[0050] In some embodiments, constructing a data structure model specifically includes: defining entities and data labels in a relational database; establishing data relationships between entities through primary keys and foreign keys; and constructing a data structure model based on the data relationships.
[0051] First, you need to identify the entities involved in the database, such as "user", "order", "product", etc. Each entity will have corresponding attributes (data labels), for example, "user" may have attributes such as name, email address, registration date, etc.
[0052] Based on this, primary keys and foreign keys are used to define relationships between entities. A primary key is an attribute that uniquely identifies an entity, such as a user ID in a user table. A foreign key refers to the primary key of another table and is used to represent the association between the two entities. For example, in an "Orders" table, a user ID could be used as a foreign key to indicate which user an order belongs to.
[0053] Based on the entities and relationships defined above, we construct an overall data structure model. This includes determining the table structure, field data types, and index settings to ensure the database can effectively store and manage data. These steps ensure data integrity and consistency, while also facilitating future data queries and operations.
[0054] Step 120 : When a data update event is monitored, entities in the updated data, data relationships between entities, and data tags are identified.
[0055] You can set up an event listener to receive real-time notifications of data updates. Depending on the system implementation, this can be a database trigger, a message queue, or other real-time data streaming service.
[0056] In some embodiments, monitoring a data update event includes monitoring at least one of a user's data modification input, an external data update push message, and an internal data change task.
[0057] User data modification input refers to the system receiving user input directly, usually in the user interface (UI). When a user modifies data, such as updating personal information, the system monitors these inputs in real time and processes them as data update events.
[0058] External data update push notifications involve external systems or services sending notifications of data updates to the current system. For example, third-party applications such as payment platforms and management platforms may send data update events via APIs or message queues. When this external data is received, the system identifies and processes the updates.
[0059] Internal data change tasks refer to automated tasks or processes within the system, such as periodic data synchronization, batch updates, or background jobs. These tasks can be scheduled tasks, triggered, or data migration processes. In these cases, the system automatically modifies data and generates corresponding update events.
[0060] In this embodiment, by monitoring data update events from these different sources, the system can respond to data changes in real time, thereby ensuring data accuracy and consistency. This mechanism can ensure data synchronization and the accuracy of business logic processing.
[0061] When an event occurs, updated data is extracted, typically transmitted in JSON, XML, or other formats, containing the updated content.
[0062] Based on the structure of the updated data, the involved entities are identified. For example, if the updated data contains "user ID" and "order ID", it can be determined that "user" and "order" are two related entities.
[0063] Extract the attributes (data tags) of each entity from the updated data. For example, for the "User" entity, you can extract fields such as name and email address; for the "Order" entity, you can extract fields such as order amount and status.
[0064] Analyze relationships between entities, usually based on the existence of foreign keys. For example, examining the user ID in the "orders" data to determine which user the order is related to, thus establishing a relationship between "user" and "order".
[0065] Based on the identified entities and relationships, the data structure model is updated. This process involves updating tables, records, or other data storage structures in the database. The success of the update can also be verified to ensure data consistency and integrity. If errors are found, the data may need to be rolled back or corrected.
[0066] In some embodiments, data tags are also used to indicate business types. The business types of stored data vary across scenarios such as production, distribution, circulation, consumption, and social service management. For example, in a production scenario, business types include warehousing, production, quality management, and supply chain management. In a distribution scenario, business types include marketing management and distribution management. In a consumption scenario, business types may include dealer management, payment management, and banking and financial data management.
[0067] Therefore, the data element processing method in the embodiment of the present invention can cover multiple business types.
[0068] Step 130 : Perform text matching between the entities in the updated data and the entities under the corresponding data tags.
[0069] Relevant entities and their attributes can be extracted from the updated data. Ensure that the extracted entities include fields relevant to the business type, that is, corresponding to the data labels. For example, in a consumption scenario, information such as "dealer ID" and "payment amount" might be extracted.
[0070] Based on the entity attributes in the updated data, retrieve the corresponding entities in the database or storage system. At this point, use relevant data tags to filter the data. For example, if the updated data belongs to the "production" scenario, query entities with relevant tags such as "warehouse" and "production."
[0071] The extracted entities are matched against the entities in the stored data using various matching methods, such as exact matching, which directly compares IDs and names, and fuzzy matching, which uses string similarity algorithms to compare fields such as names and addresses.
[0072] If a matching entity is found, the stored data is updated. If no matching entity is found, it can be marked as "pending".
[0073] In some embodiments, after text matching is performed between entities in the updated data and entities under corresponding data tags, a data element processing method of the present invention further includes: when the entity in the updated data matches the corresponding target entity, updating the data of the target entity based on the updated data.
[0074] After completing the text matching between the entities in the updated data and the target entities in the stored data, it has been successfully identified that a certain entity in the updated data, such as dealer, product, etc., corresponds to the target entity (entity of the same type) in the storage system.
[0075] Updated data usually contains some new information or changes. For example, it may include new sales, inventory quantities, customer information, etc. This information needs to be applied to the target entity.
[0076] Once a match is made, the next step is to apply the information in the updated data to the target entity, which can include field updates and merging data.
[0077] Field updates replace the corresponding fields in the target entity based on the updated data. For example, if the updated data contains a new payment amount, the system will update the "Payment Amount" field in the target entity.
[0078] Merging data means that in some cases, you may need to merge new data with existing data rather than simply replace it. For example, when updating inventory, you may need to increase the quantity of the new inventory instead of overwriting the original inventory.
[0079] After the update operation is completed, the update operation is recorded for subsequent query and audit. This helps track the history of data changes and facilitates analysis and troubleshooting. After the update is completed, it is also possible to provide feedback to the user on the update results, such as confirming which data was successfully updated and whether there were any errors or unprocessed entities.
[0080] Step 140 : If no corresponding target entity is matched, determine an entity associated with the entity in the updated data from the stored data based on the mutual information value.
[0081] You can analyze the entities in the updated data and all entities in the stored data and calculate the mutual information between them. Mutual information measures the degree of dependence between two variables, with higher values indicating stronger correlation.
[0082] Based on the calculated mutual information value, candidate entities with high correlation with the entities in the updated data are filtered out from the stored data. A threshold can be set, and only entities exceeding the threshold are considered to be related.
[0083] Further validation of the candidate entities, possibly using additional features or contextual information, ensures that the final selected entity is indeed related to the entity in the updated data.
[0084] In this embodiment, identifying potential related entities through mutual information values can help complete data and improve the accuracy and completeness of information. By finding highly relevant entities, false matches can be reduced, ensuring that subsequent data processing is more efficient.
[0085] Step 150: Establish a target data relationship between the entity in the updated data and the associated entity, and store the entity in the updated data according to the target data relationship.
[0086] It can be understood that by identifying the relationships between entities in the updated data and the associated entities determined by the mutual information values, a mapping or relational model can be constructed to represent the target data relationships between these entities.
[0087] Based on this relationship, the entities in the updated data can be organized into a structured format, ensuring that the attributes of each entity correspond to its associated target entity. Finally, the organized entity data is stored in the database for subsequent query and analysis. This process ensures the consistency and integrity of the data and improves the efficiency of data management.
[0088] A data element processing method provided in an embodiment of the present invention achieves efficient management of updated data by constructing a flexible data structure model, can timely identify and process entities and their relationships in data elements, and can effectively associate entities under different labels through text matching and mutual information value analysis, reducing data identification confusion caused by inconsistent labels, thereby improving the accuracy and speed of data storage and retrieval responses, being able to more flexibly adapt to business needs, and reducing the complexity and maintenance costs of data management.
[0089] In some embodiments, as Figure 2 As shown, determining an entity associated with an entity in updated data from stored data based on a mutual information value includes steps 210 , 220 , and 230 .
[0090] Step 210, determining a strong entity and a weak entity corresponding to the strong entity from the stored data;
[0091] Step 220 , respectively determining a first mutual information value between the entity in the updated data and the strong entity and a second mutual information value between the entity in the updated data and the weak entity;
[0092] Step 230 : Based on the first mutual information value with the strong entity and the second mutual information value between each weak entity corresponding to the strong entity, determine an entity associated with the entity in the updated data from among each strong entity and each weak entity.
[0093] It is understandable that first, it is necessary to identify strong entities from the stored data, which have higher credibility and information content. At the same time, it is necessary to identify weak entities corresponding to strong entities, which have relatively lower credibility and information content.
[0094] Strong entities are entities that can exist independently and have their own primary key, which is used to uniquely identify each entity instance. The primary key is composed of the attributes of the entity and can uniquely identify the entity.
[0095] For example, in a student management system, the "student" entity is a strong entity because each student has a unique student number (primary key) and can exist independently.
[0096] A weak entity is an entity that depends on a strong entity for its existence. It cannot exist alone and does not have its own primary key.
[0097] A weak entity will typically contain a partial key attribute (i.e. the portion of the primary key inherited from the strong entity) and its own attributes.
[0098] For example, in an order management system, an "order item" can be considered a weak entity because it depends on an "order" (a strong entity) to define its existence. An order item typically contains an order number (from the order's primary key) and other attributes such as product name, quantity, etc.
[0099] The first mutual information value is the degree of association between the entity in the updated data and the strong entity, reflecting the degree of information association between them.
[0100] The second mutual information value is the degree of association between the entity in the updated data and the weak entity, which is used to measure the relationship between these entities.
[0101] Combining the above two mutual information values, we can analyze the relationship between the entities in the updated data and the strong entities and their corresponding weak entities, and then identify their potential associations and determine which entities have a strong association with the entities in the updated data.
[0102] Mutual information (MI) measures the degree of association between two variables. The calculation steps include defining the variables (e.g., updating entities and strong or weak entities), collecting data to construct a joint probability distribution, calculating marginal and joint probabilities, and then applying the mutual information formula. This can be implemented using programming tools such as Python, ensuring a sufficiently large data sample for improved accuracy. Ultimately, the mutual information is used to analyze potential associations between entities.
[0103] In some embodiments, the second mutual information value between the entity and the weak entity in the updated data is determined in the following manner.
[0104] Based on the data relationship between the weak entity and the corresponding strong entity, a text corpus containing the weak entity and the corresponding strong entity can be generated according to the corpus; based on the text corpus, a second mutual information value between the entity and the weak entity in the updated data is determined.
[0105] The connection between the weak entity and its corresponding strong entity can be clarified in the data structure based on the known relationship between the two.
[0106] Based on the established relationships, a text corpus containing weak entities and corresponding strong entities is generated using relevant information or data from the corpus. The text corpus can be descriptions, examples, or any other relevant content that can capture the semantic relationship between weak entities and strong entities as much as possible.
[0107] In the generated text corpus, statistical or natural language processing methods are used to analyze the relationship between entities and weak entities in the updated data to calculate the frequency of occurrence, co-occurrence pattern, etc., and determine the second mutual information value.
[0108] In other words, to generate a text corpus containing weak entities and corresponding strong entities and calculate the second mutual information value, we first need to identify the entities and build a relationship model. Then, we extract information from the relevant data based on the text corpus and generate descriptive sentences and examples.
[0109] On this basis, we can preprocess the text, construct the co-occurrence matrix of weak entities and updated entities, calculate the frequency and probability distribution. Finally, we apply the mutual information formula to calculate the second mutual information value and analyze the degree of association between weak entities and updated entities.
[0110] The second mutual information value reflects the degree of information sharing between entities in the updated data and weak entities, thus providing a quantitative basis for correlation analysis. This method can more accurately measure the role of weak entities in the updated data, enhancing the system's ability to understand and process complex data relationships.
[0111] In some embodiments, based on the first mutual information value between the strong entity and the second mutual information value between the weak entities corresponding to the strong entity, the entity associated with the entity in the updated data is determined from the strong entities and the weak entities, including the following process.
[0112] When the first mutual information value between the strong entity and the weak entity is less than a first threshold and the second mutual information value between the weak entity and the strong entity is greater than a second threshold, the weak entity is determined to be an entity associated with the entity in the updated data.
[0113] The first threshold is used to determine the relevance between the strong entity and the entity in the updated data. If the first mutual information value is less than this threshold, it means that the entity in the updated data has a weak relationship with the strong entity.
[0114] The second threshold is used to determine the relevance between the weak entity and the entity in the updated data. If the second mutual information value is greater than this threshold, it indicates that there is a strong relationship between the entity in the updated data and the weak entity.
[0115] When conditions are met, such as the first mutual information value is less than a first threshold (weak association) and the second mutual information value is greater than a second threshold (strong association), the weak entity is identified as an entity associated with the entity in the updated data.
[0116] In this embodiment, when the strong entity association is weak, it is allowed to find a suitable replacement or associated entity through the strong association of the weak entity, thereby improving the flexibility and accuracy of data processing.
[0117] In some embodiments, when a condition is met, such as the first mutual information value is greater than a first threshold (strong association), the strong entity is directly identified as an entity associated with the entity in the updated data.
[0118] When the conditions are met, such as the first mutual information value is less than the first threshold (weak association) and the second mutual information value is less than the second threshold (strong association), the associated entity cannot be found.
[0119] The data element processing device provided by the present invention is described below. The data element processing device described below and the data element processing method described above can be referenced to each other.
[0120] like Figure 3 As shown, a data element processing device according to an embodiment of the present invention mainly includes a construction module 310, a monitoring module 320, a matching module 330, a first processing module 340 and a second processing module 350.
[0121] The construction module 310 is used to construct a data structure model and store data based on the data structure model; the data structure model is used to define data labels of entities in the data and data relationships between entities;
[0122] The monitoring module 320 is used to identify entities in the updated data, data relationships between entities, and data tags when a data update event is monitored;
[0123] The matching module 330 is used to perform text matching between entities in the updated data and entities under corresponding data tags;
[0124] The first processing module 340 is configured to determine, from the stored data, an entity associated with the entity in the updated data based on the mutual information value if no corresponding target entity is matched;
[0125] The second processing module 350 is used to establish a target data relationship between the entity in the updated data and the associated entity, and store the entity in the updated data according to the target data relationship.
[0126] A data element processing device provided in accordance with an embodiment of the present invention achieves efficient management of updated data by constructing a flexible data structure model, can timely identify and process entities in data elements and their relationships, and can effectively associate entities under different labels through text matching and mutual information value analysis, reducing data identification confusion caused by inconsistent labels, thereby improving the accuracy and speed of data storage and retrieval responses, being able to more flexibly adapt to business needs, and reducing the complexity and maintenance costs of data management.
[0127] Figure 4 An example of a physical structure diagram of an electronic device is shown below. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other via the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute a data element processing method, which includes: constructing a data structure model and storing data based on the data structure model; the data structure model is used to define data labels of entities in the data and data relationships between entities; when a data update event is monitored, identifying entities in the updated data, data relationships between entities and data labels; performing text matching between entities in the updated data and entities under corresponding data labels; when no corresponding target entity is matched, determining entities associated with the entities in the updated data from the stored data based on the mutual information value; establishing a target data relationship between the entity in the updated data and the associated entity, and storing the entities in the updated data according to the target data relationship.
[0128] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0129] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the data element processing method provided by the above methods, which includes: constructing a data structure model and storing data based on the data structure model; the data structure model is used to define data labels of entities in the data and data relationships between entities; when a data update event is monitored, the entities in the updated data, the data relationships between entities and the data labels are identified; text matching is performed on the entities in the updated data with the entities under the corresponding data labels; when the corresponding target entity is not matched, the entity associated with the entity in the updated data is determined from the stored data based on the mutual information value; a target data relationship is established between the entity in the updated data and the associated entity, and the entity in the updated data is stored according to the target data relationship.
[0130] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the data element processing method provided by the above-mentioned methods, the method including: constructing a data structure model and storing data based on the data structure model; the data structure model is used to define data labels of entities in the data and data relationships between entities; when a data update event is monitored, identifying entities in the updated data, data relationships between entities, and data labels; performing text matching on entities in the updated data with entities under corresponding data labels; when no corresponding target entity is matched, determining entities associated with the entities in the updated data from the stored data based on the mutual information value; establishing a target data relationship between the entities in the updated data and the associated entities, and storing the entities in the updated data according to the target data relationship.
[0131] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0132] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A data element processing method, characterized in that: include: Constructing a data structure model and storing data based on the data structure model; the data structure model is used to define data labels of entities in the data and data relationships between entities; When a data update event is detected, identify the entities in the updated data, the data relationships between the entities, and the data labels; Perform text matching between entities in the updated data and entities under corresponding data labels; In the case where no corresponding target entity is matched, determining an entity associated with the entity in the updated data from the stored data based on the mutual information value; Establishing a target data relationship between the entity in the updated data and the associated entity, and storing the entity in the updated data according to the target data relationship; The determining, from the stored data based on the mutual information value, an entity associated with the entity in the updated data comprises: Determining a strong entity and a weak entity corresponding to the strong entity from the stored data; respectively determining a first mutual information value between the entity in the updated data and the strong entity and a second mutual information value between the entity in the updated data and the weak entity; Based on the first mutual information value with the strong entity and the second mutual information value between each weak entity corresponding to the strong entity, an entity associated with the entity in the updated data is determined from among the strong entities and the weak entities.
2. The data element processing method according to claim 1, characterized in that: The determining, based on the first mutual information value between the strong entity and the weak entities corresponding to the strong entity and the second mutual information value between the weak entities, an entity associated with the entity in the updated data from among the strong entities and the weak entities, includes: When a first mutual information value between the weak entity and the strong entity is less than a first threshold and a second mutual information value between the weak entity and the strong entity is greater than a second threshold, the weak entity is determined as an entity associated with the entity in the updated data.
3. The data element processing method according to claim 1, characterized in that: The second mutual information value between the entity and the weak entity in the updated data is determined as follows: Based on the data relationship between the weak entity and the corresponding strong entity, generating a text corpus containing the weak entity and the corresponding strong entity according to the corpus; Based on the text corpus, a second mutual information value between the entity and the weak entity in the updated data is determined.
4. The data element processing method according to claim 1, characterized in that: After text matching the entities in the updated data with the entities under the corresponding data labels, the method further includes: In the event that an entity in the updated data matches a corresponding target entity, the data of the target entity is updated based on the updated data.
5. The data element processing method according to claim 1, characterized in that: The monitoring of the data update event includes monitoring at least one of a user's data modification input, an external data update push message, and an internal data change task.
6. The data element processing method according to claim 1, characterized in that: The constructing of the data structure model includes: Define entities and data labels in relational databases; Establish data relationships between entities through primary keys and foreign keys; The data structure model is constructed based on data relationships.
7. A data element processing device, characterized in that: include: A construction module, configured to construct a data structure model and store data based on the data structure model; The data structure model is used to define data labels of entities in the data and data relationships between entities; A monitoring module is used to identify entities in the updated data, data relationships between entities, and data labels when a data update event is monitored; A matching module is used to perform text matching between entities in the updated data and entities under corresponding data labels; a first processing module for determining, from the stored data, an entity associated with the entity in the updated data based on the mutual information value if no corresponding target entity is matched; the first processing module is further configured to determine, from the stored data, a strong entity and a weak entity corresponding to the strong entity; and respectively determine a first mutual information value between the entity in the updated data and the strong entity and a second mutual information value between the entity in the updated data and the weak entity; Determining an entity associated with the entity in the updated data from among the strong entities and the weak entities based on a first mutual information value with the strong entity and a second mutual information value between the weak entities corresponding to the strong entity; The second processing module is used to establish a target data relationship between the entity in the updated data and the associated entity, and store the entity in the updated data according to the target data relationship.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor executes the program, it implements the data element processing method as described in any one of claims 1 to 6.
9. A non-transitory 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 data element processing method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Interactive data migration method from relational data to graph data
CN109753537A
Knowledge graph updating method and device
CN113127494A
Interactive knowledge graph data editing computer device and method
CN116090554A