Big data analysis-based legal history document classified storage method

Through OCR recognition and weight calculation, combined with time decay function and legal logic label matching, a knowledge graph of legal history documents is constructed, which solves the problem of insufficient reflection of the spatiotemporal trajectory of cross-code revisions of legal history documents in traditional solutions, and realizes efficient storage and accurate retrieval.

CN120596589AInactive Publication Date: 2025-09-05TIBET UNIVERSITY FOR NATIONALITIES
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510677450.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-26
Publication Date
2025-09-05
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional solutions ignore the legal effect representation of seals and annotations in images, resulting in the inability of legal history documents to reflect the temporal and spatial trajectory of legal provisions in real time during cross-code revisions, making it difficult to meet the needs of high-precision historical tracing and knowledge reasoning.

Method used

Through OCR to identify the text and images of legal history documents, detect the seal area and calculate the seal area ratio and annotation density, generate a joint weight value, combine the frequency weights of legal terms in the text, construct a set of spatiotemporal trajectory vectors of the articles, and establish knowledge graph nodes through time decay function and legal logic label matching to achieve dynamic expansion and storage.

Benefits of technology

It realizes efficient storage and retrieval of legal history documents, can accurately capture the historical revision characteristics of legal provisions, supports cross-code provision similarity calculation and dynamic update, and meets the needs of high-precision historical tracing and knowledge reasoning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120596589A_ABST
    Figure CN120596589A_ABST
Patent Text Reader

Abstract

The invention discloses a legal history document classified storage method based on big data analysis, and relates to the technical field of knowledge maps, and the method comprises the steps: collecting texts, images and metadata of legal history documents, carrying out OCR recognition and multi-language alignment, detecting an image seal region, and segmenting a format to obtain a multi-modal data set; the method comprises the following steps: coding a legal provision cross-forensic revision record into a graph embedding vector, and constructing a time decay function to obtain a provision space-time trajectory vector set; according to a clause keyword and a time range input by a user, activating related fragments and calculating a trajectory vector cosine similarity to obtain a retrieval result; and fusing the revision record of the newly added literature into the article spatio-temporal trajectory vector set in real time, and triggering the dynamic extension of the knowledge graph node to obtain a classified storage database. Classification labels and knowledge graph nodes are obtained through legal logic label matching, the knowledge graph nodes are dynamically expanded, and cross-legal provision similarity accurate calculation is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of knowledge graph technology, and in particular to a method for classifying and storing legal history documents based on big data analysis. Background Art

[0002] In recent years, digital management and intelligent analysis of legal history documents, a crucial resource for legal research, have become crucial for both academic research and social practice. With advances in information technology, multimodal data (including text, images, and metadata) has become a crucial form of digitalization for legal history documents. By extracting and analyzing key information, such as legal terminology in text and seals and annotations in images, we can more comprehensively reveal the academic value and historical context of documents.

[0003] Traditional solutions ignore the legal effect representation of seals and annotations in images and only use the overall features of the image as the basis for classification. When the documents involve cross-code revisions or historical evolution, it is difficult to reflect the spatiotemporal trajectory of legal provisions in real time by dynamically updating the knowledge graph. It cannot support high-precision historical tracing and knowledge reasoning, and it is difficult to meet the efficient retrieval needs of large-scale legal history documents. Summary of the Invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides a legal history document classification and storage method based on big data analysis to solve the problem of insufficient multimodal data fusion in legal history document classification and storage.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In the first aspect, the present invention provides a method for classifying and storing legal history documents based on big data analysis, which includes collecting text, images and metadata of legal history documents, performing OCR recognition and multilingual alignment, detecting image seal areas and segmenting layouts to obtain a multimodal data set; calculating the image seal area ratio and annotation density as image weights, combining the text legal terminology frequency weights to generate a joint weight value to obtain a weighted feature vector; encoding the cross-code revision records of legal provisions into graph embedding vectors, constructing a time decay function, and obtaining a set of provision spatiotemporal trajectory vectors; matching the provision spatiotemporal trajectory vector set with legal logic labels to obtain classification labels and knowledge graph nodes, and storing the classification labels in fragments, associating the provision spatiotemporal trajectory vectors with knowledge graph nodes to obtain fragment indexes and knowledge graph relationship tables; activating relevant fragments and calculating the cosine similarity of the trajectory vectors based on the provision keywords and time ranges input by the user to obtain retrieval results; integrating the revision records of newly added documents into the provision spatiotemporal trajectory vector set in real time, and triggering the dynamic expansion of the knowledge graph nodes to obtain a classified storage database.

[0008] As a preferred solution of the method for classifying and storing legal history documents based on big data analysis described in the present invention, the steps of collecting text, images, and metadata of legal history documents, performing OCR recognition and multi-language alignment, detecting image seal areas, and segmenting the layout to obtain a multimodal data set are as follows:

[0009] Scan documents to obtain high-definition images, simultaneously input article metadata, perform OCR recognition on legal history document images, extract text, and perform multi-language alignment based on language identifiers to obtain legal history document images with text layers and metadata;

[0010] The legal history document image is processed through OCR to obtain the position information of each character in the text. The image seal area is located and segmented through edge detection and feature classification to obtain the number of pixels in the image seal area. The text, legal history document image, metadata, image seal area and the number of pixels in the image seal area are stored to obtain a multimodal data set.

[0011] As a preferred solution of the method for classifying and storing legal history documents based on big data analysis described in the present invention, the following steps are used to calculate the image seal area ratio and annotation density as image weights, and to generate a joint weight value in combination with the frequency weights of legal terms in the text to obtain a weighted feature vector:

[0012] Compare the number of pixels in the seal area of ​​the image with the total number of pixels in the legal history document image to obtain the proportion of the seal area in the image;

[0013] The legal history document image is binarized to identify the number of pixels in the annotation area and compared with the total number of pixels in the legal history document image to obtain the annotation density.

[0014] Use OCR recognition to filter stop words from the word segmentation of legal history documents, and count the frequency of legal terms to generate a word frequency statistics table. According to the legal knowledge base, the importance of legal terms is scored and weighted summed to obtain the legal term frequency weight;

[0015] The image seal area ratio, annotation density and legal term frequency weights are normalized, weighted proportionally and then a joint weight value is generated to obtain a weighted feature vector.

[0016] As a preferred solution of the method for classifying and storing legal history documents based on big data analysis described in the present invention, the following specific steps are used to encode the cross-code revision records of legal provisions into graph embedding vectors, construct a time decay function, and obtain a set of spatiotemporal trajectory vectors of the provisions:

[0017] Collect cross-code revision records of legal provisions, treat each legal provision as a node, and the revision relationship as a directed edge. Use weighted eigenvectors to calculate edge weights, record revision time and type, and obtain a revision relationship graph.

[0018] The revision graph is vectorized using a graph embedding algorithm, converting each legal provision node in the revision graph into a low-dimensional vector representation to obtain the revision graph embedding vector and the corresponding revision time record.

[0019] According to the revision time record, the time decay weight of each revision time record is calculated using the exponential decay algorithm. The revision relationship graph is embedded in the vector and weighted summed according to the time decay weight to generate a set of spatiotemporal trajectory vectors of the article.

[0020] As a preferred solution of the method for classifying and storing legal history documents based on big data analysis described in the present invention, the specific steps of obtaining classification labels and knowledge graph nodes by matching the spatiotemporal trajectory vector set of the articles with the legal logic labels are as follows:

[0021] Collect standard terminology and classification systems in the legal field, generate a hierarchical legal logic label tree, obtain legal logic labels, and calculate the similarity score between the spatiotemporal trajectory vector set of the provisions and the legal logic labels;

[0022] Arrange the similarity scores from high to low, select the legal logic label with the highest similarity score as the classification label of the spatiotemporal trajectory vector of the article, and add the article name and number of articles to create a knowledge graph node.

[0023] As a preferred solution of the method for classifying and storing legal history documents based on big data analysis described in the present invention, the classification labels are stored in slices, and the spatiotemporal trajectory vectors of the articles are associated with the knowledge graph nodes to obtain the slice index and the knowledge graph relationship table. The specific steps are as follows:

[0024] A sharding strategy for classification labels is developed based on the code and label hierarchy to which the legal article belongs. The metadata corresponding to the spatiotemporal trajectory vector of the article is matched with the sharding strategy. Each spatiotemporal trajectory vector of the article is assigned an article classification shard, and an inverted index is created for each article classification shard to obtain the shard index.

[0025] Associate knowledge graph nodes with classification labels and establish a knowledge graph relationship table through article classification sharding.

[0026] As a preferred solution of the method for classifying and storing legal history documents based on big data analysis described in the present invention, the following specific steps are used to activate relevant fragments and calculate the cosine similarity of trajectory vectors based on the article keywords and time range input by the user to obtain the search results:

[0027] Split the article keywords and time range entered by the user into independent fields, convert the article keywords into a list of terms, and convert the time range into a start and end year. Query the article classification shard index by article keywords, filter the article label shards, filter the shards based on the time range, and take the intersection to activate the relevant shards.

[0028] The corresponding spatiotemporal trajectory vector of the article is read from the activated relevant slice to obtain the set of vectors to be retrieved. According to the article keywords, the label node vector is obtained and the average value is taken as the query vector. The cosine similarity with the set of vectors to be retrieved is calculated and sorted from high to low according to the cosine similarity to obtain the retrieval results.

[0029] As a preferred solution of the method for classifying and storing legal history documents based on big data analysis described in the present invention, the revision records of newly added documents are integrated into the spatiotemporal trajectory vector of the article in real time, and the dynamic expansion of the knowledge graph nodes is triggered to obtain a classified storage database. The specific steps are as follows:

[0030] Extract revision records from newly added legal documents, analyze the revision time, type, and article changes, identify the affected original articles and code affiliation, vectorize the revised content using the legal text vector model, fuse the original article vectors according to time weights, update the article spatiotemporal trajectory vector set, and adjust the time decay parameter;

[0031] Establish an association edge between the new node and the original article in the knowledge graph, record the association strength and revision time, update the connection relationship between the knowledge graph nodes, write the updated article spatiotemporal trajectory vector set into the article classification shard storage, and simultaneously insert the new node and edge records into the knowledge graph relationship table;

[0032] Create a vector storage shard table and a knowledge graph node table, insert the newly generated graph nodes and edge information into the knowledge graph node table and the knowledge graph relationship table to obtain a classified storage database.

[0033] In a second aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the computer program is executed by the processor, any step of the method for classifying and storing legal history documents based on big data analysis as described in the first aspect of the present invention is implemented.

[0034] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the method for classifying and storing legal history documents based on big data analysis as described in the first aspect of the present invention.

[0035] The present invention has the following beneficial effects: by calculating the image seal area ratio, annotation density, and the weight of the legal terminology frequency in the text to generate a joint weight value, constructing a combination of a set of spatiotemporal trajectory vectors of legal provisions and a time decay function, accurately capturing the time-sensitive characteristics of historical revisions of legal provisions, obtaining classification labels and knowledge graph nodes through legal logic label matching, storing the classification labels in shards and associating related vectors with nodes, creating a shard index and knowledge graph relationship table, and dynamically expanding knowledge graph nodes. This allows for efficient storage and retrieval of legal documents and accurate calculation of similarity across legal codes. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0037] Figure 1 This is a flowchart of the classification and storage method of legal history documents based on big data analysis.

[0038] Figure 2 Flowchart of the acquisition and processing process of multimodal data sets.

[0039] Figure 3 Flowchart of the construction of the space-time trajectory vector set and the time decay function.

[0040] Figure 4 Flowchart for the dynamic expansion of knowledge graph nodes and the generation of classified storage database. DETAILED DESCRIPTION

[0041] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0042] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0043] Secondly, the term "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in various places throughout this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive of other embodiments.

[0044] Reference Figures 1 to 4 This embodiment provides a method for classifying and storing legal history documents based on big data analysis, comprising the following steps:

[0045] S1. Collect text, images, and metadata from legal history documents, perform OCR recognition and multi-language alignment, detect image seal areas, and segment layouts to obtain a multimodal data set.

[0046] Scan documents to obtain high-definition images, enter article metadata simultaneously, perform OCR recognition on legal history document images, extract text and perform multi-language alignment based on language identifiers to obtain legal history document images with text layers and metadata.

[0047] Specifically, a high-resolution scanner is used to scan legal history documents page by page, and the resolution (such as 300dpi or 600dpi) and clarity of the legal history document image are set. The scanned high-definition images of the legal history documents are stored in the designated legal history document image storage directory according to the document number and page number sequence. The article metadata of the legal history document (including the document name, the code to which it belongs, the chapter number, the revision time, etc.) are entered into the metadata database through manual entry and collection. An associated mapping relationship between the legal history document image file name and the metadata record is established. OCR is used to perform text recognition on the high-definition images of the legal history documents, and the text content in the legal history document images is extracted. The recognition results are preliminarily matched with the entered article metadata. The text recognized by OCR is subjected to language detection and word segmentation processing, and text paragraphs in different languages ​​(such as Chinese, Japanese, Latin, etc.) are identified. The multi-language texts of the same article are aligned according to the language identifier to generate a legal history document image with a text layer and metadata.

[0048] The legal history document image is processed through OCR to obtain the position information of each character in the text. The image seal area is located and segmented through edge detection and feature classification to obtain the number of pixels in the image seal area. The text, legal history document image, metadata, image seal area and the number of pixels in the image seal area are stored to obtain a multimodal data set.

[0049] Specifically, OCR technology is used to perform text recognition on legal history document images, and the position coordinates of each character or word in the legal history document image (including the upper left corner coordinates, width and height) are extracted, and the character position coordinates are associated with the recognized text content and stored. Based on the text position information extracted by OCR, edge detection is performed on the legal history document image, and significant contour features in the legal history document image are identified. In combination with the shape features of the seal area of ​​the legal history document image, the overlapping area and overlapping ratio of the seal area of ​​the legal history document image are calculated through a feature classification algorithm, and an overlapping threshold is set to remove redundant candidate areas with a high degree of overlap, and select candidate areas that meet the seal features; an initial segmentation algorithm is used to generate candidate areas, and the intersection-union ratio between all candidate areas is calculated, and a higher quantile value of the intersection-union ratio is selected as the overlap threshold (for example, the intersection-union ratio corresponding to the 90% quantile).

[0050] Morphological processing is performed on the screened seal candidate areas to segment the seal areas of the legal history document image. The segmented seal areas of the legal history document image are binarized, and the number of foreground pixels is counted to obtain the number of pixels in the seal area of ​​the legal history document image as a quantitative indicator of the characteristics of the seal area of ​​the legal history document image. The legal history document image file, text content extracted by OCR, metadata (such as document name, code to which it belongs, etc.), coordinates of the seal area of ​​the legal history document image and the number of pixels are integrated and stored. The database is used to organize the data, and the legal history document image, text, metadata and seal information are associated through unique identifiers to form a complete multimodal data set of legal history documents.

[0051] S2. Calculate the image seal area ratio and annotation density as the image weight, and combine them with the frequency weight of legal terms in the text to generate a joint weight value to obtain a weighted feature vector.

[0052] The number of pixels in the seal area of ​​the image is compared with the total number of pixels in the legal history document image to obtain the image seal area ratio.

[0053] Specifically, the resolution information of the legal history document image is obtained through the legal history document image processing tool to obtain the total number of pixels of the legal history document image. The total number of pixels of the legal history document image is compared with the number of pixels in the image seal area to obtain the image seal area ratio.

[0054] It should be noted that the calculation of the seal area ratio is as follows:

[0055]

[0056] Among them, R represents the proportion of seal area, P represents the number of pixels in the seal area of ​​the image, and Q represents the total number of pixels in the legal history document image.

[0057] The legal history document image is binarized to identify the number of pixels in the annotation area and compare it with the total number of pixels in the legal history document image to obtain the annotation density.

[0058] Specifically, the legal history document image is modeled as a graph structure, and segmented by minimizing the energy function to obtain different areas, forming a sharp contrast between the annotation area and the main text content. The pixels in the annotation area are set to white, and the pixels in the main text and other areas are set to black. The connected domain analysis is performed on the binarized image to screen out the white connected areas of the annotation features, and the total number of pixels in the white area is counted to obtain the number of pixels in the annotation area. The annotation density is obtained by comparing the total number of pixels in the legal history document image with the number of pixels in the annotation area.

[0059] It should be noted that the formula for calculating annotation density is:

[0060]

[0061] Where T represents the annotation density and E represents the number of pixels in the annotation area.

[0062] OCR recognition is used to filter stop words in the word segmentation of legal history documents, and the frequency of occurrence of legal terms is counted to generate a word frequency statistics table. The importance of legal terms is scored according to the legal knowledge base, and weighted summation is performed to obtain the word frequency weight of legal terms.

[0063] Specifically, OCR technology is used to identify text content in images of legal history documents. A dictionary-based word segmentation algorithm is used to segment continuous text into independent word units. Irrelevant words are filtered out using a stop word list specifically for the legal field. The filtered legal terminology is then subjected to frequency statistics, counting the number of occurrences of each legal term. A word frequency statistics table is then constructed using the key-value pair format of "term name - frequency of occurrence";

[0064] The word frequency statistics table is matched with the legal knowledge base (including the legal terminology system structure and hierarchical relationship). An importance score is assigned to each legal term based on factors such as the hierarchical status of the legal term in the legal system, the scope of professional field coverage, and the frequency of citation in judicial practice. The word frequency statistics results are weighted with the importance score to generate a comprehensive weight value for each legal term, and the legal term frequency weight is generated by arranging them in descending order of the weight value.

[0065] The image seal area ratio, annotation density and legal term frequency weights are normalized, weighted proportionally and then a joint weight value is generated to obtain a weighted feature vector.

[0066] Specifically, the image seal area ratio and annotation density are converted into numerical values ​​in the range of 0-1 through the linear normalization method, and the legal term frequency weight is converted into a numerical value in the range of 0-1 through the maximum-minimum normalization method. According to the preset weight distribution coefficient, the normalized seal area ratio, annotation density and legal term frequency weight are weighted and summed in proportion to generate a joint weight value. The joint weight value is combined in sequence with other features of the legal history document image (such as image resolution, color features, etc.) to form a multi-dimensional weighted feature vector.

[0067] It should be noted that the rationality of the weights was verified through statistical analysis using a dataset of annotated historical legal documents. For example, the correlation coefficient between each feature and the core value of the document was calculated, and the weights were adjusted based on a comprehensive determination of the historical data. The preset weight distribution coefficients are 0.4 for seals, 0.3 for annotations, and 0.3 for word frequency.

[0068] S3. Encode the cross-code revision records of legal provisions into graph embedding vectors, construct a time decay function, and obtain a set of spatiotemporal trajectory vectors of the provisions.

[0069] Collect cross-code revision records of legal provisions, take each legal provision as a node, and the revision relationship as a directed edge. Use weighted eigenvectors to calculate edge weights, record revision time and type, and obtain a revision relationship graph.

[0070] Specifically, all cross-code revision records of legal articles are extracted from the legal database, including structured information such as article number, code, revision time, type, and revision content. The article number in the collected revision records is used as a unique identifier. Each legal article is abstracted as a node in the graph, and attribute fields are added to each node. Based on the association information in the revision records, the revision behavior is abstracted as a directed edge, with the starting node of the edge being the original article being revised and the ending node being the revised target article.

[0071] Based on the weighted feature vector, the vector similarity of each pair of revision-related articles is calculated by cosine similarity, and the comprehensive weight value of each revision edge is obtained by combining the features such as revision type (modification weight is higher than new addition), revision time decay coefficient and annotation density. The timestamp and revision type in the revision record are stored as attribute fields of the directed edge, and the edge weight is dynamically adjusted according to the time decay function. The node set, directed edge set and weight attribute are integrated into a complete revision relationship graph data structure to form a revision relationship graph that supports the evolution analysis and association retrieval of legal articles.

[0072] The revision relationship graph is vectorized through the graph embedding algorithm, and each legal provision node in the revision relationship graph is converted into a low-dimensional vector representation to obtain the revision relationship graph embedding vector and the corresponding revision time record.

[0073] Specifically, the distribution characteristics of each node's adjacent nodes are counted, including the number of adjacent nodes, the sum of the connecting edge weights, and the edge weights after time decay. A matrix decomposition-based method is used to directly map the graph structure into a low-dimensional vector space, generating an initial embedding vector representation for each node. For nodes with sparse connections, vector completion is performed by introducing code hierarchy relationships or legal term similarity. All nodes obtain valid vector representations, and a low-dimensional vector is ultimately output.

[0074] The low-dimensional vectors are stored according to the unique identifiers of the legal article nodes, and a mapping relationship is established between the low-dimensional vectors and the revision time records of the corresponding legal articles, forming a structured data set containing vector data (such as [0.12, -0.34, 0.56, ...]) and timestamps. Metadata labels such as code affiliation and chapter position are added to each low-dimensional vector, and a complete revision relationship graph embedding vector and corresponding revision time records are output.

[0075] According to the revision time record, the time decay weight of each revision time record is calculated using the exponential decay algorithm. The revision relationship graph is embedded in the vector and weighted summed according to the time decay weight to generate a set of spatiotemporal trajectory vectors of the article.

[0076] Specifically, according to the revision relationship graph embedding vector and each revision time record stored in the corresponding revision time record, the timestamp information is extracted, the time difference is calculated based on the current time, and the exponential decay function formula is substituted to calculate the time decay weight of all revision records. For the revision relationship graph embedding vector, the historical version vectors are weighted and summed according to the time decay weight. Similarly, the spatiotemporal trajectory vectors of all legal article nodes are calculated, and the spatiotemporal trajectory vector of each legal article node is integrated with the corresponding metadata (including article number, code to which it belongs, chapter position, etc.) and revision time record to form a complete set of article spatiotemporal trajectory vectors.

[0077] It should be noted that the exponential decay formula is:

[0078] W(T)=W0×e -λT ;

[0079] Where W(T) represents the decay weight after time T, e is the base of the natural logarithm, λ is the decay coefficient, T is the time difference between the revision record and the current time, and W0 is the initial weight.

[0080] S4. By matching the spatiotemporal trajectory vector set of the articles with the legal logic labels, we can obtain the classification labels and knowledge graph nodes.

[0081] Collect standard terminology and classification systems in the legal field, generate a hierarchical legal logic label tree, obtain legal logic labels, and calculate the similarity score between the spatiotemporal trajectory vector set of the provisions and the legal logic labels.

[0082] Specifically, standard legal terms and their hierarchical classification relationships are extracted from authoritative legal databases and regulatory compilations, integrated to form a multi-level terminology library containing basic terms, professional terms, and related concepts. A classification system framework is established in accordance with the legal system structure. Based on the collected legal terminology library and classification system, a tree-like data structure is used to organize legal logic labels. With the first-level classification of the legal system as the root node, it is expanded layer by layer to the second-level classification, third-level classification, and specific term nodes. A complete hierarchical legal logic label tree is established through parent-child node association.

[0083] The standardized label name and hierarchical path information of each node in the hierarchical legal logic label tree are extracted to form a legal logic label set. Each label contains the complete path, hierarchical identification and semantic description information, and an association mapping relationship is established between the legal logic label and the corresponding legal article metadata. The similarity between each legal article spatiotemporal trajectory vector in the article spatiotemporal trajectory vector set and each label vector in the legal logic label set (represented by the average vector of legal articles associated with the label or the pre-trained label vector) is calculated, and the cosine similarity algorithm is used to obtain the similarity score between each article vector and all labels.

[0084] It should be noted that the formula for calculating similarity is:

[0085]

[0086] Among them, S is the similarity score, V law Represents the space-time trajectory vector of the legal provisions, V label is the legal logic label vector, DotProduct(V law ,V label ) is the space-time trajectory vector V of the legal provisions law and the legal logic label vector V label The dot product of ||V law || is the modulus of the space-time trajectory vector of the legal text, ||V label || is the modulus of the legal logic label vector.

[0087] Arrange the similarity scores from high to low, select the legal logic label with the highest similarity score as the classification label of the spatiotemporal trajectory vector of the article, and add the article name and number of articles to create a knowledge graph node.

[0088] Specifically, the similarity scores between each article's spatiotemporal trajectory vector and all legal logic labels are sorted in descending order, and the legal logic label with the highest score is placed first. The legal logic label with the highest score corresponding to each article's spatiotemporal trajectory vector is extracted as the classification label. The article name in the metadata corresponding to the spatiotemporal trajectory vector of the classification label (including the article number, the code to which it belongs, the chapter position, etc.) is extracted, and the number of all articles associated with the classification label is counted. The classification label name, article name, number of articles and classification confidence (highest similarity score value) are used as attribute fields to create a knowledge graph node.

[0089] S5. The classification labels are stored in shards, and the spatiotemporal trajectory vectors of the articles are associated with the knowledge graph nodes to obtain the shard index and knowledge graph relationship table.

[0090] A sharding strategy for classification labels is formulated based on the code and label hierarchy to which the legal article belongs. The metadata corresponding to the spatiotemporal trajectory vector of the article is matched with the sharding strategy. Each spatiotemporal trajectory vector of the article is assigned an article classification shard, and an inverted index is created for each article classification shard to obtain a sharding index.

[0091] Specifically, based on the "code" field in the metadata of legal articles and the hierarchical label path generated in the legal logic tag, a two-level sharding strategy is designed - the first level is divided according to the code name, and the second level is divided according to the first two levels of the label path, forming a sharding strategy. According to the set of spatiotemporal trajectory vectors of the articles, the metadata of the spatiotemporal trajectory vector of each article (including the code to which it belongs and the associated label path) is extracted. According to the formulated sharding strategy, each spatiotemporal trajectory vector of the article is accurately assigned to a shard that conforms to the code and label hierarchy to obtain a matching result. Based on the matching result, each spatiotemporal trajectory vector of the article is stored in the corresponding shard directory, and a shard identification field is added to the metadata. At the same time, a dedicated storage unit is created for high-frequency independent shards.

[0092] For the spatiotemporal trajectory vectors of the articles in each shard directory, an inverted index is constructed to record the mapping relationship between the vector ID and the metadata. The index fields include the vector ID, the code to which it belongs, the associated label hierarchical path, the timestamp, and the shard name. A mapping table from the shard name to the shard storage path is established. The vector storage location can be quickly located through the shard name, forming a complete shard index system, including the shard directory structure, the vector storage path mapping table, and the inverted index file. The index file is stored by shard and contains the mapping relationship between the vector ID and the metadata, ultimately obtaining the shard index.

[0093] Associate knowledge graph nodes with classification labels and establish a knowledge graph relationship table through article classification sharding.

[0094] Specifically, based on the knowledge graph nodes with labeled classification labels in the knowledge graph nodes, the classification label field in the node attributes is matched with the classification label sharding strategy established in the sharding index, each knowledge graph node is associated with the corresponding sharding index, and the sharding name field is supplemented in the node attributes. Based on the established association relationship between the knowledge graph nodes and the classification label shards, a knowledge graph relationship table is constructed. The table structure contains relationship ID, starting node ID, ending node ID, association label, shard name, association strength and revision time fields. The association label comes from the attributes of the knowledge graph node, the shard name is determined by the shard associated with the node, the association strength is calculated based on the connection edge weight between the nodes (such as weighted by the number of revisions), and the revision time takes the latest revision time of the node to form a knowledge graph relationship table that supports sharding queries.

[0095] S6. Based on the article keywords and time range entered by the user, activate the relevant fragments and calculate the cosine similarity of the trajectory vectors to obtain the search results.

[0096] Split the article keywords and time range entered by the user into independent fields, convert the article keywords into a word list, and convert the time range into the start and end years. Query the article classification shard index through the article keywords, filter the article classification shards, filter the shards based on the time range, and take the intersection to activate the relevant shards.

[0097] Specifically, the query request entered by the user is parsed, and the string is separated by spaces or punctuation marks to extract the article keywords. The keywords and time range are stored as independent variables respectively. The extracted article keywords are standardized, stop words are removed, and a word list is generated through stem extraction to form a complete legal semantic keyword word list. The extracted time range string is converted into an integer type start and end year variable. If the user does not provide a time range, the default setting is the full time range.

[0098] Based on the term list, a full-text search is performed in the inverted index of the shard index to match the article vector records containing all keywords, and a list of shard names that meet the keyword conditions is obtained. All keywords appear in the article content through Boolean search, and a set of article shards containing keywords is returned. The shard name list is matched with the classification label sharding rules established in the classification label association in the knowledge graph node to filter out the shard set that also contains the target label. The filtered shard set is further filtered according to the time range condition to check whether the time attributes of the articles in the shard (such as revision time or effective time) fall within the start and end year range specified by the user, and the shards with inconsistent time are eliminated. The query range is narrowed to the shards that meet the time conditions to obtain the time range filtered shards. The filtered label matching shard set is intersected with the filtered time range filtered shards to obtain the final shard set that meets the keyword, classification label and time range conditions.

[0099] The corresponding spatiotemporal trajectory vector of the article is read from the activated relevant slice to obtain the set of vectors to be retrieved. According to the article keywords, the label node vector is obtained and the average value is taken as the query vector. The cosine similarity with the set of vectors to be retrieved is calculated and sorted from high to low according to the cosine similarity to obtain the retrieval results.

[0100] Specifically, the activated shard set determined in the activated related shards is obtained by taking the intersection, the spatiotemporal trajectory vectors of the articles and the associated metadata are read in batches from the corresponding shard storage paths to form a set of vectors to be retrieved, and based on the article keywords input by the user, the matching label nodes are extracted from the knowledge graph, and the vector representation corresponding to the label node is obtained (generated by averaging the spatiotemporal trajectory vectors of the associated articles), and the arithmetic mean of all label node vectors is calculated as the query vector. For each vector in the set of retrieval vectors and the query vector, the cosine similarity formula is used to calculate the similarity score, and the semantic similarity between each document vector and the query vector is quantitatively evaluated. The similarity score ranges from -1 to 1, and the larger the value, the stronger the semantic relevance. The similarity scores of all document vectors are sorted in descending order to form a list of retrieval results arranged in descending order of relevance.

[0101] S7. Integrate the revision records of newly added documents into the spatiotemporal trajectory vector of the article in real time, and trigger the dynamic expansion of the knowledge graph nodes to obtain a classified storage database.

[0102] Extract revision records from newly added legal documents, analyze the revision time, type and article changes, identify the affected original articles and code affiliation, use the legal text vector model to vectorize the revised content, fuse the original article vectors according to time weight, update the article spatiotemporal trajectory vector set and adjust the time decay parameter.

[0103] Specifically, OCR technology is used to perform full-text scanning and semantic analysis of newly added legal documents, identify revised paragraphs containing keywords such as revision, modification, and supplement, extract the clear revision time, revision type, and article changes, and determine the affected original articles and their code affiliation through regular matching of code names, chapter titles, and article numbers to form a structured revision record dataset. The revision record dataset is deeply analyzed, and a rule matching method is used to accurately extract the specific date of the revision time, the precise classification of the revision type, and the specific content of the article changes from the natural language text to obtain the article number and code name information. Through cross-validation of regular expressions and legal article databases, all directly and indirectly affected original articles are identified, the code affiliation of the articles is confirmed, and a hierarchical mapping relationship is established between the affected articles and the code to which they belong. The identified revision content and the associated original articles are input into a pre-trained legal text vector model to generate a vector representation of the revision content. The spatiotemporal trajectory vector of the original article is extracted as the baseline vector, and the semantic association between the revision content and the original text is captured through an attention mechanism fusion model.

[0104] According to the revision time, the time decay weight of each revision version is calculated, and the newly generated revision content vector is weightedly fused with the original text vector of the historical version according to the time weight to generate a fused space-time trajectory vector, and written into the corresponding shard of the article space-time trajectory vector set. The time decay parameter value is dynamically adjusted according to the latest revision time, so that each article vector in the article space-time trajectory vector set reflects the latest legal revision status in real time; the vector data and metadata in the shard index are updated, including the latest time weight, the fused vector representation and the associated revision record information, to form an article space-time trajectory vector set that contains the complete historical evolution and the latest revision status.

[0105] It should also be noted that the legal text vector model is trained by collecting and cleaning a large-scale legal corpus (including laws and regulations, judicial interpretations, judgments, etc.), pre-processing through word segmentation, part-of-speech tagging and dependency syntax analysis, and constructing a legal field-specific dictionary and stop word list; using the language model as the basic architecture, further pre-training is carried out on the legal corpus, and the parameters of the legal text vector model are fine-tuned through MLM and NSP tasks; according to the characteristics of legal text, a domain adaptation layer is added to capture legal terminology and sentence features, and the contrastive learning method is used to optimize the vector representation, maximizing the semantic similarity between positive and negative sample pairs; through multi-task learning, the classification task, information retrieval task and similarity calculation task are jointly optimized, and a dynamic weight adjustment strategy is used to balance the loss function of each task; the performance of the legal text vector model is evaluated, the legal text vector model parameters are frozen and exported as a legal text vector model.

[0106] The attention mechanism fusion model is trained based on a multimodal data set, including image features of legal history documents (such as seals and text areas). The attention mechanism fusion model architecture is constructed. The image encoder uses CNN plus attention module to extract local features, the text encoder uses Transformer to process text and highlight legal terms, and the cross-modal fusion layer interacts image and text features through the cross-attention mechanism. During training, the loss function of the classification or retrieval task is set, and auxiliary loss is added to constrain modal alignment and attention distribution. The Adam optimizer is used for iterative training with example parameters, and the attention mechanism fusion model is optimized through hyperparameter adjustment.

[0107] Establish an association edge between the new node and the original article in the graph, record the association strength and revision time, update the connection relationship between the knowledge graph nodes, write the updated article spatiotemporal trajectory vector set into the article classification shard storage, and simultaneously insert new node and edge records into the knowledge graph relationship table.

[0108] Specifically, an independent node is created for each new legal article in the knowledge graph, and it is associated with the corresponding original article node through a directed edge. The direction of the edge is from the new node to the original node. The initial weight of the edge is set according to the revision type, and two key attribute fields are added to each created associated edge - association strength and revision time, to obtain attributed associated edges, and the adjacency list structure of the knowledge graph is updated. For each new node, the outgoing edge set (pointing to the original node) and the incoming edge set (from other associated nodes) are maintained. Possible redundant edges or conflicting relationships are checked and repaired, and the fused spatiotemporal trajectory vector set is written to the corresponding shard storage path according to the sharding strategy, and the number of vectors and the latest modification timestamp field in the shard index table are updated. The created new nodes and associated edge information are batch inserted into the relational storage table of the knowledge graph.

[0109] Create a vector storage shard table and a knowledge graph node table, write the updated article spatiotemporal trajectory vector into the article classification shard storage table according to the sharding rules and synchronously maintain the shard index, insert the newly generated graph nodes and edge information into the knowledge graph node table and the knowledge graph relationship table to obtain a classified storage database.

[0110] Specifically, according to the sharding strategy, the vector storage sharding table structure and the knowledge graph node table structure are designed, and the database table creation statement is used to create the vector storage sharding table and the knowledge graph node table in the relational database, and a mapping relationship index between the sharding ID and the storage path is established. The fused spatiotemporal trajectory vector set is written into the storage path of the article shard according to the sharding strategy for each vector and metadata. The statistical information such as the number of vectors and the latest modification time of the article shard is updated in the sharding index table. The new nodes and associated edge information are batch inserted according to the created knowledge graph node table and relationship table structure. The node table inserts records containing fields such as node ID, type, and shard to which it belongs, and the relationship table inserts records containing fields such as the starting node ID, ending node ID, association strength, and revision time. Before insertion, a unique constraint check is performed to avoid duplication. The vector storage sharding table, the article classification sharding storage table, the knowledge graph node table, and the knowledge graph relationship table are integrated to form a complete classification storage database.

[0111] This embodiment also provides a computer device, which is suitable for the case of a classification and storage method of legal history documents based on big data analysis, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions, thereby implementing the classification and storage method of legal history documents based on big data analysis proposed in the above embodiment.

[0112] The computer device may be a terminal, comprising a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. The display screen of the computer device may be a liquid crystal display or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse.

[0113] This embodiment also provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for classifying and storing legal history documents based on big data analysis as proposed in the above embodiment; the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk.

[0114] In summary, the present invention generates a joint weighted value by calculating the image seal area ratio, annotation density, and the weight of legal terminology frequency in the text; constructs a combination of a spatiotemporal trajectory vector set of legal provisions and a time decay function to accurately capture the time-sensitive characteristics of historical revisions of legal provisions; obtains classification labels and knowledge graph nodes through legal logic label matching; stores the classification labels in shards and associates related vectors with nodes; creates a shard index and knowledge graph relationship table; and dynamically expands knowledge graph nodes. This allows for efficient storage and retrieval of legal documents and accurate calculation of similarity across legal codes.

[0115] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for classifying and storing legal history documents based on big data analysis, characterized by: include, Collect text, images, and metadata of legal history documents, perform OCR recognition and multi-language alignment, detect image seal areas, and segment layouts to obtain a multimodal data set; The image seal area ratio and annotation density are calculated as the image weight, and combined with the legal term frequency weight of the text to generate a joint weight value to obtain a weighted feature vector; Encode the cross-code revision records of legal provisions into graph embedding vectors, construct a time decay function, and obtain a set of spatiotemporal trajectory vectors of the provisions; By matching the spatiotemporal trajectory vector set of the articles with the legal logic labels, we can obtain classification labels and knowledge graph nodes, store the classification labels in shards, and associate the spatiotemporal trajectory vectors of the articles with the knowledge graph nodes to obtain the shard index and knowledge graph relationship table; According to the article keywords and time range entered by the user, relevant fragments are activated and the cosine similarity of the trajectory vectors is calculated to obtain the search results; The revision records of newly added documents are integrated into the spatiotemporal trajectory vector set of the articles in real time, and the dynamic expansion of the knowledge graph nodes is triggered to obtain a classified storage database.

2. The method for classifying and storing legal history documents based on big data analysis according to claim 1 is characterized by: The specific steps of collecting text, images and metadata of legal history documents, performing OCR recognition and multi-language alignment, detecting image seal areas and segmenting layouts to obtain a multimodal data set are as follows: Scan legal history documents to obtain legal history document images, simultaneously input article metadata, perform OCR recognition on legal history document images, extract text, and perform multi-language alignment based on language identifiers to obtain legal history document images with text layers and metadata; The legal history document image is processed through OCR to obtain the position information of each character in the text. The image seal area is located and segmented through edge detection and feature classification to obtain the number of pixels in the image seal area. The text, legal history document image, metadata, image seal area and the number of pixels in the image seal area are stored to obtain a multimodal data set.

3. The method for classifying and storing legal history documents based on big data analysis according to claim 2, characterized in that: The calculation of the image seal area ratio and annotation density as the image weight is combined with the text legal term frequency weight to generate a joint weight value to obtain a weighted feature vector. The specific steps are as follows: Compare the number of pixels in the seal area of ​​the image with the total number of pixels in the legal history document image to obtain the proportion of the seal area in the image; The legal history document image is binarized to identify the number of pixels in the annotation area and compared with the total number of pixels in the legal history document image to obtain the annotation density. Use OCR recognition to filter stop words from the word segmentation of legal history documents, and count the frequency of legal terms to generate a word frequency statistics table. According to the legal knowledge base, the importance of legal terms is scored and weighted summed to obtain the legal term frequency weight; The image seal area ratio, annotation density and legal term frequency weights are normalized, weighted proportionally and then a joint weight value is generated to obtain a weighted feature vector.

4. The method for classifying and storing legal history documents based on big data analysis according to claim 3 is characterized by: The specific steps of encoding the cross-code revision records of legal provisions into graph embedding vectors, constructing a time decay function, and obtaining a set of spatiotemporal trajectory vectors of the provisions are as follows: Collect cross-code revision records of legal provisions, treat each legal provision as a node, and the revision relationship as a directed edge. Use weighted eigenvectors to calculate edge weights, record revision time and type, and obtain a revision relationship graph. The revision graph is vectorized using a graph embedding algorithm, converting each legal provision node in the revision graph into a low-dimensional vector representation to obtain the revision graph embedding vector and the corresponding revision time record. According to the revision time record, the time decay weight of each revision time record is calculated using the exponential decay algorithm. The revision relationship graph is embedded in the vector and weighted summed according to the time decay weight to generate a set of spatiotemporal trajectory vectors of the article.

5. The method for classifying and storing legal history documents based on big data analysis according to claim 4 is characterized in that: The specific steps of matching the spatiotemporal trajectory vector set of the articles with the legal logic labels to obtain the classification labels and knowledge graph nodes are as follows: Collect standard terminology and classification systems in the legal field, generate a hierarchical legal logic label tree, obtain legal logic labels, and calculate the similarity score between the spatiotemporal trajectory vector set of the provisions and the legal logic labels; Arrange the similarity scores from high to low, select the legal logic label with the highest similarity score as the classification label of the spatiotemporal trajectory vector of the article, and add the article name and number of articles to create a knowledge graph node.

6. The method for classifying and storing legal history documents based on big data analysis according to claim 5 is characterized by: The classification labels are stored in slices, and the spatiotemporal trajectory vectors of the articles are associated with the knowledge graph nodes to obtain the slice index and the knowledge graph relationship table. The specific steps are as follows: A sharding strategy for classification labels is developed based on the code and label hierarchy to which the legal article belongs. The metadata corresponding to the spatiotemporal trajectory vector of the article is matched with the sharding strategy. Each spatiotemporal trajectory vector of the article is assigned an article classification shard, and an inverted index is created for each article classification shard to obtain the shard index. Associate knowledge graph nodes with classification labels and establish a knowledge graph relationship table through article classification sharding.

7. The method for classifying and storing legal history documents based on big data analysis according to claim 6, characterized in that: According to the article keywords and time range input by the user, the relevant fragments are activated and the cosine similarity of the trajectory vector is calculated to obtain the search results. The specific steps are as follows: Split the article keywords and time range entered by the user into independent fields, convert the article keywords into a list of terms, and convert the time range into a start and end year. Query the article classification shard index by article keywords, filter the article classification shards, filter the shards based on the time range, and take the intersection to activate the relevant shards. The corresponding spatiotemporal trajectory vector of the article is read from the activated relevant slice to obtain the set of vectors to be retrieved. According to the article keywords, the label node vector is obtained and the average value is taken as the query vector. The cosine similarity with the set of vectors to be retrieved is calculated and sorted from high to low according to the cosine similarity to obtain the retrieval results.

8. The method for classifying and storing legal history documents based on big data analysis according to claim 7 is characterized in that: The revision records of newly added documents are integrated into the spatiotemporal trajectory vector of the article in real time, and the dynamic expansion of the knowledge graph nodes is triggered to obtain a classified storage database. The specific steps are as follows: Extract revision records from newly added legal documents, analyze the revision time, type, and article changes, identify the affected original articles and code affiliation, vectorize the revised content using the legal text vector model, fuse the original article vectors according to time weights, update the article spatiotemporal trajectory vector set, and adjust the time decay parameter; Establish an association edge between the new node and the original article in the knowledge graph, record the association strength and revision time, update the connection relationship between the knowledge graph nodes, write the updated article spatiotemporal trajectory vector set into the article classification shard storage, and simultaneously insert the new node and edge records into the knowledge graph relationship table; Create a vector storage shard table and a knowledge graph node table, insert the newly generated graph nodes and edge information into the knowledge graph node table and the knowledge graph relationship table to obtain a classified storage database.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for classifying and storing legal history documents based on big data analysis according to any one of claims 1 to 8 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for classifying and storing legal history documents based on big data analysis according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Tax policy document processing method based on multi-modal analysis

    CN120808378A

  • A tax policy document processing method based on multi-modal analysis

    CN120808378B

  • Chinese language and literature database online query reading method and system

    CN120821831A

  • Online query and reading method and system for Chinese language and literature database

    CN120821831B