Method and system for identifying abnormal data based on knowledge graph
By constructing a knowledge graph of logistics data and using graph traversal algorithms and abnormal feature rules, the problem of low efficiency in finding abnormal items in the logistics industry is solved, intelligent and automated abnormal data identification is achieved, and analysis accuracy and security are improved.
Patent Information
- Application Number
- CN202410519416.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2024-10-11
AI Technical Summary
The logistics and delivery industry has problems with low detection efficiency and inaccurate clues in the transportation of abnormal items. It is difficult for existing technology to effectively identify and process abnormal data.
Using a knowledge graph-based method, we construct a data knowledge graph by acquiring and standardizing business data, and use graph traversal algorithms and abnormal feature rules to identify abnormal data. Combined with integral models and weight calculations, we achieve automated and intelligent identification of abnormal data.
It improves the efficiency of detecting abnormal items, enhances the accuracy of logistics data analysis, forms a long-term working mechanism, reduces safety hazards caused by insufficient manpower, and achieves reliable identification and verification of abnormal data.
Smart Images

Figure CN118760770A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data and knowledge graphs, and mainly to a method and system for identifying abnormal data based on knowledge graphs. Background Art
[0002] At present, the logistics and delivery service industry has brought convenience to our lives, but it has also become a channel for the transportation of abnormal items. To this end, the present invention proposes a method and system for abnormal data identification based on knowledge graphs, which conducts special data governance and constructs business element entities and relationships through real-time access to Internet business data and existing stored basic data, thereby forming a knowledge graph of business data, and then uses graph algorithm rules to realize abnormal early warning of business transaction behaviors, greatly improving the efficiency of abnormal item discovery. Summary of the invention
[0003] In response to the technical problems of abnormal data processing defects in the prior art, this application proposes a method and system for abnormal data identification based on knowledge graph.
[0004] According to one aspect of the present invention, a method for identifying abnormal data based on a knowledge graph is proposed, comprising:
[0005] S1. Acquire business data, extract key fields from the business data, standardize the key fields and add attribute tags to the key fields;
[0006] S2. Take the key fields as entity objects, use big data resources to supplement the attributes of the entity objects, establish data relationships between entity objects that can be associated, and finally store them in the warehouse for processing to form a data knowledge graph, which is stored as a directed graph;
[0007] S3. Construct abnormal feature rules based on the feature knowledge of the business;
[0008] S4, using a graph traversal algorithm to process the directed graph in step S2 to obtain key area data;
[0009] S5. Process the key area data using the abnormal feature rules to obtain final abnormal data.
[0010] Furthermore, the directed graph is represented by the following formula:
[0011] G=(V,E)
[0012] Among them, V represents the entity set, E represents the relationship set, and G represents the directed graph;
[0013] Each node v∈V in the directed graph represents information of a business entity, and the directed edge (u,v)∈E represents the relationship from entity u to entity v.
[0014] In the field of natural language processing and knowledge management, a knowledge graph is a directed graph in which nodes represent entities (such as people, places, concepts, etc.) and directed edges represent the relationships between entities (such as birthplace, creative works, etc.).
[0015] Furthermore, the step S3 also includes: the construction of abnormal feature rules is specifically to supplement entity and entity relationship content in the data knowledge graph.
[0016] In a specific embodiment, for example, the sender and the recipient are added to the nodes of the data knowledge graph, the directed edges between the two nodes are added, and the relationship content of the directed edges is added, that is, the delivery relationship and assigned a value of true.
[0017] Furthermore, the graph traversal algorithm specifically adopts: a gremlin traversal algorithm, including constructing a graph traversal query statement in the directed graph, for retrieving and modifying directed graph data.
[0018] The Gremlin traversal algorithm is a series of steps or instructions for navigating, searching, and manipulating data in a graph database. It uses a declarative query style, allowing users to walk from one node to another along the edges in the graph and perform various operations such as filtering, projection, and aggregation.
[0019] The algorithm and algorithm explanation involved in the present invention are as follows:
[0020] Select vertices: gV() is used to select all vertices in the graph;
[0021] Traversing edges: out(), in(), and both() are used to traverse outgoing edges, incoming edges, or bidirectional edges starting from the current vertex;
[0022] Filtering: has('property','value') is used to filter vertices or edges with specific properties and values.
[0023] Projection: project('a','b') is used to project the attributes of a vertex or edge into the result set.
[0024] Aggregation: group().by('label').by(count()) is used to group vertices or edges by label and count the number of each group.
[0025] Path tracing: path() is used to trace the path formed during the traversal process.
[0026] By chaining these traversal steps, developers can construct rich queries to discover and filter patterns, entities, relationships, paths, and other useful data information in graph data.
[0027] Furthermore, in step S5, processing the key area data specifically includes: using an integral model and weight calculation to determine the data reaching a preset threshold as abnormal data.
[0028] The integral model may adopt but is not limited to statistical charts, including pie charts and bar charts.
[0029] The weight calculation allocates weights to the integral model based on existing business experience and calculates the final data.
[0030] Filtering data requires a threshold reference, so a threshold needs to be set in advance according to business needs. When the data reaches or exceeds the threshold, it is considered abnormal data.
[0031] The abnormal data needs to be further manually verified to obtain verification results, and the verification results further improve the accuracy of the integral model calculation, and the reliability of the abnormal data is improved through iterative adjustment.
[0032] According to a second aspect of the present invention, a system for identifying abnormal data based on a knowledge graph is proposed, comprising the following units:
[0033] A data-specific processing unit configured to obtain business data, extract key fields from the business data, perform standardization on the key fields and label the key fields with attributes;
[0034] A knowledge graph construction unit is configured to use the key fields as entity objects, use big data resources to supplement the attributes of the entity objects, establish data relationships between entity objects that can be associated, and finally store them in the warehouse for processing to form a data knowledge graph, which is stored as a directed graph;
[0035] An abnormal feature rule unit, configured to construct an abnormal feature rule according to feature knowledge of the business;
[0036] The abnormal data mining unit is configured to use a graph traversal algorithm to process the directed graph in the knowledge graph construction unit, obtain key area data, process the key area data using the abnormal feature rules, and obtain final abnormal data.
[0037] According to a third aspect of the present invention, a computer-readable storage medium is provided, on which one or more computer programs are stored. When the one or more computer programs are executed by a computer processor, the above method is implemented.
[0038] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:
[0039] (1) Build a logistics and delivery data anomaly detection model based on knowledge graph, and use graph computing methods to achieve flexible configuration of model rules. This model can meet application needs in complex scenarios and effectively solve business problems such as insufficient ability to detect abnormal item clues and inaccurate clues.
[0040] (2) The entire identification and analysis method is intelligent and automated, and can analyze logistics and delivery data as soon as it is accessed, greatly improving efficiency. It can also perform efficient identification on existing historical data, thus making up for logistics safety risks caused by lack of administrative means and insufficient manpower.
[0041] (3) Relying on the entire analysis model, logistics and delivery companies can be encouraged to establish a long-term working mechanism, forming a closed loop in the process by discovering anomalies, verifying anomalies, feedback on anomalies and iteratively improving the knowledge base. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and are used together with the description to explain the principles of the present invention. It will be easy to recognize other embodiments and many expected advantages of the embodiments because they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with each other. The same reference numerals refer to corresponding similar parts.
[0043] Figure 1 A schematic diagram of a process for identifying abnormal data based on a knowledge graph according to an embodiment of the present invention is shown;
[0044] Figure 2 A schematic diagram of a data knowledge graph according to a specific embodiment of the present invention is shown;
[0045] Figure 3 A schematic diagram of a data knowledge graph relationship network according to a specific embodiment of the present invention is shown;
[0046] Figure 4 A schematic diagram of data situation analysis according to a specific embodiment of the present invention is shown;
[0047] Figure 5 A schematic diagram of abnormal warning data according to a specific embodiment of the present invention is shown;
[0048] Figure 6 A schematic diagram of the overall technical steps according to a specific embodiment of the present invention is shown. DETAILED DESCRIPTION
[0049] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0050] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0051] This embodiment uses logistics delivery to realize abnormal data identification in logistics. Figure 1 A schematic diagram of a process for identifying abnormal data based on a knowledge graph according to an embodiment of the present invention is shown. Figure 1 As shown,
[0052] S1. Special data processing:
[0053] Acquire business data, extract key fields from the business data, standardize the key fields and add attribute tags to the key fields;
[0054] The delivery data of the logistics company is accessed in batches in real time or offline mode. The delivery data elements mainly include waybill number, courier company code, courier company name, sender's name, sender's mobile phone number, shipping address, recipient's ID number, recipient's name, recipient's mobile phone number, recipient's ID number, receiving address, item type, item name, item quantity, billable weight, collection time, courier name, courier mobile number, order notes, etc.
[0055] In order to improve the accuracy of subsequent logistics data analysis, key fields such as mobile phone number, ID number, address, name, etc. need to be standardized and labeled with corresponding attribute labels during the data processing stage. Attribute label types include but are not limited to mobile phone number segment type, mobile phone location, ID card location, whether it is a sensitive item, whether it is a standard address, etc.
[0056] Table 1 Logistics delivery sample data
[0057]
[0058]
[0059] Table 1 provides sample data of logistics delivery in this embodiment, in which mobile phone number and name are standardized as key fields.
[0060] S2. Construction of knowledge graph:
[0061] The key fields are used as entity objects, and the attributes of the entity objects are supplemented by using big data resources, and data relationships are established between entity objects that can generate associations, and finally stored in the warehouse for processing to form a data knowledge graph, which is stored as a directed graph;
[0062] The directed graph is represented by the following formula:
[0063] G=(V,E)
[0064] Among them, V represents the entity set, E represents the relationship set, and G represents the directed graph;
[0065] Each node v∈V in the directed graph represents information of a business entity, and the directed edge (u,v)∈E represents the relationship from entity u to entity v.
[0066] In this embodiment, the construction of the knowledge graph of logistics delivery is specifically carried out in the following steps:
[0067] Step 1: Construct object entities. The identity information of the sender and the recipient in the logistics data is the core data. In the business data of most logistics companies, the mobile phone number is usually used as the key field to identify the identities of both parties. Therefore, the mobile phone number is used as the main entity object to construct the knowledge graph. Other entities include ID card, name, address, virtual identity, etc.
[0068] Step 2: Supplement entity attributes. Based on the attribute labels that have been added during the data processing stage, further supplement and improve the entity attributes with the help of big data resources. For example: associate the corresponding registered virtual identity number and nickname through the mobile phone number; associate the specific associated label information through the mobile phone number; associate the corresponding real name, former name, personnel label, etc. through the ID card number.
[0069] Step 3: Construct relational data, establish relationships between entities that can generate associations, among which the most core relationship type is the "delivery relationship", which is generated between the sender and the recipient. The attribute values of this relationship include delivery direction, courier company, item name, billing weight, delivery time, delivery time, recipient name, remarks, etc. Each delivery behavior will generate corresponding relationship attribute values. Other relationship types include: belonging, binding, association, friends, communication, transaction, etc. The relationship mainly exists in the form of two-to-two associations, including "mobile phone number and ID card", "mobile phone number and name", "mobile phone number and address", "mobile phone number virtual identity", "ID card and real name", "ID card and former name", "ID card and household registration place", "virtual identity and virtual identity", etc.
[0070] Through the above steps, the accessed logistics data is put into storage, and the final logistics data knowledge graph structure is shown in Figure 2.
[0071] S3. Abnormal feature rules:
[0072] Construct abnormal feature rules based on business feature knowledge;
[0073] The specific construction of abnormal feature rules is to supplement entity and entity relationship content in the data knowledge graph.
[0074] In this embodiment, the construction of abnormal feature rules for logistics delivery is specifically carried out in the following steps:
[0075] S31, address abnormality:
[0076] (1) The mobile phone number of the recipient or sender is a key area: The location of the mobile phone numbers of the recipient and sender is compared with the key area knowledge base that has been mastered. If the location of a mobile phone number is a key area, the sensitiveArea attribute is added to the mobile phone number node on the graph and the value is set to true.
[0077] (2) The mailing address is a key area or the address is unclear: The mailing address is standardized and information such as province, city, district, street, community, building, unit, and room number is extracted. If the province, city, county, and district in the mailing address matches the key area, the sensitiveArea attribute is added to the mailing address on the map and the value is assigned to true. If the key item information of the standard address does not appear in the mailing address, it means that the mailing address is unclear, and the blurred attribute is added to the mailing address on the map and the value is assigned to true.
[0078] (3) The location of the mobile phone and the destination of the delivery are inconsistent: The location of the mobile phone and the destination address are used for keyword matching. For example, if the location of the mobile phone is YY city in XX province, the two keywords "XX" and "YY" are used to match the destination address. For data where the location and the destination address do not match, an addrInconsisent attribute is added to the edge of the shipping relationship on the graph and the value is assigned to true.
[0079] (4) Frequently receiving mail from key areas: Perform a key area analysis on the addresses of all senders. If the mail is from a key area, add the sensitiveAreaCount attribute to the recipient's mobile phone number and assign it a value of 1. Repeat this process to count the number of times the recipient receives mail from key areas.
[0080] (5) The recipient address does not contain Arabic numerals or is less than 8 digits long: Use a regular expression to match whether the recipient address contains Arabic numerals. If so, add the attribute hasArabicNum to the recipient address information and assign it to true. Count the length of the recipient address and assign it to the length attribute.
[0081] S32, Number Abnormality:
[0082] (1) The mobile phone numbers of the sender and the recipient are the same: The mobile phone numbers of the sender and the recipient in any delivery relationship are judged. If they are the same, the samePhoneNum attribute is added to the edge of the delivery relationship and the value is set to true.
[0083] (2) Irregular mobile phone numbers of the recipient / sender: Use the regular expression of mobile phone numbers to verify whether the mobile phone numbers of the recipient and sender meet the standard rules. If the numbers are irregular, add the attribute unregular to the mobile phone number node and assign it a value of true.
[0084] (3) The recipient / sender's mobile phone number is a virtual number: the first three digits of the mobile phone number are judged. If it is a virtual number segment (starting with 170, 171, 162, 165, etc.), the attribute virtualNum is added to the mobile phone number node and the value is assigned to true.
[0085] S33, information duplication exception:
[0086] (1) Multiple addresses for one mobile phone number for the consignee or consignee: Count the number of addresses bound or associated with the same mobile phone number on the knowledge graph and record it in the attribute addrCount of the mobile phone number.
[0087] (2) Multiple names for one mobile phone number for the consignee / sender: Count the number of names bound or associated with the same mobile phone number on the knowledge graph and record them in the nameCount attribute of the mobile phone number.
[0088] (3) Multiple mobile phone numbers for one address for the consignee or consignee: Count the number of mobile phone numbers bound or associated with the same address on the knowledge graph and record them in the attribute phoneCount of the address.
[0089] S34, Number association abnormality:
[0090] (1) The recipient / sender's mobile phone number is the personal number shown in the historical stored data: The recipient's and sender's mobile phone numbers are compared with the basic data currently available. If a mobile phone number successfully matches the stored data, the attribute criminal is added to the mobile phone number and the value is assigned to true.
[0091] (2) The recipient / sender's mobile phone number is connected to the historically stored data: The recipient's and sender's mobile phone numbers are compared with the currently available contact data. If it is confirmed that there has been mobile phone contact (including contacts, calls, and text message records), the attribute criminalRel is added to the mobile phone number and the value is assigned to true.
[0092] S35, abnormal sensitive content:
[0093] Item name, shipping address, and receiving address match sensitive keywords: Use the currently accumulated potential abnormal item keywords to match the item name and shipping address. For the edges of the shipping relationship that hit the keywords, add the attribute sensitiveKeyword and assign it a value of true.
[0094] S4. Abnormal area screening:
[0095] Process the directed graph in step S2 using a graph traversal algorithm to obtain key area data;
[0096] The graph traversal algorithm specifically adopts: a gremlin traversal algorithm, including constructing a graph traversal query statement in the directed graph, for retrieving and modifying directed graph data.
[0097] In this embodiment, the gremlin traversal algorithm is used to select the sender's mobile phone number as the key area:
[0098] gV().hasLabel('phone').has('sensitiveArea',true)
[0099] When the consignee / sender has multiple addresses for one mobile phone number (more than 5 addresses are considered multiple addresses):
[0100] gV().hasLabel('phone').where(values('addrCount').is(gt(5)))
[0101] Figure 3 This is a schematic diagram of the relationship network of the knowledge graph of logistics and delivery data. The calculation syntax of this graph can be used to quickly filter a batch of data with the mobile phone numbers of the consignees and senders as the key areas.
[0102] S5. Abnormal data mining:
[0103] The key area data is processed using the abnormal feature rules to obtain final abnormal data.
[0104] In the step S5, processing the key area data specifically includes: using an integral model and weight calculation to determine the data reaching a preset threshold as abnormal data.
[0105] The abnormal data needs to be further manually verified to obtain verification results, and the verification results further improve the accuracy of the integral model calculation, and the reliability of the abnormal data is improved through iterative adjustment.
[0106] like Figure 4 Logistics and delivery data situation analysis and Figure 5Abnormal logistics and delivery warning data, after graph calculation of the above types of abnormal rules, a batch of potential abnormal delivery data can be obtained in batches, and integral models and weight calculations are performed on these data. Abnormal delivery data that reaches a certain threshold is pushed to related programs as abnormal item clues for manual verification. The verification results can further feed back to improve the accuracy of model calculations. Through continuous iterative adjustments, the reliability of abnormal item clues can be greatly improved.
[0107] In summary, the entire technical method of this embodiment includes the following Figure 6 As shown: ① Access the business data of logistics and delivery companies to carry out special governance work; ② Extract entities and relationship elements with mobile phone numbers as the center, connect to big data resources to support and supplement key information, and build a logistics data knowledge graph; ③ Utilize the accumulated knowledge of prohibited items and calculate the graph algorithm based on the knowledge graph to realize the discovery of abnormal delivery clues; ④ Take action on abnormal clues, improve the feature knowledge base based on feedback results, and form a closed mechanism.
[0108] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0109] The modules involved in the embodiments of the present application may be implemented by software or by hardware.
[0110] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
Claims
1. A method for identifying abnormal data based on knowledge graph, characterized in that: The following steps are involved: S1. Acquire business data, extract key fields from the business data, standardize the key fields and add attribute tags to the key fields; S2. Take the key fields as entity objects, use big data resources to supplement the attributes of the entity objects, establish data relationships between entity objects that can be associated, and finally store them in the warehouse for processing to form a data knowledge graph, which is stored as a directed graph; S3. Construct abnormal feature rules based on the feature knowledge of the business; S4, using a graph traversal algorithm to process the directed graph in step S2 to obtain key area data; S5. Process the key area data using the abnormal feature rules to obtain final abnormal data.
2. The method according to claim 1, characterized in that: The business data includes logistics and delivery data.
3. The method according to claim 1, characterized in that: The directed graph is represented by the following formula: G=(V,E) Among them, V represents the entity set, E represents the relationship set, and G represents the directed graph; Each node v∈V in the directed graph represents information of a business entity, and the directed edge (u,v)∈E represents the relationship from entity u to entity v.
4. The method according to claim 1, characterized in that: The specific construction of abnormal feature rules is to supplement entity and entity relationship content in the data knowledge graph.
5. The method according to claim 1, characterized in that: The graph traversal algorithm specifically adopts: a gremlin traversal algorithm, including constructing a graph traversal query statement in the directed graph, for retrieving and modifying directed graph data.
6. The method according to claim 1, characterized in that: In the step S5, processing the key area data specifically includes: using an integral model and weight calculation to determine the data reaching a preset threshold as abnormal data.
7. The method according to claim 6, characterized in that: The abnormal data needs to be further manually verified by relevant departments to obtain verification results, and the verification results further improve the accuracy of the integral model calculation, and improve the reliability of the abnormal data through iterative adjustment.
8. A system for identifying abnormal data based on knowledge graph, characterized in that: The following units are included: A data-specific processing unit configured to obtain business data, extract key fields from the business data, perform standardization on the key fields and label the key fields with attributes; A knowledge graph construction unit is configured to use the key fields as entity objects, use big data resources to supplement the attributes of the entity objects, establish data relationships between entity objects that can be associated, and finally store them in the warehouse for processing to form a data knowledge graph, which is stored as a directed graph; An abnormal feature rule unit, configured to construct an abnormal feature rule according to feature knowledge of the business; The abnormal data mining unit is configured to use a graph traversal algorithm to process the directed graph in the knowledge graph construction unit, obtain key area data, process the key area data using the abnormal feature rules, and obtain final abnormal data.
9. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 7.
10. A computing system comprising a processor and a memory, wherein the processor is configured to execute the method according to any one of claims 1 to 7.
