A data query method and device, electronic equipment and storage medium
By receiving data query requests from the target terminal, obtaining the target data type set, filtering the target data identifier subset, obtaining the target data name set based on the correspondence, and selecting target data from the historical database, the problem of low query efficiency caused by a large amount of historical data in the database is solved, and fast query is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-09
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, the large amount of historical data in the database leads to low data query efficiency, requiring a lot of time to perform data name matching operations, and making it impossible to query the data to be called in a timely manner.
By receiving data query requests from the target terminal, the system obtains a set of target data types, filters out a subset of matching target data identifiers from the candidate data identifier set, obtains a set of target data names based on the correspondence, and finally selects target data from the historical database as the data to be called.
It improves the efficiency of data querying, avoids the need to match data names with historical data in the database, reduces query time, and improves the timeliness of queries.
Smart Images

Figure CN115481104B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data search technology, and in particular to a data query method, apparatus, electronic device and storage medium. Background Technology
[0002] With the development of information technology, data is widely used in the carrying and presentation of information. Therefore, in data communication, it is necessary to frequently query and use the data generated by the system.
[0003] Therefore, in order to facilitate data retrieval and use, the data generated by the system usually needs to be stored in the corresponding database. However, over time, the amount of data in the database will gradually increase, which will greatly affect the subsequent data retrieval and use.
[0004] Currently, in order to ensure the query and use of data, the target data name of the data to be called is usually matched with the data names of various historical data contained in the database. When it is determined that there is historical data in the database that meets the preset data name similarity condition with the data to be called, the corresponding historical data can be used as the data to be called, thereby realizing the query and use of the corresponding historical data.
[0005] However, the data query method described above requires matching the data names with the various historical data in the database until the corresponding historical data is found. This can lead to a significant amount of time being spent on matching data names when the database contains a large amount of historical data, making it impossible to retrieve the data to be called in a timely manner.
[0006] Therefore, using the above method results in low efficiency for data retrieval. Summary of the Invention
[0007] This application provides a data query method, apparatus, electronic device, and storage medium to improve the efficiency of data query.
[0008] In a first aspect, embodiments of this application provide a data query method, the method comprising:
[0009] The system receives a data query request sent by the target terminal and obtains a set of target data types for the data to be retrieved from the data query request. The set of target data types includes at least one target data type, and each target data type is determined based on an attribute dimension of the data to be retrieved.
[0010] From the preset set of candidate data identifiers, select a subset of target data identifiers that match the target data type set;
[0011] Based on the obtained subset of target data identifiers and the correspondence between candidate data identifiers and data names, the corresponding set of target data names is obtained;
[0012] Select target data associated with the target data name set from the preset historical database, and use the target data as the data to be called.
[0013] Secondly, embodiments of this application also provide a data query device, the device comprising:
[0014] The receiving module is used to receive data query requests sent by the target terminal and obtain a set of target data types of the data to be called from the data query requests; wherein, the set of target data types includes: at least one target data type, and each target data type is determined according to an attribute dimension of the data to be called;
[0015] The filtering module is used to filter out a subset of target data identifiers that match the target data type set from a preset set of candidate data identifiers;
[0016] The processing module is used to obtain the corresponding set of target data names based on the obtained subset of target data identifiers and the correspondence between candidate data identifiers and data names;
[0017] The determination module is used to select target data associated with the target data name set from a preset historical database and use the target data as the data to be called.
[0018] In one possible embodiment, before receiving a data query request sent by the target terminal, the receiving module is further configured to:
[0019] For each piece of historical data contained in the historical database, perform the following operations:
[0020] Determine the various feature attributes of a historical data set and their corresponding historical data types;
[0021] Based on the data encoding operations performed on each obtained historical data type, the encoding results for each historical data type are obtained.
[0022] Based on the obtained encoding results, candidate data identifiers for each historical data type are determined, and the obtained candidate data identifiers are added to the candidate data identifier set.
[0023] In one possible embodiment, after determining the various feature attributes of a historical data and their corresponding historical data types, the receiving module is further configured to:
[0024] Based on the attribute correlation between each feature attribute, the type correlation of each historical data type is determined; whereby each type correlation represents the probability of a combination of the corresponding historical data type with at least one historical data type.
[0025] If there is a historical data type among the various historical data types that meets the preset type association condition, then the historical data type and its corresponding at least one historical data type are combined to obtain the corresponding data type combination.
[0026] Based on the data encoding operations performed on the data type combination, the combined encoding result of the data type combination is obtained;
[0027] Based on the combined encoding results, candidate data identifiers for data type combinations are determined, and the obtained candidate data identifiers are added to the candidate data identifier set.
[0028] In one possible embodiment, when obtaining the corresponding set of target data names based on the obtained subset of target data identifiers and the correspondence between candidate data identifiers and data names, the processing module is specifically used for:
[0029] If there exists a target data identifier corresponding to a combination of data types in the subset of target data identifiers, then the corresponding combined data name is obtained based on the target data identifier corresponding to the combination of data types and the correspondence between the candidate data identifier and the data name;
[0030] Determine the target data types included in the combination name, their corresponding target data names, and save the obtained target data names to the target data name set.
[0031] In one possible implementation, the combined data name is not saved to the target data name set if one of the following conditions is met:
[0032] Determine the name of the combined data;
[0033] Determine to save each target data name to the target data name set.
[0034] In one possible embodiment, after obtaining the corresponding set of target data names, the determining module is further configured to:
[0035] If the data query request contains preset target data name tagging information, then each target data name contained in the target data name set is tagged, and the tagged target data names are sent to the target terminal.
[0036] In one possible embodiment, the receiving module is further configured to:
[0037] Receive a data name modification request sent by the target terminal, and obtain the corresponding data name modification information from the data name modification request;
[0038] Based on the updated data name carried by the data name modification information, a data encoding operation is performed on the historical data name corresponding to the data modification information to obtain the encoding result of the updated data name;
[0039] Based on the encoding result of the updated data name, the updated data identifier of the updated data name is determined, and the obtained updated data identifier is added to the candidate data identifier set.
[0040] Thirdly, an electronic device is proposed, comprising a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the processor to perform the steps of the data query method described in the first aspect.
[0041] Fourthly, a computer-readable storage medium is proposed, comprising program code that, when executed on an electronic device, causes the electronic device to perform the steps of the data query method described in the first aspect.
[0042] Fifthly, a computer program product is provided, which, when invoked by a computer, causes the computer to execute the data query method steps as described in the first aspect.
[0043] The beneficial effects of this application are as follows:
[0044] In the data query method provided in this application embodiment, a data query request sent by a target terminal is received, and a set of target data types for the data to be called is obtained from the data query request. The set of target data types includes at least one target data type, and each target data type is determined according to an attribute dimension of the data to be called. Next, a subset of target data identifiers that match the set of target data types is selected from a preset set of candidate data identifiers. Further, based on the obtained subset of target data identifiers and the correspondence between candidate data identifiers and data names, a corresponding set of target data names is obtained. Finally, target data associated with the set of target data names is selected from a preset historical database, and the target data is used as the data to be called.
[0045] This approach determines the corresponding set of target data names based on a subset of target data identifiers that match the target data type set of the data to be retrieved. Then, it selects the target data associated with the target data name set from a pre-defined historical database and uses this target data as the data to be retrieved. This avoids the drawback of existing technologies, which require matching data names with each historical data point in the database until a match is found. This process can be time-consuming when the database contains a large amount of historical data, hindering timely data retrieval. Therefore, this approach improves data retrieval efficiency.
[0046] Furthermore, other features and advantages of this application will be set forth in the following description and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0048] Figure 1 An exemplary schematic diagram of an optional system architecture to which embodiments of this application apply is shown;
[0049] Figure 2 An exemplary illustration shows a flowchart of a method for generating candidate data identifiers provided in an embodiment of this application;
[0050] Figure 3 An exemplary illustration shows a specific application scenario diagram of obtaining combined encoding results provided by an embodiment of this application;
[0051] Figure 4 An exemplary illustration shows a schematic diagram of the implementation flow of a data query method provided in an embodiment of this application;
[0052] Figure 5 An exemplary schematic diagram of a method for not storing combined data names provided in an embodiment of this application is shown;
[0053] Figure 6 An exemplary embodiment of this application provides a method based on... Figure 4 Specific application scenario diagram;
[0054] Figure 7 An exemplary illustration shows a specific application scenario diagram of data name modification provided by an embodiment of this application;
[0055] Figure 8 An exemplary schematic diagram of a data query device provided in an embodiment of this application is shown;
[0056] Figure 9 An exemplary schematic diagram of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this application. Obviously, the described embodiments are only some embodiments of the technical solutions of this application, and not all embodiments. Based on the embodiments recorded in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the technical solutions of this application.
[0058] It should be noted that in the description of this application, "multiple" is understood as "at least two". "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. A connected to B can represent: A and B directly connected, or A and B connected through C. Furthermore, in the description of this application, terms such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or order.
[0059] The design concept of the embodiments of this application is briefly introduced below:
[0060] In existing technologies, in order to ensure the accuracy of querying and using various data in the database, some commonly used fields are usually redundantly stored for massive amounts of data to avoid low performance of the corresponding data query system when performing related queries, that is, low accuracy of data query.
[0061] For example, the query data items include not only combinations of department names and personnel names, but also separate department names and personnel names.
[0062] However, for some historical data, if you need to change the content of these fields, or perform data queries and use, you need to perform corresponding data update or data query operations from the massive amount of data in the corresponding historical database or data retrieval library (such as Elastic Search).
[0063] It is easy to see that if the above method is adopted, it will not only consume a lot of time, but also greatly affect the system's operating performance due to a large number of data query operations.
[0064] In view of this, in order to improve the efficiency of data query, this application proposes a data query method, specifically including: receiving a data query request sent by a target terminal, and obtaining a set of target data types of the data to be called from the data query request, wherein the set of target data types includes: at least one target data type, each target data type being determined according to an attribute dimension of the data to be called; then, filtering out a subset of target data identifiers that match the set of target data types from a preset set of candidate data identifiers; further, obtaining a corresponding set of target data names based on the obtained subset of target data identifiers and the correspondence between candidate data identifiers and data names; finally, selecting target data associated with the set of target data names from a preset historical database, and using the target data as the data to be called.
[0065] In particular, the preferred embodiments of this application will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application. Furthermore, the embodiments of this application and the features in the embodiments can be combined with each other without conflict.
[0066] See Figure 1 As shown, this is a schematic diagram of a system architecture provided in an embodiment of this application. The system architecture includes: target terminals (101a, 101b) and server 102. The target terminals (101a, 101b) and server 102 can interact with each other through a communication network, wherein the communication network can use wireless communication and wired communication methods.
[0067] For example, the target terminal (101a, 101b) can access the network and communicate with the server 102 through cellular mobile communication technology, wherein the cellular mobile communication technology includes, for example, 5th generation mobile network (5G) technology.
[0068] Optionally, the target terminal (101a, 101b) can access the network and communicate with the server 102 via short-range wireless communication, wherein the short-range wireless communication method includes, for example, Wireless Fidelity (Wi-Fi) technology.
[0069] This application embodiment does not impose any limitation on the number of the above-mentioned devices, such as Figure 1As shown, only the target terminal (101a, 101b) and server 102 are described as examples. The following is a brief introduction to each of the above devices and their respective functions.
[0070] The target terminal (101a, 101b) is a device that can provide voice and / or data connectivity to users, including: handheld terminal devices with wireless connectivity, vehicle-mounted terminal devices, etc.
[0071] For example, the target terminals (101a, 101b) include, but are not limited to: mobile phones, tablets, laptops, handheld computers, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminal devices in industrial control, wireless terminal devices in autonomous driving, wireless terminal devices in smart grids, wireless terminal devices in transportation safety, wireless terminal devices in smart cities, or wireless terminal devices in smart homes, etc.
[0072] Furthermore, the target terminals (101a, 101b) may have related clients installed. These clients can be software (e.g., applications, browsers, short video software, etc.), or web pages, mini-programs, etc. In this embodiment, data query requests and / or data name modification requests can both be sent from the target terminals (101a, 101b) to the server 102.
[0073] It is worth noting that, in this embodiment of the application, the server 102 is used to receive a data query request sent by the target terminal, and obtain a set of target data types of the data to be called from the data query request. The set of target data types includes at least one target data type, and each target data type is determined according to an attribute dimension of the data to be called. Next, a subset of target data identifiers that match the set of target data types is selected from a preset set of candidate data identifiers. Further, based on the obtained subset of target data identifiers and the correspondence between candidate data identifiers and data names, a corresponding set of target data names is obtained. Finally, target data associated with the set of target data names is selected from a preset historical database, and the target data is used as the data to be called.
[0074] It should be noted that, for ease of understanding and description, this article uses the Elastic Search index as an example to describe the historical database. Elastic Search is a distributed search and analysis engine located at the core of the Elastic Stack.
[0075] The data query method provided by the exemplary embodiments of this application will be described below in conjunction with the above system architecture and with reference to the accompanying drawings. It should be noted that the above system architecture is only shown to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way in this respect.
[0076] It should be noted that before implementing the data query method based on the above system architecture, please refer to [the relevant documentation / reference]. Figure 2 As shown, the server needs to perform the following operations on any historical data saved to the historical database:
[0077] S201: Determine the various characteristic attributes of a historical data set and the corresponding historical data type for each.
[0078] Specifically, during step S201, the server extracts the feature attributes of the historical data to be written into the historical database, thereby obtaining the various feature attributes of the historical data. Then, by combining the correspondence between the feature attributes and the historical data types, the server determines the historical data type corresponding to each of the obtained feature attributes.
[0079] For example, when the server is about to write historical data into the Elastic Search index, it first performs structural analysis on the historical data to extract some basic data items (i.e., various feature attributes). Then, it can determine the historical data type of each basic data item. The basic data items include, but are not limited to: department, category, registration, tag, etc.
[0080] S202: Based on the data encoding operations performed on each obtained historical data type, obtain the encoding results for each historical data type.
[0081] Specifically, when executing step S202, after the server obtains the various historical data types of the aforementioned historical data, it can perform corresponding data encoding operations on each obtained historical data type to obtain the encoding results of each historical data type.
[0082] It should be noted that for each different historical data, even if they have the same data type, the corresponding data encoding will be different. That is, when performing data encoding operations, the differences of the historical data itself, i.e., unique identifiers, must be considered.
[0083] In one possible implementation, the server can determine the type correlation degree of each historical data type based on the attribute correlation degree between each feature attribute, wherein each type correlation degree represents the probability of a combination of the corresponding historical data type with at least one historical data type; then, if there is a historical data type among the historical data types that satisfies the preset type correlation degree condition, the historical data type and its corresponding at least one historical data type are combined to obtain the corresponding data type combination; further, based on the data encoding operation performed on the obtained data type combination, the combination encoding result of the data type combination is obtained.
[0084] For example, see Figure 3 As shown, taking the three feature attributes of the aforementioned historical data (Char.Attri1, Char.Attri2, and Char.Attri3) as an example, the server can obtain the type correlation (Type.Rele1, Type.Rele2, Type.Rele3, and Type.Rele4) of each historical data type (His.Data.Type1, His.Data.Type2, and His.Data.Type3) based on the attribute similarity between the three feature attributes (in order: Attri.Simi1, Attri.Simi2, and Attri.Simi3). Furthermore, if there exists a type correlation Type.Rele4 that satisfies the preset type correlation condition Type.Rele.Con, then the historical data types (His.Data.Type1, His.Data.Type2, and His.Data.Type3) corresponding to the type correlation Type.Rele4 are combined to obtain the corresponding data type combination Data.Type.Com. The corresponding data encoding operation can then be performed on the data type combination Data.Type.Com to obtain the combined encoding result Com.Cod.Res of the data type combination.
[0085] It should be noted that each of the above type association degrees represents the probability of a combination of the corresponding historical data type with at least one historical data type, i.e., the probability of combined use. For example, a certain label under a certain department can be processed as a combined label. Furthermore, in the above type association degrees, Type.Rele1 is the type association degree between historical data types His.Data.Type1 and His.Data.Type2, Type.Rele2 is the type association degree between historical data types His.Data.Type1 and His.Data.Type3, Type.Rele3 is the type association degree between historical data types His.Data.Type2 and His.Data.Type2, and Type.Rele4 is the type association degree between historical data types His.Data.Type1, His.Data.Type2, and His.Data.Type3.
[0086] S203: Based on the obtained encoding results, determine the candidate data identifiers for each historical data type, and add the obtained candidate data identifiers to the candidate data identifier set.
[0087] Specifically, when executing step S203, after obtaining each encoding result, the server can use each encoding result as a candidate data identifier for each historical data type, and then add each candidate data identifier to the candidate data identifier set.
[0088] For example, suppose the data items of the above historical data are as follows:
[0089] "id": "12345678",
[0090] "creator": "admin"
[0091] "detpName": "Research and Development Department 1"
[0092] "tagName": "Security Data"
[0093] "level": "Level 2".
[0094] If the basic data items in the above historical data are: "detpName": "R&D Department 1", "tagName": "Security Data", and "level": "Level 2", then the historical data types are: detpName, tagName, and level, respectively. Furthermore, based on the data encoding of each of the above three historical data types, the candidate data identifiers of the above three historical data types can be obtained as: yfyb, aqsj, and ej, respectively. Finally, the three candidate data identifiers are added to the candidate data identifier set.
[0095] Optionally, if among the aforementioned historical data types, there exists a historical data type that satisfies the preset type association condition (i.e., composite condition), such as tagName and level, then after obtaining the corresponding data type combination taglevel, the candidate data identifier ejaqsj of the data type combination taglevel can be obtained based on the data encoding of the data type combination taglevel, and thus the obtained candidate data identifier can be added to the candidate data identifier set.
[0096] Furthermore, based on the above method steps, corresponding relational tables can be created in the relational database based on historical data type, historical data name, and candidate data identifier, as shown in Table 1:
[0097] Table 1: Correspondence Table
[0098]
[0099]
[0100] Furthermore, based on the aforementioned correspondence table, the basic data items of the aforementioned historical data are replaced and updated, and the final saved data items are as follows:
[0101] "id": "12345678",
[0102] "creator": "admin"
[0103] "detpName": "yfyb"
[0104] "tagName": "aqsj",
[0105] "level": "ej",
[0106] "taglevel": "ejaqsj".
[0107] Therefore, based on the above-described method and steps for generating candidate data identifiers, the server can, after obtaining the candidate data identifiers for each historical data point and adding them to a preset candidate data identifier set, execute the corresponding data query method. (See [link to relevant documentation]). Figure 4 The diagram shown is a flowchart of a data query method provided in this application. The specific implementation process of this method is as follows:
[0108] S401: Receive a data query request sent by the target terminal, and obtain the target data type set of the data to be called from the data query request.
[0109] Specifically, when executing step S401, when the server receives a data query request sent by the target terminal, it can obtain the target data type set of the data to be called from the data query request through a preset data query request parsing method. The target data type set includes at least one target data type, and each target data type is determined according to an attribute dimension of the data to be called.
[0110] S402: Select a subset of target data identifiers that match the target data type set from the preset candidate data identifier set.
[0111] Specifically, when executing step S402, after the server obtains the target data type set of the data to be called, it can filter out the target data identifiers corresponding to each target data type contained in the target data type set from the preset candidate data identifier set based on the correspondence between historical data types and candidate data identifiers, thereby obtaining the corresponding target data identifier subset.
[0112] Optionally, taking the query of security tag data of a Level 2 security unit as an example, using the basic data item conditions such as grouping tags designed above, the target data type set for the query includes: deptName, tagName, and level. Furthermore, since commonly used tag and level combination conditions are preset in advance, the two target data types (i.e., type fields) deptName and TagLevel can be used directly for data querying. The corresponding target data identifiers will then become: yfyb and ejaqsj. In addition, if there are other target data types (set search conditions) that can be used for combination, they will be merged based on the above combination conditions.
[0113] For example, during the process of querying data based on a data query request, the server can perform the corresponding data query based on the following data:
[0114] "id": "12345678",
[0115] "creator": "admin"
[0116] "detpName": "yfyb"
[0117] "tagName": "aqsj",
[0118] "level": "ej",
[0119] "taglevel": "ejaqsj".
[0120] S403: Based on the obtained subset of target data identifiers and the correspondence between candidate data identifiers and data names, obtain the corresponding set of target data names.
[0121] Specifically, when executing step S403, after obtaining the target data identifier subset, the server can obtain each target data identifier contained in the target data identifier subset and its corresponding target data name based on the correspondence between candidate data identifiers and data names. Then, based on the obtained target data names, the server can generate a corresponding target data name set.
[0122] In one possible implementation, if there exists a target data identifier corresponding to a combination of data types in the subset of target data identifiers, then based on the target data identifier corresponding to the combination of data types and the correspondence between candidate data identifiers and data names, the corresponding combined data name is obtained; further, each target data type contained in the combined data name and its corresponding target data name are determined, and each obtained target data name is saved to the target data name set.
[0123] For example, if there exists a target data identifier ejaqsj corresponding to the data type combination taglevel in the target data identifier subset, then the corresponding combined data name can be determined as: Level 2 - Security Data based on the correspondence between candidate data identifiers and data names; further, based on the obtained combined data name, the target data type tagName and its corresponding target data name can be determined as Security Data, and the target data type level and its corresponding target data name can be determined as Level 2.
[0124] It should be noted that, for reference Figure 5 As shown, if there are target data identifiers corresponding to data type combinations within the target data identifier subset, the combined data name does not need to be saved to the target data name set if one of the following two conditions is met: Condition 1: It is determined that the combined data name has been obtained; Condition 2: It is determined that each target data name has been saved to the target data name set. In particular, if Condition 2 is met, the combined data name can also be deleted.
[0125] Optionally, after the server determines that it has obtained the corresponding set of target data names, if there is preset target data name tagging information in the data query request, it can tag each target data name contained in the target data name set and send the tagged target data names to the corresponding target terminal.
[0126] For example, if the highlight prefix is configured as " <font color='red'> "and suffix"< / font> The target data name tag information, after replacing the basic data items of the historical data, becomes the target data items after the tagging process is completed as follows:
[0127] "id": "12345678";
[0128] "creator": "admin";
[0129] "detpName": <font color='red'> Research and Development Department< / font> ";
[0130] "tagName": <font color='red'> Security Data< / font> ";
[0131] "level": <font color='red'> Level 2< / font> ".
[0132] S404: Select the target data associated with the target data name set from the preset historical database, and use the target data as the data to be called.
[0133] Specifically, when executing step S404, after obtaining the target data name set, the server can select the target data associated with the target data name set from the preset historical database based on the association between the data name set and historical data, and use the target data as the data to be called to meet the corresponding data query and usage business needs.
[0134] See Figure 6The diagram illustrates a specific application scenario of a data query method provided in this application. After receiving a data query request (Data.Que.Request) from the target terminal, the server retrieves the target data type set (Tar.Type.Set) of the data to be called (Demand.Data) from the Data.Que.Request. Next, it filters out a subset of target data identifiers (Tar.Ide.Subset) that matches the target data type set (Tar.Type.Set) from a preset candidate data identifier set (Can.Ide.Set). Further, based on the obtained subset of target data identifiers (Tar.Ide.Subset) and the correspondence between candidate data identifiers and data names (Correspondence), it obtains the corresponding target data name set (Tar.Name.Set). Finally, it selects the target data (Tar.Data) associated with the target data name set (Tar.Name.Set) from a preset historical database (His.Database) and uses the target data (Tar.Data) as the data to be called (Demand.Data).
[0135] For example, the main process of the data query method provided in this application embodiment is as follows: extracting basic data items such as grouping, classification, and tags, and analyzing commonly used search combinations (i.e., basic data item combinations); then, processing the data based on the basic data items, encoding them, and extracting and saving the encoded data and combined data; further, converting the conditions into codes based on the encoded data, thereby converting ordinary search into encoded search; finally, converting the codes into data based on the encoded data, converting the encoded data into raw data, and highlighting it according to the configuration.
[0136] In one possible implementation, see [reference] Figure 7As shown, if the server receives a data name modification request (Data.Name.Mod.Request) from the target terminal, it obtains the corresponding data name modification information (Data.Name.Mod.Mes) from the request. Next, based on the updated data name (Update.Data.Name) carried in the Data.Name.Mod.Mes, it performs a data encoding operation on the corresponding historical data name (His.Data.Name) to obtain the encoding result (Cod.Result) of the updated data name (Update.Data.Name). Finally, based on the encoding result (Cod.Result) of the updated data name (Update.Data.Name), it determines the updated data identifier (Update.Data.Id) of the updated data name (Update.Data.Name) and adds the obtained updated data identifier (Update.Data.Id) to the candidate data identifier set (Can.Ide.Set).
[0137] Obviously, based on the data name update method described above, when the names and other information of these basic data are modified, it is not necessary to update the contents of the historical database (such as the ElasticSearch index), but only the relational database needs to be updated. This avoids the need to update massive amounts of data to a certain extent. The relational database contains at least: a preset set of candidate data identifiers and the correspondence between candidate data identifiers and data names.
[0138] In summary, the data query method provided in this application embodiment receives a data query request sent by a target terminal and obtains a set of target data types for the data to be called from the data query request. The set of target data types includes at least one target data type, each of which is determined based on an attribute dimension of the data to be called. Next, a subset of target data identifiers that match the set of target data types is selected from a preset set of candidate data identifiers. Further, based on the obtained subset of target data identifiers and the correspondence between candidate data identifiers and data names, a corresponding set of target data names is obtained. Finally, target data associated with the set of target data names is selected from a preset historical database, and the target data is used as the data to be called.
[0139] This approach determines the corresponding set of target data names based on a subset of target data identifiers that match the target data type set of the data to be retrieved. Then, it selects the target data associated with the target data name set from a pre-defined historical database and uses this target data as the data to be retrieved. This avoids the drawback of existing technologies, which require matching data names with each historical data point in the database until a match is found. This process can be time-consuming when the database contains a large amount of historical data, hindering timely data retrieval. Therefore, this approach improves data retrieval efficiency.
[0140] Furthermore, based on the same technical concept, embodiments of this application also provide a data query device, which is used to implement the data query method flow described above in embodiments of this application. See also... Figure 8 As shown, the data query device includes: a receiving module 801, a filtering module 802, a processing module 803, and a determining module 804, wherein:
[0141] The receiving module 801 is used to receive a data query request sent by the target terminal and obtain a set of target data types of the data to be called from the data query request; wherein, the set of target data types includes: at least one target data type, and each target data type is determined according to an attribute dimension of the data to be called;
[0142] The filtering module 802 is used to filter out a subset of target data identifiers that match the target data type set from a preset set of candidate data identifiers;
[0143] The processing module 803 is used to obtain a corresponding set of target data names based on the obtained subset of target data identifiers and the correspondence between candidate data identifiers and data names;
[0144] The determination module 804 is used to select target data associated with the target data name set from the preset historical database and use the target data as the data to be called.
[0145] In one possible embodiment, before receiving a data query request sent by the target terminal, the receiving module 801 is further configured to:
[0146] For each piece of historical data contained in the historical database, perform the following operations:
[0147] Determine the various feature attributes of a historical data set and their corresponding historical data types;
[0148] Based on the data encoding operations performed on each obtained historical data type, the encoding results for each historical data type are obtained.
[0149] Based on the obtained encoding results, candidate data identifiers for each historical data type are determined, and the obtained candidate data identifiers are added to the candidate data identifier set.
[0150] In one possible embodiment, after determining the various feature attributes of a historical data and their corresponding historical data types, the receiving module 801 is further configured to:
[0151] Based on the attribute correlation between each feature attribute, the type correlation of each historical data type is determined; whereby each type correlation represents the probability of a combination of the corresponding historical data type with at least one historical data type.
[0152] If there is a historical data type among the various historical data types that meets the preset type association condition, then the historical data type and its corresponding at least one historical data type are combined to obtain the corresponding data type combination.
[0153] Based on the data encoding operations performed on the data type combination, the combined encoding result of the data type combination is obtained;
[0154] Based on the combined encoding results, candidate data identifiers for data type combinations are determined, and the obtained candidate data identifiers are added to the candidate data identifier set.
[0155] In one possible embodiment, when obtaining the corresponding set of target data names based on the obtained subset of target data identifiers and the correspondence between candidate data identifiers and data names, the processing module 803 is specifically used for:
[0156] If there exists a target data identifier corresponding to a combination of data types in the subset of target data identifiers, then the corresponding combined data name is obtained based on the target data identifier corresponding to the combination of data types and the correspondence between the candidate data identifier and the data name;
[0157] Determine the target data types included in the combination name, their corresponding target data names, and save the obtained target data names to the target data name set.
[0158] In one possible implementation, the combined data name is not saved to the target data name set if one of the following conditions is met:
[0159] Determine the name of the combined data;
[0160] Determine to save each target data name to the target data name set.
[0161] In one possible embodiment, after obtaining the corresponding set of target data names, the determining module 804 is further configured to:
[0162] If the data query request contains preset target data name tagging information, then each target data name contained in the target data name set is tagged, and the tagged target data names are sent to the target terminal.
[0163] In one possible embodiment, the receiving module 801 is further configured to:
[0164] Receive a data name modification request sent by the target terminal, and obtain the corresponding data name modification information from the data name modification request;
[0165] Based on the updated data name carried by the data name modification information, a data encoding operation is performed on the historical data name corresponding to the data modification information to obtain the encoding result of the updated data name;
[0166] Based on the encoding result of the updated data name, the updated data identifier of the updated data name is determined, and the obtained updated data identifier is added to the candidate data identifier set.
[0167] Based on the same technical concept, embodiments of this application also provide an electronic device that can implement the data query method flow provided in the above embodiments of this application. In one embodiment, the electronic device can be a server, a terminal device, or other electronic devices. Figure 9 As shown, the electronic device may include:
[0168] At least one processor 901 and a memory 902 connected to at least one processor 901. In this embodiment, the specific connection medium between the processor 901 and the memory 902 is not limited. Figure 9 The example shown is the connection between processor 901 and memory 902 via bus 900. Bus 900 is... Figure 9 The connections between other components are indicated by thick lines and are for illustrative purposes only, not as limiting information. The Bus 900 can be divided into address bus, data bus, control bus, etc., for ease of representation. Figure 9 The term is represented by a single thick line, but this does not imply that there is only one bus or one type of bus. Alternatively, the processor 901 can also be called a controller; there is no restriction on the name.
[0169] In this embodiment, memory 902 stores instructions executable by at least one processor 901. By executing the instructions stored in memory 902, at least one processor 901 can perform a data query method as described above. Processor 901 can implement... Figure 8 The functions of each module in the device shown.
[0170] The processor 901 is the control center of the device. It can connect to various parts of the control device through various interfaces and lines. By running or executing instructions stored in memory 902 and calling data stored in memory 902, the processor can perform various functions and process data, thereby monitoring the device as a whole.
[0171] In one possible design, processor 901 may include one or more processing units. Processor 901 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into processor 901. In some embodiments, processor 901 and memory 902 may be implemented on the same chip; in some embodiments, they may also be implemented on separate chips.
[0172] The processor 901 can be a general-purpose processor, such as a CPU, digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of a data query method disclosed in the embodiments of this application can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.
[0173] Memory 902, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 902 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. Memory 902 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 902 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0174] By designing and programming the processor 901, the code corresponding to a data query method described in the foregoing embodiments can be embedded into the chip, enabling the chip to execute it during operation. Figure 4 The steps of a data query method according to the illustrated embodiment are as follows. How to design and program the processor 901 is a technique well-known to those skilled in the art and will not be described further here.
[0175] Based on the same inventive concept, embodiments of this application also provide a storage medium storing computer instructions that, when executed on a computer, cause the computer to perform a data query method described above.
[0176] In some possible implementations, various aspects of the data query method provided by this application can also be implemented in the form of a program product, which includes program code that, when the program product is run on a device, causes the control device to perform the steps in a data query method according to various exemplary embodiments of this application as described above.
[0177] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0178] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will 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 program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0179] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0180] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A data query method, characterized in that, include: For each piece of historical data contained in the historical database, perform the following operations: Determine the various feature attributes of a historical data set and their corresponding historical data types; Based on the attribute correlation degree between the various feature attributes, the type correlation degree of each historical data type is determined; wherein, each type correlation degree represents the probability of a combination of the corresponding historical data type with at least one historical data type. If among the various historical data types, there exists a historical data type that satisfies the preset type association condition, then the historical data type and its corresponding at least one historical data type are combined to obtain the corresponding data type combination; Based on the data encoding operations performed on the combination of the data types, the combined encoding result of the combination of data types is obtained; Based on the combined encoding result, candidate data identifiers for the data type combination are determined, and the obtained candidate data identifiers are added to the candidate data identifier set. The system receives a data query request sent by a target terminal and obtains a set of target data types for the data to be invoked from the data query request; wherein the set of target data types includes at least one target data type, and each target data type is determined according to an attribute dimension of the data to be invoked; From the preset set of candidate data identifiers, a subset of target data identifiers that matches the target data type set is selected; Based on the obtained subset of target data identifiers and the correspondence between candidate data identifiers and data names, the corresponding set of target data names is obtained; Select target data associated with the target data name set from the preset historical database, and use the target data as the data to be called.
2. The method as described in claim 1, characterized in that, After determining the various feature attributes of a historical data point and their corresponding historical data types, the process further includes: Based on the data encoding operations performed on each of the obtained historical data types, the encoding results of each historical data type are obtained. Based on the obtained encoding results, candidate data identifiers for each historical data type are determined, and the obtained candidate data identifiers are added to the candidate data identifier set.
3. The method as described in claim 1, characterized in that, The process of obtaining a corresponding set of target data names based on the obtained subset of target data identifiers and the correspondence between candidate data identifiers and data names includes: If there exists a target data identifier corresponding to a combination of data types in the subset of target data identifiers, then based on the target data identifier corresponding to the combination of data types and the correspondence between the candidate data identifier and the data name, the corresponding combined data name is obtained; Each target data type contained in the combined data name is determined, and its corresponding target data name is determined. The obtained target data names are then saved to the target data name set.
4. The method as described in claim 3, characterized in that, If any of the following conditions are met, the combined data name will not be saved to the target data name set: Determine the name of the combined data; It is determined that each of the target data names will be saved to the target data name set.
5. The method as described in claim 1, characterized in that, After obtaining the corresponding set of target data names, the process also includes: If the data query request contains preset target data name tagging information, then each target data name contained in the target data name set is tagged, and the tagged target data names are sent to the target terminal.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: Receive a data name modification request sent by the target terminal, and obtain the corresponding data name modification information from the data name modification request; Based on the updated data name carried by the data name modification information, a data encoding operation is performed on the historical data name corresponding to the data name modification information to obtain the encoding result of the updated data name; Based on the encoding result of the updated data name, the updated data identifier of the updated data name is determined, and the obtained updated data identifier is added to the candidate data identifier set.
7. A data query device, characterized in that, include: The receiving module performs the following operations on each piece of historical data contained in the historical database: Determine the various feature attributes of a historical data set and their corresponding historical data types; Based on the attribute correlation degree between the various feature attributes, the type correlation degree of each historical data type is determined; wherein, each type correlation degree represents the probability of a combination of the corresponding historical data type with at least one historical data type. If among the various historical data types, there exists a historical data type that satisfies the preset type association condition, then the historical data type and its corresponding at least one historical data type are combined to obtain the corresponding data type combination; Based on the data encoding operations performed on the combination of the data types, the combined encoding result of the combination of data types is obtained; Based on the combined encoding result, candidate data identifiers for the data type combination are determined, and the obtained candidate data identifiers are added to the candidate data identifier set. A receiving module is configured to receive a data query request sent by a target terminal, and obtain a set of target data types of the data to be invoked from the data query request; wherein, the set of target data types includes: at least one target data type, and each target data type is determined according to an attribute dimension of the data to be invoked; The filtering module is used to filter out a subset of target data identifiers that match the target data type set from a preset set of candidate data identifiers; The processing module is used to obtain the corresponding set of target data names based on the obtained subset of target data identifiers and the correspondence between candidate data identifiers and data names; The determination module is used to select target data associated with the target data name set from a preset historical database, and use the target data as the data to be called.
8. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Data query method and device
CN110704491A
SQL (Structured Query Language) rewriting method and device, electronic equipment and storage medium
CN114443688A