Method, apparatus, device and storage medium for data query
By constructing an index using a many-to-one mapping function, the problems of the upper limit of enumeration values and storage space occupation in data query are solved, achieving efficient data filtering and storage, and suitable for data sources with complex levels.
Patent Information
- Application Number
- CN202311434188.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2043-10-31
AI Technical Summary
Existing technologies suffer from limitations in data querying, such as the upper limit of index field enumeration values and excessive storage space consumption. This is especially true when the data source is deep, making it difficult to efficiently filter and store data entities.
Multiple mapping functions are used to map data entity identifiers to multiple indexes. The indexes are constructed using a many-to-one mapping method, which reduces the need for enumerating values of index fields. The query results are determined by the intersection, avoiding the limitations of direct enumeration and sharded indexes.
It improves the efficiency of data querying and storage space utilization, and can handle complex data filtering in a large number of data sources, reducing storage space usage and query time.
Smart Images

Figure CN119003837B_ABST
Abstract
Description
Technical Field
[0001] The exemplary embodiments disclosed herein generally relate to the field of computers, and particularly to methods, apparatus, devices, and computer-readable storage media for data retrieval. Background Technology
[0002] With the development of information technology, various terminal devices can provide people with a variety of services in work and life. For example, applications that provide services can be deployed on terminal devices. Terminal devices or applications can provide users with digital assistant functions to assist users in using the terminal devices or applications. Users can use plugins to complete various operations during the interaction with digital assistants. How to conveniently and quickly create plugins that meet user needs is a technical problem that needs to be explored. Summary of the Invention
[0003] In a first aspect of this disclosure, a method for data querying is provided. The method includes: receiving a data query request for a target data source, the data query request indicating a first entity identifier to be queried; mapping the first entity identifier to a plurality of first indices using a plurality of mapping functions, each mapping multiple different entity identifiers to the same index; filtering from the target data source, based on the plurality of first indices and index information of data entities in the target data source, multiple sets of first data entities that match the plurality of first indices respectively, the index information of each set of data entities matching one of the plurality of first indices; and determining a query result for the data query request from the intersection of the multiple sets of first data entities, the query result indicating at least a portion of the data entities included in the intersection.
[0004] In a second aspect of this disclosure, a method for data querying is provided. The method includes: receiving a data query request for a target data source, the data query request indicating a first folder identifier to be queried; in response to determining that the first folder identified by the first folder identifier has subfolders, obtaining at least one second folder identifier for at least one subfolder within the first folder based on the first folder identifier; and filtering from the target data source a plurality of data entities that match the first folder identifier and the at least one second folder identifier based on index information of data entities in the target data source, the index information of each data entity including at least a folder field indicating one of the first folder identifier and the at least one second folder identifier.
[0005] In a third aspect of this disclosure, a method for data querying is provided. The method includes: determining a target data source for a question-and-answer plugin used by a digital assistant based on a first configuration operation by a user; receiving a data query request from the user during an interaction between the user and the digital assistant; and presenting the query results of the digital assistant to the user, wherein the query results are obtained by the digital assistant using the question-and-answer plugin to match the data query request with the target data source.
[0006] In a fourth aspect of this disclosure, an apparatus for data querying is provided. The apparatus includes: a request receiving module configured to receive a data query request for a target data source, the data query request indicating a first entity identifier to be queried; an index mapping module configured to map the first entity identifier to a plurality of first indices using a plurality of mapping functions, each mapping function mapping a plurality of different entity identifiers to the same index; a data filtering module configured to filter out a plurality of sets of first data entities from the target data source based on the plurality of first indices and index information of data entities in the target data source, each set of data entities having index information matching one of the plurality of first indices; and a result determining module configured to determine a query result for the data query request from the intersection of the plurality of sets of first data entities, the query result indicating at least a portion of the data entities included in the intersection.
[0007] In a fifth aspect of this disclosure, an apparatus for data querying is provided. The apparatus includes: a request receiving module configured to receive a data query request for a target data source, the data query request indicating a first folder identifier to be queried; an identifier acquisition module configured to, in response to determining that the first folder identified by the first folder identifier has subfolders, acquire at least one second folder identifier of at least one subfolder within the first folder based on the first folder identifier; and a data filtering module configured to filter out a plurality of data entities from the target data source that match the first folder identifier and the at least one second folder identifier based on index information of data entities in the target data source, the index information of each data entity including at least a folder field indicating one of the first folder identifier and the at least one second folder identifier.
[0008] In a sixth aspect of this disclosure, an apparatus for data querying is provided. The apparatus includes: a data source determination module configured to determine a target data source for a question-and-answer plugin used by a digital assistant based on a first configuration operation by a user; a request receiving module configured to receive a data query request from a user during an interaction between the user and the digital assistant; and a result presentation module configured to present the query results of the digital assistant to the user, wherein the query results are obtained by the digital assistant using the question-and-answer plugin to match the data query request with the target data source.
[0009] In a seventh aspect of this disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit. When executed by the at least one processing unit, the instructions cause the device to perform the methods of the first aspect, the second aspect, and / or the third aspect.
[0010] In an eighth aspect of this disclosure, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program that can be executed by a processor to implement the method of the first aspect, the method of the second aspect, and / or the method of the third aspect.
[0011] It should be understood that the description in this section is not intended to limit the key or essential features of the embodiments of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0012] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:
[0013] Figure 1 A schematic diagram of an example environment in which embodiments of the present disclosure can be implemented is shown;
[0014] Figures 2A to 2C A schematic diagram of an example user interface for data querying based on a digital assistant according to some embodiments of the present disclosure is shown;
[0015] Figure 3 A schematic diagram illustrating an example of a data entity storage hierarchy in a data source according to some embodiments of the present disclosure is shown;
[0016] Figure 4 A schematic diagram illustrating example mappings between different indexes and data entities according to some embodiments of this disclosure is shown;
[0017] Figure 5A A flowchart of a data query process according to some embodiments of the present disclosure is shown;
[0018] Figure 5B A flowchart of a process for data querying according to other embodiments of the present disclosure is shown;
[0019] Figure 5C A flowchart of a process for data querying according to further embodiments of the present disclosure is shown;
[0020] Figure 6A A block diagram of an apparatus for data querying according to some embodiments of the present disclosure is shown;
[0021] Figure 6B A block diagram of an apparatus for data querying according to other embodiments of the present disclosure is shown;
[0022] Figure 6C A block diagram of an apparatus for data querying according to further embodiments of the present disclosure is shown; and Figure 7 A block diagram of an electronic device in which one or more embodiments of the present disclosure may be implemented is shown. Detailed Implementation
[0023] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0024] In the description of embodiments of this disclosure, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.
[0025] In this document, unless explicitly stated otherwise, performing a step in response to A does not mean that the step is performed immediately after A, but may include one or more intermediate steps.
[0026] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition, use, storage or deletion of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0027] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, relevant users should be informed of the type, scope of use, and usage scenarios of the information involved in this disclosure through appropriate means in accordance with relevant laws and regulations, and authorization from relevant users should be obtained. Among them, relevant users may include any type of rights holder, such as individuals, enterprises, and groups.
[0028] For example, in response to receiving an active request from a user, a prompt message is sent to the relevant user to clearly inform the user that the requested operation will require obtaining and using the user's information, thereby enabling the relevant user to choose whether to provide information to the software or hardware such as the electronic device, application, server, or storage medium that performs the operation of the technical solution disclosed herein based on the prompt message.
[0029] As an optional but non-restrictive implementation, in response to a user's active request, a prompt message can be sent to the user, such as a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide information to the electronic device.
[0030] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0031] Figure 1 A schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented is shown. In this example environment 100, a digital assistant 120 and an application 125 are installed on a terminal device 110. A user 140 can interact with the digital assistant 120 and the application 125 via the terminal device 110 and / or an attachment device to the terminal device 110.
[0032] In some embodiments, the digital assistant 120 and application 125 can be downloaded and installed on the terminal device 110. In some embodiments, the digital assistant 120 and application 125 can also be accessed in other ways, such as through a web page. Figure 1 In environment 100, in response to application 125 being launched, terminal device 110 can present the interface 150 of digital assistant 120 and application 125.
[0033] Applications 125 include, but are not limited to, one or more of the following: chat applications (also known as instant messaging applications), document applications, audio and video conferencing applications, email applications, task applications, calendar applications, goal and key results (OKR) applications, etc. Although Figure 1 The image shows a single application, but in reality, multiple applications can be installed on the terminal device 110. In some embodiments, application 125 may include a multi-functional collaboration platform, such as an office collaboration platform (also known as an office suite), which can provide integration of various types of applications or components to facilitate people's office work, communication, and other activities. In a multi-functional collaboration platform, people can launch different applications or components as needed to complete corresponding information processing, sharing, communication, etc.
[0034] Application 125 can provide data entity 126. Data entity 126 can be a content instance created by user 140 or other users on application 125. For example, depending on the data types supported by application 125, data entity 126 can be a document (e.g., a Word document, a PDF document, a presentation, a spreadsheet document, etc.), an email, a message (e.g., a conversation message on an instant messaging application), a calendar, a schedule, a task, audio, video, an image, etc.
[0035] In some embodiments, the digital assistant 120 may be provided by a standalone application or may be integrated into an application 120 capable of providing data entities. The application providing the client interface for the digital assistant may correspond to a single-function application or a multi-functional collaboration platform, such as an office suite or other collaboration platform capable of integrating multiple components. In some embodiments, the digital assistant 120 supports the use of plugins. Each plugin can provide one or more functions of the application. Such plugins include, but are not limited to, one or more of the following: search plugins, contact plugins, messaging plugins, document plugins, form plugins, email plugins, calendar plugins, schedule plugins, task plugins, etc.
[0036] Digital assistant 120 is a user's intelligent assistant, possessing intelligent dialogue and information processing capabilities. In embodiments of this disclosure, digital assistant 120 is used to interact with user 140 to assist user 140 in using terminal devices or applications. An interaction window with digital assistant 120 can be presented in the client interface. In the interaction window, user 140 can converse with digital assistant 120 by inputting natural language to instruct digital assistant to assist in completing various tasks, including operations on data entity 126.
[0037] In some embodiments, the digital assistant 120 may be included as a contact of user 140 in the current user 140's contact list in the application, or in the message stream of a chat component. In some embodiments, the digital assistant 120 may be a personal digital assistant specific to the current user 140, or it may be a generic digital assistant.
[0038] In some embodiments, multiple interaction modes can be provided for the user 140 and the digital assistant 120, and the user can flexibly switch between these modes. When a certain interaction mode is triggered, a corresponding interaction area is presented to facilitate interaction between the user 140 and the digital assistant 120. The interaction methods between the user 140 and the digital assistant 120 differ under different interaction modes, thus flexibly adapting to the interaction needs of different application scenarios.
[0039] In some embodiments, information processing services specific to user 140 can be provided based on historical interaction information between user 140 and digital assistant 120 and / or data ranges specific to user 140. In some embodiments, historical interaction information of user 140 interacting with digital assistant 120 in multiple interaction modes can all be associated with user 140 and stored. Thus, in one of the multiple interaction modes (any or a specified interaction mode), digital assistant 120 can provide services to user 140 based on the historical interaction information associated with user 140 stored therein.
[0040] Digital Assistant 120 can assist users in using terminal devices or applications. Some applications can provide integration functionality for different plugins. In addition to free conversation with the digital assistant, users can also use natural language commands to enable the digital assistant to perform more complex application-related business operations using different plugins, such as searching data, creating documents, scheduling appointments, and creating tasks.
[0041] Digital assistant 120 can be invoked or activated by an appropriate means (e.g., shortcut keys, buttons, or voice) to present an interaction window with user 140. The interaction window with digital assistant 120 can be opened by selecting digital assistant 1201. The interaction window may include interface elements for information interaction, such as input boxes, message lists, message bubbles, etc. In other embodiments, digital assistant 120 can be invoked through entry controls or menus provided on the page, or by inputting preset commands. In some embodiments described below, for ease of discussion, a session window is used as the example for illustrating the interaction window between the user and the digital assistant.
[0042] In some embodiments, terminal device 110 communicates with server 130 to provide services to digital assistant 120 and application 125. Terminal device 110 can be any type of mobile terminal, fixed terminal, or portable terminal, including mobile phones, desktop computers, laptop computers, notebook computers, netbook computers, tablet computers, media computers, multimedia tablets, personal communication system (PCS) devices, personal navigation devices, personal digital assistants (PDAs), audio / video players, digital cameras / camcorders, television receivers, radio receivers, e-book devices, gaming devices, or any combination thereof, including accessories and peripherals of these devices or any combination thereof. In some embodiments, terminal device 110 can also support any type of user-facing interface (such as "wearable" circuitry). Application 130 can be various types of computing systems / servers capable of providing computing power, including but not limited to mainframes, edge computing nodes, computing devices in cloud environments, etc.
[0043] It should be understood that the structure and function of the various elements in environment 100 are described for illustrative purposes only and do not imply any limitation on the scope of this disclosure.
[0044] In data search applications, the information of the data entities the user expects to search for is typically determined based on user input, such as the identifiers of one or more data entities within the data source. To improve data filtering efficiency, index information is built for each data entity in the data source. Separate index information can be built for different data sources, enabling filtering across different data sources. Within the same data source, finer-grained index information can also be built to achieve fast searches at different granularities. For example, within a data source, index fields can be built at the data entity level to achieve data filtering by data entity. Furthermore, index information can be built based on the parent node of a data entity, such as including the folder where the data entity resides, enabling data filtering by folder. The way index information is built affects data filtering efficiency and the storage space of the index information. Therefore, more efficient data query methods are needed.
[0045] In digital assistant-based interactions, users can also ask and answer data-related questions. Users can input questions into the digital assistant, which will automatically determine and present the answers. This allows users to obtain desired responses through natural language input within the interaction window. In data search scenarios, there is also a desire to leverage digital assistants to complete data queries through question-and-answer formats. How to achieve more efficient data filtering in such question-and-answer scenarios is also a key concern.
[0046] According to embodiments of this disclosure, an improved scheme for data querying is proposed. In some embodiments of this disclosure, during user-digital assistant interaction, a user's data query request is received, the data query request indicating a data identifier to be queried; a set of data entities that the user has permissions to access is determined from a target data source accessible to the digital assistant; based on index information of the target data source, at least one data entity matching the data identifier is filtered from the data entity set; and the determined at least one data entity is presented to the user. In this scheme, an accessible data source can be provided to the digital assistant, allowing the user to construct question-and-answer data sources on demand, enabling the user to construct more targeted question-and-answer interactions and improve the quality of question-and-answer interactions.
[0047] In some embodiments of this disclosure, a data query request for a target data source is received, the data query request indicating a first entity identifier to be queried; multiple mapping functions are used to map the first entity identifier to multiple first indices, each mapping function mapping multiple different entity identifiers to the same index; based on the multiple first indices and the index information of data entities in the target data source, multiple sets of first data entities that match the multiple first indices are filtered out from the target data source, the index information of each set of data entities matches one of the multiple first indices; and a query result for the data query request is determined from the intersection of the multiple sets of first data entities, the query result indicating at least a portion of the data entities included in the intersection. By using many-to-one mapping functions to map a large number of entity identifiers in the data source to a small number of index values, the limitation of enumerating the index field values can be bypassed. Furthermore, by cleverly utilizing the mapping of multiple such mapping functions, data entities that do not match the user query can be filtered out from the intersection of different indices, providing accurate data query results.
[0048] In some embodiments of this disclosure, a data query request for a target data source is received, the data query request indicating a first folder identifier to be queried; in response to determining that the first folder identified by the first folder identifier has subfolders, at least one second folder identifier of at least one subfolder within the first folder is obtained based on the first folder identifier; and based on the index information of data entities in the target data source, multiple data entities matching the first folder identifier and at least one second folder identifier are filtered out from the target data source, the index information of each data entity including at least a folder field, the folder field indicating one of the first folder identifier and at least one second folder identifier. Thus, for data sources with many deep folder hierarchies, it is not necessary to store the index information corresponding to all folders containing each data entity separately, greatly reducing storage space. Simultaneously, during data filtering, obtaining a list of all subfolders at a certain time cost allows for easy filtering of data entities within folders.
[0049] Some exemplary embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0050] Figures 2A to 2C A schematic diagram of an example user interface for data querying based on a digital assistant according to some embodiments of the present disclosure is shown. Figures 2A to 2C The client interface shown can be implemented on terminal device 110. See below for reference. Figure 1 describe Figures 2A to 2C Examples. It should be noted that the operations performed by the aforementioned terminal device 110, as well as the operations performed by the terminal device 110 as described below, can be specifically performed using relevant applications installed on the terminal device 110.
[0051] In some embodiments, in response to a user (e.g., user 140) activating a digital assistant through a preset operation (e.g., selecting a digital assistant from a contact list), terminal device 110 may display a session window for user interaction with the digital assistant, as well as a plugin selection control. Through this plugin selection control, the user can select the plugin to use in the main session window. Figure 2A As shown, the digital assistant (represented as "XX Assistant" in the figure) and the user's main conversation window are presented in area 210 of interface 201. The digital assistant can be considered one of the user's contacts and is presented in the instant messaging application's message stream. The instant messaging application is presented in area 230 of interface 201, and the message stream is presented in area 220 of interface 201. The user selects the digital assistant in the instant messaging application, thereby entering the main conversation window. The main conversation window includes a plugin selection control 212. The user can select the plugin to use in the conversation window by clicking the plugin selection control 212.
[0052] In some embodiments, in response to detecting a selection operation (e.g., a click) on the plug-in selection control 212, the terminal device 110 may present a plug-in selection panel 214. The plug-in selection panel 214 includes at least one selectable plug-in, such as a question-and-answer plug-in. Users can interact with the digital assistant as needed. For example, if a user wishes to perform a data query with the digital assistant, they can select a question-and-answer plug-in.
[0053] In some embodiments, if a user intends to query data, the user can enable the digital assistant to answer user questions by selecting a question-and-answer plugin while chatting with the digital assistant. For example... Figure 2B As shown, in interacting with the digital assistant, users can select document plugin 240 to engage in conversation. Of course, it should be understood that... Figure 2A and Figure 2B The plugin selection process shown is just an example. When interacting with the digital assistant, you can skip the selection step of the question-and-answer plugin and instead default to having the question-and-answer capabilities corresponding to the plugin.
[0054] The knowledge-based question-answering process mainly consists of two parts: search vector retrieval and model-generated answers. During the interaction between the user and the digital assistant, the terminal device 110 receives the user's data query request, which indicates the data identifier to be queried. In some embodiments, the user can input the data query request in various ways, explicitly indicating the query target, such as the name of the data entity to be queried, access links, or keywords. After receiving the user input, the digital assistant 120 can use a model to determine the user's intent and thus determine the data identifier the user expects to query. This data identifier may include, for example, entity identifiers of one or more data entities, meaning the user expects to find one or more specific data entities. An entity identifier refers to an identifier that identifies a data entity in a data source, such as a document identifier (Doc ID). In some embodiments, the data identifier in the data query request may also include a folder identifier to be queried, meaning the user expects to find all data entities under a specific folder. A folder identifier is used to identify a folder in the data source.
[0055] After determining the query target, i.e., the data identifier to be queried, from the data query request, the digital assistant 120 can use a question-and-answer plugin or question-and-answer capability to filter out at least one data entity from the target data source that matches the data identifier to be queried, and present the determined at least one data entity to the user. For example, in Figure 2B In the example, the user enters message 242 in the conversation window with the digital assistant to request a search for "documents under Item X". Depending on the data source used, the digital assistant 120 can identify documents whose document keywords involve "Item X" and use the entity identifiers of these documents to filter the corresponding documents from the data source. The digital assistant 120 lists the filtered documents in message 244.
[0056] In embodiments of this disclosure, in a question-and-answer scenario between a user and a digital assistant, the digital assistant is configured with an accessible data source to enable user-specific data queries. In some embodiments, one of the necessary tools for a question-and-answer plugin includes a data source. This data source may include, for example, the data that the user expects the digital assistant to perform question-and-answer operations. For instance, for employees in an enterprise, the data source in the question-and-answer plugin may include information from various aspects such as internal rules and regulations, operational processes, and business records. The data source can be in any format, including offline documents, online documents, knowledge spaces, frequently asked questions (FAQ) documents, and documents in various formats (e.g., PDF, Word, PPT, etc.).
[0057] In some embodiments, the target data source accessible to the digital assistant is configured to be accessible by a question-and-answer plugin used by the digital assistant to enable users to query and answer data. For example, a data source containing desired knowledge information can be provided to the digital assistant. Thus, users can directly ask the digital assistant various questions, and the digital assistant can use the question-and-answer plugin to provide answers based on the knowledge information included in the data source, which can greatly improve the efficiency of question-and-answer scenarios.
[0058] In some embodiments, users can define the target data source to be used each time the question-and-answer plugin is used. During the interaction with the digital assistant, the system can receive the user's initial configuration operation. Based on the user's initial configuration operation, the target data source for the question-and-answer plugin used by the digital assistant is determined. Figure 2C As shown, in the configuration interface 202 of the digital assistant's question-and-answer plugin, a data source selection box 250 can be provided so that the user can select the target data source that the digital assistant or question-and-answer plugin can access in this interface.
[0059] Then, during the interaction between the user and the digital assistant, the system receives the user's data query request and presents the digital assistant's query results to the user. The query results are obtained by the digital assistant using a question-and-answer plugin to match the data query request with the target data source.
[0060] In some embodiments, users can also configure online data sources as target data sources. For example, the configured target data source may include one or more online documents. This way, as the documents are updated online, the question-and-answer plugin can always determine the query results for the user based on the latest document content.
[0061] In some embodiments, additionally, the selection of some data sources to be used for question answering can also be completed during the configuration phase of the question answering plugin, for example, by the creator of the question answering plugin.
[0062] In some embodiments, for data security purposes, when determining the result of a data query request, a set of data entities that the user has permission to access is determined from the target data source accessible to the digital assistant, and at least one data entity that matches the data identifier is filtered from the set of data entities based on the index information of the target data source.
[0063] When configuring the data source to be used, user permissions must also be considered. Data entities that allow users to query and present to them are data entities that users have permissions to access. These permissions can be read permissions, query permissions, etc.
[0064] Once the target data source for the query is determined, and the set of data entities for which the user has permissions can be identified, the system can further filter the data entity set based on the index information built for that set, using data identifiers to filter at least one data entity that matches the data identifier. For example, data identifiers can be mapped to corresponding indexes using the same indexing method, and data filters can be used to locate the corresponding indexes from the data entity set, then filter out the data entities pointed to by those indexes.
[0065] In some embodiments, separate index information can be built for different data sources, thereby enabling data filtering across different data sources. In some embodiments, within the same data source, data entities are stored at specific levels, thus allowing the construction of index information at different granularities within the data source. Depending on how the index information is constructed within the data source, the granularity of filtering supported by the data source may vary.
[0066] Figure 3 A schematic diagram illustrating an example of a storage hierarchy 300 for data entities in a data source according to some embodiments of the present disclosure is shown. In this example, it is assumed that the data source is a document library. As shown, in storage hierarchy 300, the highest-level root folder has a folder identifier "Folder_A", under which one or more folders (also called subfolders) and / or one or more documents can be stored, identified by folder identifiers "Folder_B" and "Folder_C" and document identifier "Doc_1", respectively. Similarly, each folder can continue to store its own subfolders and / or documents, and so on. Note that although the term "folder" is used herein, the terms "directory", "node", "space", "library", etc., may also be used in the definition of different data sources to represent a collection capable of storing multiple lower-level data entities. Figure 3 This is just one example of a storage hierarchy; in real-world applications, there may be more and more complex storage hierarchies.
[0067] In a hierarchically stored data source, for each individual data entity, entity-level index information can be stored when constructing the index. Specifically, a field can be defined to store the index (or index value) corresponding to the entity identifier of each data entity. This allows for data retrieval at the entity level during data queries. For example, by setting the filter condition Doc_ID = Doc_1, Doc_2, documents with the corresponding identifiers can be retrieved based on the index information. In some cases, it may be desirable to support even coarser-grained data retrieval, such as folder-level retrieval, to retrieve all data entities under a specific folder at once. To implement indexes of different granularities, the corresponding granularity needs to be stored as a field in the index information, and the field-based filtering capability provided by the data filter can be used to retrieve all data entities under the corresponding granularity. For example, to support folder-level retrieval, a separate index corresponding to the folder identifier needs to be defined for each data entity in all information.
[0068] However, current indexing methods have some problems. First, the enumeration values of the indexed fields supported by filters all have an upper limit. For example, a filter supporting 64-bit integer (int64) fields requires that the enumeration value of a single field cannot exceed 20 million. However, as data grows, the number of data entities or higher-level storage entities in a single data source may exceed this upper limit. If the data source is directly stored as an index field (e.g., the identifier of a data entity or the identifier of its higher-level storage entity), it will be impossible to put all data entities or higher-level storage entities directly into a single index field. The current practice is to shard the index of data entities. For example, if a data source has 200 million+ documents, then 12 shards are needed, and each shard can have an index field of less than 20 million documents. However, this approach cannot handle the problem of a continuously increasing number of documents; more and more index shards not only consume more storage space but also reduce indexing efficiency because each index shard needs to be filtered individually to determine the final result.
[0069] Second, if the data source has too many storage levels, a large number of index fields may need to be configured to support indexes of different granularities for a single data entity. For example, in Figure 3In the example, for the document with the document identifier "Doc_5", in addition to the index field corresponding to the document identifier, three additional folder fields need to be stored. These fields store the folder identifier "Folder_D" corresponding to the folder containing "Doc_5", the parent folder "Folder_B" containing "Folder_D", and the parent folder "Folder_A" containing "Folder_B". This allows for direct filtering of all documents within the corresponding folder when querying "Folder_A", "Folder_B", or "Folder_D". Similarly, for the document "Doc_2", two additional file fields need to be stored: the folder identifier "Folder_B" corresponding to the folder containing "Doc_2" and the parent folder "Folder_A" containing "Folder_B".
[0070] In fact, Figure 3 This is just a simple storage level. In a real data source, some data entities may have as many as 100 or more parent folders. Considering the number of data entities, storing these fields will significantly increase the index's memory usage. On the other hand, during queries, there is also an upper limit to the number of enumerated values that a single filter can support (e.g., 5000), otherwise query efficiency will be greatly reduced. Therefore, if you directly use the field-by-field filtering capability provided by the data source filter itself, you will not be able to complete the filtering at the granular level above the data entity level.
[0071] In some embodiments of this disclosure, to address the issue of an upper limit on the enumeration values of the index field, a method is proposed to construct the index corresponding to the entity identifier using multiple many-to-one mapping functions, instead of directly using the entity identifier as the index. Specifically, for a data entity in the target data source, multiple mapping functions are used to map the entity identifier of the data entity to multiple indexes. Each mapping function maps multiple different entity identifiers to the same index. In this way, multiple data entities identified by multiple different entity identifiers can be indexed using the same index (index value). Thus, the multiple indexes obtained through multiple mapping functions are stored in multiple index fields (sometimes also called "entity fields") of the data entity as index information for the data entity.
[0072] In some embodiments, the multiple mapping functions can be multiple different hash functions. In some embodiments, two different mapping functions, such as two different hash functions, can be selected to perform the mapping. For example, the document identifier Doc_x of a document can be hashed into two indices G(Doc_x) and H(Doc_x) using two hash functions G() and H() respectively, and then the two indices G(Doc_x) and H(Doc_x) can be stored in two index fields G and H respectively.
[0073] Since the mapping function performs a many-to-one mapping, the number of indexes obtained after a single mapping function is much smaller than the number of data entities in the target data source, and therefore will not exceed the upper limit of the enumeration value of the index field.
[0074] Figure 4 A schematic diagram illustrating an example mapping 400 between different indexes and data entities according to some embodiments of the present disclosure is shown. As shown, document identifiers “Doc_1”, “Doc_3”, and “Doc_5” are hashed to the same index IndexG_1 by hash function G(), document identifiers “Doc_2”, “Doc_4”, and “Doc_6” are hashed to another index IndexG_2 by hash function G(), and so on. Thus, N document identifiers are mapped by hash function G() to M indices stored under index field G. Furthermore, document identifiers “Doc_1”, “Doc_4”, and “Doc_6” are hashed to the same index IndexH_1 by hash function H(), document identifiers “Doc_2”, “Doc_5”, and “Doc_7” are hashed to another index IndexH_2 by hash function H(), and so on. Thus, N document identifiers are mapped by hash function H() to K indices stored under index field K.
[0075] In some embodiments, when selecting a mapping function, the range of values for each selected mapping function (e.g., a hash function) can be determined based on the upper limit of the enumeration values of the index field of the data entity in the target data source. For example, if the upper limit of the enumeration values of the index field is 10 million, then when performing mapping on the target data source, the range of values for hash functions G() and H() should not exceed 10 million. This allows all indexes corresponding to each hash function to be stored in a single index field without the need for index sharding.
[0076] After constructing and storing index information at the data entity granularity level, data queries at the data entity granularity level of the target data source can be supported. Terminal device 110 receives a data query request for the target data source, the data query request indicating the first entity identifier to be queried. For example, a user can initiate a data query request through interaction with digital assistant 120. By analyzing the user input, one or more data entities at the data entity granularity level that need to be queried can be determined, each data entity being identified by a corresponding entity identifier.
[0077] Terminal device 110 uses multiple mapping functions to map the first entity identifier to be queried to multiple first indices. The multiple mapping functions used here are the same as those used when constructing the index information, such as two hash functions G() and H(). In some embodiments, if the data query request also indicates a second entity identifier of a second data entity to be queried, then terminal device 110 continues to use multiple mapping functions to map the second entity identifier of the second data entity to multiple second indices. For example, if the user specifies document identifiers Doc_ID:{Doc_1,Doc_2,….,Doc_2000} for 2000 documents, then the index g = {G(Doc_1),G(Doc_2),….,G(Doc_2000)} corresponding to hash function G() and the index h = {H(Doc_1),H(Doc_2),….,H(Doc_2000)} corresponding to hash function H() can be obtained.
[0078] Then, based on the index information of data entities in the target data source and multiple first indexes, the terminal device 110 filters out multiple sets of first data entities from the target data source that match the multiple first indexes respectively. For example, in Figure 4 In the first set of documents, using the index G(Doc_1) = IndexG_1 corresponding to Doc_1, three documents can be filtered out: Doc_1, Doc_3, and Doc_5. Similarly, using the index H(Doc_1) = IndexH_1 corresponding to Doc_1, three documents can be filtered out: Doc_1, Doc_4, and Doc_6. Further, the terminal device 110 determines the query result for the data query request from the intersection of multiple sets of first data entities. The query result indicates at least a portion of the data entities included in the intersection. For example, taking the intersection of the first set of documents Doc_1, Doc_3, and Doc_5 and the second set of documents Doc_1, Doc_4, and Doc_6 yields document Doc_1.
[0079] If another entity identifier exists, terminal device 110 can filter out multiple sets of second data entities that match multiple second indexes from the target data source, with the index information of each set of second data entities matching one of the multiple second indexes. Then, terminal device 110 determines the query result for the data query request from the intersection of the multiple sets of first data entities and the intersection of the multiple sets of second data entities, with the query result indicating at least a portion of the data entities included in the intersection.
[0080] For document identifier Doc_2, using the index G(Doc_2) = IndexG_2 corresponding to Doc_2, three documents can be filtered out: Doc_2, Doc_4, and Doc_6; using the index H(Doc_2) = IndexH_2 corresponding to Doc_2, three more documents can be filtered out: Doc_2, Doc_5, and Doc_7. Taking the intersection of these three indexes yields document Doc_2. Therefore, documents Doc_1 and Doc_2 are determined as the query results.
[0081] Notice, Figure 4 This provides a simple example. In some practical applications, the intersection might yield some redundant data entities that do not match the entity identifier being queried. In such cases, filtering can be performed by the index field of the data entity, followed by a subsequent filtering process to remove irrelevant data entities.
[0082] In some embodiments, a further improvement is proposed to address the problem of having too many storage levels, resulting in the need to build and store too many index fields to support indexes of different granularities. Specifically, for each data entity in the target data source, in addition to creating an entity field to store the entity identifier of the data entity and the corresponding index (to support filtering at the data entity granularity), a single folder field (represented as parent_folder) is also created and stored for each data entity to store the folder identifier (or the index mapped from the folder identifier) that directly includes the parent folder of the current data entity.
[0083] In other words, for each data entity, only a maximum of two types of index fields need to be constructed: one type stores the index at the data entity level, and the other stores the index corresponding to the direct parent folder. The latter type of index field can be used to support data filtering at different granularities. If a data entity's parent folder is also included in a higher-level parent folder, then the folder identifier of the higher-level parent folder will not be stored in the folder field. (Continuing with...) Figure 3 Taking storage level 300 as an example. For each document, in addition to the index field corresponding to the document identifier, for document Doc_5, only the folder identifier "Folder_D" needs to be stored in the folder field parent_folder; for document Doc_2, only the folder identifier "Folder_B" needs to be stored in the folder field parent_folder; for document Doc_3, only the folder identifier "Folder_C" needs to be stored in the folder field parent_folder, and so on. For document Doc_1, only the folder identifier "Folder_A" needs to be stored in the folder field parent_folder.
[0084] After the index information is constructed and stored, data queries at various granularities of the target data source can be supported. Specifically, if the data query request received by terminal device 110 indicates a first folder identifier to be queried, terminal device 110 can determine whether the first folder identified by the first folder identifier includes subfolders. Terminal device 110 can obtain at least one second folder identifier of at least one subfolder within the first folder based on the first folder identifier. Terminal device 110 can obtain the IDs of all folders, including the first folder, through an interface, denoted as f_IDs.
[0085] Then, based on the index information of the data entities in the target data source, terminal device 110 filters out multiple data entities from the target data source that match the first folder identifier and at least one second folder identifier. For example, terminal device 110 can obtain data entities included in the folder identified by the first folder identifier and at least one second folder identifier from the target data source. In some examples, terminal device 110 can set the filter condition parent_folder = f_IDs, and then obtain all documents under the folder identified by f_IDs. The folder field corresponding to these documents will indicate a folder identifier in f_IDs.
[0086] exist Figure 4 In the example, assuming the data query request includes the folder identifier Folder_B, then all subfolders under Folder_B, namely Folder_D and Folder_F, can be obtained based on the storage hierarchy information. Since the parent_folder field of each document records the parent folder where the document resides, matching folder identifiers with folder fields can retrieve matching documents. For example, since the parent_folder field of document Doc_2 matches the folder identifier Folder_B, document Doc_2 under that folder can be obtained; since the parent_folder field of document Doc_5 matches the folder identifier Folder_D, document Doc_5 under that folder can be obtained. If there are documents under Folder_F, they can be obtained in a similar way.
[0087] While retrieving the list of all subfolders requires some time during filtering, the above solution only needs to store a single field, `parent_folder`, in the index information to support more granular data filtering, which significantly reduces storage space. Furthermore, since the number of subfolders within each folder is relatively small compared to the number of documents (likely less than 5000), the above solution can handle situations where the number of folders exceeds the maximum value of a single filter enumeration (e.g., 5000).
[0088] The embodiments described above for constructing index information using multiple many-to-one mapping functions and / or for first retrieving folder identifiers and then filtering all data entities under a folder can be used individually or in combination. Furthermore, the embodiments described above for constructing index information using multiple many-to-one mapping functions and / or for first retrieving folder identifiers and then filtering all data entities under a folder can be combined. Figures 2A to 2C In the example of question-and-answer data query based on digital assistants, it can also be applied in data query scenarios unrelated to digital assistants.
[0089] It should be understood that some embodiments of this disclosure have been described above with reference to specific examples in the accompanying drawings, but these specific examples are not intended to limit the scope of the embodiments of this disclosure. The described embodiments can also be implemented in various other variations.
[0090] Figure 5A A flowchart of a data query process 500 according to some embodiments of the present disclosure is shown. Process 500 can be implemented at terminal device 110. For ease of discussion, reference will be made to... Figure 1 The environment 100 describes the process 500.
[0091] In box 510, terminal device 110 receives a data query request for a target data source, the data query request indicating a first entity identifier to be queried.
[0092] In box 520, terminal device 110 uses multiple mapping functions to map a first entity identifier to multiple first indices, with each mapping function mapping multiple different entity identifiers to the same index.
[0093] In box 530, terminal device 110 filters out multiple sets of first data entities that match the multiple first indexes from the target data source based on the index information of the data entities in the multiple first indexes, and the index information of each set of data entities matches one of the multiple first indexes.
[0094] In box 540, terminal device 110 determines the query result for a data query request from the intersection of multiple sets of first data entities, the query result indicating at least a portion of the data entities included in the intersection.
[0095] In some embodiments, process 500 further includes: for a data entity in a target data source, using multiple mapping functions to map the entity identifier of the data entity into multiple indexes; and storing the multiple indexes in multiple index fields of the data entity respectively, as index information of the data entity.
[0096] In some embodiments, the plurality of mapping functions includes two different mapping functions.
[0097] In some embodiments, the multiple mapping functions include multiple hash functions, and the value range of each hash function is determined based on the upper limit of the enumeration value of the index field of the data entity in the target data source.
[0098] In some embodiments, the data query request further indicates a second entity identifier of the second data entity to be queried, and determining the query result for the data query request further includes: mapping the second entity identifier of the second data entity to a plurality of second indexes using a plurality of mapping functions respectively; filtering out a plurality of sets of second data entities that match the plurality of second indexes respectively from the target data source, wherein the index information of each set of second data entities matches one of the plurality of second indexes; and determining the query result for the data query request from the intersection of the plurality of first data entities and the intersection of the plurality of second data entities, wherein the query result indicates at least a portion of the data entities included in the intersection.
[0099] In some embodiments, the data entities in the target data source include documents.
[0100] Figure 5B A flowchart of a process 502 for data querying according to some embodiments of the present disclosure is shown. Process 502 can be implemented at terminal device 110. For ease of discussion, reference will be made to... Figure 1 The environment 100 describes the process 502.
[0101] In box 512, terminal device 110 receives a data query request for a target data source, the data query request indicating a first folder identifier to be queried.
[0102] In box 522, in response to determining that the first folder identified by the first folder identifier has subfolders, the terminal device 110 obtains at least one second folder identifier of at least one subfolder within the first folder based on the first folder identifier.
[0103] In box 532, terminal device 110 filters out multiple data entities from the target data source that match a first folder identifier and at least one second folder identifier based on the index information of the data entities in the target data source. The index information of each data entity includes at least a folder field, which indicates one of the first folder identifier and at least one second folder identifier.
[0104] In some embodiments, process 502 further includes: for a first data entity in the target data source, creating index information for the first data entity, the index information including at least a folder field; and storing a folder identifier that directly includes the parent folder of the first data entity in the folder field of the index information.
[0105] In some embodiments, the parent folder of the first data entity is also included in another parent folder, and the folder identifier of the other parent folder is not stored in the folder field.
[0106] In some embodiments, process 502 further includes storing the index corresponding to the entity identifier of the first data entity in the entity field of the index information.
[0107] In some embodiments, filtering multiple data entities from a target data source includes: obtaining data entities from the target data source that are included in a folder identified by a first folder identifier and at least one second folder identifier.
[0108] Figure 5C A flowchart of a data query process 504 according to some embodiments of the present disclosure is shown. Process 504 can be implemented at terminal device 110. For ease of discussion, reference will be made to... Figure 1 The environment 100 describes the process 504.
[0109] In box 514, terminal device 110 determines the target data source for the question-and-answer plugin used by the digital assistant based on the user's first configuration operation.
[0110] In box 524, terminal device 110 receives data query requests from users during user-digital assistant interactions.
[0111] In box 534, terminal device 110 presents the query results of the digital assistant to the user, wherein the query results are obtained by the digital assistant using a question-and-answer plugin to match the data query request with the target data source.
[0112] In some embodiments, the target data source includes one or more online documents.
[0113] In some embodiments, a data query request indicates a data identifier to be queried, and the query result is obtained by: determining a set of data entities that the user has permissions to from a target data source; filtering at least one data entity from the set of data entities that matches the data identifier based on index information of the target data source; and presenting the determined at least one data entity to the user.
[0114] In some embodiments, the data identifier includes: an entity identifier or a folder identifier to be queried.
[0115] In some embodiments, filtering at least one data entity that matches a data identifier from a set of data entities includes: using the data identifier to filter at least one data entity that matches a data identifier from a set of data entities based on index information constructed for the set of data entities.
[0116] Figure 6A A schematic structural block diagram of a data query apparatus 600 according to some embodiments of the present disclosure is shown. Apparatus 600 may be implemented as or included in terminal device 110. Various modules / components in apparatus 600 may be implemented by hardware, software, firmware, or any combination thereof.
[0117] The apparatus 600 includes a request receiving module 610 configured to receive a data query request for a target data source, the data query request indicating a first entity identifier to be queried.
[0118] The device 600 also includes an index mapping module 620, which is configured to use multiple mapping functions to map the first entity identifier to multiple first indices respectively, wherein each mapping function maps multiple different entity identifiers to the same index.
[0119] The device 600 also includes a data filtering module 630, configured to filter out multiple sets of first data entities that match the multiple first indexes respectively from the target data source based on the multiple first indexes and the index information of data entities in the target data source, wherein the index information of each set of data entities matches one of the multiple first indexes.
[0120] The apparatus 600 further includes a result determination module 640 configured to determine a query result for the data query request from the intersection of the plurality of first data entities, the query result indicating at least a portion of the data entities included in the intersection.
[0121] In some embodiments, the apparatus 600 further includes: an index mapping module configured to map the entity identifier of a data entity to multiple indexes using multiple mapping functions for a data entity in a target data source; and an index storage module configured to store the multiple indexes in multiple index fields of the data entity respectively, as index information of the data entity.
[0122] In some embodiments, the plurality of mapping functions includes two different mapping functions.
[0123] In some embodiments, the multiple mapping functions include multiple hash functions, and the value range of each hash function is determined based on the upper limit of the enumeration value of the index field of the data entity in the target data source.
[0124] In some embodiments, the data query request further indicates a second entity identifier of the second data entity to be queried. The result determination module 640 is further configured to: map the second entity identifier of the second data entity to a plurality of second indices using a plurality of mapping functions respectively; filter out a plurality of sets of second data entities that match the plurality of second indices respectively from the target data source, wherein the index information of each set of second data entities matches one of the plurality of second indices; and determine the query result for the data query request from the intersection of the plurality of first data entities and the intersection of the plurality of second data entities, wherein the query result indicates at least a portion of the data entities included in the intersection.
[0125] In some embodiments, the data entities in the target data source include documents.
[0126] Figure 6B A schematic structural block diagram of a data query apparatus 602 according to some embodiments of the present disclosure is shown. Apparatus 602 may be implemented as or included in terminal device 110. Various modules / components in apparatus 602 may be implemented by hardware, software, firmware, or any combination thereof.
[0127] The device 602 includes a request receiving module 612 configured to receive a data query request for a target data source, the data query request indicating a first folder identifier to be queried.
[0128] The device 602 further includes an identifier acquisition module 622, configured to acquire at least one second folder identifier of at least one subfolder within the first folder based on the first folder identifier in response to determining that the first folder identifier identified by the first folder identifier has subfolders.
[0129] The device 602 further includes a data filtering module 632, configured to filter out multiple data entities that match the first folder identifier and the at least one second folder identifier from the target data source based on the index information of the data entities in the target data source. The index information of each data entity includes at least a folder field, which indicates one of the first folder identifier and the at least one second folder identifier.
[0130] In some embodiments, the apparatus 602 further includes: an index creation module configured to create index information for a first data entity in a target data source, the index information including at least a folder field; and a folder index storage module configured to store a folder identifier that directly includes the parent folder of the first data entity in the folder field of the index information.
[0131] In some embodiments, the parent folder of the first data entity is also included in another parent folder, and the folder identifier of the other parent folder is not stored in the folder field.
[0132] In some embodiments, the apparatus 602 further includes an entity index storage module configured to store the index corresponding to the entity identifier of the first data entity in the entity field of the index information.
[0133] In some embodiments, the data filtering module 632 further includes: obtaining data entities from the target data source that are included in the folder identified by the first folder identifier and at least one second folder identifier.
[0134] Figure 6C A schematic structural block diagram of a data query apparatus 604 according to some embodiments of the present disclosure is shown. Apparatus 604 may be implemented as or included in terminal device 110. The various modules / components in apparatus 604 may be implemented by hardware, software, firmware, or any combination thereof.
[0135] The device 604 includes a data source determination module 614, configured to determine the target data source of the question-and-answer plugin used by the digital assistant based on a first configuration operation by the user.
[0136] The device 604 also includes a request receiving module 624, configured to receive data query requests from users during interactions between users and the digital assistant.
[0137] The device 604 also includes a result presentation module 634, configured to present the query results of the digital assistant to the user, wherein the query results are obtained by the digital assistant using a question-and-answer plugin to match the data query request with the target data source.
[0138] In some embodiments, the target data source includes one or more online documents.
[0139] In some embodiments, a data query request indicates a data identifier to be queried, and the query result is obtained by: determining a set of data entities that the user has permissions to from a target data source; filtering at least one data entity from the set of data entities that matches the data identifier based on index information of the target data source; and presenting the determined at least one data entity to the user.
[0140] In some embodiments, the data identifier includes: an entity identifier or a folder identifier to be queried.
[0141] In some embodiments, the data filtering module 634 is further configured to: filter at least one data entity from the data entity set that matches the data identifier based on index information constructed for the data entity set.
[0142] The units and / or modules included in devices 600, 602, and / or 604 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units and / or modules can be implemented using software and / or firmware, such as machine-executable instructions stored on a storage medium. In addition to or as an alternative to machine-executable instructions, some or all of the units and / or modules in devices 600, 602, and / or 604 can be implemented at least partially by one or more hardware logic components. By way of example and not limitation, exemplary types of hardware logic components that can be used include field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0143] It should be understood that one or more steps in the above methods can be performed by suitable electronic devices or combinations of electronic devices. Such electronic devices or combinations of electronic devices may include, for example, […]. Figure 1 The server 130, terminal device 110 and / or a combination of server 130 and terminal device 110.
[0144] Figure 7 A block diagram of an electronic device 700 in which one or more embodiments of the present disclosure may be implemented is shown. It should be understood that... Figure 7 The electronic device 700 shown is merely exemplary and should not be construed as limiting the functionality and scope of the embodiments described herein. Figure 7 The electronic device 700 shown can be used to achieve Figure 1 Terminal equipment 110 Figures 6A to 6CDevices 600, 602 and / or 604.
[0145] like Figure 7 As shown, electronic device 700 is in the form of a general-purpose electronic device. Components of electronic device 700 may include, but are not limited to, one or more processors or processing units 710, memory 720, storage device 730, one or more communication units 740, one or more input devices 750, and one or more output devices 760. Processing unit 710 may be a physical or virtual processor and is capable of performing various processes according to programs stored in memory 720. In a multiprocessor system, multiple processing units execute computer-executable instructions in parallel to improve the parallel processing capability of electronic device 700.
[0146] Electronic device 700 typically includes multiple computer storage media. Such media can be any available media accessible to electronic device 700, including but not limited to volatile and non-volatile media, removable and non-removable media. Memory 720 can be volatile memory (e.g., registers, cache, random access memory (RAM)), non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. Storage device 730 can be removable or non-removable media and can include machine-readable media, such as flash drives, disks, or any other media capable of storing information and / or data and accessible within electronic device 700.
[0147] Electronic device 700 may further include additional removable / non-removable, volatile / non-volatile storage media. Although not explicitly stated... Figure 7 As shown, disk drives for reading from or writing to removable, non-volatile disks (e.g., "floppy disks") and optical disk drives for reading from or writing to removable, non-volatile optical disks can be provided. In these cases, each drive can be connected to a bus (not shown) via one or more data media interfaces. Memory 720 may include computer program product 725 having one or more program modules configured to perform various methods or actions of various embodiments of this disclosure.
[0148] The communication unit 740 enables communication with other electronic devices via a communication medium. Additionally, the functionality of the components of the electronic device 700 can be implemented using a single computing cluster or multiple computing machines capable of communicating via communication connections. Therefore, the electronic device 700 can operate in a networked environment using logical connections to one or more other servers, network personal computers (PCs), or another network node.
[0149] Input device 750 can be one or more input devices, such as a mouse, keyboard, trackball, etc. Output device 760 can be one or more output devices, such as a monitor, speaker, printer, etc. Electronic device 700 can also communicate with one or more external devices (not shown) via communication unit 740 as needed. These external devices include storage devices, display devices, etc., and can communicate with one or more devices that enable user interaction with electronic device 700, or with any device that enables electronic device 700 to communicate with one or more other electronic devices (e.g., network card, modem, etc.). Such communication can be performed via input / output (I / O) interface (not shown).
[0150] According to an exemplary implementation of this disclosure, a computer-readable storage medium is provided that stores computer-executable instructions thereon, wherein the computer-executable instructions are executed by a processor to implement the methods described above. According to an exemplary implementation of this disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, which are executed by a processor to implement the methods described above.
[0151] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, devices, and computer program products implemented according to this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0152] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0153] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0154] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0155] Various implementations of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the various implementations disclosed herein.
Claims
1. A method for data query, comprising: receiving a data query request for a target data source, the data query request indicating a first entity identifier to be queried; mapping the first entity identifier into a plurality of first indexes respectively by a plurality of mapping functions, each mapping function mapping a plurality of different entity identifiers into a same index, wherein the plurality of mapping functions comprise a plurality of hash functions, and a value range of each hash function is determined based on an upper limit of enumeration values of an index field of data entities in the target data source; filtering a plurality of groups of first data entities respectively matching the plurality of first indexes from the target data source based on the plurality of first indexes and index information of data entities in the target data source, each group of data entities having index information matching one of the plurality of first indexes; and determining a query result for the data query request from an intersection of the plurality of groups of first data entities, the query result indicating at least a portion of data entities included in the intersection. 2.The method of claim 1, further comprising: for a data entity in the target data source, mapping an entity identifier of the data entity into a plurality of indexes by the plurality of mapping functions; and storing the plurality of indexes in a plurality of index fields of the data entity respectively as index information of the data entity, wherein the plurality of first indexes comprise a plurality of indexes in the plurality of index fields. 3.The method of claim 1 or 2, wherein the plurality of mapping functions comprise two different mapping functions. 4.The method of claim 1, wherein the data query request further indicates a second entity identifier of a second data entity to be queried, and wherein determining the query result for the data query request further comprises: mapping the second entity identifier of the second data entity into a plurality of second indexes respectively by the plurality of mapping functions; filtering a plurality of groups of second data entities respectively matching the plurality of second indexes from the target data source, each group of second data entities having index information matching one of the plurality of second indexes; and determining the query result for the data query request from an intersection of the plurality of groups of first data entities and an intersection of the plurality of groups of second data entities, the query result indicating at least a portion of data entities included in the intersection. 5.The method of claim 1, wherein the data entities in the target data source comprise documents. 6.A method for data query, comprising: receiving a data query request for a target data source, the data query request indicating a first folder identifier to be queried; in response to determining that a first folder identified by the first folder identifier has sub-folders, obtaining at least one second folder identifier of at least one sub-folder within the first folder based on the first folder identifier; and determining a query result for the data query request from an intersection of the plurality of groups of first data entities and an intersection of the plurality of groups of second data entities, the query result indicating at least a portion of data entities included in the intersection. filtering, from the target data source, a plurality of data entities matching the first folder identifier and the at least one second folder identifier, each data entity having index information including at least a folder field indicating one of the first folder identifier and the at least one second folder identifier, and the method further comprises: for a first data entity in the target data source, creating index information of the first data entity; storing a folder identifier directly including a parent folder of the first data entity in the folder field of the index information; and storing an index corresponding to an entity identifier of the first data entity in an entity field of the index information.
7. The method of claim 6, wherein the parent folder of the first data entity is further included in another parent folder, and a folder identifier of the another parent folder is not stored in the folder field.
8. The method of claim 6, wherein filtering the plurality of data entities from the target data source comprises: obtaining, from the target data source, data entities included within folders identified by the first folder identifier and the at least one second folder identifier.
9. The method of claim 1 or 6, further comprising: determining, based on a first configuration operation of a user, a target data source of a question-answering plugin used by a digital assistant; receiving, in an interaction of the user with the digital assistant, a data query request of the user for the target data source; and presenting, to the user, a query result of the digital assistant, wherein the query result is obtained by the digital assistant using the question-answering plugin to match the data query request with the target data source.
10. The method of claim 9, wherein the target data source comprises one or more online documents.
11. The method of claim 9, wherein the data query request indicates an entity identifier to be queried, and the query result is obtained by: determining, from the target data source, a set of data entities to which the user has access; filtering, based on index information of the target data source, at least one data entity matching the entity identifier from the set of data entities; and presenting, to the user, the determined at least one data entity. an entity identifier or a folder identifier to be queried.
12. The method of claim 11, wherein the data identifier comprises:
13. The method of claim 11, wherein filtering, from the set of data entities, at least one data entity matching the entity identifier comprises: filtering, based on index information constructed for the set of data entities, at least one data entity matching the entity identifier from the set of data entities using the entity identifier.
14. An apparatus for data query, comprising: a request receiving module configured to receive a data query request for a target data source, the data query request indicating a first entity identifier to be queried; and a query result presenting module configured to present, to a user, a query result of a digital assistant, wherein the query result is obtained by the digital assistant using a question-answering plugin to match the data query request with the target data source. an index mapping module configured to map the first entity identifier to a plurality of first indexes respectively by using a plurality of mapping functions, each mapping function mapping a plurality of different entity identifiers to a same index, wherein the plurality of mapping functions comprises a plurality of hash functions, and a value range of each hash function is determined based on an upper limit of enumeration values of an index field of data entities in the target data source; a data filtering module configured to filter a plurality of groups of first data entities respectively matching the plurality of first indexes from the target data source based on the plurality of first indexes and index information of data entities in the target data source, and each group of data entities has index information matching one of the plurality of first indexes; and a result determining module configured to determine a query result for the data query request from an intersection of the plurality of groups of first data entities, and the query result indicates at least part of data entities included in the intersection.
15. An apparatus for data query, comprising: a request receiving module configured to receive a data query request for a target data source, and the data query request indicates a first folder identifier to be queried; an identifier obtaining module configured to, in response to determining that a first folder identified by the first folder identifier has a subfolder, obtain at least one second folder identifier of at least one subfolder in the first folder based on the first folder identifier; and a data filtering module configured to filter a plurality of data entities matching the first folder identifier and the at least one second folder identifier from the target data source based on index information of data entities in the target data source, and each data entity has index information including at least a folder field indicating one of the first folder identifier and the at least one second folder identifier, and the apparatus further comprises: an index creating module configured to create index information of a first data entity in the target data source for the first data entity; a folder index storing module configured to store a folder identifier directly including a parent folder of the first data entity in the folder field of the index information; and an entity index storing module configured to store an index corresponding to an entity identifier of the first data entity in an entity field of the index information.
16. The apparatus of claim 14 or 15, further comprising: a data source determining module configured to determine a target data source of a question and answer plug-in used by a digital assistant based on a first configuration operation of a user; a request receiving module configured to receive a data query request of the user in an interaction between the user and the digital assistant; and a result presenting module configured to present a query result of the digital assistant to the user, wherein the query result is obtained by the digital assistant matching the data query request with the target data source using the question and answer plug-in.
17. An electronic device, comprising: at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions when executed by the at least one processing unit cause the electronic device to perform the method according to any one of claims 1 to 5 and / or the method according to any one of claims 6 to 13.
18. A computer readable storage medium having stored thereon a computer program, the computer program being executable by a processor to implement the method according to any one of claims 1 to 5 and / or the method according to any one of claims 6 to 13.
Citation Information
Patent Citations
File processing method and device
CN109299037A
Block chain transaction data query method and device
CN116628285A