Search

CN-120429341-B - Data query method based on data source combination, electronic equipment and storage medium

CN120429341BCN 120429341 BCN120429341 BCN 120429341BCN-120429341-B

Abstract

The embodiment of the application provides a data query method based on data source combination, electronic equipment and a storage medium. In the method, a database can be constructed according to data acquired from a plurality of preset data sources, and the data corresponding to the request type in the preset data sources is stored in the database in advance. And responding to the data query request, and determining the request type and the query object corresponding to the data query request. Determining a search result of the query object corresponding to each preset data source in the database based on the request type; based on the plurality of search results, encoded data is determined. And determining an evaluation result corresponding to the query object according to the coding data according to the mapping relation between the preset coding and the evaluation result. By using the method, the evaluation efficiency of the query object can be improved, and the equipment load can be reduced.

Inventors

  • YANG YUANYU
  • WU ZHIQIANG
  • LI JIAXI

Assignees

  • 荣耀终端股份有限公司

Dates

Publication Date
20260508
Application Date
20241125

Claims (18)

  1. 1. The data query method based on data source combination is applied to electronic equipment and is characterized in that a database is built in the electronic equipment, and the method comprises the following steps: Responding to a data query request, and determining a request type and a query object corresponding to the data query request; determining a search result of the query object corresponding to each preset data source in the database based on the request type, wherein the database stores data corresponding to the request type in a plurality of preset data sources in advance; Determining coded data based on a plurality of search results, wherein the method comprises the steps of determining a preset identifier according to a data category corresponding to each preset data source, generating a first code based on each search result and the preset identifier, wherein the number of bits of the first code is the number of bits in the preset identifier; And determining an evaluation result corresponding to the query object based on the coded data and a preset mapping relation, wherein the mapping relation comprises a corresponding relation between a preset code and the evaluation result.
  2. 2. The data query method based on data source merging as claimed in claim 1, wherein a data table is created in the database, and data corresponding to a plurality of preset request types acquired from a plurality of preset data sources is stored in the data table.
  3. 3. A data source merge-based data query method as claimed in claim 1 or claim 2, wherein each data category corresponds to one or more bits in the preset identifier.
  4. 4. The data source merge-based data query method as claimed in claim 1, wherein said method further comprises: and determining a corresponding search result of the query object on each preset data source based on the database.
  5. 5. The data query method based on data source merging as claimed in claim 1, wherein said generating a first code based on each search result and said preset identifier comprises: Determining a target bit corresponding to each search result on the preset identifier according to the corresponding relation between each data category and the bit in the preset identifier; And updating the preset identifier according to the target bit corresponding to each search result to obtain a first code corresponding to the query object on each preset data source.
  6. 6. The data query method based on data source merging as claimed in claim 5, wherein updating the preset identifiers according to the target bit corresponding to each search result to obtain the corresponding first codes of the query object on each preset data source comprises: Setting a bit value corresponding to the target bit in the preset identifier as a first preset value, and setting bit values corresponding to other bits in the preset identifier as a second preset value to obtain the first code.
  7. 7. The data query method based on data source merging as claimed in claim 5, wherein updating the preset identifiers according to the target bit corresponding to each search result to obtain the corresponding first codes of the query object on each preset data source comprises: And performing a moving operation on a bit value taking a value as a first preset value in the preset identifier based on a position corresponding to the target bit on the preset identifier to obtain the first code.
  8. 8. The data query method based on data source merging as claimed in claim 6 or 7, wherein said determining encoded data based on a plurality of search results comprises: and performing exclusive OR operation on the plurality of first codes to obtain the coded data.
  9. 9. The data source merge-based data query method as claimed in claim 6 or 7, wherein said determining encoded data based on a plurality of search results further comprises: performing exclusive-or operation on the plurality of first codes to obtain a second code; And converting the second code into the code data based on a preset rule.
  10. 10. The data source merge-based data query method as claimed in claim 1, wherein said method further comprises: updating the database based on any data source in response to a change request of the any data source; and updating the length of the preset identifier according to the data type of the random data source in the updated database and the change request.
  11. 11. The data query method based on data source merging as claimed in claim 10, wherein said updating the length of the preset identifier according to the data category of the arbitrary data source in the updated database and the change request comprises: determining the number of data categories of the arbitrary data source in the updated database; If the change request is a newly added data source, based on the number of the data categories, newly adding corresponding bits in the preset identifier; And if the change request is to delete the data source, reducing corresponding bits in the preset identifier based on the number of the data categories.
  12. 12. The data source merge-based data query method as claimed in claim 1, wherein said method further comprises: And sending the evaluation result to the terminal equipment which initiates the data query request.
  13. 13. The data source merge-based data query method as recited in claim 1, wherein the request types include one or more of an incoming call request type, an application installation request type, and a web page access request type.
  14. 14. A data query method based on data source merging, the method comprising: Responding to a data query request, and determining a data table according to the request type of the data query request, wherein data corresponding to the request type in a plurality of preset data sources are stored in the data table in advance; Determining a first code corresponding to a query object in the data query request on each preset data source based on the data table, wherein the first code comprises a preset identifier according to a data category corresponding to each preset data source in the data table; determining a first code corresponding to the query object on each preset data source based on the data table and the preset identifier, wherein the number of bits of the first code is the number of bits in the preset identifier; calculating a plurality of first codes to obtain coded data; And determining an evaluation result corresponding to the query object based on the coded data and a preset mapping relation, wherein the mapping relation comprises a corresponding relation between a preset code and the evaluation result.
  15. 15. The method of claim 14, wherein the data table is created based on data corresponding to a plurality of preset types obtained from the plurality of preset data sources, the request type is one or more of the plurality of preset types, and the data table uses different data table identifiers to distinguish between different preset types.
  16. 16. The data query method based on data source merging as claimed in claim 14, wherein said operating on a plurality of first encodings to obtain encoded data comprises: performing exclusive-or operation on the plurality of first codes to obtain a second code; And converting the second code into the code data based on a preset rule.
  17. 17. An electronic device, the electronic device comprising a memory and a processor: Wherein the memory is used for storing program instructions; The processor configured to read and execute the program instructions stored in the memory, which when executed by the processor, cause the electronic device to perform the data source merging-based data query method according to any one of claims 1 to 16.
  18. 18. A computer storage medium storing program instructions which, when run on an electronic device, cause a processor of the electronic device to perform the data source merge-based data querying method as claimed in any one of claims 1 to 16.

Description

Data query method based on data source combination, electronic equipment and storage medium Technical Field The application belongs to the field of terminals, and particularly relates to a data query method based on data source combination, electronic equipment and a storage medium. Background With the development of electronic devices, functions supported by the electronic devices are becoming more and more abundant. For example, by the electronic device, the evaluation result of the query object (e.g., communication number) may be determined from a plurality of network data sources. In the related art, when the electronic device determines the evaluation result from the plurality of network data sources, it is required to determine the search result of the communication number from the source table corresponding to each network data source, and by combining the search results corresponding to each network data source, the evaluation result of the plurality of network data sources corresponding to the query object can be obtained. However, this approach requires multiple queries of the communication number, resulting in inefficient queries, thereby affecting the user's experience with the electronic device. Disclosure of Invention In view of the foregoing, it is necessary to provide a data query method, an electronic device, and a storage medium based on data source merging, which can solve the problem of low data query efficiency. In a first aspect, the application provides a data query method based on data source merging, which is applied to electronic equipment, wherein a database is built in the electronic equipment; the method comprises the steps of determining a search result of the query object corresponding to each preset data source in a database based on the request type, storing data corresponding to the request type in a plurality of preset data sources in the database in advance, determining coding data based on the plurality of search results, and determining an evaluation result corresponding to the query object based on the coding data and a preset mapping relation, wherein the mapping relation comprises a corresponding relation between preset codes and the evaluation result. According to the technical scheme, the search result of the query object corresponding to each preset data source in the database can be determined through the request type, and because the data corresponding to the request type in the preset data sources are stored in the database in advance, when the search result of the query object corresponding to the preset data sources is determined through the database, the query object is not required to be matched with the data of other fields in the preset data sources, so that the determination efficiency of the search result can be improved, and meanwhile, the query times of the query object can be reduced because the source table in the preset data sources is not required to be queried, so that the determination efficiency of the search result is further improved. The encoding data is determined through the plurality of search results, so that the plurality of search results can be directly combined, and the combination efficiency of the plurality of search results is improved. In addition, through the coded data and the preset mapping relation, the evaluation results corresponding to the query object can be directly determined, and the evaluation results corresponding to the query object in each preset data source do not need to be combined again, so that the determination efficiency of the evaluation results can be further improved, the evaluation efficiency of the query object is improved, and the equipment load is reduced. In one possible implementation, a data table is created in the database, where data corresponding to a plurality of preset request types obtained from a plurality of preset data sources is stored. Through the technical scheme, the data which are acquired from the plurality of preset data sources and correspond to the plurality of preset request types can be stored in the data table, and the searching efficiency of the query object is improved. In one possible implementation, the method further includes determining a preset identifier according to a data class corresponding to each preset data source, each data class corresponding to one or more bits in the preset identifier. Through the technical scheme, the preset identifiers can be set according to the data types corresponding to each preset data source, wherein each data type can correspond to different bits, and the problem of coupling in the subsequent merging of results can be avoided. In one possible implementation manner, the method further comprises determining a search result corresponding to the query object on each preset data source based on the database, and generating a first code based on each search result and the preset identifier, wherein the number of bits of the first code is th