Data query method based on data source merging, electronic device, and storage medium
By pre-storing data from multiple data sources in the database and utilizing encoding and mapping relationships, the inefficiency caused by multiple queries is solved, enabling efficient data querying and evaluation result determination.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-11-25
- Publication Date
- 2026-05-08
AI Technical Summary
In existing technologies, determining evaluation results from multiple network data sources requires multiple queries, leading to low query efficiency and impacting user experience.
By constructing a database, data corresponding to the request type from multiple preset data sources is stored in advance. The retrieval results of the query object in the database are determined based on the request type. The evaluation results are directly determined by using coded data and mapping relationships, reducing the number of queries and merging steps.
It improves the efficiency of data querying and the speed of determining evaluation results, reduces equipment load, and ensures the accuracy and efficiency of query results merging.
Smart Images

Figure CN120429341B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of terminal devices, and in particular relates to a data query method, electronic device and storage medium based on data source merging. Background Technology
[0002] With the development of electronic devices, their functions are becoming increasingly diverse. For example, electronic devices can determine the evaluation result of a query object (e.g., a phone number) from multiple online data sources. In related technologies, when an electronic device determines the evaluation result from multiple online data sources, it needs to retrieve the phone number from the source table corresponding to each online data source. By merging the retrieval results from each online data source, the evaluation result for the query object corresponding to multiple online data sources can be obtained. However, this method requires multiple queries for the phone number, resulting in low query efficiency and negatively impacting the user experience of using the electronic device. Summary of the Invention
[0003] In view of the above, it is necessary to provide a data query method, electronic device and storage medium based on data source merging, which can solve the problem of low data query efficiency.
[0004] In a first aspect, this application provides a data query method based on data source merging, applied to an electronic device, wherein a database is constructed in the electronic device. The method includes: responding to a data query request and determining the request type and query object corresponding to the data query request; based on the request type, determining the retrieval results of the query object corresponding to each preset data source in the database, wherein the database pre-stores data corresponding to the request type from multiple preset data sources; determining coded data based on multiple retrieval results; and determining the evaluation result corresponding to the query object based on the coded data and a preset mapping relationship, wherein the mapping relationship includes a correspondence between preset codes and evaluation results.
[0005] Through the above technical solution, the retrieval results of the query object corresponding to each preset data source in the database can be determined based on the request type. Since the database pre-stores data corresponding to the request type from multiple preset data sources, when determining the retrieval results of the query object on multiple preset data sources, it is not necessary to match the query object with data from other fields in multiple preset data sources. Therefore, the efficiency of determining the retrieval results can be improved. Furthermore, since there is no need to query from the source tables in multiple preset data sources, the number of queries for the query object can be reduced, further improving the efficiency of determining the retrieval results. Determining coded data from multiple retrieval results enables the direct merging of multiple retrieval results, improving the merging efficiency. In addition, through coded data and preset mapping relationships, the evaluation result corresponding to the query object can be directly determined. Since there is no need to merge the evaluation results of the query object corresponding to each preset data source again, the efficiency of determining the evaluation result can be further improved, thereby improving the evaluation efficiency of the query object and reducing the device load.
[0006] In one possible implementation, the database contains data tables that store data obtained from multiple preset data sources and corresponding to multiple preset request types.
[0007] The above technical solution can store data obtained from multiple preset data sources and corresponding to multiple preset request types into a data table, which helps to improve the retrieval efficiency of the query object.
[0008] In one possible implementation, the method further includes: determining a preset identifier based on the data category corresponding to each preset data source, wherein each data category corresponds to one or more bits of the preset identifier.
[0009] The above technical solution allows for the setting of preset identifiers based on the data category corresponding to each preset data source. Each data category can correspond to different bit positions, which can avoid coupling problems during subsequent merging of results.
[0010] In one possible implementation, the method further includes: determining the retrieval results corresponding to the query object on each preset data source based on the database; generating a first code based on each retrieval result and the preset identifier, wherein the number of bits in the first code is the number of bits in the preset identifier.
[0011] The above technical solution can generate a first code corresponding to each search result based on the bit position of the data category in the preset identifier in each preset data source. This ensures that different search results correspond to different first codes, thereby ensuring the uniqueness of the first code.
[0012] In one possible implementation, generating a first code for each search result and the preset identifier includes: determining the data category corresponding to the query object on each preset data source as the search result; determining the target bit corresponding to each search result on the preset identifier according to the correspondence between each data category and the bit in the preset identifier; updating the preset identifier according to the target bit corresponding to each search result to obtain the first code corresponding to the query object on each preset data source.
[0013] The above technical solution can determine the target bit corresponding to each search result based on the bit corresponding to the data category in each preset data source, and then update the preset identifier based on the target bit. This ensures that different search results correspond to different first codes, thereby ensuring the uniqueness of the first code.
[0014] In one possible implementation, updating the preset identifier based on the target bit corresponding to each search result to obtain the first code corresponding to the query object on each preset data source includes: setting the bit value corresponding to the target bit in the preset identifier to a first preset value, and setting the bit values corresponding to other bits in the preset identifier to a second preset value, thereby obtaining the first code.
[0015] The above technical solution allows for the assignment of values to preset identifiers based on the first and second preset values, thereby improving the generation efficiency of the first code.
[0016] In one possible implementation, updating the preset identifier based on the target bit corresponding to each search result to obtain the first code corresponding to the query object on each preset data source includes: shifting the bit value of the preset identifier that takes a first preset value based on the position of the target bit on the preset identifier to obtain the first code.
[0017] The above technical solution can be used to move the bit value of the preset identifier that takes the first preset value according to the position of the target bit on the preset identifier, thereby improving the generation efficiency of the first code.
[0018] In one possible implementation, determining the encoded data based on multiple retrieval results includes: performing an XOR operation on multiple first codes to obtain the encoded data.
[0019] By performing an XOR operation on multiple first codes, the comprehensive retrieval results of the query object on multiple preset data sources can be quickly obtained, improving the efficiency of determining the encoded data. Furthermore, since merging multiple first codes does not result in coupling issues, it can improve the accuracy and efficiency of determining the encoded data.
[0020] In one possible implementation, determining the encoded data based on multiple search results further includes: performing an XOR operation on multiple first codes to obtain a second code; and converting the second code into the encoded data based on a preset rule.
[0021] By performing an XOR operation on multiple first codes and then converting the determined second code, the intuitiveness of the encoded data can be improved.
[0022] In one possible implementation, the method further includes: responding to a change request for any data source, updating the database based on the arbitrary data source; and 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.
[0023] By employing the above technical solution, in response to change requests from any data source, the database is updated based on that data source. This not only avoids including irrelevant data in the database but also ensures the comprehensiveness of the data. Furthermore, when the data source changes, there is no need to rewrite code statements, thus improving the efficiency of data source changes, thereby increasing the evaluation efficiency of query objects and reducing device load.
[0024] In one possible implementation, updating the length of the preset identifier based on the data category of the arbitrary data source in the updated database and the change request includes: determining the number of data categories of the arbitrary data source in the updated database; if the change request is to add a new data source, adding corresponding bits to the preset identifier based on the number of data categories; if the change request is to delete a data source, reducing corresponding bits in the preset identifier based on the number of data categories.
[0025] The above technical solution allows for the selection of an appropriate method to update the length of the preset identifier based on the change request, thereby ensuring that the bits in the updated preset identifier correspond to the data category in each changed data source.
[0026] In one possible implementation, the method further includes: sending the evaluation result to the terminal device that initiated the data query request.
[0027] The above technical solution can send the evaluation results to the terminal device that initiated the data query request, which can assist the terminal device in responding to the request and improve the security of data in the terminal device.
[0028] In one possible implementation, the request type includes one or more of the following types: incoming call request type, application installation request type, and web page access request type.
[0029] The above technical solution allows data query requests to include any of the following types: incoming call request, application installation request, and webpage access request. This can improve the diversity of data queries and the diversity of risk identification.
[0030] Secondly, embodiments of this application provide another data query method based on data source merging. The method includes: responding to a data query request; determining a data table according to the request type of the data query request, wherein the data table pre-stores data corresponding to the request type from multiple preset data sources; determining a first code corresponding to the query object in the data query request on each preset data source based on the data table; performing operations on multiple 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 relationship, wherein the mapping relationship includes a correspondence between preset codes and evaluation results.
[0031] Through the above technical solution, the data table can be determined by the request type. Since the data table pre-stores data corresponding to the request type from multiple preset data sources, when determining the first code corresponding to the query object on multiple preset data sources through the data table, it is not necessary to match the query object with data from other fields in multiple preset data sources. Therefore, the efficiency of determining the first code can be improved. At the same time, since it is not necessary to query from the source tables in multiple preset data sources, the number of queries for the query object can be reduced, thereby further improving the efficiency of determining the first code. By performing operations on multiple first codes, multiple first codes can be directly merged, improving the merging efficiency of multiple first codes. In addition, through the coded data and the preset mapping relationship, the evaluation result corresponding to the query object can be directly determined. Since it is not necessary to merge the evaluation results of the query object on each preset data source again, the efficiency of determining the evaluation result can be further improved, thereby improving the evaluation efficiency of the query object and reducing the device load.
[0032] In one possible implementation, the data table is created based on data obtained from the plurality of preset data sources and corresponding to the plurality of preset types, and the request type is one or more of the plurality of preset types; the data table uses different data table identifiers to distinguish different preset types.
[0033] The above technical solution can store data obtained from multiple preset data sources and corresponding to multiple preset request types into a data table. Different preset types correspond to different data tables, which helps to improve the retrieval efficiency of query objects.
[0034] In one possible implementation, the step of performing operations on multiple first codes to obtain encoded data includes: performing an XOR operation on multiple first codes to obtain second codes; and converting the second codes into the encoded data based on a preset rule.
[0035] By performing an XOR operation on multiple first codes, the comprehensive retrieval results of the query object on multiple preset data sources can be quickly obtained, improving the efficiency of determining the encoded data. Furthermore, since merging multiple first codes does not result in coupling issues, it can improve the accuracy and efficiency of determining the encoded data.
[0036] Thirdly, embodiments of this application provide an electronic device, the electronic device including a memory and a processor: wherein the memory is used to store program instructions; the processor is used to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, the electronic device performs the above-described data query method based on data source merging.
[0037] Fourthly, embodiments of this application provide a computer storage medium storing program instructions that, when executed on an electronic device, cause the processor of the electronic device to perform the aforementioned data query method based on data source merging.
[0038] Furthermore, the technical effects brought about by the second to fourth aspects can be found in the descriptions of the methods in the above-mentioned method section, and will not be repeated here. Attached Figure Description
[0039] Figure 1 This is a schematic diagram of an information recognition scenario.
[0040] Figure 2 This is a schematic diagram of a data query method based on data source merging provided in an embodiment of this application.
[0041] Figure 3 This is a schematic diagram of another scenario of the data query method based on data source merging provided in an embodiment of this application.
[0042] Figure 4 This is a flowchart of a data query method based on data source merging provided in an embodiment of this application.
[0043] Figure 5This is a detailed flowchart of determining the first code provided in an embodiment of this application.
[0044] Figure 6 This is a schematic diagram of a preset identifier provided in an embodiment of this application.
[0045] Figure 7 This is a schematic diagram illustrating the movement relationship between data categories in a preset data source and bit values in a preset identifier, provided in an embodiment of this application.
[0046] Figure 8A This is a schematic diagram of a preset mapping table provided in an embodiment of this application.
[0047] Figure 8B This is a schematic diagram of a preset mapping table provided in another embodiment of this application.
[0048] Figure 8C This is a schematic diagram of a preset mapping table provided in another embodiment of this application.
[0049] Figure 9 This is a flowchart of a data query method based on data source merging provided in another embodiment of this application.
[0050] Figure 10 This is a flowchart of a data query method based on data source merging provided in another embodiment of this application.
[0051] Figure 11 This is a schematic diagram illustrating the movement relationship between the data source and the bit values in the preset identifier before and after the change, according to an embodiment of this application.
[0052] Figure 12 This is a schematic diagram of the preset mapping table corresponding to the data source before and after the change provided in an embodiment of this application.
[0053] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0054] In one embodiment of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in one embodiment of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this application's specification is for the purpose of describing particular embodiments only and is not intended to limit the application. It should be understood that, unless otherwise stated, " / " in this application means "or". For example, A / B can mean A or B. "And / or" in this application is merely a description of 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, and B alone. "At least one" refers to one or more. "More than one" refers to two or more. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, and a, b, and c. Where there is no conflict, the following embodiments and features described herein can be combined with each other.
[0056] Improper operation of user devices can lead to data security issues. For example, after answering a risky call, a user might be tricked into installing a malicious application or visiting a risky website, resulting in the leakage of their private information (such as user account details and payment passwords). To mitigate the risk of data breaches, risk assessment is typically performed on the incoming call number, application information, or website address before the user answers a call, installs an application, or visits a website.
[0057] To improve the accuracy of risk identification of information (using communication numbers as an example below), communication numbers can be queried from multiple online data sources, and then all search results can be merged. The combined search results can then be used to determine whether the communication number poses a risk.
[0058] For example, combining Figure 1 The diagram illustrates an information recognition scenario. In related technologies, the requested communication number can be queried based on a whitelist pre-maintained by the terminal device. If the requested communication number is not found in the whitelist, the requested communication number is then queried through network data source A, network data source B, network data source C, and network data source D respectively (a total of five queries are required). The multiple search results are then merged to obtain a comprehensive search result.
[0059] However, the above method requires querying different data source tables, which increases the number of queries for communication numbers and results in low risk identification efficiency.
[0060] To address the aforementioned issues, this application provides a data query method based on data source merging. (See also...) Figure 2The diagram shown is a scenario illustration of a data query method based on data source merging provided in an embodiment of this application. This data query method based on data source merging can be applied to electronic devices. To clearly illustrate the embodiments of this application, an electronic device is described using a server as an example. Figure 2 As shown, the server builds a database based on data obtained from multiple network data sources. When querying the query object in a data query request, the database in the server is queried once, which can reduce the number of queries for the query object, improve the evaluation efficiency of the query object, and reduce the server load.
[0061] See Figure 3 The diagram shown illustrates another scenario of the data query method based on data source merging provided in an embodiment of this application. This data query method based on data source merging can be applied to electronic devices to identify the query object in a received data query request, thereby completing a risk assessment. For example... Figure 3 As shown, electronic devices can be independent servers, server clusters, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The above are just examples, and actual applications are not limited to these.
[0062] To clearly illustrate the embodiments of this application, the electronic device is described using a server as an example, such as... Figure 3 As shown, the server communicates with multiple terminal devices and one or more database servers. The database server provides different data sources, such as contact numbers, the file source of installation packages, the file version of installation packages, application identifiers, and web addresses. The data source can be a platform built by a specific organization or any enterprise for anti-fraud purposes. Through its connection to the database server, the server can retrieve data from preset data sources and store it in a database created by the server. The database can include multiple tables, each corresponding to different fields of data. For example, table X stores contact numbers, and table Y stores web addresses.
[0063] In some embodiments of this application, when a terminal device receives requests involving information, such as incoming call requests, application installation requests, or webpage access requests, it can generate a corresponding data query request based on the information in the aforementioned requests (e.g., mobile phone number, webpage address, installation package source, etc.) and send the data query request to the server. The server responds to the data query request and performs risk identification on the query object in the data query request according to a data table. For example, if the data query request corresponds to an incoming call request, the server can perform risk identification on the communication number in the data query request.
[0064] For example, the terminal device in the embodiments of this application may be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, as well as cellular phone, personal digital assistant (PDA), artificial intelligence (AI) device, wearable device, in-vehicle device and / or smart home device and other electronic devices.
[0065] See Figure 4 The diagram shown is a flowchart of a data query method based on data source merging provided in an embodiment of this application. This data query method based on data source merging can be applied to electronic devices; the following description uses an electronic device as a server as an example.
[0066] S401, responding to a data query request, determines the data table based on the request type.
[0067] In some embodiments of this application, a user can input a user request on a terminal device. For example, a user can input information related to querying the weather on the terminal device. When the terminal device receives the user request, it can generate a data query request and send it to the server, thereby requesting the server to query the query object (e.g., weather) in the data query request. The terminal device can also request the server to perform risk identification on the query object in the data query request. The following description uses the terminal device requesting risk identification from the server as an example, but the actual application is not limited to this.
[0068] In some embodiments of this application, when a terminal device receives an incoming call or SMS message, or detects that an application needs to be installed or a webpage needs to be accessed, it can generate a data query request and send it to a server. This requests the server to perform risk identification on the query objects (e.g., caller ID, webpage address, etc.) in the data query request. The request types for data query requests may include, but are not limited to, caller ID request types, application installation request types, and webpage access request types. A data query request corresponding to a caller ID request type can be used to perform risk identification on the incoming caller ID. A data query request corresponding to an application installation request type can be used to perform risk identification on the application's installation package file. During the risk identification process, the file source, file version, and other file information of the installation package file can be checked for potential risks. The data query request corresponding to an application installation request type can also be used to perform risk identification on the application's application identifier. A data query request corresponding to a webpage access request type can be used to perform risk identification on the webpage address.
[0069] In one example, when a terminal device receives an incoming call, it can generate a data query request corresponding to the call request type. In other examples, for information received by the terminal device (e.g., SMS), a data query request corresponding to the call request type can also be generated based on the source of the information (e.g., mobile phone number or other number). In another example, when the terminal device's operating system detects a user's application installation request—for example, when the terminal device receives information including application installation information or when the user initiates the installation of an application through an app store or third-party application source—the terminal device can generate a data query request corresponding to the application installation request type. In another example, when the terminal device detects a need to access a webpage, it can generate a data query request corresponding to a webpage access request. In yet another example, when the terminal device receives an incoming call or SMS, it can generate a data query request corresponding to the call request type. After the user answers the call or reads the SMS, when the terminal device detects a need to install an application (e.g., installing an application using an installation package provided in the message), it can generate a data query request corresponding to the application installation request type. After a user answers a call or reads a text message, the terminal device can generate a data query request corresponding to the webpage access request when it detects that a webpage needs to be accessed (for example, accessing a webpage via a URL provided in a text message).
[0070] In some embodiments of this application, to provide risk identification services, the server can pre-create multiple data tables. The server can obtain corresponding data from multiple database servers connected via communication, each database server providing one or more preset data sources. The data pre-stored in the multiple preset data sources may include, but is not limited to: communication numbers (e.g., telephone numbers), the file source of the installation package file (e.g., website address), the file version of the installation package file (e.g., whether the version is V5), the application identifier, and the web address. The server can create one or more data tables according to preset types. Preset types may include, but are not limited to: incoming call request type, application installation request type, and web page access request type. The server can obtain data corresponding to the preset type from multiple preset data sources according to the preset type.
[0071] To improve the efficiency of risk identification of data, in some embodiments of this application, the server sets a corresponding data category for each preset data source in a preset data table. The data category corresponding to the preset data source can be set and adjusted according to the actual scenario. For example, the data category corresponding to the preset data source may include whitelist category, blacklist category, and other categories. Other categories can be categories other than whitelist and blacklist categories. For example, other categories can correspond to data in the following situations: "Does not exist", indicating that the queried data does not exist in the whitelist and blacklist categories; "Unidentifiable", indicating that the queried data cannot be identified. Other categories are only examples and are not limited to these in actual applications. In other embodiments, the data category may also include high-risk category, medium-risk category, low-risk category, and other categories. Other categories can be categories other than high-risk, medium-risk, and low-risk categories (e.g., "Unidentifiable risk"). The server stores the obtained data into the data category corresponding to the preset data table to obtain a data table corresponding to the preset type. The data table can record information such as data, the preset type corresponding to the data, and the data source. The above embodiments describe the creation of a data table corresponding to each data source in the server based on multiple preset data sources. In other embodiments, the server may also classify the data obtained from different data sources according to a preset type, and create corresponding data tables for the classified data. The creation method and type of the data tables can be flexibly adjusted in actual applications, and this application embodiment does not limit this.
[0072] In one example, the preset type is the incoming call request type. The server can obtain the communication number from multiple preset data sources, and store the obtained communication number in the corresponding data category of the preset data source according to the category of the communication number in the corresponding preset data source (e.g., whitelist category, blacklist category, or high-risk category, medium-risk category, low-risk category, etc.), thus obtaining the data table corresponding to the incoming call request type.
[0073] In another example, the preset type is the application installation request type. The server can obtain the file source and / or file version of the installation package file and / or the application identifier of the application (the application identifier is used as an example below) from multiple preset data sources. Based on the category of the application identifier in the corresponding preset data source (e.g., whitelist category, blacklist category, or, for example, high-risk category, medium-risk category, low-risk category, etc.), the server stores the obtained application identifier into the data category corresponding to the preset data table, thus obtaining the data table corresponding to the application installation request type.
[0074] In another example, the preset type is a web page access request type. The server can obtain web page addresses from multiple preset data sources, and store the obtained web page addresses in the corresponding data categories of the preset data sources according to the categories of the web page addresses in the corresponding preset data sources (e.g., whitelist categories, blacklist categories, or high-risk categories, medium-risk categories, low-risk categories, etc.), thus obtaining the data table corresponding to the web page access request type.
[0075] The category used by the server when creating a data table can be determined based on the category of a preset data source, or a custom category can be added, such as other categories mentioned in the above embodiments, which can be customized when creating a data table.
[0076] In other embodiments of this application, to achieve faster risk identification, the server may also obtain data of a specified category from multiple preset data sources. For example, the specified category may be one or more categories such as a whitelist category, a blacklist category, and a high-risk category. Based on the obtained data, the server establishes a corresponding data table.
[0077] In some embodiments of this application, when a data update is detected in any preset data source, the server can update the corresponding data table based on the updated data in any preset data source. For example, when a communication number update is detected in preset data source A, the server can update the data table corresponding to the call request type. Similarly, when an application identifier update is detected in preset data source B, the server can update the data table corresponding to the application installation request type. In other embodiments, the server can periodically update the data table according to a preset time period, for example, once every seven days.
[0078] In another embodiment, data such as phone numbers and web addresses can be used as field data in multiple preset data sources. When it is detected that multiple preset data sources have all updated the same field data, the server can update the corresponding data table based on the updated data in the multiple preset data sources. For example, assuming the field data is related to phone numbers, and the preset data sources include preset data source A, preset data source B, and preset data source C, if preset data source A updates the phone number at 10:00, preset data source B updates the phone number at 13:00, and preset data source C updates the phone number at 16:00, the server can update the data table corresponding to the call request type after 16:00 based on the updated data in preset data sources A, B, and C.
[0079] In some embodiments of this application, different request types may correspond to different data tables. The data tables store data corresponding to the request type from multiple preset data sources. For example, the data in the data table corresponding to the incoming call request type may include communication numbers from multiple preset data sources. The data in the data table corresponding to the application installation request type may include the file source and / or file version of the installation package file and / or application identifier of the application from multiple preset data sources. The data in the data table corresponding to the web page access request type may include web page addresses from multiple preset data sources.
[0080] In some embodiments of this application, data table identifiers can be used to distinguish data tables corresponding to different preset types. For example, a data table identifier represented by "num" can represent a data table corresponding to an incoming call request type; another example is a data table identifier represented by "app," which can represent a data table corresponding to an application installation request type; and yet another example is a data table identifier represented by "add," which can represent a data table corresponding to a webpage access request type. Data table identifiers can be set and adjusted according to actual needs. The above data table identifiers are merely illustrative examples, and actual applications are not limited to these; they can be any combination of letters, numbers, symbols, or characters. The server establishes a correspondence between preset types and data table identifiers. Based on this correspondence, the server determines the corresponding data table according to the request type of the data query request.
[0081] In several embodiments of this application, the corresponding data table can be determined by the request type of the data query request, thereby narrowing the search scope of the query object in the data query request. It is not necessary to query each data query by connecting to the database server every time a data query request is received, thus improving query efficiency.
[0082] S402, based on the data table, determine the first code corresponding to the query object in the data query request on each preset data source.
[0083] In some embodiments of this application, a data query request includes a request identifier, which indicates the type of the data query request. The server can determine the request type corresponding to the data query request based on the request identifier. Each request type corresponds to one or more tags, which are used to extract the corresponding query object from the data query request. Tags can be composed of preset characters of different types, such as letters, numbers, and symbols. Depending on actual needs, different request types can correspond to different tags or the same tags; practical applications do not impose any restrictions on this. The server determines the corresponding tag based on the request type. For example, the tag corresponding to an incoming call request type can be a tag indicating a communication number; the tag corresponding to an application installation request type can be a tag indicating information related to the application, such as, but not limited to, the file source, file version, and application identifier of the installation package file; the tag corresponding to a webpage access request type can be a tag indicating a webpage address.
[0084] In some embodiments of this application, the server extracts query objects from data query requests based on tags. For example, if the request type is an incoming call request, the corresponding tag can be "phone," indicating that information related to communication security, such as phone numbers, needs to be extracted from the data query request as query objects for risk identification. Similarly, if the request type is an application installation request, the corresponding tags can be "source," "app-name," etc. The tag "source" indicates that information related to application installation security needs to be extracted from the data query request, such as the file source of the installation package, as query objects for risk identification. Furthermore, if the request type is a webpage access request, the corresponding tag can be "page." The tag "page" indicates that information related to webpage security needs to be extracted from the data query request, such as webpage URLs, as query objects for risk identification.
[0085] This application embodiment can reasonably determine the corresponding tags by determining the request type of the data query request. Through the tags, the query object can be extracted from the data query request quickly and accurately, thereby improving the efficiency of determining the query object.
[0086] In some embodiments of this application, when retrieving a query object in the server, in order to encode the retrieval results, a preset identifier can be determined based on the data categories corresponding to multiple preset data sources. Then, a first code for representing the retrieval results of the query object is determined based on the preset identifier. The method for determining the first code can be referred to Figure 5 The process shown below, combined with the following text Figure 5 Please provide an explanation.
[0087] S501, determine the preset identifier based on the data category corresponding to each preset data source in the data table.
[0088] In some embodiments of this application, each data category corresponds to one or more bits of a preset identifier. The number of bits in the preset identifier can be determined based on the data categories corresponding to multiple preset data sources. Taking one bit per data category as an example, if multiple preset data sources include data source A, data source B, and data source C, and data source A corresponds to 3 data categories, data source B corresponds to 3 data categories, and data source C corresponds to 3 data categories, then the preset identifier can include 9 bits. Different data categories correspond one-to-one with different bits in the preset identifier. For example, the data category "blacklist" can correspond to the 0th bit in the preset identifier, and the data category "whitelist" can correspond to the 1st bit in the preset identifier. The preset identifier can be any combination of letters, numbers, symbols, or characters. Taking binary as an example, if the preset identifier includes 9 bits, the bit value corresponding to each bit can be used to provide the retrieval result for the data category corresponding to that bit. The preset identifier consists of a first preset value and / or a second preset value. The first preset value and the second preset value can be either 0 or 1, and the first preset value and the second preset value are different. For example, the initial value of the preset identifier can be set to 000 000 000.
[0089] The following text combines Figure 6 The diagram illustrates the case where each data category corresponds to one bit. Figure 6 This is a schematic diagram of a preset identifier provided in an embodiment of this application. For example... Figure 6 As shown, the data categories corresponding to data source A in the data table include: "blacklist", "whitelist", and "not present"; the data categories corresponding to data source B in the data table include: "blacklist", "whitelist", and "not present"; and the data categories corresponding to data source C in the data table include: "blacklist", "whitelist", and "not present". The server can set a preset identifier consisting of 9 bits based on the 9 data categories in data sources A, B, and C. Each bit can indicate a data category. For example, the "not present" category for data source A in the data table can be represented by the 0th bit of the preset identifier; the "whitelist" category for data source A in the data table can be represented by the 1st bit of the preset identifier; and the "blacklist" category for data source C in the data table can be represented by the 8th bit of the preset identifier.
[0090] This application embodiment sets preset identifiers for data categories corresponding to multiple preset data sources. Each data category can correspond to different bits, which can avoid coupling problems when merging results later.
[0091] S502, based on the data table and preset identifiers, determine the first code corresponding to the query object on each preset data source.
[0092] In some embodiments of this application, the first code can be used to indicate the retrieval status of the query object on the corresponding preset data source. The server can update the preset identifier based on the retrieval results corresponding to the query object on each preset data source. The number of bits in the first code can be the number of bits in the preset identifier. The method for determining the first code includes: the server searches for the query object in the data category corresponding to each preset data source based on the data table, and determines the corresponding first code based on all the retrieval results.
[0093] In the embodiments of this application, the search results can represent the search status of the query object in any category of a preset data source. For example, after searching, if it is confirmed that the data category corresponding to the query object in data source A is "blacklist", then the search result corresponding to the query object in data source A can be "blacklist". Similarly, if it is confirmed that the data category corresponding to the query object in data source B is "high-risk", then the search result corresponding to the query object in data source B can be "high-risk". The server determines the target bit corresponding to each search result in a preset identifier based on the correspondence between each data category and bit positions. For example, if the "whitelist" data category in data source A corresponds to the first bit in the preset identifier, and the search result for the query object in data source A is "whitelist", the target bit can be determined as the first bit in the preset identifier. Based on the data table, the server determines the target bit corresponding to each search result based on the search results corresponding to each preset data source, updates the bit value corresponding to the target bit, for example, updating it to a first preset value (e.g., "1"), completes the update of the preset identifier, and obtains the first code corresponding to the query object in each preset data source.
[0094] In one example, the first encoding can be a binary number or a number from another base. The server sets the bit value corresponding to the target bit in the preset identifier to a first preset value, and sets the bit values corresponding to other bits in the preset identifier to a second preset value, thus obtaining the first encoding. The other bits can indicate bits in the preset identifier other than the target bit. The first preset value and the second preset value can have different values; for example, if the first preset value is set to 1, the second preset value can be set to 0; conversely, if the first preset value is set to 0, the second preset value can be set to 1.
[0095] The following text combines Figure 6The diagram illustrates the case where the first encoding is a binary value. Assume the initial value of the preset identifier is 000 000 000, the first preset value is 1, the second preset value is 0, and the bit value corresponding to the target bit is assigned the first preset value "1". For example, if the query object is the communication number "99999999999", and the search result for the communication number "99999999999" on data source A is "not found", the search result for the communication number "99999999999" on data source B is "whitelisted", and the search result for the communication number "99999999999" on data source C is also "whitelisted". Since the "not found" data category in data source A corresponds to the 0th bit, the target bit corresponding to the "not found" search result in data source A is the 0th bit in the preset identifier. The server updates the information corresponding to the target bit in the preset identifier to the first preset value, and updates the information corresponding to the other bits in the preset identifier to the second preset value. Therefore, the first code corresponding to the "not found" search result for the communication number "99999999999" in data source A is 000 000 001. Similarly, the "whitelist" data category in data source B corresponds to the 4th bit, and the "whitelist" data category in data source C corresponds to the 7th bit. Therefore, the first code corresponding to the "whitelist" search result for the communication number "9999999999" in data source B is 000010 000, and the first code corresponding to the "whitelist" search result for the communication number "99999999999" in data source C is 010 000 000.
[0096] In another example, the initial value of the preset identifier can be set to 000 000 001. By shifting the bit values in the preset identifier, the first code corresponding to the query object on each preset data source can be determined. The shift operation includes the bit value to be shifted, the number of bits to shift, and a sign indicating the direction of the shift. For example, 1 << 2 indicates that the bit value "1" in the preset identifier needs to be shifted 2 bits to the left. After shifting the bit value "1" in the preset identifier 000 000 001 2 bits to the left, we get 000 000 100. Based on the position of the target bit in the preset identifier, the server shifts the bit value in the preset identifier that takes the first preset value (e.g., shifts it to the left) to obtain the first code corresponding to the query object on each preset data source.
[0097] The following text combines Figure 7 The diagram is illustrated with an example of the first encoding being a binary value. For example, Figure 7 This is a schematic diagram illustrating the movement relationship between data categories in a preset data source and bit values in a preset identifier, provided in an embodiment of this application. Figure 7 As shown, the data categories of data source A in the data table include: "blacklist", "whitelist", and "not present". The data categories of data source B in the data table also include: "blacklist", "whitelist", and "not present". The data categories of data source C in the data table also include: "blacklist", "whitelist", and "not present". Taking the default identifier set to 000 000 001 as an example, the data category "not present" in data source A corresponds to "1<<0" (the bit value "1" in the default identifier is shifted 0 bits to the left), the data category "whitelist" in data source A corresponds to "1<<1" (the bit value "1" in the default identifier is shifted 1 bit to the left), and the data category "blacklist" in data source A corresponds to "1<<2" (the bit value "1" in the default identifier is shifted 2 bits to the left). In data source B, the data category "Not Found" corresponds to "1<<3" (the bit value "1" in the default identifier shifted 3 bits to the left), the data category "Whitelist" corresponds to "1<<4" (the bit value "1" in the default identifier shifted 4 bits to the left), and the data category "Blacklist" corresponds to "1<<5" (the bit value "1" in the default identifier shifted 5 bits to the left). In data source C, the data category "Not Found" corresponds to "1<<6" (the bit value "1" in the default identifier shifted 6 bits to the left), the data category "Whitelist" corresponds to "1<<7" (the bit value "1" in the default identifier shifted 7 bits to the left), and the data category "Blacklist" corresponds to "1<<8" (the bit value "1" in the default identifier shifted 8 bits to the left).
[0098] For example, if the query object is the communication number "211111111111", and the search result for the communication number "211111111111" on data source A is "not found", the search result "not found" in data source A corresponds to the 0th bit in the preset identifier. Then, the first code corresponding to the search result "not found" in data source A can be obtained by shifting the bit value "1" in the preset identifier 0 bits to the left ("1<<0"). Therefore, the first code of the communication number "21111111111" in data source A is: 000000 001. For example, the search result for the communication number "21111111111" on data source B is "whitelist". The search result "whitelist" in data source B corresponds to the 4th bit in the preset identifier. The first code corresponding to the search result "whitelist" in data source B can be obtained by shifting the bit value "1" in the preset identifier 4 bits to the left ("1<<4"). Therefore, the first code of the communication number "21111111111" in data source B is: 000 010 000. For example, the search result for the communication number "21111111111" on data source C is "whitelist". The search result "whitelist" in data source C corresponds to the 7th bit in the preset identifier. The first code corresponding to the search result "whitelist" in data source C can be obtained by shifting the bit value "1" in the preset identifier 7 bits to the left ("1<<7"). Therefore, the first code of the communication number "21111111111" in data source C is: 010000 000.
[0099] In some embodiments of this application, by applying a data table, it is not necessary to query the query object separately from the source table of each preset data source, which reduces the number of queries and enables the rapid determination of the retrieval results corresponding to the query object on each preset data source. By determining the target bit corresponding to each retrieval result through the bit corresponding to the data category in each preset data source, and then determining the corresponding first code based on the target bit, it is possible to ensure that different retrieval results correspond to different first codes, thereby ensuring the uniqueness of the first code.
[0100] S403 performs operations on multiple first codes to obtain encoded data.
[0101] In some embodiments of this application, the encoded data can indicate the comprehensive search results of the query object on multiple preset data sources. The encoded data can be a binary value, or it can be a value in other bases besides binary, such as a decimal value or a hexadecimal value.
[0102] In some embodiments of this application, the server performs an XOR operation on multiple first codes to obtain encoded data. Continuing with the above embodiments, the multiple first codes include: the first code for the communication number "99999999999" on data source A is 000 000 001; the first code for the communication number "99999999999" on data source B is 000 010 000; and the first code for the communication number "99999999999" on data source C is 010 000 000. Performing an XOR operation on these multiple first codes yields the encoded data: 010 010 001. By performing an XOR operation on multiple first codes, this application can quickly obtain the comprehensive retrieval results of the query object on multiple preset data sources, improving the efficiency of determining the encoded data. Furthermore, since merging multiple first codes does not cause coupling problems, it can improve the accuracy and efficiency of determining the encoded data.
[0103] In other embodiments, the server performs an XOR operation on multiple first codes to obtain a second code. Based on preset rules, the second code is converted into encoded data. These preset rules may include binary-to-decimal conversion algorithms, binary-to-hexadecimal conversion algorithms, etc. Different base conversion algorithms determine different encoded data. Continuing with the above embodiments, the code "010 010001" obtained after performing an XOR operation on multiple first codes is used as the second code. If a binary-to-decimal conversion algorithm is applied to the second code, the encoded data "145" can be obtained. This application embodiment improves the intuitiveness of the encoded data by performing an XOR operation on multiple first codes and then converting the determined second code.
[0104] S404, based on the encoded data and the preset mapping relationship, determines the evaluation result corresponding to the query object.
[0105] In some embodiments of this application, the preset mapping relationship in the server can be presented in the form of a mapping table. For example, a preset mapping table is pre-created in the server, storing the correspondence between preset codes and evaluation results. In practical applications, the preset mapping relationship can also be represented in other forms. The following uses a preset mapping table as an example to illustrate the preset mapping relationship.
[0106] In one example, a preset mapping table can store the correspondence between preset codes and risk levels, combined with... Figure 8A To explain, Figure 8A This is a schematic diagram of a preset mapping table provided in an embodiment of this application. Figure 8AThe example uses a pre-defined code in decimal. In practical applications, the pre-defined code can take other forms. The first column represents the pre-defined code, and the second column represents the risk level. For example, the pre-defined code "292" corresponds to a "high risk" risk level, which means the query result for the target object in at least one pre-defined data source is "blacklisted." Similarly, the pre-defined code "81" corresponds to a "no risk" risk level, which means the query result for the target object in all pre-defined data sources is "whitelisted," and / or, "no risk" means the query result for the target object in all pre-defined data sources includes both "whitelisted" and "not found." In practical applications, the risk level can also be any combination of letters, numbers, symbols, or characters. In one example, if the data query request is a call request, and the assessment result for the communication number in the data query request is "high risk," then the communication number in the data query request is determined to be a high-risk number. In another example, if the data query request is an application installation request, and the assessment result for the application in the data query request is "high risk," then the application in the data query request is determined to be a high-risk application. In another example, if the data query request is a webpage access request, and the evaluation result corresponding to the webpage address in the data query request is "high risk", then the webpage address in the data query request is determined to be a high-risk URL.
[0107] In another example, the preset mapping table can also store the correspondence between preset codes and risk types, combined with... Figure 8B To explain, Figure 8B This is a schematic diagram of a preset mapping table provided in another embodiment of this application. Figure 8BThe example uses a pre-defined code in decimal. In practical applications, the pre-defined code can also take other forms. The first column represents the pre-defined code, and the second column represents the risk type, which can include: fraud, normal, etc. For example, the pre-defined code "100" corresponds to the risk type "fraudulent application." This risk type "fraudulent application" means that the search results for the query object in at least one pre-defined data source are "high risk." For applications with the risk type "fraudulent application," the terminal device will prohibit the download of the related application's installation package file. Similarly, the pre-defined code "33" corresponds to the risk type "rogue application." This risk type "rogue application" means that the search results for the query object in at least one pre-defined data source are "unidentified risk." For applications with the risk type "rogue application," the terminal device will restrict the download of the related application's installation package file. Finally, the pre-defined code "0" corresponds to the risk type "normal application." This risk type "normal application" means that the search results for the query object in all pre-defined data sources are "whitelisted." In another embodiment, the risk type corresponding to the preset code "100" may also include "fraudulent number" and "fraudulent website," etc. The risk type corresponding to the preset code "33" may also include "harassing number" and "malicious website," etc. The risk type corresponding to the preset code "0" may also include "normal number" and "normal website," etc. In practical applications, the risk type can also be any combination of letters, numbers, symbols, or characters.
[0108] In another example, the preset mapping table can also store the correspondence between preset codes, risk levels, and risk types, combined with... Figure 8C To explain, Figure 8C This is a schematic diagram of a preset mapping table provided in another embodiment of this application. Figure 8C The example uses a pre-defined code in decimal. In practical applications, the pre-defined code can also be represented in other ways. The first column represents the pre-defined code, the second column represents the risk level, and the third column represents the risk type. For example, the pre-defined code "100" corresponds to a risk level of "high risk" and a risk type of "fraudulent application". Similarly, the pre-defined code "33" corresponds to a risk level of "high risk" and a risk type of "rogue application". Furthermore, the pre-defined code "0" corresponds to a risk level of "no risk" and a risk type of "normal application".
[0109] In some embodiments of this application, the server determines the information corresponding to the encoded data as the evaluation result based on a preset mapping table. The evaluation result may include the risk level, risk type, etc., of the queried object. Different preset mapping tables can indicate different evaluation results; for example, for... Figure 8A The server determines the assessment results based on the pre-defined mapping table, including the risk level of the queried object (e.g., high risk, medium risk, low risk, unknown risk, etc.); for example, Figure 8B The server determines the evaluation results based on the preset mapping table, including the risk type of the queried object (e.g., risky, not risky, or fraud, rogue, normal, etc.); for example, Figure 8C The server uses a pre-defined mapping table to determine the risk level and risk type of the queried object in the assessment results.
[0110] The embodiments of this application can directly determine the evaluation result of the query object through a preset mapping table. Since the evaluation result can be determined without merging the search results again, the efficiency of determining the evaluation result is improved.
[0111] In some embodiments of this application, the server sends the evaluation result to the terminal device that initiated the data query request. For example, if the evaluation result is of risk level "high risk," the server can send the evaluation result of the query object to the terminal device, for example, the mobile phone number "69999999999" is a high-risk number. If the evaluation result is of risk level "no risk," the server can send the evaluation result of the query object to the terminal device, for example, the mobile phone number "79999999999" is a non-risk number. Similarly, if the evaluation result is of risk type "fraud," the server can send the evaluation result of the query object to the terminal device, for example, the application "YY" is a fraudulent application. If the evaluation result is of risk type "rogue," the server can send the evaluation result of the query object to the terminal device, for example, the application "KK" is a rogue application. If the evaluation result is of risk type "normal," the server can send the evaluation result of the query object to the terminal device, for example, the application "KK" is a normal application.
[0112] This application embodiment provides feedback of the evaluation results to the terminal device that initiated the data query request, enabling a rapid response to the terminal device's request and improving the security of data within the terminal device.
[0113] The data query method based on data source merging provided in this application can determine the data table by request type. Since the data pre-stored in the data table consists of data corresponding to the request type from multiple preset data sources, when determining the first code corresponding to the query object on multiple preset data sources through the data table, it is not necessary to match the query object with data from other fields in multiple preset data sources. Therefore, the efficiency of determining the first code can be improved. At the same time, since it is not necessary to query from the source tables in multiple preset data sources, the number of queries for the query object can be reduced, thereby further improving the efficiency of determining the first code. By performing operations on multiple first codes, multiple first codes can be directly merged, improving the merging efficiency of multiple first codes. In addition, through the coded data and preset mapping relationships, the evaluation result corresponding to the query object can be directly determined. Since it is not necessary to merge the evaluation results of the query object on each preset data source again, the efficiency of determining the evaluation result can be further improved, thereby improving the evaluation efficiency of the query object and reducing the server load.
[0114] See Figure 9 The diagram shown is a flowchart of a data query method based on data source merging, provided in another embodiment of this application. This data query method based on data source merging can be applied to electronic devices; the following description uses an electronic device as a server as an example.
[0115] S901 responds to the data query request and determines the request type and query object corresponding to the data query request.
[0116] In some embodiments of this application, the data query request includes a request identifier, which indicates the type of the data query request. When the server receives a data query request sent by the terminal device, it determines the corresponding request type based on the request identifier. A description of the data query request and the method for determining the request type can be found above. Figure 4 The detailed description of steps S401-S402 is provided in the previous section and will not be repeated here.
[0117] In some embodiments of this application, each request type corresponds to one or more tags. The server extracts the information corresponding to the tags from the data query request as the query object based on the tags corresponding to the request type. The method for determining the query object can be referred to above. Figure 4 The detailed description of step S402 is provided in the previous section and will not be repeated here.
[0118] S902, based on the request type, determine the retrieval results of the query object in the database for each preset data source.
[0119] In some embodiments of this application, the server constructs a database based on data obtained from multiple preset data sources. The database pre-stores data corresponding to the request type from these preset data sources. Based on the request type, the server retrieves the query object from the data corresponding to that request type stored in each preset data source in the database and determines the retrieval results for each preset data source corresponding to the query object.
[0120] In other embodiments, the database may contain multiple tables storing data obtained from multiple preset data sources, corresponding to multiple preset request types. The method by which the server determines the search results from the data tables can be found above. Figure 5 The description of step S502 will not be repeated in this embodiment. In practical applications, other types of files can also be created in the database, and the server can determine the search results from these other types of files.
[0121] S903, based on multiple search results, determine the encoded data.
[0122] In some embodiments of this application, the server can assign a corresponding data category to each preset data source. For example, the server can determine a preset identifier based on the data category corresponding to each preset data source, with each data category corresponding to one or more bits in the preset identifier. Taking one bit of the preset identifier corresponding to each data category as an example, for instance, multiple preset data sources include data source A, data source B, and data source C, where data source A corresponds to 3 data categories, data source B corresponds to 3 data categories, and data source C corresponds to 3 data categories; then the preset identifier can include 9 bits. Taking two bits of the preset identifier corresponding to each data category as an example, for instance, multiple preset data sources include data source A, data source B, and data source C, where data source A corresponds to 3 data categories, data source B corresponds to 3 data categories, and data source C corresponds to 3 data categories; then the preset identifier can include 18 bits. The specific method for determining the preset identifier can be found above. Figure 5 Description of step S501.
[0123] In some embodiments of this application, the server generates a first code based on each search result and a preset identifier, wherein the number of bits in the first code is the same as the number of bits in the preset identifier. For example, the preset identifier includes 9 bits, and the first code includes the bit values corresponding to those 9 bits.
[0124] In some embodiments of this application, the server determines the target bit corresponding to each search result on the preset identifier based on the correspondence between each data category and the bits in the preset identifier. The server updates the preset identifier based on the target bit corresponding to each search result to obtain a first code corresponding to the query object on each preset data source. In one example, the server sets the bit value corresponding to the target bit in the preset identifier to a first preset value, and sets the bit values corresponding to other bits in the preset identifier to second preset values, thus obtaining the first code. In another example, the server performs a shift operation on the bit values in the preset identifier that take the first preset value, based on the position of the target bit on the preset identifier, to obtain the first code. The specific method for determining the first code can be found above. Figure 5 Description of step S502.
[0125] In some embodiments of this application, the server performs an XOR operation on multiple first codes to obtain encoded data. In other embodiments, the server performs an XOR operation on multiple first codes to obtain second codes. The server converts the second codes into encoded data based on preset rules. The method for determining the encoded data can be referred to above. Figure 4 Description of step S403.
[0126] S904, based on the encoded data and the preset mapping relationship, determines the evaluation result corresponding to the query object.
[0127] In some embodiments of this application, the mapping relationship includes a correspondence between preset codes and evaluation results. The server can determine the information corresponding to the encoded data as the evaluation result based on the preset mapping relationship. The server determines the prompt information based on the evaluation result and sends the prompt information to the terminal device that initiated the data query request. The method for determining the evaluation result can be referred to above. Figure 4 The detailed description of step S404 is provided in the previous section and will not be repeated here.
[0128] The data query method based on data source merging provided in this application can determine the retrieval results of a query object in each preset data source in the database based on the request type. Since the database pre-stores data corresponding to the request type from multiple preset data sources, when determining the retrieval results of a query object on multiple preset data sources, it is unnecessary to match the query object with data from other fields in multiple preset data sources. Therefore, the efficiency of determining the retrieval results can be improved. Furthermore, since there is no need to query from the source tables in multiple preset data sources, the number of queries for the query object can be reduced, further improving the efficiency of determining the retrieval results. By determining the encoded data from multiple retrieval results, the direct merging of multiple retrieval results can be achieved, improving the merging efficiency of multiple retrieval results. In addition, by using the encoded data and preset mapping relationships, the evaluation result corresponding to the query object can be directly determined. Since there is no need to merge the evaluation results of the query object corresponding to each preset data source again, the efficiency of determining the evaluation result can be further improved, thereby improving the evaluation efficiency of the query object and reducing the server load.
[0129] In some embodiments of this application, based on the above... Figure 4 The process shown illustrates that after obtaining the evaluation results for the corresponding query object, to further improve the accuracy of risk identification, additional online data sources can be added to identify the query object, or data sources affecting the accuracy of risk identification can be deleted. However, when changing online data sources, it is necessary to reconstruct the merging rules of the search results, which leads to low data source maintenance efficiency and thus affects risk identification efficiency. Furthermore, if a new online data source needs to be added, a query statement in a corresponding format must be written based on the data format of the new online data source, further impacting risk identification efficiency and negatively affecting user experience. To solve the above problems, this application provides... Figure 10 The flowchart shown. (Reference) Figure 10 The diagram shown is a flowchart of a data query method based on data source merging provided in another embodiment of this application.
[0130] S1001 responds to a change request for any data source and updates the database based on that data source.
[0131] In some embodiments of this application, a change request may include adding and / or deleting a data source. The updated database stores the data from the changed data source.
[0132] In one example, if the change request is to add a new data source, the server retrieves the data corresponding to the field labels from the new data source based on the field labels in the database, stores it in the database, and obtains the updated database.
[0133] In another example, if the change request is to delete a data source, the server deletes the data corresponding to the data source to be deleted from the database, resulting in an updated database.
[0134] In another example, if the change request includes an add request to the first data source and a delete request to the second data source, the server deletes the data corresponding to the second data source from the database, and retrieves the data corresponding to the field labels from the first data source based on the field labels in the database, stores it in the database, and obtains the updated database.
[0135] In this embodiment of the application, when the data source is changed, updating the database not only avoids the inclusion of irrelevant data in the database, which would affect the efficiency of risk identification, but also allows for the timely addition of data from the data source to the database, thereby improving the accuracy of risk identification.
[0136] S1002, based on the data category and change request of any data source in the updated database, update the length of the preset identifier.
[0137] In some embodiments of this application, each data category may correspond to at least one bit. Therefore, when the data source changes, the length of the preset identifier needs to be updated according to the data category corresponding to the changed data source.
[0138] In one example, if the change request is to add a new data source, the server adds a bit to the preset identifier. If the change request is to delete a data source, the server decrements a bit from the preset identifier.
[0139] Figure 11 This is a schematic diagram illustrating the movement of bit values in a preset identifier before and after a change in the data source provided in an embodiment of this application. For example... Figure 11As shown, the preset data sources before the change include data source a and data source b. Data source a includes categories 1 to 3, and data source b includes categories 1 to 3. Each category corresponds to one bit. Categories 1 to 3 in data source a can correspond to the 0th to 2nd bits from right to left in the preset identifier. Categories 1 to 3 in data source b can correspond to the 3rd to 5th bits from right to left in the preset identifier. For example, the movement relationship between category 1 in data source a and the bit value in the preset identifier is: shift the bit value "1" in the preset identifier 0 bits to the left (1<<0). The movement relationship between category 2 in data source a and the bit value in the preset identifier is: shift the bit value "1" in the preset identifier 1 bit to the left (1<<1). And so on. The movement relationship between category 3 in data source b and the bit value in the preset identifier is: shift the bit value "1" in the preset identifier 5 bits to the left (1<<5). If the change request is to add a new data source c, then the default data sources after the change include data source a, data source b, and data source c. Data source a includes categories 1 to 3, data source b includes categories 1 to 3, and data source c includes categories 1 to 2. Each category corresponds to one bit. Categories 1 to 3 in data source a can correspond to the 0th to 2nd bits from right to left in the default identifier. Categories 1 to 3 in data source b can correspond to the 3rd to 5th bits from right to left in the default identifier. Categories 1 to 2 in data source c can correspond to the 7th to 8th bits from right to left in the default identifier.
[0140] Therefore, two new bits are added to the preset identifier. For example, the 6th bit in the preset identifier can indicate category 1 in data source c. The relationship between category 1 in data source c and the bit value shift in the preset identifier is: shift the bit value "1" in the preset identifier to the left by 6 bits (1 << 6). Similarly, the 7th bit in the preset identifier can indicate category 2 in data source c. The relationship between category 2 in data source c and the bit value shift in the preset identifier is: shift the bit value "1" in the preset identifier to the left by 7 bits (1 << 7). Therefore, the updated preset identifier includes 8 bits.
[0141] In another example, the server determines the total number of data categories corresponding to the changed data source and resets the preset identifier based on the total number of data categories.
[0142] This application embodiment allows for the selection of an appropriate method to update a preset identifier through a change request, thereby ensuring that the bits in the updated preset identifier correspond to each data category.
[0143] In some embodiments of this application, the preset mapping relationship is reconfigured based on the data categories of all data sources in the updated database.
[0144] In some embodiments of this application, the comprehensive category includes any data category in each preset data source. For example, the preset data sources include data source a and data source b. Data source a includes category 1, category 2 and category 3, and data source b includes category 1, category 2 and category 3. Then, data source a and data source b can include 9 comprehensive categories. The 9 comprehensive categories are: category 1 of data source a and category 1 of data source b, category 2 of data source a and category 1 of data source b, category 3 of data source a and category 1 of data source b, category 1 of data source a and category 2 of data source b, category 2 of data source a and category 2 of data source b, category 3 of data source a and category 2 of data source b, category 1 of data source a and category 3 of data source b, category 2 of data source a and category 3 of data source b, and category 3 of data source a and category 3 of data source b.
[0145] In some embodiments of this application, if the change request is to add a new data source, the comprehensive category of the new data source and the multiple preset data sources is determined based on the data categories in the new data source and the data categories in multiple preset data sources. A preset code corresponding to the comprehensive category is then determined, and a preset mapping table is constructed based on the preset code and the preset result to obtain the reconfigured preset mapping table. In another embodiment, other mapping relationships can be constructed using preset codes and preset results. The following description uses the updating of the preset mapping table as an example.
[0146] Combination Figure 11 and Figure 12 This explains the update of the preset mapping table. Figure 12 This is a schematic diagram of a preset mapping table of the data source provided in an embodiment of this application before and after the change. For example... Figure 11 As shown, the preset data sources before the change include data source a and data source b. Data source a includes categories 1-3, and data source b includes categories 1-3. Data source a and data source b include 9 comprehensive categories. Therefore, the preset mapping table corresponding to data source a and data source b includes the correspondence between 9 preset codes and 9 evaluation results. For example... Figure 11 The preset mapping table is shown. If the change request is to add a new data source c, the changed data sources include data source a, data source b, and data source c. Data source a includes categories 1-3, data source b includes categories 1-3, and data source c includes categories 1-2. Therefore, data sources a, b, and c include 18 comprehensive categories. The reconfigured preset mapping table includes the correspondence between the preset codes corresponding to the 18 comprehensive categories and the 18 evaluation results. For example... Figure 12 The reconfigured preset mapping table is shown.
[0147] S1003, respond to the data query request and determine the request type and query object corresponding to the data query request.
[0148] S1004, Based on the request type, determine the retrieval results of the query object in the database for each preset data source.
[0149] S1005, Based on multiple search results, determine the encoded data.
[0150] S1006, Based on the encoded data and the preset mapping relationship, determine the evaluation result corresponding to the query object.
[0151] For detailed information on steps S1003-S1006, please refer to the above text. Figure 4 and Figure 9 The detailed description will not be repeated here.
[0152] The data query method based on data source merging provided in this application responds to change requests for any data source and updates the database based on that data source. This not only avoids irrelevant data in the database but also ensures the comprehensiveness of the data. Furthermore, when the data source changes, there is no need to rewrite code statements, thus improving the efficiency of data source changes, thereby increasing the evaluation efficiency of the query object and reducing the server load.
[0153] See Figure 13 As shown, the electronic device 100 involved in the embodiments of this application will be described below. The electronic device 100 includes, but is not limited to, personal computers, industrial computers, servers, and other devices. Figure 13 As shown, the electronic device 100 may include a processor 1301, a memory 1302, a communication bus 1303, and a communication interface 1304. The processor 1301, memory 1302, and communication interface 1304 can communicate with each other via the communication bus 1303. The memory 1302 stores one or more computer programs 1304. The one or more computer programs 1304 are configured to be executed by the processor 1301. The one or more computer programs 1304 include instructions, and the processor 1301, by executing these instructions, can implement the aforementioned method for measuring the falling angle within the electronic device 100. The electronic device 100 may be a computer, a server, a server cluster, or other similar device.
[0154] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements.
[0155] Processor 1301 may include one or more processing units, such as: application processor (AP), modem, graphics processing unit (GPU), image signal processor (ISP), controller, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. The different processing units may be independent devices or integrated into one or more processors.
[0156] The processor 1301 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 1301 is a cache memory. This memory can store instructions or data that the processor 1301 has just used or is recurring. If the processor 1301 needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces the waiting time of the processor 1301, and thus improves the efficiency of the system.
[0157] In some embodiments, the processor 1301 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM interface, and / or a USB interface, etc.
[0158] In some embodiments, memory 1302 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other non-volatile solid-state storage device.
[0159] In some embodiments, the communication bus 1303 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 13 The bus is represented by a single line, but this does not mean that there is only one bus or one type of bus. The communication bus 1303 may include a path for transmitting information between various components of the electronic device 100 (e.g., processor 1301, memory 1302, and communication interface 1304).
[0160] In some embodiments, the communication interface 1304 uses a transceiver module, such as, but not limited to, a network interface card or a transceiver, to enable communication between the electronic device 100 and other devices or communication networks.
[0161] This application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on the electronic device 100, the electronic device 100 performs the aforementioned related method steps to implement the fall angle measurement method in the above embodiments.
[0162] This application also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the fall angle measurement method described in the above embodiments.
[0163] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0164] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0165] The unit described as a separate component may or may not be physically separate. The component shown as a unit can be one physical unit or multiple physical units, that is, it can be located in one place or distributed in multiple different places. Some or all of the units can be selected to achieve the purpose of the embodiment of this application according to actual needs.
[0166] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0167] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0168] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A data query method based on data source merging, applied to electronic devices, characterized in that, The electronic device has a database built into it, and the method includes: In response to a data query request, determine the request type and query object corresponding to the data query request; Based on the request type, the retrieval results of the query object corresponding to each preset data source in the database are determined, and the database stores data corresponding to the request type from multiple preset data sources in advance; Based on multiple search results, the encoded data is determined, including: determining a preset identifier according to the 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 in the first code is the number of bits in the preset identifier; and performing operations on multiple first codes to obtain the encoded data. Based on the encoded data and the preset mapping relationship, the evaluation result corresponding to the query object is determined, and the mapping relationship includes the correspondence between the preset encoding and the evaluation result.
2. The data query method based on data source merging as described in claim 1, characterized in that, The database contains data tables that store data obtained from multiple preset data sources and corresponding to multiple preset request types.
3. The data query method based on data source merging as described in claim 1 or 2, characterized in that, Each data category corresponds to one or more bits of the preset identifier.
4. The data query method based on data source merging as described in claim 1, characterized in that, The method further includes: Based on the database, the retrieval results corresponding to the query object on each preset data source are determined.
5. The data query method based on data source merging as described in claim 1, characterized in that, The step of generating a first code based on each search result and the preset identifier includes: Based on the correspondence between each data category and the bits in the preset identifier, determine the target bit corresponding to each search result on the preset identifier; Based on the target bit corresponding to each search result, the preset identifier is updated to obtain the first code of the query object on each preset data source.
6. The data query method based on data source merging as described in claim 5, characterized in that, The step of updating the preset identifier based on the target bit corresponding to each search result to obtain the first code of the query object on each preset data source includes: The first encoding is obtained by setting the bit value corresponding to the target bit in the preset identifier to a first preset value and setting the bit values corresponding to other bits in the preset identifier to a second preset value.
7. The data query method based on data source merging as described in claim 5, characterized in that, The step of updating the preset identifier based on the target bit corresponding to each search result to obtain the first code of the query object on each preset data source includes: Based on the position of the target bit on the preset identifier, a shift operation is performed on the bit value of the preset identifier that takes the value of a first preset value to obtain the first code.
8. The data query method based on data source merging as described in claim 6 or 7, characterized in that, The process of determining coded data based on multiple search results includes: The encoded data is obtained by performing an XOR operation on multiple first codes.
9. The data query method based on data source merging as described in claim 6 or 7, characterized in that, The process of determining coded data based on multiple search results also includes: Perform an XOR operation on multiple first codes to obtain second codes; Based on preset rules, the second encoding is converted into the encoded data.
10. The data query method based on data source merging as described in claim 1, characterized in that, The method further includes: In response to a change request for any data source, update the database based on the arbitrary data source; The length of the preset identifier is updated based on the data category of the arbitrary data source in the updated database and the change request.
11. The data query method based on data source merging as described in claim 10, characterized in that, The step of updating the length of the preset identifier based on the data category of the arbitrary data source in the updated database and the change request includes: Determine the number of data categories of the arbitrary data source in the updated database; If the change request is for adding a new data source, add a corresponding bit to the preset identifier based on the number of data categories; If the change request is to delete a data source, the corresponding bits in the preset identifier are reduced based on the number of data categories.
12. The data query method based on data source merging as described in claim 1, characterized in that, The method further includes: The evaluation results are sent to the terminal device that initiated the data query request.
13. The data query method based on data source merging as described in claim 1, characterized in that, The request types include one or more of the following: incoming call request type, application installation request type, and web page access request type.
14. A data query method based on data source merging, characterized in that, The method includes: In response to a data query request, a data table is determined based on the request type of the data query request. The data table stores data corresponding to the request type from multiple preset data sources in advance. Based on the data table, determining the first code corresponding to the query object in the data query request on each preset data source includes: determining a preset identifier according to the data category corresponding to each preset data source in the data table; and determining the 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 in the first code is the number of bits in the preset identifier. Perform operations on multiple first codes to obtain encoded data; Based on the encoded data and the preset mapping relationship, the evaluation result corresponding to the query object is determined, and the mapping relationship includes the correspondence between the preset encoding and the evaluation result.
15. The data query method based on data source merging as described in claim 14, characterized in that, The data table is created based on data obtained from the multiple preset data sources and corresponding to multiple preset types. The request type is one or more of the multiple preset types. The data table uses different data table identifiers to distinguish different preset types.
16. The data query method based on data source merging as described in claim 14, characterized in that, The process of performing operations on multiple first codes to obtain encoded data includes: Perform an XOR operation on multiple first codes to obtain second codes; Based on preset rules, the second encoding is converted into the encoded data.
17. An electronic device, characterized in that, The electronic device includes a memory and a processor: The memory is used to store program instructions; The processor is configured to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, cause the electronic device to perform the data query method based on data source merging as described in any one of claims 1 to 16.
18. A computer storage medium, characterized in that, The computer storage medium stores program instructions that, when executed on an electronic device, cause the processor of the electronic device to perform the data query method based on data source merging as described in any one of claims 1 to 16.
Citation Information
Patent Citations
Data inquiry control method and device, computer device and storage medium
CN109446253A
Graph database-based multi-data source joint query method and system
CN114265957A
Risk data storage and acquisition method and device, equipment and medium
CN114862548A