A logical relationship retrieval and matching method and system based on neural network

Through the logical relationship retrieval and matching method based on neural network, the problem of dependence on experience and lack of automation of logical relationship retrieval in the existing technology is solved, and high-accuracy and efficient logical relationship retrieval is achieved, which is suitable for large-scale data sets.

CN118503357BActive Publication Date: 2025-01-24SOUTHWEST JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410590227.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-13
Publication Date
2025-01-24
Estimated Expiration
2044-05-13

AI Technical Summary

Technical Problem

The search and judgment of logical relationships in the prior art rely almost entirely on experience, lack of a system framework, cannot achieve automation, has a high threshold for use, and the expansion of logical relationship libraries depends on human computing and develop slowly.

Method used

Adopt a logical relationship with a neural network to retrieve the matching method, to obtain the logical information in the database and the application model, to perform hierarchical and vectorized processing, and use the full connection neural network model for feature extraction and matching to achieve automated retrieval and retrieval of logical information and the automatic retrieval and retrieval of logical information. judge.

Benefits of technology

It improves the accuracy and speed of logical relationship retrieval, realizes automated and intelligent retrieval optimization, and is suitable for data sets of various sizes, including massive data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118503357B_ABST
    Figure CN118503357B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for retrieval and matching of logical relations based on neural networks, which relates to the field of retrieval technology, including obtaining logical information in a database and logical information in an application model; grading the logical information according to the corresponding hierarchical relationship to obtain at least two hierarchical levels; sending the logical information of all hierarchical levels to a trained fully connected neural network model for vectorization processing to obtain vectorized matrices corresponding to the logical information of all hierarchical levels; performing matrix conversion on the logical information to be retrieved, and performing retrieval and matching between the vectorized matrices corresponding to the logical information to be retrieved obtained by the conversion and the vectorized matrices corresponding to the logical information of all hierarchical levels to obtain logical information corresponding to the logical information to be retrieved. The present invention can effectively process large-scale data, improve the speed of retrieval, is not limited by the size of the data, and is applicable to data sets of various sizes, including massive data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of retrieval technology, and in particular to a neural network-based logical relationship retrieval and matching method and system. Background Art

[0002] With the development of neural networks, most formulas can now be fitted through neural networks to obtain high-accuracy results. However, due to the large number of neurons in neural networks, it is difficult for humans to understand the logical thinking inside neural networks, resulting in the black box nature of neural networks. This is not conducive to humans fully understanding the internal principles of the scientific community. Therefore, an algorithm that can clearly reflect the internal logic and principles is now needed to help humans better understand the internal principles of science. One representative of this algorithm is the logical algorithm. The logical algorithm emphasizes the use of logical relationships to explain the principles.

[0003] In the prior art, the retrieval and judgment methods of logical relationships are almost entirely based on experience, and there is no way to form a systematic framework. In addition, this kind of package swapping is also a human behavior, and there is no way to automate it. Therefore, when using logical algorithms, users have high technical and knowledge requirements. This has a high threshold for use. At the same time, this kind of experience packaging is also worth the expansion of the logical algorithm relationship library, which relies on human calculations and develops slowly. Package swapping requires manual work, and the package also contains a large number of unnecessary relationships, which is slow to use.

[0004] There is a need for a neural network-based logical relationship retrieval and matching method and system for automated logical retrieval and judgment. Summary of the invention

[0005] The purpose of the present invention is to provide a method and system for logical relationship retrieval and matching based on a neural network to improve the above problems. In order to achieve the above purpose, the technical solution adopted by the present invention is as follows:

[0006] In a first aspect, the present application provides a neural network-based logical relationship retrieval and matching method, comprising:

[0007] Acquire first information, where the first information includes logic information in a database and logic information in an application model;

[0008] Classifying all first information according to corresponding hierarchical relationships to obtain at least two levels of first information;

[0009] Sending the first information of all levels to the trained fully connected neural network model for vectorization processing to obtain second information, where the second information includes vectorized matrices corresponding to the first information of all levels;

[0010] The logic information to be retrieved is transformed into a matrix, and the vectorized matrix corresponding to the logic information to be retrieved obtained by the transformation is searched and matched with the second information to obtain the second information corresponding to the logic information to be retrieved.

[0011] In a second aspect, the present application also provides a neural network-based logical relationship retrieval and matching system, comprising:

[0012] An acquisition unit, configured to acquire first information, wherein the first information includes logic information in a database and logic information in an application model;

[0013] A grading unit, configured to grade all first information according to corresponding hierarchical relationships to obtain at least two levels of first information;

[0014] A processing unit, configured to send the first information of all levels to the trained fully connected neural network model for vectorization processing to obtain second information, wherein the second information includes a vectorization matrix corresponding to the first information of all levels;

[0015] The matching unit is used to perform matrix conversion on the logic information to be retrieved, and perform search matching between the vectorized matrix corresponding to the logic information to be retrieved and the second information to obtain the second information corresponding to the logic information to be retrieved.

[0016] The beneficial effects of the present invention are:

[0017] The present invention can more accurately capture the association and similarity between information by converting the logical information matrix to be retrieved into a feature vector and matching it using a neural network model, thereby improving the accuracy of retrieval. The use of a neural network for feature extraction and matching has a faster processing speed than traditional methods. The parallel computing characteristics of the neural network make it possible to process multiple query requests at the same time, thereby significantly improving the speed of retrieval. Through the feature vectors trained in the neural network, the system can automatically learn and adjust to adapt to data sets of different types and sizes, and realize intelligent retrieval optimization. This makes the system have better versatility and adaptability. A method based on a neural network is adopted, and the retrieval optimization method can effectively process large-scale data, is not limited by the data scale, and is applicable to data sets of various sizes, including massive data. A method based on a neural network is adopted, and the retrieval optimization method can effectively process large-scale data, is not limited by the data scale, and is applicable to data sets of various sizes, including massive data.

[0018] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or be understood by implementing the embodiments of the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 Schematic diagram of the process of the neural network-based logical relationship retrieval and matching method described in an embodiment of the present invention;

[0021] Figure 2 Schematic diagram of the structure of the neural network-based logical relationship retrieval and matching system described in an embodiment of the present invention.

[0022] In the figure: 701, acquisition unit; 702, classification unit; 703, processing unit; 704, matching unit; 7021, first processing subunit; 7022, first analysis subunit; 7023, second analysis subunit; 7024, second processing subunit; 7031, third processing subunit; 7032, fourth processing subunit; 7041, fifth processing subunit; 7042, sixth processing subunit; 7043, seventh processing subunit; 7044, first calculation subunit; 7045, first judgment subunit; 7046, second calculation subunit; 7047, second judgment subunit; 70431, eighth processing subunit; 70432, third calculation subunit; 70441, third judgment subunit; 70442, ninth processing subunit; 70443, tenth processing subunit. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0024] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0025] Embodiment 1:

[0026] This embodiment provides a logical relationship retrieval and matching method based on a neural network.

[0027] See also Figure 1 , the figure shows that the method includes step S1, step S2, step S3 and step S4.

[0028] Step S1, obtaining first information, wherein the first information includes logic information in a database and logic information in an application model;

[0029] It is understood that the logical information in the database includes various logical relationships stored in the database. The logical information in the application model refers to the logical information contained in the model constructed in a specific application scenario.

[0030] Step S2: classify all first information according to corresponding hierarchical relationships to obtain at least two levels of first information;

[0031] It can be understood that the present invention improves the organizational structure and management efficiency of data by grading the first information according to the corresponding hierarchical relationship, so that subsequent processing steps can be carried out more efficiently. Through hierarchical grading, we can clearly understand the relationship between data, so as to carry out subsequent processing and optimization in a targeted manner, and improve the performance and effect of the system. In this step, step S2 includes step S21, step S22, step S23 and step S24.

[0032] Step S21, sorting all the logical relationships according to the frequency of occurrence, and intercepting a preset number of logical relationships according to the sorting order to obtain a preset number of initial logical relationships;

[0033] It can be understood that this step first counts the frequency of each logical relationship in the data. The frequency of occurrence of a logical relationship can reflect its importance or prevalence in the data. Then, we sort the logical relationships according to the frequency of occurrence, and put the logical relationships with higher frequency in front. This step screens out the logical relationships with higher importance or prevalence in the data, providing an important data basis for subsequent processing and analysis. By sorting by frequency of occurrence, we can prioritize those logical relationships that have a greater impact on the system, thereby improving the efficiency and performance of the system.

[0034] Step S22, all the initial logical relations are analyzed in pairs, wherein two initial logical relations are analyzed to determine whether one of the initial logical relations is a subset of the other initial logical relation, if so, the other initial logical relation is deleted, if not, the two initial logical relations are retained to obtain a basic logical relation, wherein the basic logical relation is an initial logical relation without a subset;

[0035] It can be understood that the technical effect of this step is to streamline the initial logical relationship and remove redundant and repeated information, thereby improving the simplicity and interpretability of the data. By deleting the subset relationship, we retain more important and independent logical relationships, making subsequent processing more efficient and accurate.

[0036] Step S23, performing pairwise analysis again on the deleted initial logical relationships to obtain at least one category of secondary logical relationships;

[0037] It can be understood that this step further refines the data structure and extracts more specific and detailed information by generating secondary logical relationships. These secondary logical relationships are more accurate than the initial logical relationships and can provide a more accurate and in-depth basis for subsequent analysis and processing.

[0038] Step S24: classify the basic logical relationship and all categories of secondary logical relationships according to the order of acquisition to obtain at least two levels of first information.

[0039] It can be understood that by grading the basic logical relationships and secondary logical relationships in this step, we can better organize and manage the data, making the data structure clearer and more orderly. This can improve the efficiency and accuracy of subsequent processing, and also facilitate users to understand and apply the data.

[0040] Step S3: sending the first information of all levels to the trained fully connected neural network model for vectorization processing to obtain second information, where the second information includes the vectorization matrix corresponding to the first information of all levels;

[0041] It is understandable that this step uses a fully connected neural network model for vectorization processing, which can convert the original unstructured or semi-structured data into a structured vector representation with good expressiveness, so as to facilitate subsequent processing and analysis. This representation can retain the important features of the data and improve the interpretability and usability of the data. In this step, step S3 includes step S31 and step S32.

[0042] Step S31, encoding the input and output of the logical relationship in the first information of all levels, and performing product calculation on the encoding and the preset trained vectorization matrix to obtain vectorized data corresponding to the logical relationship in the first information of all levels, wherein the vectorized data is vector data;

[0043] It can be understood that the trained vectorized matrix in this step utilizes the embedding function of keras and its optimized nature of back propagation training. In the embedding process, a number or character is first converted into a corresponding one-hot number, and the number is multiplied by the built-in matrix to obtain vectorized data. Keras is an open source library, and the built-in embedding function will form a matrix that meets the requirements according to the specified dimension and data type. The formation of this matrix depends on the large amount of built-in data provided by keras. Therefore, the matrix of the embedding function generated by default also has a good vectorization effect. During use, turn on the back propagation function, and the embedding function will adjust itself according to the input result to make the output effect better. In this step, we obtain the vectorized data of the logical relationship through the encoding of the logical relationship and the product calculation with the preset vectorized matrix, which has better expression ability and processing performance. Such vectorized data can be input into the neural network model as a feature for subsequent processing and analysis tasks.

[0044] Step S32: sending the vectorized data to a preset fully connected neural network for fitting, wherein the input vector and output vector in the vectorized data are passed to a fully connected neural network model of a preset number of layers for fitting, so as to obtain a vectorized matrix corresponding to the logical relationship in the first information of all levels.

[0045] It can be understood that the fully connected neural network in this step is composed of a preset number of layers, each layer contains multiple neurons, and by using the fully connected neural network for fitting, the system can better learn and understand the complex relationship between vectorized data, thereby obtaining a more accurate and expressive vectorized matrix. These matrices can be used for subsequent data analysis, feature extraction or other tasks, thereby improving the efficiency and accuracy of data processing.

[0046] Step S4: perform matrix conversion on the logic information to be retrieved, and perform search and matching between the vectorized matrix corresponding to the logic information to be retrieved and the second information to obtain the second information corresponding to the logic information to be retrieved.

[0047] It can be understood that in this step, by converting the logical information to be retrieved into a matrix form and matching it with the second information, the system can achieve efficient retrieval of the logical information. This matching process can accurately find the second information related to the information to be retrieved, providing support for subsequent analysis and application. In this step, step S4 includes step S41, step S42, step S43, step S44, step S45, step S46 and step S47.

[0048] Step S41, performing matrix conversion on the logic information to be retrieved to obtain a vectorized matrix corresponding to the logic information to be retrieved;

[0049] It can be understood that this step uses the same method to transform the logical information to be retrieved into a matrix. By transforming the logical information into a matrix representation, we can structure and standardize it, making it more suitable for calculation and analysis. This matrix representation can improve the expressiveness and processability of the data, laying the foundation for subsequent retrieval and matching operations.

[0050] Step S42: sending the vectorized matrix corresponding to the second information and the logic information to be retrieved to a preset multi-dimensional space for projection to obtain a spatial position point corresponding to the vector in each matrix;

[0051] It can be understood that by projecting in multidimensional space, we can convert high-dimensional vectorized data into a form that is easier to understand and visualize. Doing so helps us intuitively understand the relationship between the data and further conduct subsequent analysis and processing. This projection process can use various methods, such as principal component analysis (PCA), t-SNE, etc., to retrieve high-dimensional vectors in high-dimensional space. After the retrieval is completed, we get the spatial position points corresponding to the vectors in each matrix. The positions of these points in multidimensional space represent the relative position relationship of the corresponding vectors.

[0052] Step S43: performing block and clustering hierarchical processing on the spatial position points corresponding to the vectors in the second information to obtain at least two levels of first spatial blocks and cluster center points of the first spatial blocks at each level;

[0053] It can be understood that in this step, by dividing and clustering the spatial points of the second information, we can better understand the relationship and distribution between the spatial points. This helps us discover the structure and pattern in the space, and then provide more targeted data support for subsequent analysis and application. In this step, step S43 includes step S431 and step S432.

[0054] Step S431: classify the spatial position points corresponding to the vectors in the second information according to corresponding levels to obtain first spatial blocks corresponding to different levels;

[0055] It can be understood that in this step, by classifying the spatial location points according to the hierarchy and generating the first spatial block, we can better organize and manage the spatial data, make the data structure clearer, and provide a good foundation for subsequent processing and analysis.

[0056] Step S432: cluster the first spatial blocks corresponding to each level based on the k-means clustering algorithm, and calculate the cluster center points in each cluster cluster to obtain the cluster center points corresponding to the first spatial blocks of each level.

[0057] It can be understood that this step applies the k-means clustering algorithm to the first spatial block of each level. The algorithm can divide the spatial point set into k categories and find the cluster center of each category. For each cluster cluster, the system calculates the average value of all spatial points in it to obtain the cluster center point of the cluster. This center point represents the spatial characteristics of the cluster cluster. Through the k-means clustering algorithm, we can divide the spatial point set into clusters with similar characteristics and find the center point of each cluster, so as to better understand and describe the structure and characteristics of spatial data.

[0058] Step S44: judging whether the spatial position point corresponding to the logical information to be retrieved is within the first spatial block of the highest level based on the cluster center point of the first spatial block of each level, wherein the Euclidean distance between the cluster center point of the first spatial block of each level and the spatial position point corresponding to the logical information to be retrieved is calculated;

[0059] It can be understood that this step calculates the Euclidean distance between the spatial position point corresponding to the logical information to be retrieved. This distance measurement can reflect the relative position relationship between the information to be retrieved and the cluster center point in space. In this step, by calculating the Euclidean distance and comparing the threshold, we can accurately determine whether the logical information to be retrieved is in the first spatial block of the highest level. This helps the system to quickly locate and extract the spatial position points related to the information to be retrieved, so as to perform subsequent processing and analysis more effectively. Among them, step S44 also includes step S441, step S442 and step S443 after step S444.

[0060] Step S441: If the Euclidean distance is greater than the range threshold of the first spatial block, it means that the spatial position point corresponding to the logical information to be retrieved is not in the first spatial block;

[0061] It can be understood that in this step, by judging the relationship between the Euclidean distance and the threshold, the system can effectively determine whether the spatial position point corresponding to the logical information is within the first spatial block, which helps to filter out spatial points that do not meet the conditions and improve the accuracy and efficiency of retrieval.

[0062] Step S442: setting the spatial position points corresponding to the logic information to be retrieved in a preset multi-dimensional space according to a preset density, and performing block processing on all the spatial position points corresponding to the logic information to be retrieved to obtain at least one second spatial block corresponding to the logic information to be retrieved;

[0063] It can be understood that in this step, by resetting the spatial position points and performing block processing, we can effectively organize and manage the spatial position points corresponding to the logical information to be retrieved, making them more suitable for subsequent retrieval and analysis tasks, thereby improving the processing efficiency of spatial data.

[0064] Step S443: cluster the second spatial blocks corresponding to all the logical information to be retrieved, obtain the spatial ranges and cluster center points of the second spatial blocks corresponding to all the logical information to be retrieved, and determine whether they overlap with the first spatial blocks based on the spatial ranges and cluster center points of all the second spatial blocks; if not, add all the second spatial blocks to the preset multi-dimensional space.

[0065] It can be understood that by clustering and overlapping the second spatial blocks in this step, we can better understand and process the spatial location points corresponding to the logical information to be retrieved, ensure the integrity of spatial coverage, and improve the utilization efficiency of spatial data. And the non-overlapping logical relationships are added to the logical relationship database.

[0066] Step S45: if the Euclidean distance is less than or equal to the range threshold of the first spatial block, it means that it is within the first spatial block, and repeatedly determine whether it is within the first spatial block of the next level, until it is determined that the spatial position point corresponding to the logical information to be retrieved is located at the first spatial block level;

[0067] It can be understood that by recursively determining the spatial block level of the spatial position point in this step, we can accurately determine in which level the first spatial block the spatial position point corresponding to the logical information to be retrieved is located. This method can effectively locate the position of the spatial position point and ensure that it belongs to the correct spatial block level.

[0068] Step S46, calculating the Euclidean distance between the spatial position point corresponding to the logical information to be retrieved and all spatial position points in the first spatial block of the corresponding level, and determining whether there is a Euclidean distance less than a preset threshold;

[0069] It can be understood that in this step, by calculating the distance between the point to be retrieved and all points in the first spatial block and comparing it with the preset threshold, we can determine whether the point to be retrieved is in the first spatial block. This method can help us quickly and accurately locate the spatial block where the point to be retrieved is located, providing a basis for subsequent processing and analysis.

[0070] Step S47: If there is a Euclidean distance less than a preset threshold, the minimum value among the Euclidean distances less than the preset threshold is selected, and the logical relationship of the spatial position points in the first spatial block corresponding to the minimum value is used as the logical relationship corresponding to the logical information to be retrieved.

[0071] It can be understood that in this step, by selecting the logical relationship of the spatial position points corresponding to the minimum distance, we can find the spatial position points most relevant to the logical information to be retrieved, thereby improving the accuracy and efficiency of the retrieval.

[0072] Embodiment 2:

[0073] like Figure 2 As shown, this embodiment provides a logical relationship retrieval and matching system based on a neural network, see Figure 2 The system includes an acquisition unit 701 , a classification unit 702 , a processing unit 703 and a matching unit 704 .

[0074] An acquisition unit 701 is used to acquire first information, where the first information includes logic information in a database and logic information in an application model;

[0075] A grading unit 702, configured to grade all first information according to corresponding hierarchical relationships to obtain at least two levels of first information;

[0076] The grading unit 702 includes a first processing subunit 7021 , a first analyzing subunit 7022 , a second analyzing subunit 7023 and a second processing subunit 7024 .

[0077] The first processing sub-unit 7021 is used to sort all the logical relationships according to the frequency of occurrence, and intercept a preset number of logical relationships according to the sorting order to obtain a preset number of initial logical relationships;

[0078] The first analysis subunit 7022 is used to perform pairwise analysis on all initial logical relations, wherein two initial logical relations are analyzed to determine whether one of the initial logical relations is a subset of the other initial logical relation, if so, the other initial logical relation is deleted, if not, the two initial logical relations are retained to obtain a basic logical relation, wherein the basic logical relation is an initial logical relation without a subset;

[0079] The second analysis subunit 7023 is used to analyze the deleted initial logical relations again in pairs to obtain at least one category of secondary logical relations;

[0080] The second processing sub-unit 7024 is used to classify the basic logical relationship and all categories of secondary logical relationships according to the order of acquisition to obtain at least two levels of first information.

[0081] A processing unit 703 is used to send the first information of all levels to the trained fully connected neural network model for vectorization processing to obtain second information, where the second information includes a vectorization matrix corresponding to the first information of all levels;

[0082] The processing unit 703 includes a third processing sub-unit 7031 and a fourth processing sub-unit 7032 .

[0083] The third processing sub-unit 7031 is used to encode the input and output of the logical relationship in the first information of all levels, and perform product calculation on the encoding and the preset trained vectorization matrix to obtain vectorized data corresponding to the logical relationship in the first information of all levels, wherein the vectorized data is vector data;

[0084] The fourth processing sub-unit 7032 is used to send the vectorized data to a preset fully connected neural network for fitting, wherein the input vector and output vector in the vectorized data are passed to a fully connected neural network model of a preset number of layers for fitting, so as to obtain a vectorized matrix corresponding to the logical relationship in the first information of all levels.

[0085] The matching unit 704 is used to perform matrix conversion on the logic information to be retrieved, and perform search matching between the vectorized matrix corresponding to the logic information to be retrieved and the second information to obtain the second information corresponding to the logic information to be retrieved.

[0086] The matching unit 704 includes a fifth processing subunit 7041 , a sixth processing subunit 7042 , a seventh processing subunit 7043 , a first calculation subunit 7044 , a first judgment subunit 7045 , a second calculation subunit 7046 and a second judgment subunit 7047 .

[0087] The fifth processing sub-unit 7041 is used to perform matrix conversion on the logic information to be retrieved to obtain a vectorized matrix corresponding to the logic information to be retrieved;

[0088] The sixth processing subunit 7042 is used to send the vectorized matrix corresponding to the second information and the logic information to be retrieved to a preset multi-dimensional space for projection, so as to obtain a spatial position point corresponding to the vector in each matrix;

[0089] The seventh processing subunit 7043 is used to perform block and cluster hierarchical processing on the spatial position points corresponding to the vectors in the second information to obtain at least two levels of first spatial blocks and cluster center points of the first spatial blocks of each level;

[0090] The first calculation subunit 7044 is used to determine whether the spatial position point corresponding to the logical information to be retrieved is within the first spatial block of the highest level based on the cluster center point of the first spatial block of each level, wherein the Euclidean distance between the cluster center point of the first spatial block of each level and the spatial position point corresponding to the logical information to be retrieved is calculated;

[0091] The first judgment subunit 7045 is used to indicate that the Euclidean distance is less than or equal to the range threshold of the first spatial block, and repeatedly judge whether it is in the first spatial block of the next level, until it is determined that the spatial position point corresponding to the logical information to be retrieved is located at the first spatial block level;

[0092] The second calculation subunit 7046 is used to calculate the Euclidean distance between the spatial position point corresponding to the logical information to be retrieved and all the spatial position points in the first spatial block of the corresponding level, and determine whether there is a Euclidean distance less than a preset threshold;

[0093] The second judgment subunit 7047 is used to select the minimum value among the Euclidean distances that are less than the preset threshold if there is a Euclidean distance that is less than the preset threshold, and use the logical relationship of the spatial position points in the first spatial block corresponding to the minimum value as the logical relationship corresponding to the logical information to be retrieved.

[0094] Among them, the seventh processing sub-unit 7043 includes an eighth processing sub-unit 70431 and a third calculation sub-unit 70432.

[0095] An eighth processing subunit 70431 is configured to classify the spatial position points corresponding to the vectors in the second information according to corresponding levels to obtain first spatial blocks corresponding to different levels;

[0096] The third computing subunit 70432 is used to cluster the first spatial blocks corresponding to each level based on the k-means clustering algorithm, and calculate the cluster center points within each cluster cluster to obtain the cluster center points corresponding to the first spatial blocks of each level.

[0097] Among them, the first calculation subunit 7044 also includes a third judgment subunit 70441, a ninth processing subunit 70442 and a tenth processing subunit 70443.

[0098] The third judgment subunit 70441 is configured to indicate that the spatial position point corresponding to the logical information to be retrieved is not within the first spatial block if the Euclidean distance is greater than the range threshold of the first spatial block;

[0099] The ninth processing subunit 70442 is used to set the spatial position points corresponding to the logical information to be retrieved in a preset multi-dimensional space according to a preset density, and perform block processing on all the spatial position points corresponding to the logical information to be retrieved to obtain at least one second spatial block corresponding to the logical information to be retrieved;

[0100] The tenth processing sub-unit 70443 is used to cluster the second spatial blocks corresponding to all the logical information to be retrieved, obtain the spatial ranges and cluster center points of the second spatial blocks corresponding to all the logical information to be retrieved, and judge whether they overlap with the first spatial blocks based on the spatial ranges and cluster center points of all the second spatial blocks; if not, add all the second spatial blocks to the preset multi-dimensional space.

[0101] It should be noted that, regarding the system in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0102] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

[0103] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A logical relationship retrieval and matching method based on neural network, characterized in that: include: Acquire first information, where the first information includes logic information in a database and logic information in an application model; Classifying all first information according to corresponding hierarchical relationships to obtain at least two levels of first information; Sending the first information of all levels to the trained fully connected neural network model for vectorization processing to obtain second information, where the second information includes vectorized matrices corresponding to the first information of all levels; Performing matrix transformation on the logic information to be retrieved, and performing search and matching between the vectorized matrix corresponding to the logic information to be retrieved obtained by the transformation and the second information, so as to obtain the second information corresponding to the logic information to be retrieved; The step of grading all the first information according to the corresponding hierarchical relationships to obtain at least two levels of first information includes: Sort all of them according to the frequency of occurrence, and intercept a preset number of logical relationships according to the sorting order to obtain a preset number of initial logical relationships; Perform pairwise analysis on all initial logical relations, wherein two initial logical relations are analyzed to determine whether one of the initial logical relations is a subset of the other initial logical relation, if so, delete the other initial logical relation, if not, retain the two initial logical relations, and obtain a basic logical relation, wherein the basic logical relation is an initial logical relation without a subset; The deleted initial logical relations are analyzed again in pairs to obtain at least one category of secondary logical relations; The basic logical relationship and all categories of secondary logical relationships are graded according to the order of acquisition to obtain at least two levels of first information.

2. The neural network-based logical relationship retrieval and matching method according to claim 1 is characterized in that ,The first information of all levels is sent to the trained fully connected neural network model for vectorization processing, including: Encoding the input and output of the logical relationship in the first information of all levels, and performing product calculation on the encoding and the preset trained vectorization matrix to obtain vectorized data corresponding to the logical relationship in the first information of all levels, wherein the vectorized data is vector data; The vectorized data is sent to a preset fully connected neural network for fitting, wherein the input vector and output vector in the vectorized data are passed to a fully connected neural network model of a preset number of layers for fitting, so as to obtain a vectorized matrix corresponding to the logical relationship within the first information of all levels.

3. The neural network-based logical relationship retrieval and matching method according to claim 1 is characterized in that , performing matrix transformation on the logic information to be retrieved, and performing search and matching between the vectorized matrix corresponding to the logic information to be retrieved and the second information, including: Performing matrix conversion on the logic information to be retrieved to obtain a vectorized matrix corresponding to the logic information to be retrieved; Sending the vectorized matrix corresponding to the second information and the logical information to be retrieved to a preset multi-dimensional space for projection to obtain a spatial position point corresponding to a vector in each matrix; Performing block and clustering hierarchical processing on the spatial position points corresponding to the vectors in the second information to obtain at least two levels of first spatial blocks and cluster center points of the first spatial blocks at each level; Based on the cluster center point of the first spatial block of each level, it is determined whether the spatial position point corresponding to the logical information to be retrieved is within the first spatial block of the highest level, wherein the Euclidean distance between the cluster center point of the first spatial block of each level and the spatial position point corresponding to the logical information to be retrieved is calculated; If the Euclidean distance is less than or equal to the range threshold of the first spatial block, it means that it is within the first spatial block, and it is repeatedly determined whether it is within the first spatial block of the next level until it is determined that the spatial position point corresponding to the logical information to be retrieved is located at the first spatial block level; Calculate the Euclidean distance between the spatial position point corresponding to the logical information to be retrieved and all spatial position points in the first spatial block of the corresponding level, and determine whether there is a Euclidean distance less than a preset threshold; If a Euclidean distance is less than a preset threshold, the minimum value among the Euclidean distances less than the preset threshold is selected, and the logical relationship of the spatial position points in the first spatial block corresponding to the minimum value is used as the logical relationship corresponding to the logical information to be retrieved.

4. The neural network-based logical relationship retrieval and matching method according to claim 3, characterized in that: The spatial position points corresponding to the vectors in the second information are divided into blocks and clustered in layers to obtain first spatial blocks of at least two layers, including: Classifying the spatial position points corresponding to the vectors in the second information according to corresponding levels to obtain first spatial blocks corresponding to different levels; The first spatial block corresponding to each level is clustered based on the k-means clustering algorithm, and the cluster center point in each cluster cluster is calculated to obtain the cluster center point corresponding to the first spatial block of each level.

5. A logical relationship retrieval and matching system based on neural network, characterized in that: include: An acquisition unit, configured to acquire first information, wherein the first information includes logic information in a database and logic information in an application model; A grading unit, configured to grade all first information according to corresponding hierarchical relationships to obtain at least two levels of first information; A processing unit, configured to send the first information of all levels to the trained fully connected neural network model for vectorization processing to obtain second information, wherein the second information includes a vectorization matrix corresponding to the first information of all levels; A matching unit, used for performing matrix conversion on the logic information to be retrieved, and performing search and matching between the vectorized matrix corresponding to the logic information to be retrieved obtained by the conversion and the second information, so as to obtain the second information corresponding to the logic information to be retrieved; Wherein, the grading unit comprises: The first processing sub-unit is used to sort all the logical relations according to the frequency of occurrence, and intercept a preset number of logical relations according to the sorting order to obtain a preset number of initial logical relations; A first analysis subunit is used to analyze all the initial logical relations in pairs, wherein two initial logical relations are analyzed to determine whether one of the initial logical relations is a subset of the other initial logical relation, if so, the other initial logical relation is deleted, if not, the two initial logical relations are retained to obtain a basic logical relation, wherein the basic logical relation is an initial logical relation without a subset; The second analysis subunit is used to analyze the deleted initial logical relations again in pairs to obtain at least one category of secondary logical relations; The second processing subunit is used to classify the basic logical relationship and all categories of secondary logical relationships according to the order of acquisition to obtain at least two levels of first information.

6. The neural network-based logical relationship retrieval and matching system according to claim 5, characterized in that: The processing unit comprises: a third processing subunit, configured to encode the input and output of the logical relations in the first information of all levels, and perform product calculation on the encoding and a preset trained vectorization matrix to obtain vectorized data corresponding to the logical relations in the first information of all levels, wherein the vectorized data is vector data; The fourth processing sub-unit is used to send the vectorized data to a preset fully connected neural network for fitting, wherein the input vector and output vector in the vectorized data are passed to a fully connected neural network model with a preset number of layers for fitting, so as to obtain a vectorized matrix corresponding to the logical relationship in the first information of all levels.

7. The neural network-based logical relationship retrieval and matching system according to claim 5, characterized in that: The matching unit comprises: A fifth processing subunit, configured to perform matrix conversion on the logic information to be retrieved to obtain a vectorized matrix corresponding to the logic information to be retrieved; A sixth processing sub-unit, used for sending the vectorized matrix corresponding to the second information and the logic information to be retrieved to a preset multi-dimensional space for projection, to obtain a spatial position point corresponding to the vector in each matrix; a seventh processing subunit, configured to perform block and cluster hierarchical processing on the spatial position points corresponding to the vectors in the second information, to obtain at least two levels of first spatial blocks and cluster center points of the first spatial blocks at each level; A first calculation subunit is used to determine whether the spatial position point corresponding to the logical information to be retrieved is within the first spatial block of the highest level based on the cluster center point of the first spatial block of each level, wherein the Euclidean distance between the cluster center point of the first spatial block of each level and the spatial position point corresponding to the logical information to be retrieved is calculated; A first judgment subunit is configured to indicate that the Euclidean distance is less than or equal to a range threshold of the first spatial block, and repeatedly judge whether the information is within the first spatial block of the next level, until it is determined that the spatial position point corresponding to the logical information to be retrieved is located at the first spatial block level; A second calculation subunit is used to calculate the Euclidean distance between the spatial position point corresponding to the logical information to be retrieved and all the spatial position points in the first spatial block of the corresponding level, and determine whether there is a Euclidean distance less than a preset threshold; The second judgment subunit is used to select the minimum value among the Euclidean distances that are less than the preset threshold if there is a Euclidean distance that is less than the preset threshold, and use the logical relationship of the spatial position points in the first spatial block corresponding to the minimum value as the logical relationship corresponding to the logical information to be retrieved.

8. The neural network-based logical relationship retrieval and matching system according to claim 7, characterized in that: The seventh processing subunit comprises: an eighth processing subunit, configured to classify the spatial position points corresponding to the vectors in the second information according to corresponding levels to obtain first spatial blocks corresponding to different levels; The third computing subunit is used to cluster the first spatial blocks corresponding to each level based on the k-means clustering algorithm, and calculate the cluster center points in each cluster cluster to obtain the cluster center points corresponding to the first spatial blocks of each level.

Citation Information

Patent Citations

  • Knowledge question and answer intention recognition method and device and computer equipment

    CN113157887A

  • Order retrieval analysis system and method based on adaptive model

    CN116089502A