File semantic association storage system and method based on knowledge graph

Through the file semantic correlation storage system based on knowledge graph, the problems of untargeted feature extraction of multi-type file storage and archives in the industrial production field are solved, and efficient semantic correlation and secure storage of files are achieved.

CN113961528BActive Publication Date: 2025-04-04SHANGHAI JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111255086.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-27
Publication Date
2025-04-04
Estimated Expiration
2041-10-27

AI Technical Summary

Technical Problem

In the field of industrial production, the storage and archive of multiple types of files face problems such as untargeted feature extraction, incomplete file associations, poor scalability and insufficient security.

Method used

The file semantic correlation storage system based on knowledge graph is adopted to realize semantic correlation and secure storage of files through technologies such as multimodal feature extraction, structured knowledge extraction, multi-level semantic completion, automatic semantic association, flexible dynamic partitioning and hash secure storage.

Benefits of technology

It improves the comprehensiveness and pertinence of file feature extraction, enhances the integrity of file associations and system scalability, and improves the confidentiality and tamper-proofness of files through hash secure storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113961528B_ABST
    Figure CN113961528B_ABST
Patent Text Reader

Abstract

A file semantic association storage system and method based on knowledge graph, including: a multimodal feature extraction module, a structured knowledge extraction module, a multi-level semantic completion module, an automatic semantic association module, a flexible dynamic partitioning module and a hash security storage module. The present invention takes a multi-type file set generated in the process of industrial production as input, combines the domain knowledge graph to complete the file semantic association and partitioning, and finally completes the file partition security storage based on file segmentation and chain hashing, and forms corresponding storage metadata.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a technology in the field of information processing, specifically a file semantic association storage system and method based on knowledge graph. Background Art

[0002] The storage and archiving of various types of files generated in the process of industrial production is an essential step in the digital construction of the industrial sector. However, the industry is still facing the following difficulties in the storage and archiving of various types of files: First, the file processing and analysis method is single. For different types of files such as XML type files, drawing type files and document type files, only a single general metadata extraction method is used. How to extract file features for various types of files in a targeted manner is an important issue. In addition, the storage of files in the file system is extremely isolated. In addition to asking file managers to manually establish associations, how to intelligently and automatically associate massive amounts of new and old files and ensure the integrity of file associations is also a problem worth considering. Finally, files are often stored simply in plain text in the file system without backup. How to improve the confidentiality, security and tamper-proofness of files while storing and archiving them is also worth exploring.

[0003] In response to the above problems, there are already some related technologies in the industry, such as: methods for querying and other processing file-related objects, methods for automatically associating files based on the relevance of file titles, and systems that use blockchain to ensure the security of file storage. However, these technologies generally have a single association dimension, poor scalability, and low efficiency, and there is no relatively complete and mature solution yet. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, the present invention proposes a file semantic association storage system and method based on knowledge graph, which takes a set of multi-type files generated in the process of industrial production as input, completes file semantic association and partitioning in combination with the domain knowledge graph, and finally completes the secure storage of file partitions based on file segmentation and chain hashing, and forms corresponding storage metadata.

[0005] The present invention is achieved through the following technical solutions:

[0006] The present invention relates to a file semantic association storage system based on knowledge graph, comprising: a multimodal feature extraction module, a structured knowledge extraction module, a multi-level semantic completion module, an automatic semantic association module, a flexible dynamic partitioning module and a hash security storage module, wherein: the multimodal feature extraction module performs multimodal analysis and feature extraction on an input multi-type file set and further converts it into a semantic abstract file set containing feature information; the structured knowledge extraction module extracts corresponding entities from an input XML original file with the help of a meta-structure extracted from an XML type file and converts it into a structured knowledge set; the multi-level semantic completion module integrates the structured knowledge set from top to bottom into The dynamic evolution of the knowledge graph is realized in the domain knowledge graph; the automatic semantic association module uses the domain knowledge graph as a support to entity link the semantic abstract file set containing feature information and establish semantic associations to convert it into an associated file set, thereby further improving the integrity of file associations with the help of semantic dimension associations; the flexible dynamic partitioning module dynamically divides files into the most relevant partitions through semantic clustering partitions, thereby guiding the establishment of semantic association directories to complete the incremental dynamic association of new and old files, thereby enhancing the scalability of the system; the hash security storage module performs distributed and secure storage of files based on the partition information of the semantic partition file set, combined with file segmentation and chain hashing.

[0007] The multimodal file feature extraction includes: XML type file feature extraction, drawing type file feature extraction and document type file feature extraction.

[0008] The XML type file feature extraction refers to: converting the relative path corresponding to each attribute in the XML file into a static absolute path structure based on XPATH expression through the SAX file parsing library and identifying the specific attribute atomic type, then merging and encapsulating each absolute path into the meta structure of the XML file, and finally extracting the leaf node noun attribute value of each XPATH record as the semantic feature of the XML type file.

[0009] The feature extraction of drawing type files refers to: first, the plane drawing file is exported by PNG to generate the corresponding image file to facilitate subsequent image processing, and then the CNN convolutional neural network pre-trained in the corresponding field is used to classify each pixel in the image for the exported PNG image, and divided into three category areas: background, noise, and modeling object. Finally, for the category area corresponding to the modeling object, the object recognition combined with the classifier is used to identify the specific category of the modeling object, such as: engine, deck, etc., and regarded as the corresponding file semantic feature.

[0010] The document type file feature extraction refers to: first, using a comprehensive method of PDF parsing library parsing combined with OCR text recognition scanning to perform document parsing and text extraction on the document file, then performing word segmentation processing on the extracted text based on a certain word segmentation algorithm, and extracting keywords with noun characteristics as semantic feature candidate sets, and finally performing keyword mining on the pre-processed word set to obtain a keyword set that can truly characterize the semantic characteristics of the document type file.

[0011] The keyword mining specifically refers to: first, based on the Word2Vec word clustering algorithm, the word set is converted into a low-order dense vector and the candidate keyword phrase is obtained by the optimized clustering algorithm, and then the TF-IDF algorithm and the Text Rank algorithm are respectively run for each word in the candidate keyword phrase to generate the corresponding score, and then the score is generated for the new word by the merging algorithm, and finally the Top-K in each keyword phrase is selected as the keyword phrase.

[0012] The optimized clustering algorithm is: based on the formula Dynamically generate the number of actual clusters, where is the average file size, s is the original file size, is the average number of candidate keywords, n is the number of candidate keywords, is the average number of keywords, and is the constant for the dynamic configuration of θ.

[0013] The merging algorithm is as follows: first, the scores obtained by the two algorithms are based on the formula To normalize, the score max 、score min They represent the maximum and minimum values ​​of the currently counted scores, score represents the current score, S represents the normalized final score, and then based on the weighted average S final =αS TF-IDF +(1-α)S Text Rank Get the final score, where S TF-IDF , S Text Rank They represent the normalized formulas obtained by the TF-IDF and Text Rank algorithms respectively, and α is a dynamically configured weight constant.

[0014] The structured knowledge extraction mentioned above means: firstly, the nested one-dimensional static structure extracted from the XML type file is converted into a two-dimensional graph structure, and then the data content of the XML type file is read through the XPATH query method of the SAX parsing library in combination with the static absolute path corresponding to XPATH, so as to extract the entity corresponding to the two-dimensional graph structure.

[0015] The nested one-dimensional static structure is converted into a two-dimensional graph structure specifically by traversing each static absolute path structure expressed based on XPATH and reading the fields corresponding to each layer of attributes from the root. If the field has not been built into a node, the corresponding node is created and connected to the node corresponding to the upper layer field. Otherwise, the traversal continues until the static structure is converted into the corresponding two-dimensional graph structure.

[0016] The multi-level semantic completion includes: semantic ontology completion and semantic entity completion, wherein:

[0017] The semantic ontology completion refers to: traversing each ontology with a domain type in the structured knowledge set as the ontology to be fused, and traversing the ontology with a domain type in the ontology layer of the knowledge graph as the target ontology, and then obtaining the similarity between each target ontology and the ontology to be fused based on the similarity calculation, wherein the similarity calculation first substitutes the ontology into the word vector file to obtain the corresponding low-order dense vector, and then calculates the similarity between the target ontology and the ontology to be fused in combination with the cosine similarity formula, and then calculates the similarity between the attribute ontology of the target ontology and the attribute ontology of the ontology to be fused and selects the attribute ontology with the highest similarity as the matching attribute ontology, and finally performs weighted averaging and normalization on the similarity of the type ontology and the attribute ontology similarity to obtain the final similarity, if the calculated similarity of all ontologies and the ontology to be fused is lower than the dynamically configured threshold δ, then the ontology to be fused is directly added to the ontology layer of the knowledge graph as a new ontology, otherwise the ontology with the highest similarity among all candidates is selected as the main body of the ontology to be fused, and the corresponding attribute ontology is fused and expanded together.

[0018] The semantic entity completion refers to: calculating the similarity between the entities of the domain type in the data set to be merged and the existing entities that are similar to the ontology. If the similarity is higher than the threshold δ, the entity is merged into the existing entity and some attribute entities that were originally empty are expanded. Otherwise, it is added to the entity layer as a new entity with a UUID.

[0019] The entity linking refers to: linking with a certain entity in the knowledge graph by traversing each keyword in the semantic features, first generating the corresponding candidate entity based on the name dictionary generation method, which contains various variation information of the keywords to be connected, such as abbreviations, obfuscated names, etc., and then matching each type of variation information with the entities in the domain knowledge graph and calculating the score. The matching rules are mainly based on context-independent features, such as: matching information between the entity to be linked and the knowledge graph entity, the type of entity to be linked and the popularity of the entity, etc., and then selecting the entity with the highest score as the link entity.

[0020] The association of the semantic dimension is established in the following way: a minimum width graph is established based on the minimum shortest path idea with the support of the knowledge graph. For any pair of keyword semantic features with domain type in any two files, the shortest path between them is calculated based on the breadth-first search combined with the priority queue method and the graph association of the domain knowledge graph at the ontology layer and the entity layer. After the calculation is completed, if all the keywords between the two files have no path association, it means that there is no association relationship between the files, so there is no need to establish a semantic association. Otherwise, a semantic association is established between the corresponding two files and the weight of the association between the two files is set to the minimum shortest path length divided by the corresponding number of paths. At the same time, the corresponding keyword features are recorded. Since the idea of ​​the minimum shortest path is applied in the algorithm, the entire file semantic association network constructed by the algorithm is a minimum width graph in the solution space, thereby ensuring the closeness of the semantic association between files, and thus further strengthening the integrity of the file association in the semantic dimension.

[0021] The semantic clustering partitioning means: firstly, specify the corresponding partition number as n based on the specific application scenario, then arbitrarily select n files in the semantically associated file set as the partition center node, and calculate the distance from other files to the partition center node, where the distance calculation is based on the formula: Distance(s,t)=Min{Weight(s,s i )+Distance(s i ,t),s i ∈NeighborOf(s)} recursively calculates, where s represents other files except the partition center node, t represents the file corresponding to the partition center node, and s i Represents all neighbor files of s. Since in the semantic association network diagram, the smaller the weight, the closer the association between the two files. Therefore, the smaller the calculated distance, the more semantically related the files are, and they should be divided into the same partition. Therefore, after completing the distance calculation, the node is assigned to the partition corresponding to the partition center node closest to it. At the same time, for each partition, the node with the smallest distance sum is calculated as the new partition center node, and then the above process is repeated until convergence.

[0022] The convergence means that for any file F and its semantic partition center point P central All of them make the formula Distance(F,P central ) and formula Satisfies the global minimization feature, where F i Any file allocated to partition P.

[0023] The semantic association directory is established in the following way: for each partition, the keyword feature with the strongest correlation with other files in its center is calculated as the main feature of the files in the partition, and other keyword features are used as secondary features. Then, all file keyword features are traversed and a hierarchical nested keyword directory corresponding to the entity link is established in the local file system. Finally, the file reference is stored in the directory corresponding to its keyword feature, and the corresponding directory is divided into primary and secondary directories according to the primary and secondary nature of the keyword feature.

[0024] The incremental dynamic association means that new and old files are divided into main and sub-directories through the establishment of semantic association directories. Each file can only be actively found in the main directory through the main feature, but when the corresponding file is found, other files in the directory, whether new or old, will be returned as associated files. Therefore, each file exists in the main directory and is actively associated with other new and old files, and also exists in the sub-directory and is passively associated with other new and old files.

[0025] The file segmentation refers to: slicing each original file evenly to obtain a set of file segments of the same size, so as to avoid the unsafe scenario where the user directly sees the original text of the file, thereby replacing encryption to reduce the risk of storing the original file in plain text, and at the same time establishing a relative index value in the original file for each file segment to facilitate the subsequent recovery of the original file.

[0026] The chain hashing means that for each file block, the hash value corresponding to its content is obtained based on the hash algorithm and recorded in the header record of the file block, and then the hash value of the header record of the previous file block is recorded in the header record at the same time. The hash value adopts the multiple hash formula: HASH i =hash(hash(Content i )+HASH i-1 ) is calculated, where HASH i With HASH i-1 Represents the hash value of the header record of the current file block and the hash value of the header record of the previous file block, Content i Represents the content of the current file block, and hash represents the corresponding hash algorithm. In addition, for the first file block of each file, based on the association between files, it points to the last file block of the previous file associated with it in the same partition. When it is the first file in the partition, the header record hash value of the previous block in the block is set to 0000…000 and then multiple hash calculations are performed.

[0027] The hash algorithm is specifically as follows: the input is a binary array of a file block, and the output is a binary number of 8 bytes. The process is to convert each 8 bits in the binary array, that is, 1 Byte, into a corresponding decimal value p. If it is less than 1 Byte, it is automatically filled with zeros. At the same time, the initial hash value is a Long type, that is, a decimal value h of 8 bytes, which is equal to 0. Finally, for each decimal p, the hash value is iteratively calculated according to the formula: h=31*h+p, where h is the iterative hash value and p is the decimal number corresponding to each Byte. 31 is selected as the multiplier in the formula because 31 is a prime number of appropriate size and is not prone to hash collision. On the other hand, 31*h can be optimized to (h<<5)-h to improve the calculation efficiency.

[0028] The distributed secure storage refers to: storing files in distributed data nodes and performing multiple copy backups, wherein the allocation algorithm mainly calculates the master data node ID by taking a modulo method based on the main features of the file's partition keyword combined with the number of data nodes, thereby ensuring that files in the same partition can be stored in the same physical data node, thereby improving the spatial locality of file storage.

[0029] The file block record header includes: relative index value, content hash value, file block name, previous file block name and record header hash value, primary data node and backup data node list

[0030] The database building data storage information includes: semantic association directory, file record header list, file index table, metadata, etc.

[0031] Technical Effects

[0032] The present invention solves multiple problems in the existing file associative storage process as a whole, including: 1. The mined file features are not representative due to the single file processing and analysis method; 2. The overall association integrity is insufficient due to the single association dimension between files; 3. The scalability is poor due to the inability to dynamically establish incremental associations between new and old files; 4. The security is insufficient due to the simple stand-alone storage of files in plain text.

[0033] Compared with the prior art, the technical effects achieved by the present invention include: 1. Multi-modal feature extraction is performed for multiple types of files, which improves the comprehensiveness and pertinence of feature extraction and integrates three types of keyword mining algorithms through the keyword mining step to further improve the feature representativeness of the mined keywords in the text; 2. Automatic semantic associations between files are established with the domain knowledge graph as the underlying support and in combination with the corresponding association construction algorithm, wherein the minimum width graph is established through the minimum shortest path, ensuring that the entire file semantic association network has the smallest width and the closest association within the solution space, thereby improving the integrity of the association between files at the semantic level; 3. Combined with the semantic clustering partitioning algorithm, the file is divided into the partition most associated with it and guides the establishment of a semantic association directory to complete the incremental dynamic association of new and old files, realizing flexible dynamic partitioning and enhancing the scalability of the system; 4. The original file is divided into multiple file blocks based on file segmentation and then combined with chain hashing to prevent the file from being tampered with or directly read, and finally the security of file storage is improved as a whole through distributed storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 is a flow chart of the method of the present invention;

[0035] Figure 2 This is a system structure diagram of the present invention. DETAILED DESCRIPTION

[0036] like Figure 1 As shown, this embodiment involves a file semantic association storage system based on knowledge graph, including: a multimodal feature extraction module, a structured knowledge extraction module, a multi-level semantic completion module, an automatic semantic association module, a flexible dynamic partitioning module and a hash security storage module.

[0037] The multimodal feature extraction module includes: XML file feature extraction, drawing file feature extraction and document file feature extraction.

[0038] The XML file feature extraction includes: a static structure parsing unit and a semantic extraction unit, wherein: the static structure parsing unit converts the relative path corresponding to each attribute in the XML file into a static absolute path structure based on XPATH expression through a SAX file parsing library according to the original XML file and identifies the specific attribute atomic type, and then merges and encapsulates each absolute path into a meta-structure of the XML file; the semantic extraction unit extracts the leaf node noun attribute value of each XPATH record as the semantic feature of the XML type file according to the original structure of the XML file.

[0039] The drawing file feature extraction includes: an image semantic segmentation unit and an object recognition unit, wherein the image semantic segmentation unit generates a corresponding PNG image according to the original file of the drawing file by PNG export and uses a CNN convolutional neural network pre-trained in the corresponding field to classify each pixel in the image, and divides it into three category areas: background, noise, and modeling object. The object recognition unit identifies the specific category of the modeling object, such as engine, deck, etc., according to the category area corresponding to the modeling object combined with the pre-trained classifier, and regards it as the corresponding file semantic feature.

[0040] The document file feature extraction includes: a document text extraction unit and a keyword mining unit, wherein the document text extraction unit performs document parsing and text extraction on the document file according to the original file of the document file through a comprehensive method of PDF parsing library parsing combined with OCR text recognition scanning, and performs word segmentation processing based on a specific word segmentation algorithm to extract keywords with noun characteristics as a semantic feature candidate set, and the keyword mining unit mines representative keywords according to the word set obtained by preprocessing by integrating three algorithms: TF-IDF algorithm, Text Rank algorithm and Word2Vec word clustering algorithm, and regards them as corresponding file semantic features.

[0041] The structured knowledge extraction module includes a structured knowledge extraction unit, wherein: the structured knowledge extraction unit first converts the corresponding one-dimensional static metastructure into a two-dimensional graph structure based on the metastructure extracted from the XML type file, and then reads the data content of the XML type file through the XPATH query method of the SAX parsing library in combination with the static absolute path corresponding to XPATH, thereby extracting the entities corresponding to the two-dimensional graph structure and converting them into a structured knowledge set.

[0042] The multi-level semantic completion module includes: a semantic ontology completion unit and a semantic entity completion unit, wherein: the semantic ontology completion unit calculates and compares the similarity between the ontology with domain type in the structured knowledge set obtained by the file entity extraction module and the ontology with domain type in the ontology layer of the knowledge graph, and selects the ontology with the highest similarity to complete the ontology in the structured knowledge set into the domain knowledge graph; the semantic entity completion unit calculates and compares the similarity between the entity with domain type in the structured knowledge set obtained by the file entity extraction module and the existing entity in the knowledge graph, and then combines the corresponding ontology information to complete it into the domain knowledge graph.

[0043] The automatic semantic association module includes: an entity linking unit and a semantic association establishing unit, wherein: the entity linking unit links the semantic abstract file set output by the file feature extraction module with a certain entity in the knowledge graph by traversing each keyword in the semantic feature, and the semantic association establishing unit establishes a minimum width graph based on the knowledge graph based on the linked entity and the minimum shortest path idea to obtain a semantically associated file set. Since the minimum shortest path algorithm is applied in the semantic association algorithm, the entire file semantic association network constructed by the algorithm is a minimum width graph in the solution space, thereby ensuring the closeness of the semantic association between files, and further strengthening the integrity of the file association in the semantic dimension.

[0044] The flexible dynamic partitioning module includes: a semantic clustering partitioning unit and a semantic association directory establishment unit, wherein: the semantic clustering partitioning unit performs a semantic clustering algorithm according to the semantic association file set output by the file semantic association module to obtain the corresponding file partition. The semantic association directory establishment unit is based on the file partition, and for each partition, the keyword feature with the strongest association between its center and other files is calculated as the main feature of the file in the partition, and other keyword features are used as secondary features, and then all file keyword features are traversed and a hierarchical nested keyword directory corresponding to the entity link is established in the local file system, and finally the file reference is stored in the directory corresponding to its keyword feature, and the corresponding directory is divided into a primary and secondary directory according to the primary and secondary nature of the keyword feature. If there is an old file reference in the keyword directory, an incremental association between the new and old files based on the definition of the primary and secondary directories is dynamically established.

[0045] The actual application of the main and sub-directories is as follows: each file can only be actively found in the main directory through the main feature, but when the corresponding file is found, other files in the directory, whether new or old, will be returned as associated files. Therefore, each file exists in the main directory and is actively associated with other files, and also exists in the sub-directory and is passively associated with other files, further enhancing the scalability of the system.

[0046] The hash security storage module includes: a file block unit, a chain hash unit and a data node allocation unit, wherein: the file block unit evenly slices each original file based on the original file of the input file to obtain a set of file blocks of the same size, so as to avoid the unsafe scenario that the user directly sees the original text of the file, thereby replacing encryption to reduce the risk of storing the original file in plain text, and at the same time establishes a relative index value in the original file for each file block to facilitate the subsequent recovery of the original file, the chain hash unit calculates the corresponding hash value based on each file block and stores it in the file block header record, and records the hash value of the header record of the previous file block in the header record, through the chain hash, even if part of the information and the corresponding hash value of the file block are tampered with, since the original header record hash value is still recorded in the record header of the subsequent file block, the hash verification will fail, unless the record headers of all subsequent file blocks are tampered with, the tampering can be successful, and at the same time, as time goes by, the file blocks will continue to increase, so the difficulty of tampering with the same file block will continue to increase with time, which further ensures the security of file data. The data node allocation unit calculates the primary data node ID based on the main file partition features of the file semantic partition module and the number of data nodes by taking the modulus method, thereby ensuring that files under the same partition can be stored in the same physical data node, thereby improving the spatial locality of file storage.

[0047] like Figure 2As shown. Before the system runs, users need to generate corresponding word vector files and offline dictionaries based on the domain knowledge graph to make fuller use of domain knowledge. At the same time, users need to train corresponding object recognition models and OCR tools based on the existing corpus and knowledge in the corresponding field as a prerequisite for the system to run. During the use of the system, users upload multi-type file sets through the REST API and hand them over to the multimodal feature extraction module for processing. The multimodal feature extraction module combines the pre-prepared file analysis auxiliary tools: file parsing library, object recognition model and OCR tool to perform multimodal processing and analysis on various types of files in the multi-type file set and generate corresponding file features. Among them, the drawing type file first performs background-noise-modeling recognition based on the object recognition model, and then partitions the modeling object through the pre-trained classification model. The document type file first performs Word2Vec word clustering to obtain the corresponding keyword feature clustering, and then selects the Top K keyword features from the cluster based on the TF-IDF and Text Rank keyword mining algorithms combined with the normalization model. The XML type file reads the XPATH static structure through SAX, and then extracts the leaf node noun attribute value of each XPATH record as the semantic feature of the XML type file. The file features generated for XML type files will be further obtained through the structured knowledge extraction module to obtain the corresponding structured knowledge set, and then the multi-level semantic completion module will be combined with the word vector file generated by the domain knowledge graph to calculate the similarity of the knowledge set, and then integrated and completed into the domain knowledge graph stored in the Neo4j graph database. The file features extracted for each type of file will be converted into a semantic abstract file set containing feature information, and the subsequent modules will perform semantic association and semantic partitioning and finally store it safely. In automatic semantic association, the keyword features of the file are entity linked based on the domain knowledge graph stored in the Neo4j graph database and the offline dictionary derived from it, and then the semantic association between files is established through the graph association structure of the domain knowledge graph combined with the minimum shortest path algorithm and the minimum width graph generation. After that, the semantic association network graph generated by the semantic association module is clustered and partitioned through the flexible dynamic partitioning module, and a semantic association directory is generated to establish an incremental dynamic association between new and old files, and then recorded in the local file system Ext4.Finally, the hash security storage module performs hash security storage on the original file. During the implementation process, the original file is first divided into file blocks instead of encryption to reduce the risk of storing the original file in plain text. Then, the original file blocks in the same partition are hashed and linked based on the chain hash algorithm to prevent malicious tampering. In addition, the partition results and the data node allocation algorithm are combined to distribute the files in the same partition based on spatial locality on the same data node of the underlying HDFS-based distributed file system. Finally, a reverse index is established for the file to improve the full-text retrieval performance. At the same time, the metadata set generated by the system, including: file index table, metadata table and file record header list, is stored in the MongoDB cluster deployed with a replica set cluster architecture to ensure the disaster tolerance of the metadata. In addition, a Redis-based cache implementation is added between the MongoDB cluster and the tool to improve the query performance of the metadata. After completing the file semantic association storage, upper-level enterprise applications such as ERP, DMS and other systems that require file query applications can read file metadata through the corresponding file query engine through fuzzy association query, keyword full-text search, associated file download and other functions, and obtain the corresponding original file from the HDFS-based distributed file system through the file record header, then perform chain hash verification and finally return the corresponding file.

[0048] Table 1 Comparison of technical characteristics

[0049]

[0050]

[0051] From the perspective of system functions, the present invention extracts multimodal features for multiple types of files generated in the industrial production process, and performs reverse multi-level semantic completion on the domain knowledge graph as the supporting platform based on the extracted knowledge. At the same time, it also combines the domain knowledge graph to automatically semantically associate the input files. In addition, through clustering partitioning, files with strong associations are assigned to the same partition, and guidance is provided to establish a semantic association directory to achieve incremental dynamic association between new and old files. Finally, based on file segmentation and chain hashing, file storage can be safely implemented.

[0052] From the perspective of system integrity, the present invention extracts corresponding semantic features from different types of files in a multimodal manner, and then uses the automatic semantic association module, guided by the knowledge information of the domain knowledge graph itself, combined with the generation of the minimum width graph, to establish a close association between files at the semantic level, thereby ensuring the integrity of the association between files. Therefore, compared with other existing technologies, the present invention has more comprehensive integrity.

[0053] From the perspective of system scalability, the present invention dynamically partitions the associated files by cluster partitioning and creates semantically associated directories in combination with the definition of primary and secondary directories to establish incremental dynamic associations between new and old files, thereby improving the scalability of the system. At the same time, the system sets a series of key parameters that can be dynamically adjusted according to the scenario, such as: the number of clusters, the size of the file block, the similarity threshold, etc., so that the system can be configured with different parameters to better adapt to different application scenarios, further enhancing the scalability of the system. Therefore, the present invention has better scalability than other existing technologies.

[0054] From the perspective of system security, the present invention avoids the unsafe scenario of users directly seeing the original text of the file by dividing the file into blocks, thereby replacing encryption to increase the security of file storage, and at the same time, chain hashing is used to ensure that the file blocks cannot be tampered with after being stored on the disk. If a file is to be tampered with, it is necessary to tamper with the corresponding hash value and the hash values ​​of all subsequent file blocks chained on the file block at the same time, and the difficulty of tampering with the same block will increase with the increase in the number of blocks. Therefore, the present invention has stronger security than other existing technologies.

[0055] The above-mentioned specific implementation can be partially adjusted in different ways by those skilled in the art without departing from the principle and purpose of the present invention. The protection scope of the present invention shall be based on the claims and shall not be limited by the above-mentioned specific implementation. Each implementation scheme within its scope shall be subject to the constraints of the present invention.

Claims

1. A file semantic association storage system based on knowledge graph, characterized in that: include: A multimodal feature extraction module, a structured knowledge extraction module, a multi-level semantic completion module, an automatic semantic association module, a flexible dynamic partitioning module, and a hash security storage module, wherein: the multimodal feature extraction module performs multimodal analysis and feature extraction on the input multi-type file set and further converts it into a semantic abstract file set containing feature information; the structured knowledge extraction module extracts the corresponding entities from the input multi-type file set with the help of the meta-structure extracted from the XML type file, thereby converting it into a structured knowledge set; the multi-level semantic completion module integrates the structured knowledge set into the domain knowledge graph from top to bottom to realize the dynamic evolution of the knowledge graph; the automatic semantic association module uses the domain knowledge graph as a support to perform entity linking on the semantic abstract file set containing feature information and establish semantic associations to convert it into an associated file set; the flexible dynamic partitioning module dynamically divides the file into the partition most associated with it through semantic clustering partitioning; the hash security storage module performs distributed and secure storage of the file based on the partition information of the semantic partition file set, combined with file segmentation and chain hashing; The multimodal feature extraction includes: XML type file feature extraction, drawing type file feature extraction and document type file feature extraction; The multi-level semantic completion includes: semantic ontology completion and semantic entity completion, wherein: The semantic ontology completion refers to: traversing each ontology with a domain type in the structured knowledge set as an ontology to be fused, and traversing the ontology with a domain type in the ontology layer of the knowledge graph as a target ontology, and then obtaining the similarity between each target ontology and the ontology to be fused based on the similarity calculation, wherein the similarity calculation first substitutes the ontology into the word vector file to obtain the corresponding low-order dense vector, and then calculates the similarity between the target ontology and the ontology to be fused in combination with the cosine similarity formula, and then calculates the similarity between the attribute ontology of the target ontology and the attribute ontology of the ontology to be fused and selects the attribute ontology with the highest similarity as the matching attribute ontology, and finally performs weighted averaging and normalization on the similarity of the type ontology and the attribute ontology similarity to obtain the final similarity, if the calculated similarity of all ontologies and the ontology to be fused is lower than the dynamically configured threshold δ, then the ontology to be fused is directly added to the ontology layer of the knowledge graph as a new ontology, otherwise the ontology with the highest similarity among all candidates is selected as the main body of the ontology to be fused, and the corresponding attribute ontology is fused and expanded together; The semantic entity completion means: calculating the similarity between the entities of the domain type in the data set to be merged and the existing entities and the entities similar to the entity. If the similarity is higher than the threshold δ, the entity is merged into the existing entity and some attribute entities that were originally empty are expanded. Otherwise, it is added to the entity layer as a new entity with a UUID. The entity linking means: linking with a certain entity in the knowledge graph by traversing each keyword in the semantic feature, firstly generating the corresponding candidate entity based on the generation method of the name dictionary, which contains various change information of the keyword to be connected, matching the various change information with the entity in the domain knowledge graph and calculating the score, and selecting the entity with the highest score as the link entity based on the matching rule based on the context-independent feature; The establishment of semantic associations refers to: establishing a minimum width graph based on the minimum shortest path idea with the support of the knowledge graph. For any pair of keyword semantic features with domain types in any two files, the shortest paths between the two are calculated based on the breadth-first search combined with the priority queue method and through the graph-like association of the domain knowledge graph at the ontology layer and the entity layer. After the calculation is completed, if all the keywords between the two files have no path association, it means that there is no association relationship between the files, so there is no need to establish a semantic association. Otherwise, a semantic association is established between the corresponding two files and the weight of the association between the two files is set to the minimum shortest path length divided by the corresponding path number. At the same time, the corresponding keyword features are recorded. Since the idea of ​​the minimum shortest path is applied in the algorithm, the entire file semantic association network constructed by the algorithm is a minimum width graph in the solution space, thereby ensuring the closeness of the semantic association between files, and thus further strengthening the integrity of the file association in the semantic dimension; The semantic clustering partitioning means: firstly, specify the corresponding partition number as n based on the specific application scenario, then arbitrarily select n files in the semantically associated file set as the partition center node, and calculate the distance from other files to the partition center node, wherein the distance calculation is based on the formula: Distance(s, t) = Min{Weight(s, s i )+Distance(s i ,t),s i ∈NeighborOf(s)} recursively calculates, where s represents other files except the partition center node, t represents the file corresponding to the partition center node, and s i Represents all neighbor files of s. Since the smaller the weight in the semantic association network diagram, the closer the association between two files is, the smaller the calculated distance is, the more semantically related the files are, and thus they should be divided into the same partition. Therefore, after completing the distance calculation, the node is assigned to the partition corresponding to the partition center node closest to it. At the same time, for each partition, the node with the smallest distance sum is calculated as the new partition center node, and then the above process is repeated until convergence; The convergence means that for any file F and its semantic partition center point P central All of these make the formula Distance(FPc entral ) and formula Satisfies the global minimization feature, where F i Any file allocated to partition P.

2. The file semantic association storage system based on knowledge graph according to claim 1 is characterized in that: The XML type file feature extraction is to convert the relative path corresponding to each attribute in the XML file into a static absolute path structure based on XPATH expression through the SAX file parsing library and identify the specific attribute atom type, then merge and encapsulate each absolute path into the meta structure of the XML file, and finally extract the leaf node noun attribute value of each XPATH record as the semantic feature of the XML type file; The feature extraction of the drawing type file refers to: firstly, the plane drawing file is exported by PNG to generate the corresponding image file so as to facilitate the subsequent image processing, and then the CNN convolutional neural network pre-trained in the corresponding field is used to classify each pixel in the image for the exported PNG image, and divide it into three categories of background, noise, and modeling object, and finally, the specific category of the modeling object is identified by combining object recognition with a classifier for the category area corresponding to the modeling object and regarded as the corresponding file semantic feature; The document type file feature extraction refers to: first, using a comprehensive method of PDF parsing library parsing combined with OCR text recognition scanning to perform document parsing and text extraction on the document file, then performing word segmentation processing on the extracted text based on the word segmentation algorithm, and extracting keywords with noun characteristics as semantic feature candidate sets, and finally performing keyword mining on the preprocessed word set to obtain a keyword set that can truly characterize the semantic characteristics of the document type file.

3. The file semantic association storage system based on knowledge graph according to claim 2 is characterized in that: The keyword mining specifically refers to: first, based on the Word2Vec word clustering algorithm, the word set is converted into a low-order dense vector and the candidate keyword phrase is obtained by the optimized clustering algorithm, and then the TF-IDF algorithm and the Text Rank algorithm are respectively run for each word in the candidate keyword phrase to generate the corresponding score, and then the score is generated for the new word by the merging algorithm, and finally the Top-K in each keyword phrase is selected as the keyword phrase.

4. The file semantic association storage system based on knowledge graph according to claim 3 is characterized in that: The optimized clustering algorithm is: based on the formula Dynamically generate the number of actual clusters, where is the average file size, s is the original file size, is the average number of candidate keywords, n is the number of candidate keywords, is the average number of keywords, and is the constant for the dynamic configuration of θ. The merging algorithm is as follows: first, the scores obtained by the two algorithms are based on the formula To normalize, the score max 、score min They represent the maximum and minimum values ​​of the currently counted scores, score represents the current score, S represents the normalized final score, and then based on the weighted average S final =αS TF-IDF +(1-α)S TextRank Get the final score, where S TF-IDF , S TextRank They represent the normalized formulas obtained by the TF-IDF and Text Rank algorithms respectively, and α is a dynamically configured weight constant.

5. The file semantic association storage system based on knowledge graph according to claim 1 is characterized in that: The structured knowledge extraction is as follows: first, the nested one-dimensional static structure extracted from the XML type file is converted into a two-dimensional graph structure, and then the data content of the XML type file is read through the XPATH query method of the SAX parsing library in combination with the static absolute path corresponding to the XPATH, thereby extracting the entity corresponding to the two-dimensional graph structure, wherein: The conversion of the nested one-dimensional static structure into a two-dimensional graph structure specifically refers to: traversing each static absolute path structure expressed based on XPATH and reading the fields corresponding to each layer of attributes starting from the root. If the field has not been built into a node, create a corresponding node and connect it to the node corresponding to the upper layer field. Otherwise, continue traversing until the static structure is converted into a corresponding two-dimensional graph structure.

6. The file semantic association storage system based on knowledge graph according to claim 1 is characterized in that: The file segmentation refers to: uniformly slicing each original file to obtain a set of file segments of the same size, so as to avoid the unsafe scenario where the user directly sees the original file, thereby replacing encryption to reduce the risk of storing the original file in plain text, and at the same time establishing a relative index value in the original file for each file segment to facilitate the subsequent recovery of the original file; The chain hashing means that for each file block, the hash value corresponding to its content is obtained based on the hash algorithm and recorded in the header record of the file block, and then the hash value of the header record of the previous file block is recorded in the header record at the same time. The hash value adopts the multiple hash formula: HASH i =hash(hash(Content i )+HASH i-1 ) is calculated, where HASH i With HASH i-1 Represents the hash value of the header record of the current file block and the hash value of the header record of the previous file block, Content i Represents the content of the current file block, hash represents the corresponding hash algorithm, and for the first file block of each file, based on the association between files, it points to the last file block of the previous file associated with it in the same partition. When it is the first file in the partition, the header record hash value of the previous block in the block is set to 0000…000 and then multiple hash calculations are performed; The distributed secure storage refers to: storing files in distributed data nodes and performing multiple copy backups, wherein the allocation algorithm calculates the master data node ID by taking a modulo method based on the main features of the file's partition keyword combined with the number of data nodes, thereby ensuring that files in the same partition can be stored in the same physical data node, thereby improving the spatial locality of file storage.

Citation Information

Patent Citations

  • Knowledge graph completion method and device, equipment and storage medium

    CN112035672A

  • Multi-modal knowledge graph construction method

    CN112200317A