A method and device for identifying potential supply chain relationships and analyzing abnormal links based on graph database
By modeling and querying technology in graph databases, identifying and analyzing potential links in the supply chain, the problem that traditional databases are difficult to identify supply chain relationships under massive data is solved, and the efficiency and accuracy of supply chain management is improved. An exception link was found.
Patent Information
- Application Number
- CN202410979661.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2044-07-22
AI Technical Summary
Under the massive data scale, traditional relational databases are difficult to effectively identify and analyze potential relationships and exceptional links in the supply chain, especially when supply chain data is stored in two-dimensional tables, it is difficult to support recursive queries and multi-dimensional association relationships.
Use the graph database to identify potential supply chain relationships and analyze abnormal links. By obtaining and formatting the supply data, setting the metadata of the graph database, writing the data into the graph database, using match query to find upstream and downstream relationships, and inserting new ones The data edges of the supply chain are viewed visually.
It realizes potential link identification and query of massive supply chain data, improves the efficiency and accuracy of supply chain management, and can intuitively discover abnormal links and analyze them.
Smart Images

Figure CN118521325B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of supply chain technology, and in particular to a method and device for identifying potential supply chain relationships and analyzing abnormal links based on a graph database. Background Art
[0002] In modern supply chain management, the efficiency and accuracy of obtaining and processing supply chain link information are crucial to the production and operation of enterprises. However, supply chain data is basically stored and recorded in the form of two-dimensional tables. Each row of data is the raw material procurement information and product sales information of a product. It is very challenging to trace the various accessories of a given product under the massive data scale, which is almost impossible to do in traditional relational databases or distributed data warehouses. The data modeling mode of relational databases based on two-dimensional relational tables is relatively rigid, and it is difficult to simply express the multi-dimensional associations required by the business. In addition, it is difficult to perform recursive queries such as deep path queries (such queries require multiple joins to find related parties) using SQL query language, which is difficult to support under the scale of big data. Summary of the invention
[0003] The purpose of this application is to overcome the problem in the prior art that supply chain data is stored and recorded in the form of a two-dimensional table, which makes it difficult to identify potential supply chain relationships and perform abnormal link analysis for each accessory of a given product in massive data. A method and device for identifying potential supply chain relationships and performing abnormal link analysis based on a graph database is provided.
[0004] In a first aspect, a method for identifying potential supply chain relationships and analyzing abnormal links based on a graph database is provided, comprising:
[0005] Obtain supply data from suppliers at all levels;
[0006] Converting the format of the supply data;
[0007] Modeling in a target graph database, and setting metadata of the target graph database according to the supply data;
[0008] Writing the format-converted supply data into the target graph database;
[0009] In the target graph database, the sales batches corresponding to the upstream products and the purchase batches corresponding to the downstream raw materials that meet the upstream and downstream relationships are found through matching, and the sales batches and purchase batches are inserted into the target graph database as new data edges to visualize the supply chain of the products.
[0010] In some possible implementations, the supply data includes at least one of the following: enterprise ID, product number, sales batch number, sales quantity, product counting unit, sales date, raw material number, purchase batch number, raw material purchase quantity, raw material piece unit and raw material purchase date.
[0011] In some possible implementations, converting the format of the supply data includes:
[0012] The supply data is formatted by using a shell command or a program written in a development language, so as to convert the data format of the supply data into a csv format.
[0013] In some possible implementations, modeling is performed in a target graph database, and metadata of the target graph database is set according to the provisioned data, including:
[0014] At least one of the following information is used as a point of the graph database: company, purchase document item, purchase batch number, raw material, sales batch number, sales document item, and product;
[0015] Use at least one of the following relationships as the edge of the graph data: the relationship between enterprise and sales batch number, the relationship between sales document item and sales batch number, the relationship between sales batch number and product, the relationship between enterprise and purchase batch number, the relationship between purchase batch number and purchase document item, the relationship between purchase batch number and raw materials, the relationship between sales batches and purchase batches of the same product, and the upstream and downstream relationship of enterprises.
[0016] In some possible implementations, the method further includes associating the purchase batch number of the product with the sales batch number.
[0017] In some possible implementations, importing the format-converted supply data into the target graph database includes:
[0018] The format-converted supply data is converted into data insert statements and written into the target graph database in batches.
[0019] In a second aspect, a device for identifying potential supply chain relationships and analyzing abnormal links based on a graph database is provided, comprising:
[0020] The acquisition module is used to obtain the supply data of suppliers at all levels;
[0021] A conversion module, used for converting the format of the supply data;
[0022] A modeling module, used for modeling in a target graph database and setting metadata of the target graph database according to the supply data;
[0023] A writing module, used for writing the supply data after format conversion into the target graph database;
[0024] The identification module is used to find out the sales batches corresponding to the upstream products and the purchase batches corresponding to the downstream raw materials that meet the upstream and downstream relationships in the target graph database through matching, insert the sales batches and the purchase batches into the target graph database as new data edges, and visualize the supply chain of the products.
[0025] In a third aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method described in the first aspect.
[0026] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable medium stores a program code for execution by a device, wherein the program code includes steps for executing the method in any one of the implementations of the first aspect described above.
[0027] In a fifth aspect, an electronic device is provided, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements a method as in any one of the implementations in the first aspect above.
[0028] The present application has the following beneficial effects: the present application utilizes graph database modeling and query technology to realize the potential link identification of massive supply chain data, and by storing the identified potential links in the graph database, it is easy to query and locate the upstream and downstream materials / products of the product, effectively connect and manage the potential link information in the supply chain, and improve the efficiency and accuracy of supply chain management. Secondly, by utilizing the graph database query result visualization technology, the abnormal links in the supply chain can be intuitively discovered, which facilitates the location of breakpoints and abnormal analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application.
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0031] Figure 1 is a flow chart of a method for identifying potential supply chain relationships and analyzing abnormal links based on a graph database according to Example 1 of the present application;
[0032] Figure 2It is a schematic diagram of modeling in the method for identifying potential supply chain relationships and analyzing abnormal links based on a graph database in Example 1 of the present application;
[0033] Figure 3 It is an example diagram of a graph database after a potential link is newly identified in the method for identifying potential supply chain relationships and analyzing abnormal links based on a graph database in Example 1 of the present application;
[0034] Figure 4 This is an example diagram of visualization of query results in the method for identifying potential supply chain relationships and analyzing abnormal links based on a graph database in Example 1 of the present application;
[0035] Figure 5 It is a structural block diagram of a device for identifying potential supply chain relationships and analyzing abnormal links based on a graph database in Example 2 of the present application;
[0036] Figure 6 It is a schematic diagram of the internal structure of the electronic device of Example 5 of the present application.
[0037] Reference numerals:
[0038] 100, acquisition module; 200, conversion module; 300, modeling module; 400, writing module; 500, recognition module. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] Example 1
[0041] Embodiment 1 of the present application involves a method for identifying potential supply chain relationships and analyzing abnormal links based on a graph database, comprising: obtaining supply data from suppliers at all levels; formatting the supply data; modeling in a target graph database, and setting metadata of the target graph database based on the supply data; writing the format-converted supply data into the target graph database; finding out the sales batches corresponding to upstream products and the purchase batches corresponding to downstream raw materials that meet the upstream and downstream relationships through match in the target graph database, inserting the sales batches and the purchase batches into the target graph database as new data edges, and visually viewing the supply chain of the product. The method utilizes graph database modeling and query technology to realize potential link identification of massive supply chain data. By storing the identified potential links in the graph database, it is easy to query and locate the upstream and downstream materials / products of the product, effectively connect and manage the potential link information in the supply chain, and improve the efficiency and accuracy of supply chain management. Secondly, by utilizing the visualization display technology of graph database query results, abnormal links in the supply chain can be intuitively discovered, which is convenient for locating breakpoints and performing abnormal analysis.
[0042] Specifically, Figure 1 A flowchart of a method for identifying potential supply chain relationships and analyzing abnormal links based on a graph database in application embodiment 1 is shown, including:
[0043] S100, obtaining supply data of suppliers at all levels;
[0044] Specifically, the most downstream enterprise can provide a platform to require upstream suppliers at all levels to upload data, and then summarize and summarize the data in the most downstream enterprise. In the supply data of suppliers at all levels, each supply data record includes information such as enterprise ID, product number, sales batch number, sales quantity, unit, sales date, raw material number, raw material purchase batch number, raw material purchase quantity, unit, raw material purchase date, etc. The specific supply data example is shown in Table 1 below:
[0045] Table 1: Supply data sheet
[0046]
[0047] S200, converting the format of the supply data;
[0048] Specifically, according to the data collected by downstream enterprises, use shell commands or write programs in development languages to convert the data format and convert it into a csv file. Converting to csv format can facilitate the use of graph database data import tools to import data into the graph database. The purpose is to facilitate the use of graph database data import tools to import data into the graph database. Currently, mainstream graph databases such as NebulaGraph, Neo4j, and TigerGraph all support data import in csv format.
[0049] S300, modeling in a target graph database, and setting metadata of the target graph database according to the supply data;
[0050] Specifically, Figure 2 As shown, according to the enterprise supply chain purchase document source information, the company, purchase document items, purchase batch number, raw materials, sales batch number, sales document items and product information are taken as points in the graph, and the relationship between the enterprise and sales batch number, the relationship between sales document items and sales batch number, the relationship between sales batch number and product, the relationship between the enterprise and purchase batch number, the relationship between purchase batch number and purchase document items, the relationship between purchase batch number and raw materials, the relationship between sales batches and purchase batches of the same product, and the upstream and downstream relationships of enterprises are taken as edges.
[0051] Taking the supply data in Table 1 above as an example, Figure 2 The data modeled in are:
[0052] The enterprise nodes are enterprise 1 and enterprise 2;
[0053] The sales batch number nodes are A1, A2, A3, A4, A5, A6, A7, XGHB1, XGHB2, XGHB3, XGHB4, XGHB5;
[0054] The purchase batch number nodes are B1, B2, B3, B4, B5, C1, C2, C3, C4, C5, C6, C7, C8, C9, C10;
[0055] The raw material and product nodes are merged together, which means that the raw material and product have the same ID, but different labels, which are raw material and product respectively, and the nodes are 1, 2, and 3;
[0056] The sales document entry node uses the self-increment id concatenated with the sales batch number as the vid of the point. The nodes are (1_A1, 1, 2024 / 03 / 01), (2_A2, 1, 2024 / 03 / 02), (3_A3, 1, 2024 / 03 / 03), (4_A4, 1, 2024 / 03 / 04), (5_A5, 1, 2024 / 03 / 05), (6_A6, 1, 2024 / 03 / 06), (7_A7, 1, 2024 / 03 / 07), (8_B1, 20, 2024 / 02 / 01), (9_ B1, 20, pcs, 2024 / 02 / 01), (10_B1, 20, pcs, 2024 / 02 / 03), (11_B1, 20, pcs, 2024 / 02 / 04), (12_B1, 20, pcs, 2024 / 02 / 05), (13_B2, 20, pcs, 2024 / 02 / 06), (14_B3, 20, pcs, 2024 / 02 / 07), (15_B4, 20, pcs, 2024 / 02 / 08), (16_B5, 20, pcs, 2024 / 02 / 09), (17_B6, 20, pcs, 2024 / 02 / 10);
[0057] The purchase document entry node uses the auto-increment id concatenated with the purchase batch number as the vid of the point. The nodes are (1_B1, 20, pcs, 2024 / 02 / 05), (2_B1, 20, pcs, 2024 / 02 / 05), (3_B1, 20, pcs, 2024 / 02 / 05), (4_B2, 20, pcs, 2024 / 02 / 06), (5_B3, 20, pcs, 2024 / 02 / 07), (6_B4, 20, pcs, 2024 / 02 / 08), (7_B5, 20, pcs, 2024 / 02 / 09), (8_C1, 30, pcs, 2024 / 01 / 15), (9_C2, 30, pieces, 2024 / 01 / 16), (10_C3, 30, pieces, 2024 / 01 / 17), (11_C4, 30, pieces, 2024 / 01 / 18), (12_C5, 30, pieces, 2024 / 01 / 19), (13_C6, 30, pieces, 2024 / 01 / 20), (14_C7, 30, pieces, 2024 / 01 / 21), (15_C8, 30, pieces, 2024 / 01 / 22), (16_C9, 30, pieces, 2024 / 01 / 23), (17_C10, 30, pieces, 2024 / 01 / 24).
[0058] The relationship edges between enterprises and sales batch numbers are Enterprise 1 -> A1, Enterprise 1 -> A2, Enterprise 1 -> A3, Enterprise 1 -> A4, Enterprise 1 -> A5, Enterprise 1 -> A6, Enterprise 1 -> A7, Enterprise 2 -> B1, Enterprise 2 -> B2, Enterprise 2 -> B3, Enterprise 2 -> B4, Enterprise 2 -> B5, Enterprise 2 -> B6;
[0059] The relationship edges between enterprises and purchase batch numbers are Enterprise 1 -> B1, Enterprise 1 -> B2, Enterprise 1 -> B3, Enterprise 1 -> B4, Enterprise 1 -> B5, Enterprise 2 -> C1, Enterprise 2 -> C2, Enterprise 2 -> C3, Enterprise 2 -> C4, Enterprise 2 -> C5, Enterprise 2 -> C6, Enterprise 2 -> C7, Enterprise 2 -> C7, Enterprise 2 -> C8, Enterprise 2 -> C9, Enterprise 2 -> C10;
[0060] The relationship edges between sales batch number and product are A1 ->1, A2 ->1, A3 ->1, A4 ->1, A5 ->1, A6 ->1, A7 ->1, B1 ->2, B2 ->2, B3 ->2, B4 ->2, B5 ->2, B6 ->2;
[0061] The relationship edges between purchase batch number and raw materials are B1 ->2, B2 ->2, B3 ->2, B4 ->2, B5 ->2, C1->3, C2 ->3, C3 ->3, C4 ->3, C5 ->3, C6 ->3, C7 ->3, C8 ->3, C9 ->3, C10 ->3;
[0062] The relationship edges between sales document items and sales batch numbers are 1_A1 ->A1, 2_A2 ->A2, 3_A3 ->A3, 4_A4 ->A4, 5_A5 ->A5, 6_A6 ->A6,7_A7 ->A7,8_B1 ->B1, 9_B1 ->B1, 10_B1 ->B1, 11_B1 ->B1, 12_B1 ->B1,13_B2 ->B2, 14_B3 ->B3, 15_B4 ->B4, 16_B5 ->B5,17_B6 ->B6;
[0063] The relationship edges between purchase document items and purchase batch numbers are 1_B1 ->B1, 2_B1 ->B1, 3_B1 ->B1, 4_B2 ->B2, 5_B3 ->B3, 6_B4 ->B4, 7_B5 ->B5, 8_C1 ->C1, 9_C2 ->C2, 10_C3 ->C3, 11_C4 ->C4, 12_C5 ->C5, 13_C6 ->C6, 14_C7 ->C7, 15_C8 ->C8, 16_C9 ->C9, 17_C10 ->C10;
[0064] The relationship edges between sales document items and purchase document items are 1_A1 ->1_B1, 2_A2 ->2_B1, 3_A3 ->3_B1, 4_A4 ->4_B2, 5_A5 ->5_B3, 6_A6 ->6_B4, 7_A7 ->7_B5, 8_B1 ->8_C1,9_B1 ->9_C2, 10_B1 ->10_C3, 11_B1 ->11_C4, 12_B1 ->12_C5, 13_B2 ->13_C6, 14_B3 ->14_C7, 15_B4 ->15_C8, 16_B5 ->16_C9, 17_B6 ->17_C10.
[0065] The relationship edges made_from between product batches and raw material batches are B1->A1, B2->A2, B1->A3,B2->A4, B3->A5, B4->A6, B5->A7, C1->B1, C2->B1, C3->B1, C4->B1, C5->B1, C6->B2, C7->B3, C8->B4, C9->B5, C10->B6.
[0066] In addition, the upstream and downstream relationships between enterprises should be extracted from the supply data. According to the supply data example in Table 1, the upstream and downstream relationship edges between enterprises are: Enterprise 2->Enterprise 1.
[0067] Based on the above modeling data, it is necessary to identify the association between the sales batch number of the downstream enterprise and the purchase batch number of the upstream enterprise in the graph database, that is, to draw the red edge in the figure below through conditional comparison. This is what step S500 is to do.
[0068] It should be noted that after the processed sales and purchase data is stored in the graph database, each node represents the subject of a link in the supply chain, and each edge represents the flow path of raw materials / products in the supply chain. For a final product, it is necessary to find the procurement link of the raw materials of the product, and the procurement link of the raw materials is the sales link of the upstream supplier of the raw materials, so it is necessary to associate the procurement batches and sales batches of all products, such as Figure 3 shown.
[0069] S400, writing the format-converted supply data into the target graph database;
[0070] Specifically, a program is written using the SDK tool of the graph database to convert the CSV data source after the format conversion in step S200 into data insertion statements and write them into the graph database in batches.
[0071] S500. Find out the sales batches corresponding to the upstream products and the purchase batches corresponding to the downstream raw materials that meet the upstream and downstream relationships through matching in the target graph database, insert the sales batches and the purchase batches into the target graph database as new data edges, and visualize the supply chain of the products.
[0072] Specifically, in Figure 3 In the two types of edges, made_from (i.e. produced from...) and purchase_from (i.e. purchased from...), the made_from relationship already exists in the source data. In the same data detail within the same enterprise, the product batch sold is made_from and the raw material batch purchased is made_from; purchase_from is the relationship between the hidden product sales batch and raw material purchase batch between the upstream and downstream enterprises found out through modeling and query statements. That is, if the raw material purchase batch of the downstream enterprise is consistent with the product batch of the upstream enterprise (this is just one of the simple cross-reference conditions), it means that the raw materials of the downstream enterprise come from the products of the upstream enterprise, so that the potential links of massive supply chain data can be identified by using graph database modeling and query technology. By storing the identified potential links in the graph database, it is easy to query and locate the upstream and downstream materials / products of the product.
[0073] Given a product / raw material v, find out the sales batch number and purchase batch number connected to v through a relationship, and write the sales batch and purchase batch with the same batch number into the database as a new edge. The query statement is as follows:
[0074] MATCH(v1:sales batch number)-[e1:the relationship between sales batch and product]-(v:product),(v)-[e2:the relationship between purchase batch and raw material]-(v2:purchase batch number) WHERE id(v)==”2” AND v1.sales batch number id==v2.purchase batch number id RETURN“\”” + id(v1) + “\”->”+”\””+id(v2)+”\”()” ASedge_list;
[0075] INSERT EDGE purchase_from() VALUES ${edge_list}; YIELD 0 AS output;
[0076] Through the match+insert statement, the potential upstream and downstream relationships of procurement and sales can be linked. After the linking, all upstream material sources of a product can be viewed through the query statement:
[0077] First, check the products of the most downstream companies and the raw materials they need. The query statement is as follows:
[0078] MATCH(company)-[:company and sales batch number]->(v:sales batch number) where id(company)==”Company 1” with v MATCH p=(v)-[:made_from|purchase_from*n]->() return p.
[0079] The above query results are as follows Figure 4 As shown in the figure, in the large data volume experiment, when there are more upstream and downstream enterprises, the number of queried links will increase accordingly. In this way, the method can effectively connect and manage the potential link information of the supply chain and improve the efficiency and accuracy of supply chain management.
[0080] At the same time, by viewing the visualized results of the link query, you can easily find abnormal links. For example, there should be 10 nodes on a supply chain link, but the query result shows only 5 nodes, indicating that the link is a broken link and an abnormal link. Users can analyze the cause of the break by checking the breakpoints.
[0081] Example 2
[0082] like Figure 5 As shown, a device for identifying potential supply chain relationships and analyzing abnormal links based on a graph database according to Embodiment 2 of the present application includes:
[0083] The acquisition module 100 is used to acquire the supply data of suppliers at all levels;
[0084] The conversion module 200 is used to convert the format of the supply data;
[0085] A modeling module 300, for modeling in a target graph database, and setting metadata of the target graph database according to the supply data;
[0086] A writing module 400, used for writing the supply data after format conversion into the target graph database;
[0087] The identification module 500 is used to find out the sales batches corresponding to the upstream products and the purchase batches corresponding to the downstream raw materials that meet the upstream and downstream relationships in the target graph database through matching, and insert the sales batches and purchase batches into the target graph database as new data edges to visualize the supply chain of the products.
[0088] It should be noted that other specific implementation methods of the device for identifying potential supply chain relationships and analyzing abnormal links based on a graph database in this embodiment can be found in the specific implementation methods of the method for identifying potential supply chain relationships and analyzing abnormal links based on a graph database mentioned above. To avoid redundancy, they will not be repeated here.
[0089] Example 3
[0090] A computer program product involved in Example 3 of the present application is used to store a computer program. When the computer program runs on a computer, the method in any one of the implementation modes in Example 1 of the present application is implemented.
[0091] Example 4
[0092] A computer-readable storage medium according to Embodiment 4 of the present application, wherein the computer-readable storage medium stores a program code for execution by a device, wherein the program code includes steps for executing a method in any one of the implementations in Embodiment 1 of the present application;
[0093] Among them, the computer-readable storage medium can be a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM); the computer-readable storage medium can store program code, and when the program stored in the computer-readable storage medium is executed by the processor, the processor is used to execute the steps of the method in any one of the implementation methods in Example 1 of the present application.
[0094] Example 5
[0095] like Figure 6As shown, an electronic device involved in Embodiment 5 of the present application includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, and when the program or instruction is executed by the processor, a method in any one of the implementations in Embodiment 1 of the present application is implemented;
[0096] Among them, the processor can adopt a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits to execute relevant programs to implement the method in any one of the implementation methods in Example 1 of the present application.
[0097] The processor may also be an integrated circuit electronic device with signal processing capability. In the implementation process, each step of the method in any implementation of Embodiment 1 of the present application may be completed by an integrated logic circuit of hardware in the processor or by instructions in software form.
[0098] The above-mentioned processor may also be a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the functions required to be performed by the unit included in the data processing device of the embodiment of the present application in combination with its hardware, or executes the method in any one of the implementation modes in the embodiment 1 of the present application.
[0099] The above are only preferred specific implementations of the present application; however, the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solution and its improved ideas of the present application within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A method for identifying potential supply chain relationships and analyzing abnormal links based on a graph database, characterized in that: include: Acquire supply data of suppliers at all levels, wherein the supply data includes at least one of the following: enterprise ID, product number, sales batch number, sales quantity, product counting unit, sales date, raw material number, purchase batch number, raw material purchase quantity, raw material piece unit and raw material purchase date; Converting the format of the supply data; Modeling in a target graph database, setting metadata of the target graph database according to the supply data, specifically including: taking at least one of the following information as a point in the graph database: company, purchase document item, purchase batch number, raw material, sales batch number, sales document item, and product; taking at least one of the following relationships as an edge of the graph data: relationship between enterprise and sales batch number, relationship between sales document item and sales batch number, relationship between sales batch number and product, relationship between enterprise and purchase batch number, relationship between purchase batch number and purchase document item, relationship between purchase batch number and raw material, relationship between sales batch and purchase batch of the same product, and upstream and downstream relationship of enterprises; Writing the format-converted supply data into the target graph database; In the target graph database, the sales batches corresponding to the upstream products and the purchase batches corresponding to the downstream raw materials that meet the upstream and downstream relationships are found through matching, and the sales batches and purchase batches are inserted into the target graph database as new data edges to visualize the supply chain of the products.
2. The method for identifying potential supply chain relationships and analyzing abnormal links based on a graph database according to claim 1 is characterized in that: Converting the format of the supply data includes: The supply data is formatted by using a shell command or a program written in a development language, so as to convert the data format of the supply data into a csv format.
3. The method for identifying potential supply chain relationships and analyzing abnormal links based on a graph database according to claim 1 is characterized in that: Also includes: Associate the purchase batch number of the product with the sales batch number.
4. The method for identifying potential supply chain relationships and analyzing abnormal links based on a graph database according to claim 1 is characterized in that: Importing the format-converted supply data into the target graph database includes: The format-converted supply data is converted into data insert statements and written into the target graph database in batches.
5. A device for identifying potential supply chain relationships and analyzing abnormal links based on a graph database, characterized in that: include: An acquisition module, used to acquire supply data of suppliers at all levels, wherein the supply data includes at least one of the following: enterprise ID, product number, sales batch number, sales quantity, product counting unit, sales date, raw material number, purchase batch number, raw material purchase quantity, raw material piece unit and raw material purchase date; A conversion module, used for converting the format of the supply data; A modeling module, used for modeling in a target graph database, setting metadata of the target graph database according to the supply data, specifically including: taking at least one of the following information as a point of the graph database: company, purchase document item, purchase batch number, raw material, sales batch number, sales document item and product; taking at least one of the following relationships as an edge of the graph data: relationship between enterprise and sales batch number, relationship between sales document item and sales batch number, relationship between sales batch number and product, relationship between enterprise and purchase batch number, relationship between purchase batch number and purchase document item, relationship between purchase batch number and raw material, relationship between sales batch and purchase batch of the same product and upstream and downstream relationship of enterprises; A writing module, used for writing the supply data after format conversion into the target graph database; The identification module is used to find out the sales batches corresponding to the upstream products and the purchase batches corresponding to the downstream raw materials that meet the upstream and downstream relationships in the target graph database through matching, insert the sales batches and the purchase batches into the target graph database as new data edges, and visualize the supply chain of the products.
6. A computer program product, characterized in that The computer program product stores computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program code for execution by a device, wherein the program code includes steps for executing the method according to any one of claims 1 to 4.
8. An electronic device, characterized in that: The electronic device includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction implements the method according to any one of claims 1 to 4 when executed by the processor.
