Query method of to-be-queried data, electronic device, and storage medium
By identifying the query entity in a traditional text database and performing feature fusion processing, the problems of low data query efficiency and accuracy are solved, and more efficient query result generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING BIG DATA CENT
- Filing Date
- 2025-10-23
- Publication Date
- 2026-04-28
AI Technical Summary
Existing technologies have low efficiency and accuracy in data querying, especially when the amount of data in traditional text databases is large, the efficiency of querying methods is significantly reduced.
By identifying the query entity corresponding to the original query data and matching the target entity among preset entities, and combining feature fusion processing to generate query augmentation data, the accuracy and efficiency of query results are improved.
It achieves comprehensive matching of query entities, improves the accuracy and generation efficiency of the final target results, and reduces maintenance costs.
Smart Images

Figure CN120994879B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more specifically to a method for querying data to be queried, an electronic device, a storage medium, and a computer program product. Background Technology
[0002] Data query and processing technologies are widely used in various information systems and knowledge service platforms. Users can obtain specific information results by entering keywords as the data to be queried.
[0003] Existing solutions for retrieving query results are generally inefficient. For example, in solutions based on traditional text databases, these databases are typically constructed using inverted indexes. Specifically, each keyword directly corresponds to a query result. The final query result is determined by matching the user-input data with the keywords. However, this query method is clearly inefficient when storing large amounts of data in traditional text databases. Therefore, how to better handle query data is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] The present invention was proposed in view of the above-mentioned problems. The present invention provides a method for querying data, an electronic device, a storage medium, and a computer program product.
[0005] According to one aspect of the present invention, a method for querying data to be queried is provided. The method includes: determining at least one query entity corresponding to the original query data based on original query data input by a first user; for each query entity among the at least one query entity, determining a target entity matching the query entity from preset entities corresponding to a first target dimension, and taking the preset query result corresponding to the target entity as the first target result corresponding to the query entity, wherein the first target dimension is the query dimension corresponding to the query entity; and determining the final target result corresponding to the original query data based on the first target result corresponding to each query entity.
[0006] For example, determining at least one query entity corresponding to the original query data based on the original query data input by the first user includes: for each target modality in at least one target modality corresponding to the feature fusion dimension, generating query augmentation data for that target modality based on the original query data, wherein the data modality of the original query data is different from that of each target modality, and at least one preset entity corresponding to the feature fusion dimension is obtained by feature fusion processing based on the data features corresponding to the data to be saved in each target modality and the data features corresponding to the data to be saved in the same data modality as the original query data; determining at least one query entity corresponding to the original query data based on the original query data and each query augmentation data.
[0007] For example, the query entity corresponding to the original query data includes a first multimodal feature, which is obtained by feature fusion processing based on the data features of both the original query data and the query augmentation data.
[0008] For example, the above query method includes:
[0009] Based on the original saved data, identify at least one target entity to be saved corresponding to the original saved data;
[0010] For each of the at least one target entities to be saved, the target entity to be saved is stored as a preset entity, a second target dimension, and target saved data. The second target dimension is the query dimension corresponding to the target entity to be saved, and the target saved data is determined based on the original saved data.
[0011] For example, the target saved data includes any one of the following: original saved data, storage address of the original saved data, wherein the storage address is used to store the original saved data.
[0012] For example, based on the original saved data, determining at least one target entity to be saved corresponding to the original saved data includes:
[0013] Based on the original saved data, corresponding extended data is generated, wherein the data modality of the extended data is different from that of the original saved data;
[0014] Based on the original saved data, at least one first entity to be saved is determined corresponding to the original saved data, and based on the saved expanded data, a second entity to be saved is determined. The first entity to be saved and the second entity to be saved are used as target entities to be saved. The query dimension corresponding to the second entity to be saved is different from the query dimension corresponding to each of the first entities to be saved.
[0015] For example, based on the original saved data, determining at least one target entity to be saved corresponding to the original saved data includes:
[0016] Based on the original saved data, corresponding extended data is generated, wherein the data modality of the extended data is different from that of the original saved data;
[0017] Feature extraction is performed on the original saved data and the saved expanded data respectively to obtain the data features corresponding to the original saved data and the data features corresponding to the saved expanded data respectively;
[0018] The data features corresponding to the original saved data and the data features corresponding to the saved expanded data are subjected to feature fusion processing to obtain the second multimodal feature, which is used as the target entity to be saved.
[0019] According to another aspect of the present invention, an electronic device is also provided. The electronic device includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, are used to perform the aforementioned method for querying data.
[0020] According to another aspect of the present invention, a storage medium is also provided. Program instructions are stored on this storage medium, which, when executed, are used to perform the above-described method for querying data.
[0021] According to another aspect of the present invention, a computer program product is also provided. This computer program product includes computer program instructions that, when executed by a processor, are used to perform the aforementioned method for querying data to be queried.
[0022] According to the above-described scheme of the present invention, at least one query entity corresponding to the original query data can be determined based on the original data input by the first user. Then, for each query entity among the at least one query entity, a target entity matching the query entity is determined from the preset entities corresponding to the first target dimension, and the preset query result corresponding to the target entity is used as the first target result corresponding to the query entity. Finally, based on the first target result corresponding to each query entity, the final target result corresponding to the original query data is determined. On the one hand, the above scheme can determine the query entities in the original query data to perform a comprehensive query. The above scheme can improve the accuracy of the final target result determined by combining the first target results corresponding to each query entity. On the other hand, in the above scheme, the query entity can be matched with the preset entity according to the first target dimension corresponding to the query entity, which can realize a targeted matching process, which is conducive to improving the determination efficiency of the first target result, and thus improving the generation efficiency of the final target result. Attached Figure Description
[0023] The above and other objects, features, and advantages of the present invention will become more apparent from the more detailed description of the embodiments of the invention in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same parts or steps.
[0024] Figure 1 A schematic flowchart of a method for querying data according to an embodiment of the present invention is shown;
[0025] Figure 2 A schematic block diagram of a query device for data to be queried according to an embodiment of the present invention is shown;
[0026] Figure 3 A schematic block diagram of an electronic device according to an embodiment of the present invention is shown. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of the present invention more apparent, exemplary embodiments according to the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely a part of the embodiments of the present invention, and not all of the embodiments of the present invention. It should be understood that the present invention is not limited to the exemplary embodiments described herein. Based on the embodiments of the present invention described herein, all other embodiments obtained by those skilled in the art without inventive effort should fall within the protection scope of the present invention.
[0028] To at least partially address the issues of low efficiency and accuracy in existing query methods, this invention provides a query method for data to be queried. Figure 1 A schematic flowchart illustrating a method for querying data according to an embodiment of the present invention is shown. Figure 1 As shown, the method may include the following steps S110 to S130.
[0029] In step S110, based on the original query data input by the first user, at least one query entity corresponding to the original query data is determined.
[0030] The first user can be any user who needs to perform a query operation. The first user can input raw query data via an input device (e.g., mouse, keyboard, etc.). This raw query data can be of various data types, such as text, images, audio, video, and sensor signals. In some embodiments, the first user's raw query data can be of a single data type. In other embodiments, the first user's raw query data can be composite data including multiple data types. It is understood that this embodiment of the invention does not limit the number of raw query data. For example, the user can input multiple raw query data (of the same or different data types), and then query each of the multiple raw query data in sequence.
[0031] Query entities can be used to represent data segments with specific meanings included in the original query data input by the first user. Specifically, if the developer defines time, space, and species as data segments with specific meanings, then these data segments can be extracted from the original query data. For example, if the original query data input by the first user is "a puppy in the park yesterday," then the multiple query entities corresponding to this original query data can include "yesterday," "park," and "puppy." Specifically, the word with time meaning (which can be regarded as the data segment mentioned above in this example) is "yesterday," the word with spatial meaning is "park," and the word with species meaning is "puppy." It can be understood that the first user's query data can correspond to one or more query entities.
[0032] In step S120, for each query entity, a target entity matching the query entity is determined from the preset entities corresponding to the first target dimension, and the preset query result corresponding to the target entity is used as the first target result corresponding to the query entity.
[0033] For each query entity, a first target dimension is defined, which is the query dimension corresponding to that query entity. Referring to the example in step S110, if the query dimension can include a time dimension, a spatial dimension, and a species dimension, then for a query entity with text content "yesterday," the first target dimension corresponding to that query entity can be the time dimension. For a query entity with text content "park," the first target dimension corresponding to that query entity can be the spatial dimension.
[0034] Preset entities can be stored in relation to their corresponding query dimensions and preset query results. These preset query results can represent the results a first user wants to query. For example, a preset query result could be a video the first user wants to find. The first user can input original query data to determine the video that matches the original query data from multiple preset query results. It is understood that a preset entity can also correspond to multiple preset query results. For example, if the preset entity is "park," then this preset entity can correspond to multiple preset query results related to parks. In practical scenarios, for each query dimension, this query dimension can correspond to multiple preset entities. For each of the above multiple preset entities, this preset entity can correspond to multiple preset query results.
[0035] For each preset query dimension, the corresponding query entity in the original query data can be determined. It's understandable that in real-world scenarios, a query dimension may not have a corresponding query entity in the original query data. For example, consider original query data with the text "a puppy in the park." For the time dimension, the query entity corresponding to the time dimension of the original query data could be empty.
[0036] Based on the first target dimension corresponding to the query entity, at least one preset entity corresponding to the first target dimension can be determined. Then, a target entity matching the query entity can be determined from among the at least one preset entity. Finally, the preset query result corresponding to the target entity can be used as the first target result corresponding to the query entity.
[0037] Specifically, referring to the example of the original query data with the text content "a puppy in the park yesterday" in step S110 above, the query dimension corresponding to the query entity with the text content "yesterday" is the time dimension. Multiple preset entities corresponding to the time dimension can include "December," "three years ago," "the day before," and "this week," etc. From these, we can determine the preset entity with the text content "the day before" that matches the query entity with the text content "yesterday," and use it as the target entity. It can be understood that in this example, if the query entity and the preset entity have the same semantics (for example, "the day before" and "yesterday" have the same semantics in the above example), then they can be considered a successful match. Specifically, referring to the above example, the preset query result corresponding to the target entity with the text content "the day before" can be used as the first target result corresponding to the query entity with the text content "yesterday."
[0038] It can be understood that the target entity matched by the query entity can be the preset entity with the highest degree of matching among multiple preset entities. In other words, the query entity and the target entity that matches it may not be completely identical, but they are the most similar.
[0039] In step S130, based on the first target result corresponding to each query entity, the final target result corresponding to the original query data is determined.
[0040] In some embodiments, all first target results can be used as the final target results. For example, if the target dimensions include target dimension 1 and target dimension 2, and the first target results corresponding to target dimension 1 include results 1 to 3, and the first target results corresponding to target dimension 2 include results 2 to 4, then results 1 to 4 can all be used as the final target results.
[0041] In some other embodiments, the intersection of the first target results can also be used as the final target result. Continuing with the previous example, in this embodiment, result 2 and result 3 can be used as the final target result.
[0042] It is understandable that users can also generate feedback information based on the final target result in order to redefine the final target result.
[0043] According to the above-described scheme of the present invention, at least one query entity corresponding to the original query data can be determined based on the original query data input by the first user. Then, for each query entity among the at least one query entity, a target entity matching the query entity is determined from the preset entities corresponding to the first target dimension, and the preset query result corresponding to the target entity is used as the first target result corresponding to the query entity. Finally, based on the first target result corresponding to each query entity, the final target result corresponding to the original query data is determined. On the one hand, the above scheme can determine the query entities in the original query data to perform a comprehensive query. The above scheme can improve the accuracy of the final target result determined by combining the first target results corresponding to each query entity. On the other hand, in the above scheme, the query entity can be matched with the preset entity according to the first target dimension corresponding to the query entity, which can realize a targeted matching process, which is conducive to improving the determination efficiency of the first target result, and thus improving the generation efficiency of the final target result.
[0044] For example, the above query method further includes steps S210 and S220.
[0045] In step S210, based on the original saved data, at least one target entity to be saved corresponding to the original saved data is determined.
[0046] It is understood that the original saved data can be data input by a second user through the input device mentioned above. The second user can be the user who needs to save the original saved data, and can be the same as or different from the first user. The original saved data can be data of various data types such as text, images, audio, video, and sensor signals. In some embodiments, the original saved data of the second user can be composite data including data of multiple data types. It is understood that the embodiments of the present invention do not limit the number of original saved data. For example, the user can input multiple original saved data (the data types can be the same or different), and then each of the multiple original saved data is saved separately in sequence. In another example, if there is a correlation between at least two of the multiple original saved data (e.g., the user simultaneously performs the operation of determining to save), then the at least two original saved data can also be stored accordingly. In other words, a first target result obtained from a query can also include multiple original saved data.
[0047] The first entity to be saved can be used to represent a data segment with specific meaning included in the original saved data. The specific process for determining the first entity to be saved can be referred to the relevant steps of querying the entity in step S110 above, and will not be elaborated upon here in this embodiment of the invention. In one example, the first entity to be saved can be used as the target entity to be saved. In another example, a data segment associated with the data segment can also be used as the target entity to be saved. The associated data segment can be obtained by expanding upon the first entity to be saved. For example, the first entity to be saved can be semantically expanded to obtain entities with different text content but the same semantics, which can then be used as the target entity to be saved.
[0048] In step S220, for each of the at least one target entities to be saved, the target entity to be saved is stored as a preset entity, a second target dimension, and the target saved data.
[0049] The second target dimension is the query dimension corresponding to the entity to be saved, and the target data to be saved is determined based on the original data to be saved.
[0050] In one example, the target saved data can be directly the original saved data. In another example, the target saved data can also be a unique identifier of the original saved data, which can be used to query the original saved data. It can be understood that the target saved result can be regarded as the preset query result in step S120 above.
[0051] Taking the target data to be saved as the original data to be saved as an example, the original data to be saved may include target entities 1 and 2 to be saved, which correspond to the second target dimensions 1 and 2, respectively. Target entity 1 to be saved can be stored as a preset entity 1, corresponding to the second target dimension 1 and the original data to be saved; similarly, target entity 2 to be saved can be stored as a preset entity 2, corresponding to the second target dimension 2 and the original data to be saved. It can be understood that in some examples, the query dimension can also be an implicit index. For example, for each query dimension, there can be a corresponding storage area to store the preset entities and target data to be saved for that query dimension. When a query is needed for that query dimension, the query can be performed directly in the storage area corresponding to that query dimension. The storage area can be represented as an index table or a tree structure, etc., and this embodiment of the invention is not limited thereto.
[0052] According to the above-described scheme of the present invention, at least one target entity to be saved can be determined based on the original saved data. Then, for each of the at least one target entity to be saved, the target entity to be saved can be stored as a preset entity, a second target dimension, and the corresponding target saved data. By storing the preset entity, the second target dimension, and the corresponding target saved data, the above scheme supports a highly targeted query and matching process, which is beneficial to improving the efficiency of determining the first target result, and thus improving the efficiency of generating the final target result.
[0053] For example, the target saved data may include the original saved data.
[0054] According to the above-described solution of the present invention, the target data to be saved can directly include the original data to be saved, and can be saved directly and conveniently for querying of the original query data, which helps to reduce maintenance costs.
[0055] For example, the target saved data may include the storage address of the original saved data.
[0056] Storage addresses can be used to store raw, saved data. Specifically, each raw, saved data can correspond to a unique storage address. Through this storage address, the raw, saved data can be read, allowing the first user to query it using the raw query data. In practical scenarios, the corresponding preset entities, the second target dimension, and the target saved data can be stored in the storage area mentioned above. The raw, saved data can be stored in a different area than this storage area. This directly reduces the total data storage volume in the aforementioned storage area, thus reducing the maintenance costs of that storage area.
[0057] For example, step S210, based on the original saved data, determines at least one target entity to be saved corresponding to the original saved data, including steps S211a and S212a.
[0058] In step S211a, based on the original saved data, the corresponding extended saved data is generated.
[0059] The data modality of the extended data differs from that of the original data. Extended data can be generated from the original data using machine learning models or related algorithms. Specifically, each machine learning model or related algorithm can correspond to a data modality, and the machine learning model or related algorithm corresponding to each data modality can be different. Taking a machine learning model as an example, for each data modality, the machine learning model for that data modality can be trained based on the training data of that data modality to obtain a machine learning model that can generate extended data for other data modalities. For example, a machine learning model corresponding to a text modality can take the original text modality's data as input, and then output extended data for an image modality. The specific training process of the machine learning model is not limited in this embodiment of the invention and can be determined by the developers according to the actual situation. It is understood that although the extended data is generated based on the original data, it may also include content not present in the original data.
[0060] In step S212a, based on the original saved data, at least one first entity to be saved corresponding to the original saved data is determined, and based on the saved extended data, a second entity to be saved is determined, and the first entity to be saved and the second entity to be saved are taken as target entities to be saved.
[0061] The query dimension corresponding to the second entity to be saved is different from the query dimension corresponding to each of the first entities to be saved. Because the data modality of the saved expanded data is different from that of the original saved data, the generated saved expanded data may include the aforementioned second entity to be saved.
[0062] In a practical scenario, the original saved data 1 corresponds to a first entity to be saved in the time dimension and a first entity to be saved in the spatial dimension. The extended data 1 corresponding to the original saved data 1 can correspond to a first entity to be saved in the time dimension, a first entity to be saved in the spatial dimension (since the extended data is generated based on the original saved data, the first entities to be saved corresponding to the existing query dimensions of the original saved data can remain unchanged), and a second entity to be saved in the species dimension. Therefore, the first entity to be saved 1 can be stored as a target entity to be saved, corresponding to the target saved data and time dimension of the original saved data 1. The first entity to be saved 2 can be stored as another target entity to be saved, corresponding to the target saved data and spatial dimension of the original saved data 1. The second entity to be saved 1 can be stored as yet another target entity to be saved, corresponding to the target saved data and species dimension of the original saved data 1.
[0063] According to the above-described scheme of the present invention, based on the original saved data, extended saved data corresponding to the original saved data can be generated. Then, based on the original saved data, at least one first entity to be saved corresponding to the original saved data is determined, and based on the extended saved data, a second entity to be saved is determined. The first entity to be saved and the second entity to be saved are used as target entities to be saved. The above scheme expands the total number of preset entities for matching the query entity, which is beneficial to improving the accuracy of the target entity matching the query entity and the accuracy of the final target result determined based on the first target result corresponding to the target entity.
[0064] For example, step S210, which determines at least one target entity to be saved based on the original saved data, may include steps S211b to S213b.
[0065] In step S211b, based on the original saved data, the corresponding extended saved data is generated.
[0066] The data modality for storing the expanded data differs from the data modality for storing the original data. The specific generation process can be found in step S211a; details are not elaborated here in this embodiment of the invention.
[0067] In step S212b, feature extraction processing is performed on the original saved data and the saved expanded data respectively to obtain the data features corresponding to the original saved data and the data features corresponding to the saved expanded data respectively.
[0068] The feature extraction process described above can be represented by performing feature extraction on the original saved data and the saved expanded data separately using a feature extraction network or algorithm. It is understood that since the original saved data and the saved expanded data have different data modalities, the feature extraction networks or algorithms used for them can also be different. In other words, for each data modality, there can be a corresponding feature extraction network or algorithm used to perform feature extraction on the data of that data modality (e.g., the original saved data and the saved expanded data mentioned above). These data features can be represented as feature vectors.
[0069] In step S213b, feature fusion processing is performed on the data features corresponding to the original saved data and the data features corresponding to the saved expanded data to obtain the second multimodal features, which are then used as the target entity to be saved.
[0070] The above feature fusion processing can be performed using the concat or add operators, which will not be elaborated upon here in this embodiment of the invention. In practical scenarios, if the original saved data modality is an image and the saved augmented data modality is text, then the second multimodal feature can be used to represent the image features and text features of the original saved data. If the subsequent original query data input by the first user is text, then the text can also be accurately matched with the image, thereby achieving accurate cross-modal matching.
[0071] According to the above-described scheme of the present invention, based on the original saved data, extended saved data corresponding to the original saved data can be generated. Then, feature extraction processing can be performed on the original saved data and the extended saved data respectively to obtain data features corresponding to the original saved data and data features corresponding to the extended saved data. Finally, feature fusion processing is performed on the data features corresponding to the original saved data and the data features corresponding to the extended saved data. Even when the data modality of the final target result differs from the data modality of the original query data, the above scheme can maintain the accuracy of the target entity matching the query entity, thereby improving the accuracy of the final target result obtained based on the first target result corresponding to the target entity.
[0072] For example, step S110, which determines at least one query entity corresponding to the original query data based on the original query data input by the first user, may include steps S111 and S112.
[0073] In step S111, for each target modality in at least one target modality corresponding to the feature fusion dimension, query augmentation data for that target modality is generated based on the original query data.
[0074] The data modality of the original query data differs from that of each target modality. At least one predefined entity corresponding to the feature fusion dimension is obtained through feature fusion processing based on the data features corresponding to the data to be saved in each target modality, and the data features corresponding to the data to be saved that share the same data modality as the original query data. The target modality is the data modality that the predefined entities in the feature fusion dimension can fuse. Specifically, for example, the predefined entity 'a' corresponding to the feature fusion dimension can be obtained through feature fusion processing based on the data features of data modalities 1 and 2. The predefined entity 'b' corresponding to the feature fusion dimension can be obtained through feature fusion processing based on the data features of data modalities 2 and 3. If the data modality of the original query data is data modality 1, then the target modality can be data modality 2 or data modality 3 in the example above. The data to be saved can include the original data to be saved and the extended data to be saved mentioned above.
[0075] A specific example of generating query augmentation data for the target modality based on the original query data can be found in the relevant content of step S211a. For example, the query augmentation data can be determined based on the machine learning model or related algorithm in step S211a. The embodiments of the present invention will not be elaborated upon here. It is understood that although the query augmentation data is generated based on the original query data, it may also include content not present in the original query data.
[0076] In step S112, based on the original query data and each query expansion data, at least one query entity corresponding to the original query data is determined.
[0077] Since the data modality of the expanded query data is different from that of the original query data, the generated expanded query data may include query entities that are not included in the original query data. Both the query entities in the original query data and the query entities in the expanded query data can be used as the query entities corresponding to the original query data.
[0078] In a practical scenario, the original query data 1 includes query entity 1 in the time dimension and query entity 2 in the spatial dimension. The corresponding extended query data 1 can include query entity 1 in the time dimension, query entity 2 in the spatial dimension (since the extended query data is generated based on the original query data, the existing query entities corresponding to the query dimensions in the original query data can remain unchanged), and query entity 3 in the species dimension. Therefore, query entity 1, query entity 2, and query entity 3 can all be considered as query entities corresponding to the original query data.
[0079] According to the above-described scheme of the present invention, for each target modality in at least one target modality corresponding to the feature fusion dimension, query augmentation data for that target modality can be generated based on the original query data. Then, based on the original query data and each query augmentation data, at least one query entity corresponding to the original query data is determined. The above scheme can determine the query augmentation data of the target modality based on the original query data, and the query entities obtained based on the original query data and the query augmentation data can be matched more comprehensively with preset entities. Therefore, the above scheme can improve the accuracy of the obtained first target result, which is beneficial to improving the accuracy of the final target result.
[0080] For example, the query entity corresponding to the original query data includes a first multimodal feature, which is obtained by feature fusion processing based on the data features of both the original query data and the query augmentation data.
[0081] The data features of both the original query data and the expanded query data can be obtained through feature extraction. For details on feature extraction, please refer to the relevant examples in step S212b. It is understood that since the original query data and the expanded query data have different data modalities, the feature extraction networks or algorithms used for them can also be different. In other words, for each data modality, there can be a corresponding feature extraction network or algorithm used to perform feature extraction processing on the data of that data modality (e.g., the original query data and the expanded query data mentioned above). These data features can be represented as feature vectors.
[0082] The above feature fusion processing can be performed using the concat or add operators, which will not be elaborated upon here in this embodiment of the invention. In practical scenarios, if the data modality of the original query data is an image and the data modality of the query augmentation data is text, then the first multimodal feature can be used to represent the image features of the original query data and the text features of the query augmentation data. If the actual final target result to be matched is text, then the image can also be accurately matched with the text, thereby achieving accurate cross-modal matching.
[0083] According to the above-described solution of the present invention, when the data modality of the final target result is different from the data modality of the original query data, the above solution can maintain the accuracy of the target entity matching the query entity, thereby improving the accuracy of the final target result obtained based on the first target result corresponding to the target entity.
[0084] This invention also provides a query device for data to be queried. Figure 2 A schematic block diagram of a data query device 300 according to an embodiment of the present invention is shown. (In conjunction with...) Figure 2 As shown, the query device 300 for querying data may include a query entity determination module 310, a first target result determination module 320, and a final target result determination module 330.
[0085] The query entity determination module 310 is used to determine at least one query entity corresponding to the original query data based on the original query data input by the first user.
[0086] The first target result determination module 320 is used to determine the target entity that matches the query entity in the preset entities corresponding to the first target dimension based on each query entity in at least one query entity, and to take the preset query result corresponding to the target entity as the first target result corresponding to the query entity, wherein the first target dimension is the query dimension corresponding to the query entity.
[0087] The final target result determination module 330 is used to determine the final target result corresponding to the original query data based on the first target result corresponding to each query entity.
[0088] For example, the query entity determination module 310 includes a query extended data generation module and a first entity determination module.
[0089] The query augmentation data generation module is used to generate query augmentation data for each target modality in at least one target modality corresponding to the feature fusion dimension, based on the original query data. The data modality of the original query data is different from that of each target modality. At least one preset entity corresponding to the feature fusion dimension is obtained by feature fusion processing based on the data features corresponding to the data to be saved in each target modality and the data features corresponding to the data to be saved that are the same as the data modality of the original query data.
[0090] The first entity determination module is used to determine at least one query entity corresponding to the original query data based on the original query data and each query expansion data.
[0091] For example, the query entity corresponding to the original query data includes a first multimodal feature, which is obtained by feature fusion processing based on the data features of both the original query data and the query augmentation data.
[0092] For example, the query device 300 further includes: a target entity to be saved determination module and an entity storage module.
[0093] The target entity to be saved determination module is used to determine at least one target entity to be saved corresponding to the original saved data based on the original saved data.
[0094] The entity storage module is used to store each of the at least one target entities to be saved as a preset entity, a second target dimension, and target saved data. The second target dimension is the query dimension corresponding to the target entity to be saved, and the target saved data is determined based on the original saved data.
[0095] For example, the target saved data includes any one of the following: original saved data, storage address of the original saved data, wherein the storage address is used to store the original saved data.
[0096] For example, the target entity to be saved determination module includes: a first storage expansion data generation module and a second entity to be saved determination module.
[0097] The first storage extended data generation module is used to generate storage extended data corresponding to the original storage data based on the original storage data. The data modality of the storage extended data is different from that of the original storage data.
[0098] The second entity to be saved determination module is used to determine at least one first entity to be saved corresponding to the original saved data based on the original saved data, and to determine a second entity to be saved based on the saved expanded data. The first entity to be saved and the second entity to be saved are used as target entities to be saved. The query dimension corresponding to the second entity to be saved is different from the query dimension corresponding to each of the first entities to be saved.
[0099] For example, the target entity to be saved determination module includes: a second data generation module for saving extended data;
[0100] The second storage extended data generation module is used to generate storage extended data corresponding to the original storage data based on the original storage data. The data modality of the storage extended data is different from that of the original storage data.
[0101] The data feature extraction module is used to perform feature extraction processing on the original saved data and the saved expanded data respectively, so as to obtain the data features corresponding to the original saved data and the data features corresponding to the saved expanded data respectively.
[0102] The feature fusion module is used to perform feature fusion processing on the data features corresponding to the original saved data and the data features corresponding to the saved expanded data to obtain the second multimodal feature, which is used as the target entity to be saved.
[0103] According to another aspect of the present invention, an electronic device is also provided. Figure 3 A schematic block diagram of an electronic device 400 according to an embodiment of the present invention is shown. Figure 3 As shown, the electronic device 400 includes a memory 410 and a processor 420. The memory 410 stores a computer program, and the computer program instructions are executed by the processor 420 to perform the above-mentioned query method for the data to be queried.
[0104] Furthermore, according to another aspect of the present invention, a storage medium is also provided, on which program instructions are stored. When the program instructions are executed by a computer or processor, the computer or processor performs corresponding steps of the query method for the query data described in the embodiments of the present invention, and is used to implement a corresponding module in the query device for the query data described in the embodiments of the present invention or a corresponding module in the electronic device. The storage medium may, for example, include a memory card of a smartphone, a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disc read-only memory (CD-ROM), a USB memory, or any combination of the above storage media.
[0105] According to another aspect of the present invention, a computer program product is also provided, comprising computer program instructions, which, when executed by a computer or processor, cause the computer or processor to perform the corresponding steps of the query method for the data to be queried.
[0106] Those skilled in the art can understand the specific implementation scheme of the above electronic device and storage medium by reading the relevant description of the query method for the data to be queried. For the sake of brevity, it will not be described in detail here.
[0107] Although exemplary embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above exemplary embodiments are merely illustrative and are not intended to limit the scope of the invention. Various changes and modifications can be made therein by those skilled in the art without departing from the scope and spirit of the invention. All such changes and modifications are intended to be included within the scope of the invention as claimed in the appended claims.
[0108] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0109] In the several embodiments provided by this invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed.
[0110] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0111] Similarly, it should be understood that, in order to streamline the invention and aid in understanding one or more of the various aspects of the invention, features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the description of exemplary embodiments of the invention. However, this approach should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the corresponding claims, its inventive point lies in solving the corresponding technical problem with fewer features than all of those in a single disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of the invention.
[0112] Those skilled in the art will understand that, apart from the mutual exclusion of features, all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or elements of any method or apparatus so disclosed may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0113] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments can be used in any combination.
[0114] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some modules in the data query device according to embodiments of the present invention. The present invention can also be implemented as an apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such programs implementing the present invention can be stored on a computer-readable medium or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0115] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0116] The above description is merely a specific embodiment of the present invention or an explanation of that embodiment. The scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. The scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for querying data to be queried, characterized in that, The method includes: Based on the original query data input by the first user, at least one query entity corresponding to the original query data is determined; For each query entity in the at least one query entity, a target entity matching the query entity is determined from the preset entities corresponding to the first target dimension, and the preset query result corresponding to the target entity is used as the first target result corresponding to the query entity, wherein the first target dimension is the query dimension corresponding to the query entity; Based on the first target result corresponding to each query entity, the final target result corresponding to the original query data is determined; The step of determining at least one query entity corresponding to the original query data based on the original query data input by the first user includes: For each target modality in at least one target modality corresponding to the feature fusion dimension, based on the original query data, query augmentation data for that target modality is generated. The data modality of the original query data is different from that of each target modality. At least one preset entity corresponding to the feature fusion dimension is obtained through feature fusion processing based on the data features corresponding to the data to be saved in each target modality and the data features corresponding to the data to be saved that are the same as the data modality of the original query data. Based on the original query data and each query expansion data, at least one query entity corresponding to the original query data is determined. The method further includes: Based on the original saved data, at least one target entity to be saved is determined corresponding to the original saved data; For each of the at least one target entities to be saved, the target entity to be saved is stored as a preset entity, corresponding to a second target dimension and target saved data, wherein the second target dimension is the query dimension corresponding to the target entity to be saved, and the target saved data is determined based on the original saved data; The step of determining at least one target entity to be saved based on the original saved data includes: Based on the original saved data, corresponding extended saved data is generated, wherein the data modality of the extended saved data is different from the data modality of the original saved data; Based on the original saved data, at least one first entity to be saved corresponding to the original saved data is determined, and based on the saved expanded data, a second entity to be saved is determined. The first entity to be saved and the second entity to be saved are used as the target entities to be saved, wherein the query dimension corresponding to the second entity to be saved is different from the query dimension corresponding to each of the first entities to be saved.
2. The method as described in claim 1, characterized in that, The query entity corresponding to the original query data includes a first multimodal feature, which is obtained by feature fusion processing based on the data features of the original query data and the query augmentation data.
3. The method as described in claim 1, characterized in that, The target saved data includes any one of the following: original saved data, and the storage address of the original saved data, wherein the storage address is used to store the original saved data.
4. The method as described in claim 1, characterized in that, The step of determining at least one target entity to be saved based on the original saved data includes: Based on the original saved data, corresponding extended saved data is generated, wherein the data modality of the extended saved data is different from the data modality of the original saved data; Feature extraction processing is performed on the original saved data and the saved expanded data respectively to obtain the data features corresponding to the original saved data and the data features corresponding to the saved expanded data respectively; The data features corresponding to the original saved data and the data features corresponding to the saved expanded data are subjected to feature fusion processing to obtain a second multimodal feature, which is used as the target entity to be saved.
5. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement the query method for data to be queried as described in any one of claims 1-4.
6. A storage medium storing computer program instructions, characterized in that, The computer program instructions, when executed, are used to perform the query method for the data to be queried as described in any one of claims 1-4.
7. A computer program product comprising computer program instructions, characterized in that, The computer program instructions, when executed by a processor, are used to perform the query method for the data to be queried as described in any one of claims 1-4.
Citation Information
Patent Citations
Entity query method and device, readable medium and electronic equipment
CN112256719A
Retrieval method and device for retrieval object with multi-modal information
CN113076433A
Information acquisition method, device and equipment, server and cluster thereof, and storage medium
CN117312529A