Data query method based on data source merging, electronic equipment and storage medium
By constructing a database to store data from multiple preset data sources and using coded data and mapping relationships, the problem of inefficient query in the prior art is solved, and efficient evaluation result determination and equipment load reduction are achieved.
Patent Information
- Application Number
- CN202411699624.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2044-11-25
AI Technical Summary
In the prior art, when determining the evaluation results from multiple network data sources, multiple queries are required to cause inefficient query and affect user experience.
By constructing a database, the data corresponding to the request type in multiple preset data sources is stored in advance, the search results of the query object in the database are determined based on the request type, and the evaluation results are directly determined through the encoded data and mapping relationship, reducing the number of queries and merging operations.
It improves the evaluation efficiency of query objects, reduces equipment load, and ensures the accuracy and merging efficiency of query results.
Smart Images

Figure CN120429341A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of terminals, and particularly relates to a data query method, an electronic device, and a storage medium based on data source merging. Background Art
[0002] With the development of electronic devices, the functions supported by electronic devices are becoming more and more abundant. For example, through an electronic device, an evaluation result of a query object (such as a communication number) can be determined from multiple network data sources. In related technologies, when an electronic device determines an evaluation result from multiple network data sources, it is necessary to determine the retrieval result of the communication number from the source table corresponding to each network data source. By merging the retrieval results corresponding to each network data source, an evaluation result of the query object corresponding to multiple network data sources can be obtained. However, this method requires multiple queries of the communication number, resulting in low query efficiency and thus affecting 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, an electronic device, and a 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, which is applied to an electronic device in which a database is built. The method includes: responding to a data query request, determining a request type corresponding to the data query request and a query object; based on the request type, determining a retrieval result of the query object corresponding to each preset data source in the database, where data corresponding to the request type in multiple preset data sources is pre-stored in the database; based on multiple retrieval results, determining encoded data; based on the encoded data and a preset mapping relationship, determining an evaluation result corresponding to the query object, where the mapping relationship includes a corresponding relationship between a preset code and an evaluation result.
[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 according to the request type. Since the data corresponding to the request type is pre-stored in multiple preset data sources in the database, when determining the retrieval results of the query object corresponding to multiple preset data sources through the database, there is no need to match the query object with the data of other fields in multiple preset data sources. Therefore, the efficiency of determining the retrieval results can be improved. At the same time, 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, thereby further improving the efficiency of determining the retrieval results. Determining the encoded data through multiple retrieval results can directly merge multiple retrieval results and improve the merging efficiency of multiple retrieval results. In addition, through the encoded data and the preset mapping relationship, the evaluation result corresponding to the query object can be directly determined. Since there is no need to merge the evaluation results corresponding to the query object in each preset data source again, the efficiency of determining the evaluation results can be further improved, thereby improving the evaluation efficiency of the query object and reducing the device load.
[0006] In a possible implementation manner, a data table is created in the database, and the data table stores the data obtained from multiple preset data sources and corresponding to multiple preset request types.
[0007] Through the above technical solution, the data obtained from multiple preset data sources and corresponding to multiple preset request types can be stored in the data table, which is beneficial to improving the retrieval efficiency of the query object.
[0008] In a possible implementation manner, the method further includes: determining a preset identifier according to the data category corresponding to each preset data source, and each data category corresponds to one or more bit positions in the preset identifier.
[0009] Through the above technical solution, a preset identifier can be set according to the data category corresponding to each preset data source. Among them, each data category can correspond to different bit positions, which can avoid the problem of coupling when merging results later.
[0010] In a possible implementation manner, the method further includes: based on the database, determining the retrieval results of the query object corresponding to each preset data source; generating a first code based on each retrieval result and the preset identifier, and the number of bits of the first code is the number of bit positions in the preset identifier.
[0011] Through the above technical solution, the first code corresponding to each retrieval result can be generated according to the bit position in the preset identifier corresponding to the data category in each preset data source, which can ensure that different retrieval results correspond to different first codes, thereby ensuring the uniqueness of the first code.
[0012] In a possible implementation, generating a first encoding based on each retrieval result and the preset identifier includes: determining the data category corresponding to the query object on each preset data source as the retrieval result; determining the target bit position corresponding to each retrieval result on the preset identifier according to the correspondence between each data category and the bits in the preset identifier; and updating the preset identifier according to the target bit position corresponding to each retrieval result to obtain the first encoding corresponding to the query object on each preset data source.
[0013] Through the above technical solution, the target bit position corresponding to each retrieval result can be determined according to the bit position corresponding to the data category in each preset data source, and then the preset identifier can be updated based on the target bit position, which can ensure that different retrieval results correspond to different first encodings, thereby ensuring the uniqueness of the first encoding.
[0014] In a possible implementation, updating the preset identifier according to the target bit position corresponding to each retrieval result to obtain the first encoding corresponding to the query object on each preset data source includes: setting the bit value corresponding to the target bit position in the preset identifier to a first preset value, and setting the bit values corresponding to other bit positions in the preset identifier to a second preset value to obtain the first encoding.
[0015] Through the above technical solution, the preset identifier can be assigned values according to the first preset value and the second preset value, which can improve the generation efficiency of the first encoding.
[0016] In a possible implementation, updating the preset identifier according to the target bit position corresponding to each retrieval result to obtain the first encoding corresponding to the query object on each preset data source includes: moving the bit value with the first preset value in the preset identifier based on the position corresponding to the target bit position in the preset identifier to obtain the first encoding.
[0017] Through the above technical solution, the bit value with the first preset value in the preset identifier can be moved according to the position corresponding to the target bit position in the preset identifier, which can improve the generation efficiency of the first encoding.
[0018] In a possible implementation, determining the encoded data based on multiple retrieval results includes: performing an exclusive OR operation on multiple first encodings to obtain the encoded data.
[0019] Through the above technical solution, performing an XOR operation on multiple first codes can quickly obtain a comprehensive search result for the query object across multiple preset data sources, thereby improving the efficiency of determining the coded data. In addition, because the merging of multiple first codes does not cause coupling issues, the accuracy and efficiency of determining the coded data can be improved.
[0020] In a possible implementation, determining the coded 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 coded data based on a preset rule.
[0021] Through the above technical solution, after performing an XOR operation on multiple first codes, the determined second code is converted, which can improve the intuitiveness of the encoded data.
[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] The above technical solution responds to change requests for any data source and updates the database based on that data source, preventing irrelevant data from being included in the database while ensuring the comprehensiveness of the data in the database. Furthermore, when a data source is changed, there is no need to rewrite code statements, thereby improving the efficiency of data source changes, thereby increasing the efficiency of query object evaluation 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, based on the number of data categories, adding corresponding bits in the preset identifier; if the change request is to delete a data source, based on the number of data categories, reducing corresponding bits in the preset identifier.
[0025] With the above technical solution, a suitable method can be selected to update the length of the preset identifier according to 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 a possible implementation, the method further includes: sending the evaluation result to a terminal device that initiates the data query request.
[0027] Through the above technical solution, the evaluation result can be sent to the terminal device that initiates the data query request, which can assist the terminal device in responding to the request and improve the security of the data in the terminal device.
[0028] In a possible implementation manner, the request type includes one or more of the following types: incoming call request type, application installation request type, and web access request type.
[0029] Through the above technical solution, the request type of the data query request includes any one of the incoming call request type, the application installation request type, and the web access request type, which can improve the diversity of data queries and the diversity of risk identification.
[0030] In a second aspect, an embodiment of the present application provides 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, where the data table pre-stores data corresponding to the request type in multiple preset data sources; based on the data table, determining a first code corresponding to the query object in the data query request on each preset data source; performing an operation on multiple first codes to obtain coded data; and based on the coded data and a preset mapping relationship, determining an evaluation result corresponding to the query object, where the mapping relationship includes the corresponding relationship between the preset code and the evaluation result.
[0031] Through the above technical solution, the data table can be determined by the request type. Since the data pre-stored in the data table is the data corresponding to the request type in multiple preset data sources, when determining the first code corresponding to the query object on multiple preset data sources through the data table, there is no need to match the query object with the data of other fields in multiple preset data sources. Therefore, the determination efficiency of the first code can be improved. At the same time, since there is no need to query from the source tables in multiple preset data sources, the query times of the query object can be reduced, thereby further improving the determination efficiency of the first code. By performing an operation 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 there is no need to merge the evaluation results of the query object on each preset data source again, the determination efficiency of the evaluation result can be further improved, thereby improving the evaluation efficiency of the query object and reducing the device load.
[0032] In a possible implementation manner, the data table is created based on the data corresponding to multiple preset types obtained from the multiple preset data sources, and the request type is one or more of the multiple preset types; different preset types are distinguished by different data table identifiers.
[0033] Through the above technical solution, the data obtained from multiple preset data sources and corresponding to multiple preset request types can be stored in a data table, and different preset types correspond to different data tables, which is beneficial to improving the retrieval efficiency of query objects.
[0034] In a possible implementation manner, the operation on multiple first encodings to obtain encoded data includes: performing an exclusive OR operation on multiple first encodings to obtain a second encoding; and converting the second encoding into the encoded data based on a preset rule.
[0035] Through the above technical solution, performing an exclusive OR operation on multiple first encodings can quickly obtain the comprehensive retrieval result of a query object on multiple preset data sources and improve the determination efficiency of the encoded data. In addition, since there is no coupling problem in the combination of multiple first encodings, the accuracy and determination efficiency of the encoded data can be improved.
[0036] In a third aspect, an embodiment of the present application provides an electronic device, which includes 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 executes the above data query method based on data source merging.
[0037] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores program instructions. When the program instructions run on an electronic device, the processor of the electronic device executes the above data query method based on data source merging.
[0038] In addition, for the technical effects brought by the second to fourth aspects, reference can be made to the descriptions related to the methods designed in the above method part, and details are not described here again. Description of the Drawings
[0039] Figure 1 is a schematic diagram of an information recognition scenario.
[0040] Figure 2 is a schematic diagram of a scenario of the data query method based on data source merging provided by an embodiment of the present application.
[0041] Figure 3 is another schematic diagram of a scenario of the data query method based on data source merging provided by an embodiment of the present application.
[0042] Figure 4 is a flowchart of the data query method based on data source merging provided by an embodiment of the present application.
[0043] Figure 5It is a detailed flowchart for determining a first encoding provided by an embodiment of the present application.
[0044] Figure 6 It is a schematic diagram of a preset identifier provided by an embodiment of the present application.
[0045] Figure 7 It is a schematic diagram of the moving relationship between data categories in a preset data source and bit values in a preset identifier provided by an embodiment of the present application.
[0046] Figure 8A It is a schematic diagram of a preset mapping table provided by an embodiment of the present application.
[0047] Figure 8B It is a schematic diagram of a preset mapping table provided by another embodiment of the present application.
[0048] Figure 8C It is a schematic diagram of a preset mapping table provided by yet another embodiment of the present application.
[0049] Figure 9 It is a flowchart of a data query method based on data source merging provided by another embodiment of the present application.
[0050] Figure 10 It is a flowchart of a data query method based on data source merging provided by another embodiment of the present application.
[0051] Figure 11 It is a schematic diagram of the moving relationship between a data source before and after change and bit values in a preset identifier provided by an embodiment of the present application.
[0052] Figure 12 It is a schematic diagram of the corresponding preset mapping table of a data source before and after change provided by an embodiment of the present application.
[0053] Figure 13 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0054] In an embodiment of the present application, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in an embodiment of the present application should not be construed as more preferred or more advantageous than other embodiments or design solutions. Exactly speaking, using words such as "exemplary" or "for example" aims to present relevant concepts in a specific 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 technical field to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. It should be understood that unless otherwise specified in this application, " / " means "or". For example, A / B may represent A or B. The "and / or" in this application is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone, these three situations. "At least one" means one or more. "Multiple" means two or more than two. For example, at least one of a, b, or c may represent: a, b, c, a and b, a and c, b and c, a, b, and c, these seven situations. Without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0056] When a user uses a terminal device, improper operation may cause data security problems. For example, after answering a risky call, the user may be induced to install a risky application or access a risky website on the terminal device, resulting in the leakage of the user's private information (such as the user account number, payment password). To reduce the risk of data leakage, usually before the user answers a call, installs an application, or accesses a website, etc., risk identification is performed on the communication number corresponding to the call, application information, or website address.
[0057] To improve the risk identification accuracy of information (hereinafter exemplified by a communication number), the communication number can be queried separately from multiple network data sources, and then the merged processing is performed on all retrieval results, and whether the communication number has a risk is determined through the comprehensive retrieval result obtained by the merging.
[0058] For example, in combination with Figure 1 the schematic diagram of the information identification scenario shown, in the related art, the communication number requested can be queried based on the whitelist maintained in advance by the terminal device. If the requested communication number does not exist in the whitelist, the communication number requested is then queried separately through network data source A, network data source B, network data source C, and network data source D (a total of five queries are required), and the multiple retrieval results obtained are merged to obtain a comprehensive retrieval result.
[0059] However, the above method requires querying different data source tables, resulting in an increase in the number of queries for the communication number and causing low risk identification efficiency.
[0060] To solve the above problems, the embodiments of this application provide a data query method based on data source merging. Refer to Figure 2As shown in the figure, it is a schematic diagram of the scenario of the data query method based on data source merging provided by an embodiment of the present application. The data query method based on data source merging can be applied to an electronic device. For the sake of clearly explaining the embodiments of the present application, the electronic device is described by taking a server as an example. For example, Figure 2 As shown, the server establishes a database according to the data obtained from multiple network data sources. When querying the query object in the data query request, by querying the database in the server (querying once), the query times of the query object can be reduced, the evaluation efficiency of the query object can be improved, and the load of the server can be reduced.
[0061] Refer to Figure 3 As shown in the figure, it is another schematic diagram of the scenario of the data query method based on data source merging provided by an embodiment of the present application. The data query method based on data source merging can be applied to an electronic device to identify the query object in the received data query request, so as to complete the risk assessment. For example, Figure 3 As shown, the electronic device can be an independent server, a server cluster, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, that is, a content delivery network (Content Delivery Network, CDN), and big data and artificial intelligence platforms. The above are only examples, and in actual applications, it is not limited to this.
[0062] For the sake of clearly explaining the embodiments of the present application, the electronic device is described by taking a server as an example. For example, Figure 3 As shown, the server is communicatively connected to multiple terminal devices and one or more database servers. The database server provides different data sources. For example, the data source can provide various types of data such as communication numbers, file sources of installation package files, file versions of installation package files, application identifiers of application programs, and web page addresses. The data source can be a platform for anti-fraud established by a specific institution or any enterprise. The server can obtain data from the preset data source through the connection with the database server and store it in the database created by the server. The database can include multiple data tables, and different data tables correspond to data of different fields. For example, data table X stores communication numbers, and data table Y stores web page addresses.
[0063] In some embodiments of the present application, when the terminal device receives requests related to information such as incoming call requests, application installation requests, and web access requests, it can generate corresponding data query requests based on the information in the above requests (for example, mobile phone numbers, web addresses, installation package sources, etc.), and send the data query requests to the server. The server responds to the data query requests and performs risk identification on the query objects in the data query requests according to the data tables. 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] Exemplarily, the terminal device in the embodiments of the present application may be an electronic device such as a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, and / or a smart home device.
[0065] Refer to Figure 4 As shown, it is a flowchart of a data query method based on data source merging provided by an embodiment of the present application. The data query method based on data source merging can be applied to an electronic device. Hereinafter, the server is taken as an example of the electronic device for illustration.
[0066] S401, in response to the data query request, determine the data table according to the request type of the data query request.
[0067] In some embodiments of the present application, the user can input user requirements on the terminal device. For example, the user can input information related to querying the weather on the terminal device. When the terminal device receives the user requirements, it can generate a data query request and send the data query request to the server, so as to request the server to query the query object (for example, the 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. Hereinafter, the example of the terminal device requesting risk identification from the server is taken for illustration, and the actual application is not limited thereto.
[0068] In some embodiments of the present application, when the terminal device receives an incoming call or a text message, or detects a need to install an application or access a webpage, it can generate a data query request and send the data query request to the server, thereby requesting the server to perform risk identification on the query object in the data query request (e.g., the incoming call number, the webpage address, etc.). The request types of the data query request can include, but are not limited to: incoming call request type, application installation request type, webpage access request type. The data query request corresponding to the incoming call request type can be used to perform risk identification on the communication number of the incoming call. The data query request corresponding to the application installation request type can be used to perform risk identification on the installation package file of the application program. During the process of performing risk identification on the installation package file of the application program, it can be detected whether there are risks in file information such as the file source and file version of the installation package file. The data query request corresponding to the application installation request type can also be used to perform risk identification on the application identifier of the application program. The data query request corresponding to the webpage access request type can be used to perform risk identification on the webpage address.
[0069] In one example, when the terminal device receives an incoming call, it can generate a data query request corresponding to the incoming call request type. In other examples, for the information received by the terminal device (e.g., a mobile phone text message), a data query request corresponding to the incoming call request type can also be generated for the source of the sent information (e.g., a mobile phone number or other number). In another example, when the operating system of the terminal device monitors the user's application installation request, for example, the information received by the terminal device includes application installation information or the user initiates the installation of a certain application through the application market or a 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, the terminal device can generate a data query request corresponding to the webpage access request. In another example, when the terminal device receives an incoming call or a text message, it can generate a data query request corresponding to the incoming call request type. After the user answers the incoming call or reads the text message, when the terminal device detects a need to install an application (e.g., install an application through the installation package provided in the message), it can generate a data query request corresponding to the application installation request type. After the user answers the incoming call or reads the text message, when the terminal device detects a need to access a webpage (e.g., access a webpage through the website provided in the text message), it can generate a data query request corresponding to the webpage access request.
[0070] In some embodiments of the present application, in order to provide risk identification services, the server may pre-create multiple data tables. The server may obtain corresponding data from multiple database servers connected by communication. Each database server may provide one or more preset data sources. The data pre-stored in the multiple preset data sources may include, but are not limited to: communication numbers (e.g., phone numbers), file sources of installation package files (e.g., website addresses), file versions of installation package files (e.g., whether the version is V5 version), application identifiers of applications, and web page addresses. The server may create one or more data tables according to preset types. The preset types may include, but are not limited to: incoming call request types, application installation request types, and web page access request types. The server may obtain data corresponding to the preset types from the multiple preset data sources.
[0071] In order to improve the risk identification efficiency of data, in some embodiments of the present application, the server sets corresponding data categories for each preset data source in the preset data table. The data categories corresponding to the preset data sources may be set and adjusted according to the actual scenario. For example, the data categories corresponding to the preset data sources may include whitelist categories, blacklist categories, and other categories. The other categories may be categories other than the whitelist categories and blacklist categories. For example, the other categories may correspond to data in the following multiple situations: "does not exist", indicating that the queried data does not exist in the whitelist category and the blacklist category; "unable to identify", indicating that the queried data cannot be identified. The other categories are only for illustrative purposes and are not limited to this in actual applications. In some other embodiments, the data categories may further include high-risk categories, medium-risk categories, low-risk categories, and other categories. The other categories may be categories other than the high-risk categories, medium-risk categories, and low-risk categories (e.g., "unable to identify risk"). The server stores the obtained data into the data categories corresponding to the preset data table to obtain the data table corresponding to the preset type. Information such as data, the preset type corresponding to the data, and the data source may be recorded in the data table. The above embodiments introduce creating data tables corresponding to each data source in the server according to multiple preset data sources. In some other embodiments, the server may also classify the data obtained from different data sources according to the preset types and create corresponding data tables for the classified data respectively. The creation methods and types of the data tables may be flexibly adjusted in actual applications, and the embodiments of the present application do not limit this.
[0072] In an example, when the preset type is an incoming call request type, the server may obtain the communication number from the multiple preset data sources and store the obtained communication number into the data category corresponding to the preset data table 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.) to obtain the data table corresponding to the incoming call request type.
[0073] In another example, the preset type is an application installation request type. The server can obtain the file source of the installation package file and / or the file version of the installation package file and / or the application identifier of the application program (hereinafter, the application identifier of the application program is taken as an example) from multiple preset data sources. The server stores the obtained application identifier in the corresponding data category of the preset data table according to the category of the application identifier in the corresponding preset data source (for example, the whitelist category, the blacklist category, and for another example, the high-risk category, the medium-risk category, the low-risk category, etc.), and obtains the data table corresponding to the application installation request type.
[0074] In another example, the preset type is a web access request type. The server can obtain the web address from multiple preset data sources, and store the obtained web address in the corresponding data category of the preset data table according to the category of the web address in the corresponding preset data source (for example, the whitelist category, the blacklist category, and for another example, the high-risk category, the medium-risk category, the low-risk category, etc.), and obtain the data table corresponding to the web access request type.
[0075] The category based on which the server creates the data table can be determined based on the category of the preset data source, or a custom category can be added. For example, other categories mentioned in the above embodiments can be customized when creating the data table.
[0076] In other embodiments of the present application, in order to achieve faster risk identification, the server can also obtain data of a specified category from multiple preset data sources. For example, the specified category can be one or more of categories such as the whitelist category, the blacklist category, the high-risk category, etc. The server establishes a corresponding data table according to the obtained data.
[0077] In some embodiments of the present application, when detecting data update 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 detecting the update of the communication number in preset data source A, the server can update the data table corresponding to the incoming call request type. Another example is that when detecting the update of the application identifier 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 update the data table regularly according to a preset time period. For example, it is updated once every seven days.
[0078] In another embodiment, data such as communication numbers, web addresses, etc. can be used as field data in multiple preset data sources. When it is detected that all the multiple preset data sources have completed the update of a certain type of field data, the server can update the corresponding data table based on the updated data in the multiple preset data sources. For example, assuming that the field data is data related to communication numbers, and the preset data sources include preset data source A, preset data source B, and preset data source C. If the update time of the communication number by preset data source A is 10:00, the update time of the communication number by preset data source B is 13:00, and the update time of the communication number by preset data source C is 16:00, the server can, after 16:00, update the data table corresponding to the incoming call request type according to the updated data in preset data source A, preset data source B, and preset data source C.
[0079] In some embodiments of the present application, different request types can correspond to different data tables, and the data tables store the data in multiple preset data sources corresponding to the request types. For example, the data in the data table corresponding to the incoming call request type can include communication numbers in multiple preset data sources, and the data in the data table corresponding to the application installation request type can include the file source of the installation package file and / or the file version of the installation package file and / or the application identifier of the application program, and the data in the data table corresponding to the web access request type can include web addresses in multiple preset data sources.
[0080] In some embodiments of the present application, data tables corresponding to different preset types can be distinguished by using data table identifiers. For example, if the data table identifier is expressed as "num", it can represent the data table corresponding to the incoming call request type; another example is that if the data table identifier is expressed as "app", it can represent the data table corresponding to the application installation request type; and another example is that if the data table identifier is expressed as "add", it can represent the data table corresponding to the web access request type. The data table identifier can be set and adjusted according to actual needs. The above data table identifiers are only for illustrative purposes, and the actual application is not limited to this, and it can be any combination of letters, numbers, symbols, or characters. The server establishes the corresponding relationship between the preset type and the data table identifier, and based on this corresponding relationship, the server determines the corresponding data table according to the request type of the data query request.
[0081] In multiple embodiments of the present application, the corresponding data table can be determined through the request type of the data query request, so as to be able to narrow the search range of the query object in the data query request, and there is no need to query one by one by connecting to the database server every time a data query request is received, thereby improving the 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 the present application, the data query request includes a request identifier, which is used to indicate the type of the data query request. The server can determine the corresponding request type of the data query request according to the request identifier of the data query request. Each request type corresponds to one or more tags, and the tags are used to extract corresponding query objects from the data query request. The tags can be composed of different types of characters such as preset letters, numbers, symbols, etc. According to actual needs, different request types can correspond to different tags or the same tags, and the actual application places no restrictions on this. The server determines the corresponding tags according to the request type. For example, the tag corresponding to the incoming call request type can be the tag indicating the communication number; the tag corresponding to the application installation request type can be the tag indicating information related to the application program. For example, the application program information may include, but is not limited to, the file source of the installation package file, the file version, and the application identifier of the application program; the tag corresponding to the web page access request type can be the tag indicating the web page address.
[0084] In some embodiments of the present application, the server extracts the query object from the data query request based on the tag. For example, if the request type is the incoming call request type, the corresponding tag can be "phone", and the tag "phone" means that information related to communication security, such as the phone number, etc., needs to be extracted from the data query request as the query object for risk identification. Another example, if the request type is the application installation request type, the corresponding tags can be "source", "app-name", etc. The tag "source" means that information related to application installation security, such as the file source of the installation file package, etc., needs to be extracted from the data query request as the query object for risk identification. Another example, if the request type is the web page access request type, the corresponding tag can be "page". The tag "page" means that information related to web page security, such as the web page URL, etc., needs to be extracted from the data query request as the query object for risk identification.
[0085] By determining the request type of the data query request, the embodiments of the present application can reasonably determine the corresponding tags, and through the tags, the query object can be quickly and accurately extracted from the data query request, improving the determination efficiency of the query object.
[0086] In some embodiments of the present application, when retrieving the query object in the server, in order to encode the retrieval result, the preset identifier can be determined based on the data categories corresponding to multiple preset data sources, and then, based on the preset identifier, the first encoding used to represent the retrieval result of the query object is determined. The method for determining the first encoding can refer to Figure 5 the process shown below, which will be described in conjunction with Figure 5 below.
[0087] S501. Determine a preset identifier according to the data category corresponding to each preset data source in the data table.
[0088] In some embodiments of the present application, each data category corresponds to one or more bit positions in the preset identifier. According to the data categories corresponding to multiple preset data sources, the number of bits of the preset identifier can be determined. Taking each data category corresponding to one bit position as an example, for instance, multiple preset data sources include data source A, data source B, and data source C. The number of data categories corresponding to data source A is 3, the number of data categories corresponding to data source B is 3, and the number of data categories corresponding to data source C is 3. Then the preset identifier can include 9 bit positions. Different data categories correspond one-to-one with different bit positions in the preset identifier. For example, the data category "blacklist" can correspond to the 0th bit position in the preset identifier, and the data category "whitelist" can correspond to the 1st bit position in the preset identifier. The preset identifier can be any combination of letters, numbers, symbols, or characters. Taking the preset identifier as binary as an example, if the preset identifier includes 9 bit positions, the bit value corresponding to each bit position can be used to feedback the retrieval result of the data category corresponding to this bit position. The preset identifier is composed of a first preset value and / or a second preset value. The first preset value and the second preset value can be one of 0 or 1, and the first preset value is different from the second preset value. For example, the initial value of the preset identifier can be set to 000 000 000.
[0089] The following combines Figure 6 with the schematic diagram to illustrate by taking the case where each data category corresponds to one bit position. Figure 6 is a schematic diagram of the preset identifier provided by an embodiment of the present application. As Figure 6 shown, the data categories corresponding to data source A in the data table include: "blacklist", "whitelist", and "absent". The data categories corresponding to data source B in the data table include: "blacklist", "whitelist", and "absent". The data categories corresponding to data source C in the data table include: "blacklist", "whitelist", and "absent". The server can set a preset identifier including 9 bit positions according to the 9 data categories in data source A, data source B, and data source C. Each bit position can indicate a data category. For example, for the "absent" category of data source A in the data table, it can be represented by the 0th bit position in the preset identifier; for the "whitelist" category of data source A in the data table, it can be represented by the 1st bit position in the preset identifier; for the "blacklist" category of data source C in the data table, it can be represented by the 8th bit position in the preset identifier.
[0090] In the embodiments of the present application, a preset identifier is set according to the data categories corresponding to multiple preset data sources. Among them, each data category can correspond to different bit positions, which can avoid the problem of coupling when merging results subsequently.
[0091] S502. Based on the data table and the preset identifier, determine the first code corresponding to the query object on each preset data source.
[0092] In some embodiments of the present application, the first code can be used to indicate the retrieval situation of the query object on the corresponding preset data source. The server can update the preset identifier according to the retrieval results of the query object on each preset data source. The number of digits of the first code can be the number of bit positions in the preset identifier. The determination method of the first code includes: the server retrieves the query object in the data categories corresponding to each preset data source based on the data table, and determines the corresponding first code according to all the retrieval results.
[0093] In the embodiments of the present application, the retrieval result can represent the retrieval situation of the query object in any category of the preset data source. For example, after retrieval, it is confirmed that the data category corresponding to the query object on data source A is: blacklist category, then the retrieval result corresponding to the query object on data source A can be: "blacklist"; another example, it is confirmed that the data category corresponding to the query object on data source B is: high-risk category, then the retrieval result corresponding to the query object on data source B can be: "high-risk". The server determines the target bit position corresponding to each retrieval result on the preset identifier according to the corresponding relationship between each data category and the bit positions. For example, the "whitelist" data category in data source A corresponds to the first bit position in the preset identifier. The retrieval result of the query object on data source A is: "whitelist", and the target bit position can be determined as: the first bit position in the preset identifier. Based on the data table, the server determines the target bit position corresponding to each retrieval result according to the retrieval results corresponding to each preset data source, and updates the bit value corresponding to the target bit position, for example, updates it to the first preset value (for example, "1"), completes the update of the preset identifier, and obtains the first code corresponding to the query object on each preset data source.
[0094] In one example, the first code can be a binary value or a value in other number systems. The server sets the bit value corresponding to the target bit position in the preset identifier to the first preset value, and sets the bit values corresponding to other bit positions in the preset identifier to the second preset value to obtain the first code. Other bit positions can indicate the bit positions in the preset identifier except the target bit position. Among them, the value of the first preset value is different from the value of the second preset value. For example, if the first preset value is set to 1, the second preset value can be set to 0; another example, if the first preset value is set to 0, the second preset value can be set to 1.
[0095] The following combination Figure 6Schematic diagram. Taking the case where the first encoding is a binary value as an example, assume that 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 position is assigned the first preset value "1". For example, the query object is the communication number "99999999999". If the search result corresponding to the communication number "99999999999" on data source A is "not exist", the search result corresponding to the communication number "99999999999" on data source B is "whitelist", and the search result corresponding to the communication number "99999999999" on data source C is "whitelist". Since the "not exist" data category in data source A corresponds to the 0th bit position, the target bit position corresponding to the search result "not exist" on data source A is: the 0th bit position in the preset identifier. The server updates the information corresponding to the target bit position in the preset identifier to the first preset value, and updates the information corresponding to other bit positions in the preset identifier to the second preset value, obtaining the first encoding corresponding to the "not exist" search result of the communication number "99999999999" on data source A as 000 000 001. By analogy, the "whitelist" data category in data source B corresponds to the 4th bit position, and the "whitelist" data category in data source C corresponds to the 7th bit position. It can be obtained that the first encoding corresponding to the "whitelist" search result of the communication number "99999999999" on data source B is 000010 000, and the first encoding corresponding to the "whitelist" search result of the communication number "99999999999" on 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 encoding corresponding to the query object on each preset data source can be determined. Among them, the shift operation includes the bit value to be shifted, the number of bits to be shifted, and the symbol indicating the shift direction. For example, 1<<2 can indicate 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, 000 000 100 can be obtained. The server shifts the bit value with the first preset value in the preset identifier based on the position corresponding to the target bit position on the preset identifier (for example, shifting to the left), obtaining the first encoding corresponding to the query object on each preset data source.
[0097] As described below in conjunction with Figure 7 the schematic diagram, taking the case where the first encoding is a binary value as an example. For example, Figure 7 is a schematic diagram of the relationship between the data categories in the preset data source and the shift of the bit values in the preset identifier provided by an embodiment of the present application. AsFigure 7 As shown, the data categories of data source A in the data table include: "blacklist", "whitelist", and "not exist". The data categories corresponding to data source B in the data table include: "blacklist", "whitelist", and "not exist". The data categories corresponding to data source C in the data table include: "blacklist", "whitelist", and "not exist". Taking the preset identifier set to 000 000 001 as an example for illustration, the data category "not exist" in data source A corresponds to "1<<0" (the bit value "1" in the preset identifier is shifted left by 0 bits), the data category "whitelist" in data source A corresponds to "1<<1" (the bit value "1" in the preset identifier is shifted left by 1 bit), and the data category "blacklist" in data source A corresponds to "1<<2" (the bit value "1" in the preset identifier is shifted left by 2 bits). The data category "not exist" in data source B corresponds to "1<<3" (the bit value "1" in the preset identifier is shifted left by 3 bits), the data category "whitelist" in data source B corresponds to "1<<4" (the bit value "1" in the preset identifier is shifted left by 4 bits), and the data category "blacklist" in data source B corresponds to "1<<5" (the bit value "1" in the preset identifier is shifted left by 5 bits). The data category "not exist" in data source C corresponds to "1<<6" (the bit value "1" in the preset identifier is shifted left by 6 bits), the data category "whitelist" in data source C corresponds to "1<<7" (the bit value "1" in the preset identifier is shifted left by 7 bits), and the data category "blacklist" in data source C corresponds to "1<<8" (the bit value "1" in the preset identifier is shifted left by 8 bits).
[0098] For example, when the query object is the communication number "21111111111", if the search result corresponding to the communication number "21111111111" on data source A is "not exist", and the search result "not exist" in data source A corresponds to the 0th bit in the preset identifier, then the first encoding corresponding to the search result "not exist" in data source A can be obtained by shifting the bit value "1" in the preset identifier to the left by 0 bits ("1<<0"). Thus, the first encoding of the communication number "21111111111" in data source A is: 000000 001. Another example, when the search result corresponding to the communication number "21111111111" on data source B is "whitelist", and the search result "whitelist" in data source B corresponds to the 4th bit in the preset identifier, then the first encoding corresponding to the search result "whitelist" in data source B can be obtained by shifting the bit value "1" in the preset identifier to the left by 4 bits ("1<<4"). Thus, the first encoding of the communication number "21111111111" in data source B is: 000 010 000. Another example, when the search result corresponding to the communication number "21111111111" on data source C is "whitelist", and the search result "whitelist" in data source C corresponds to the 7th bit in the preset identifier, then the first encoding corresponding to the search result "whitelist" in data source C can be obtained by shifting the bit value "1" in the preset identifier to the left by 7 bits ("1<<7"). Thus, the first encoding of the communication number "21111111111" in data source C is: 010000 000.
[0099] In some embodiments of the present application, by applying the data table, there is no need to separately query the query object from the source tables of each preset data source, which can reduce the number of queries, and thus can quickly determine the search results corresponding to the query object on each preset data source. By the bits corresponding to the data categories in each preset data source, the target bits corresponding to each search result are determined, and then based on the target bits, the corresponding first encoding is determined, which can ensure that different search results correspond to different first encodings, thus ensuring the uniqueness of the first encoding.
[0100] S403. Perform operations on multiple first encodings to obtain encoded data.
[0101] In some embodiments of the present 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, and the encoded data can also be other radix values other than binary values. For example, the encoded data can also be a decimal value or a hexadecimal value.
[0102] In some embodiments of the present application, the server performs an exclusive OR operation on multiple first encodings to obtain encoded data. Continuing with the above embodiments, the multiple first encodings include: the first encoding of the communication number "99999999999" on data source A is 000 000 001, the first encoding of the communication number "99999999999" on data source B is 000 010 000, and the first encoding of the communication number "99999999999" on data source C is 010 000 000. Performing an exclusive OR operation on the multiple first encodings, the obtained encoded data is: 010 010 001. By performing an exclusive OR operation on multiple first encodings in the embodiments of the present application, the comprehensive retrieval result of the query object on multiple preset data sources can be quickly obtained, improving the determination efficiency of the encoded data. In addition, since there is no coupling problem in the merging of multiple first encodings, the accuracy and determination efficiency of the encoded data can be improved.
[0103] In other embodiments, the server performs an exclusive OR operation on multiple first encodings to obtain a second encoding, and based on a preset rule, converts the second encoding into encoded data. The preset rule may include a binary-decimal conversion algorithm, a binary-hexadecimal conversion algorithm, etc. The encoded data determined by different binary conversion algorithms is different. Continuing with the above embodiments, the encoding "010 010 001" obtained by performing an exclusive OR operation on multiple first encodings is used as the second encoding. If the binary-decimal conversion algorithm is used for the second encoding, the encoded data "145" can be obtained. By performing an exclusive OR operation on multiple first encodings and then converting the determined second encoding in the embodiments of the present application, the intuitiveness of the encoded data can be improved.
[0104] S404, based on the encoded data and a preset mapping relationship, determine the evaluation result corresponding to the query object.
[0105] In some embodiments of the present application, in the server, the preset mapping relationship may be presented in the form of a mapping table. For example, a preset mapping table is pre-created in the server, and the preset mapping table stores the corresponding relationship between the preset encoding and the evaluation result. In practical applications, the preset mapping relationship may also be in other forms. Below, the preset mapping table is used as an example to illustrate the preset mapping relationship.
[0106] In one example, the preset mapping table may store the corresponding relationship between the preset encoding and the risk level. Combining Figure 8A for illustration, Figure 8A is a schematic diagram of the preset mapping table provided by an embodiment of the present application. Figure 8ATaking the preset encoding as decimal for illustration, in practical applications, the preset encoding can also be in other forms. Among them, the values in the first column represent the preset encoding, and the values in the second column represent the risk level. For example, for the preset encoding "292", the corresponding risk level is "high risk", and the risk level "high risk" can indicate that the retrieval result of the query object in at least one preset data source is "blacklist". Another example is that for the preset encoding "81", the corresponding risk level is "risk-free", and the risk level "risk-free" can indicate that the retrieval results of the query object in all preset data sources are "whitelist", and / or the risk level "risk-free" can indicate that the retrieval results of the query object in all preset data sources include "whitelist" and "not exist". 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 evaluation result corresponding to the communication number in the data query request is "high risk", it is determined that the communication number in the data query request is a high-risk number. In another example, if the data query request is an application installation request and the evaluation result corresponding to the application in the data query request is "high risk", it is determined that the application in the data query request is a high-risk application. In another example, if the data query request is a web page access request and the evaluation result corresponding to the web page address in the data query request is "high risk", it is determined that the web page address in the data query request is a high-risk website address.
[0107] In another example, the corresponding relationship between the preset encoding and the risk type can also be stored in the preset mapping table. In combination with Figure 8B for illustration. Figure 8B is a schematic diagram of the preset mapping table provided by another embodiment of the present application. Figure 8BTaking the preset encoding as decimal as an example, in actual applications, the preset encoding can also be in other forms. Among them, the values in the first column represent the preset encoding, and the values in the second column represent the risk type, which can include: fraud type, normal type, etc. For example, for the preset encoding "100", the corresponding risk type is "fraudulent application", and the risk type "fraudulent application" can indicate that the retrieval result of the query object in at least one preset data source is "high risk". For an application with the risk type of "fraudulent application", the terminal device prohibits downloading the installation package file of the relevant application. Another example is that for the preset encoding "33", the corresponding risk type is "rogue application", and the risk type "rogue application" can indicate that the retrieval result of the query object in at least one preset data source is "risk cannot be identified". For an application with the risk type of "rogue application", the terminal device restricts downloading the installation package file of the relevant application. Another example is that for the preset encoding "0", the corresponding risk type is: "normal application", and the risk type "normal application" can indicate that the retrieval results of the query object in all preset data sources are "whitelist". In another embodiment, the risk types corresponding to the preset encoding "100" can also include "fraudulent number", "fraudulent website", etc. The risk types corresponding to the preset encoding "33" can also include "harassing number", "rogue website", etc. The risk types corresponding to the preset encoding "0" can also include "normal number", "normal website", etc. In actual applications, the risk type can also be any combination of letters, numbers, symbols or characters.
[0108] In another example, the corresponding relationship between the preset encoding, risk level and risk type can also be stored in the preset mapping table. Combined with Figure 8C for illustration. Figure 8C is a schematic diagram of the preset mapping table provided by another embodiment of the present application. Figure 8C Taking the preset encoding as decimal as an example, in actual applications, the preset encoding can also be in other forms. Among them, the values in the first column represent the preset encoding, the values in the second column represent the risk level, and the values in the third column represent the risk type. For example, for the preset encoding "100", the corresponding risk level is "high risk", and the risk type corresponding to the preset encoding "100" is "fraudulent application"; another example is that for the preset encoding "33", the corresponding risk level is "high risk", and the risk type corresponding to the preset encoding "33" is "rogue application"; another example is that for the preset encoding "0", the corresponding risk level is "risk-free", and the risk type corresponding to the preset encoding "0" is: "normal application".
[0109] In some embodiments of the present application, the server determines the information corresponding to the coded data as the evaluation result according to the preset mapping table. The evaluation result may include the risk level and risk type of the query object. Different preset mapping tables may indicate different evaluation results. For example, Figure 8A The server determines that the obtained assessment result includes the risk level of the query object (for example, high risk, medium risk, low risk, unknown risk, etc.); Figure 8B The server determines that the obtained evaluation result includes the risk type of the query object (for example, risky, not risky, etc., and also for example, fraud, rogue, normal, etc.); Figure 8C The server determines that the obtained assessment result includes the risk level and risk type of the query object.
[0110] The embodiment of the present application can directly determine the evaluation result of the query object through the 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 the present application, the server sends the evaluation result to the terminal device that initiates the data query request. Taking the evaluation result of the risk level "high risk" as an example, 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; taking the evaluation result of the risk level "no risk" as an example, 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. Taking the evaluation result of the risk type "fraud" as an example, the server can send the evaluation result of the query object to the terminal device, for example, the application "YY" is a fraud application; taking the evaluation result of the risk type "rogue" as an example, the server can send the evaluation result of the query object to the terminal device, for example, the application "KK" is a rogue application; taking the evaluation result of the risk type "normal" as an example, 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] The embodiment of the present application can quickly respond to the request of the terminal device and improve the security of the data in the terminal device by feeding back the evaluation result to the terminal device that initiates the data query request.
[0113] The data query method based on data source merging provided by the embodiments of this application can determine a data table based on the request type. Since the data pre-stored in the data table is the data corresponding to the request type in multiple preset data sources, when determining the first code corresponding to the query object on multiple preset data sources through the data table, there is no need to match the query object with the data of other fields in the multiple preset data sources. Therefore, the determination efficiency of the first code can be improved. At the same time, since there is no need to query from the source tables in the multiple preset data sources, the query times of the query object can be reduced, thereby further improving the determination efficiency of the first code. By operating on multiple first codes, multiple first codes can be directly merged to improve the merging efficiency of the multiple first codes. In addition, through the encoded data and the preset mapping relationship, 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 on each preset data source again, the determination efficiency of the evaluation result can be further improved, thereby improving the evaluation efficiency of the query object and reducing the load on the server.
[0114] Refer to Figure 9 As shown, it is a flowchart of the data query method based on data source merging provided by another embodiment of this application. The data query method based on data source merging can be applied to an electronic device. Hereinafter, the electronic device is taken as an example of a server for illustration.
[0115] S901. In response to a data query request, determine the request type corresponding to the data query request and the query object.
[0116] In some embodiments of this application, the data query request includes a request identifier, and the request identifier is used to indicate the type of the data query request. When the server receives the data query request sent by the terminal device, it determines the corresponding request type according to the request identifier of the data query request. The relevant description of the data query request and the determination method of the request type can refer to the detailed description of steps S401 - S402 above Figure 4 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 according to the tags corresponding to the request type as the query object. The determination method of the query object can refer to the detailed description of step S402 above Figure 4 and will not be repeated here.
[0118] S902. Based on the request type, determine the retrieval results of the query object corresponding to each preset data source in the database.
[0119] In some embodiments of the present application, the server constructs a database based on the data obtained from multiple preset data sources. The database prestores the data corresponding to the request type in the multiple preset data sources. Based on the request type, the server retrieves a query object from the data corresponding to each preset data source stored in the database and determines the retrieval result of the query object corresponding to each preset data source.
[0120] In some other embodiments, multiple data tables can be created in the database. The data tables store the data obtained from multiple preset data sources and corresponding to multiple preset request types. The manner in which the server determines the retrieval result from the data tables can refer to the relevant description in step S502 above. The embodiments of the present application will not repeat the description here. In practical applications, other types of files can also be created in the database, and the server can determine the retrieval result from other types of files. Figure 5 In practical applications, other types of files can also be created in the database, and the server can determine the retrieval result from other types of files.
[0121] S903. Based on multiple retrieval results, determine the encoded data.
[0122] In some embodiments of the present application, the server can set a corresponding data category for each preset data source. For example, based on the data category corresponding to each preset data source, the server can determine a preset identifier, and each data category corresponds to one or more bit positions in the preset identifier. Taking the case where each data category corresponds to one bit position in the preset identifier as an example, for example, multiple preset data sources include data source A, data source B, and data source C. Data source A has 3 corresponding data categories, data source B has 3 corresponding data categories, and data source C has 3 corresponding data categories. Then the preset identifier can include 9 bit positions. Taking the case where each data category corresponds to two bit positions in the preset identifier as an example, for example, multiple preset data sources include data source A, data source B, and data source C. Data source A has 3 corresponding data categories, data source B has 3 corresponding data categories, and data source C has 3 corresponding data categories. Then the preset identifier can include 18 bit positions. The specific determination method of the preset identifier can refer to the relevant description in step S501 above. Figure 5 in the relevant description of step S501.
[0123] In some embodiments of the present application, the server generates a first code based on each retrieval result and the preset identifier. The number of bits of the first code is the same as the number of bit positions in the preset identifier. For example, if the preset identifier includes 9 bit positions, the first code includes the bit values corresponding to the 9 bit positions.
[0124] In some embodiments of the present application, the server determines the target bit corresponding to each retrieval result on the preset identifier based on the correspondence between each data category and the bit in the preset identifier. The server updates the preset identifier based on the target bit corresponding to each retrieval result, and obtains the 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 the first preset value, and sets the bit values corresponding to other bits in the preset identifier to the second preset value, to obtain the first code. In another example, the server performs a shift operation on the bit value in the preset identifier that takes the first preset value based on the position corresponding to the target bit on the preset identifier, to obtain the first code. The specific method for determining the first code can refer to the above. Figure 5 Related description of step S502 in .
[0125] In some embodiments of the present application, the server performs an XOR operation on multiple first codes to obtain coded data. In other embodiments, the server performs an XOR operation on multiple first codes to obtain a second code. The server converts the second code into coded data based on a preset rule. The method for determining the coded data can refer to the above. Figure 4 Related description of step S403 in .
[0126] S904: Determine an evaluation result corresponding to the query object based on the encoded data and a preset mapping relationship.
[0127] In some embodiments of the present application, the mapping relationship includes a correspondence between a preset code and an evaluation result. The server can determine the information corresponding to the coded 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 initiates the data query request. The method for determining the evaluation result can refer to the above. Figure 4 The detailed description of step S404 is omitted here.
[0128] The data query method based on data source merging provided by the embodiments of the present application can determine the retrieval results of a query object corresponding to each preset data source in the database through the request type. Since the database pre-stores data corresponding to the request type in multiple preset data sources, when determining the retrieval results of the query object corresponding to multiple preset data sources through the database, there is no need to match the query object with the data of other fields in the multiple preset data sources. Therefore, the efficiency of determining the retrieval results can be improved. At the same time, since there is no need to query from the source tables in multiple preset data sources, the number of query times of the query object can be reduced, thereby further improving the efficiency of determining the retrieval results. Determining the encoded data through multiple retrieval results can directly merge multiple retrieval results and improve the merging efficiency of multiple retrieval results. In addition, through the encoded data and the preset mapping relationship, the evaluation result corresponding to the query object can be directly determined. Since there is no need to merge the evaluation results corresponding to the query object in 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 load of the server.
[0129] In some embodiments of the present application, after obtaining the evaluation result corresponding to the query object based on the process shown above Figure 4 In order to further improve the accuracy of risk identification, a network data source can be newly added to identify the query object, or a data source that affects the accuracy of risk identification can be deleted. However, when changing the network data source, it is necessary to reconstruct the merging rule of the retrieval results, which will lead to low maintenance efficiency of the data source and further affect the risk identification efficiency. In addition, if a network data source needs to be newly added, it is also necessary to write a query statement in the corresponding format based on the data format of the newly added network data source, which further affects the risk identification efficiency and is not conducive to the user experience. To solve the above problems, the present application provides a flowchart as shown in Figure 10 shown. Referring to Figure 10 shown, it is a flowchart of the data query method based on data source merging provided by another embodiment of the present application.
[0130] S1001, in response to a change request for any data source, update the database based on any data source.
[0131] In some embodiments of the present application, the change request may include adding and / or deleting a data source. The updated database stores the data in the changed data source.
[0132] In one example, if the change request is to add a data source, the server obtains the data corresponding to the field label from the newly added data source based on the field label in the database and stores it in the database to obtain 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, and obtains an updated database.
[0134] In another example, if the change request includes a request to add a first data source and a request to delete a second data source, the server deletes the data corresponding to the second data source from the database, and based on the field labels in the database, obtains the data corresponding to the field labels from the first data source and stores it in the database, obtaining an updated database.
[0135] When changing the data source in the embodiments of the present application, by updating the database, it is not only possible to avoid including irrelevant data in the database, thereby affecting the risk identification efficiency, but also possible to add the data in the data source to the database in a timely manner, improving the accuracy of risk identification.
[0136] S1002. Update the length of the preset identifier according to the data category of any data source in the updated database and the change request.
[0137] In some embodiments of the present application, each data category may correspond to at least one bit. Therefore, when the data source changes, it is necessary to update the length of the preset identifier according to the data category corresponding to the changed data source.
[0138] In one example, if the change request is to add a data source, the server adds bits to the preset identifier. If the change request is to delete a data source, the server reduces the bits in the preset identifier.
[0139] Figure 11 It is a schematic diagram of the movement relationship of the bit values in the preset identifier before and after the change of the data source provided by an embodiment of the present application. As Figure 11As shown, the preset data sources before the change include data source a and data source b. Among them, data source a includes categories 1 - 3, and data source b includes categories 1 - 3. Each category corresponds to a bit. Categories 1 - 3 in data source a can correspond to the 0th bit to the 2nd bit from right to left in the preset identifier, and categories 1 - 3 in data source b can correspond to the 3rd bit to the 5th bit from right to left in the preset identifier. For example, the relationship between category 1 in data source a and the shift of 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 relationship between category 2 in data source a and the shift of 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 relationship between category 3 in data source b and the shift of 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 data source c, then the preset data sources after the change include data source a, data source b, and data source c. Among them, data source a includes categories 1 - 3, data source b includes categories 1 - 3, and data source c includes categories 1 - 2. Each category corresponds to a bit. Categories 1 - 3 in data source a can correspond to the 0th bit to the 2nd bit from right to left in the preset identifier, categories 1 - 3 in data source b can correspond to the 3rd bit to the 5th bit from right to left in the preset identifier, and categories 1 - 2 in data source c can correspond to the 7th bit to the 8th bit from right to left in the preset identifier.
[0140] Therefore, 2 bits are added to the preset identifier. For example, the 6th bit in the preset identifier can indicate category 1 in data source c. Then the relationship between category 1 in data source c and the shift of the bit value in the preset identifier is: shift the bit value "1" in the preset identifier 6 bits to the left (1<<6). Another example, the 7th bit in the preset identifier can indicate category 2 in data source c. Then the relationship between category 2 in data source c and the shift of the bit value in the preset identifier is: shift the bit value "1" in the preset identifier 7 bits to the left (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 data sources after the change, and based on the total number of data categories, re - sets the preset identifier.
[0142] Through the change request, the embodiments of this application can select an appropriate way to update the preset identifier, thereby ensuring that the bits in the updated preset identifier correspond to each data category.
[0143] In some embodiments of this application, according to the data categories of all data sources in the updated database, the preset mapping relationship is re - configured.
[0144] In some embodiments of the present application, the comprehensive categories include any data category in each preset data source. For example, if the preset data sources include data source a and data source b, data source a includes categories 1, 2, and 3, and data source b includes categories 1, 2, and 3, then data source a and data source b can include 9 comprehensive categories, which are respectively: 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, category 3 of data source a and category 3 of data source b.
[0145] In some embodiments of the present application, if the change request is to add a data source, based on the data categories in the newly added data source and the data categories in the multiple preset data sources, determine the comprehensive categories of the newly added data source and the multiple preset data sources, determine the preset codes corresponding to the comprehensive categories, and construct a preset mapping table based on the preset codes and preset results to obtain the reconfigured preset mapping table. In another embodiment, other mapping relationships can be constructed based on the preset codes and preset results. The following takes the update of the preset mapping table as an example for illustration.
[0146] Combined Figure 11 with Figure 12 illustrate the update of the preset mapping table, Figure 12 is a schematic diagram of the preset mapping table corresponding to the data source before and after the change provided by an embodiment of the present application. As Figure 11 shown, the preset data sources before the change include data source a and data source b. Among them, data source a includes categories 1 - 3, data source b includes categories 1 - 3, and data source a and data source b include 9 comprehensive categories. Then, the preset mapping table corresponding to data source a and data source b includes the corresponding relationships between 9 preset codes and 9 evaluation results. For example, Figure 11 the preset mapping table shown. If the change request is to add data source c, then the data sources after the change include data source a, data source b, and data source c. Among them, data source a includes categories 1 - 3, data source b includes categories 1 - 3, and data source c includes categories 1 - 2. Therefore, data source a, data source b, and data source c include 18 comprehensive categories, and the reconfigured preset mapping table includes the corresponding relationships between 18 preset codes corresponding to the 18 comprehensive categories and 18 evaluation results. For example, Figure 12 the reconfigured preset mapping table shown.
[0147] S1003. In response to a data query request, determine the request type corresponding to the data query request and the query object.
[0148] S1004. Based on the request type, determine the retrieval results of the query object corresponding to each preset data source in the database.
[0149] S1005. Based on multiple retrieval 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 the detailed content of steps S1003 - S1006, reference can be made to the above Figure 4 and Figure 9 for the detailed description, which will not be repeated here.
[0152] The data query method based on data source merging provided by the embodiments of the present application responds to a change request for any data source and updates the database based on any data source. It can not only avoid including irrelevant data in the database but also ensure the comprehensiveness of the data in the database. In addition, when the data source changes, there is no need to rewrite code statements. Therefore, it can improve the change efficiency of the data source, thereby improving the evaluation efficiency of the query object and reducing the load of the server.
[0153] Refer to Figure 13 as shown below, the electronic device 100 involved in the embodiments of the present application will be introduced. The electronic device 100 includes, but is not limited to, devices such as personal computers, industrial computers, and servers. As Figure 13 shown, the electronic device 100 may include a processor 1301, a memory 1302, a communication bus 1303, and a communication interface 1304. Communication can be carried out between the processor 1301, the memory 1302, and the communication interface 1304 through the communication bus 1303. The memory 1302 is used to store one or more computer programs 1304. 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 when the processor 1301 executes the above instructions, the above-mentioned falling angle measurement method can be implemented in the electronic device 100. The electronic device 100 can be a device such as a computer, a server, a server cluster, etc.
[0154] It can be understood that the structure schematically shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements.
[0155] The processor 1301 may include one or more processing units. For example, the processor 1301 may include an application processor (AP), a modem, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0156] A memory may also be provided in the processor 1301 for storing instructions and data. In some embodiments, the memory in the processor 1301 is a cache memory. This memory can save the instructions or data that the processor 1301 has just used or recycled. If the processor 1301 needs to use the instruction or data again, it can directly call it 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. The 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, the memory 1302 may include a high-speed random access memory and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
[0159] In some embodiments, the communication bus 1303 can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity of representation, Figure 13 only one line is shown in the figure, but it does not mean that there is only one bus or one type of bus. The communication bus 1303 can include a path for transmitting information between various components of the electronic device 100 (for example, the processor 1301, the memory 1302, and the 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 implement the communication between the electronic device 100 and other devices or communication networks.
[0161] The embodiment of the present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions run on the electronic device 100, the electronic device 100 is made to execute the above-mentioned related method steps to implement the falling angle measurement method in the above-mentioned embodiments.
[0162] The embodiment of the present application also provides a computer program product. When the computer program product runs on a computer, the computer is made to execute the above-mentioned related steps to implement the falling angle measurement method in the above-mentioned embodiments.
[0163] Through the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the above-mentioned division of each functional module is used for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0164] In the several embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the module or unit is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.
[0165] The unit described as a separate component may or may not be physically separated. The component shown as a unit may be a single physical unit or multiple physical units, that is, it may be located in one place or may be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present application.
[0166] In addition, each functional unit in various embodiments of the present application may be integrated in a processing unit, may exist separately as individual physical units, or two or more units may be integrated in one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software functional unit.
[0167] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions to enable a device (such as a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods of the various embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0168] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the various embodiments of the present application.
Claims
1. A data query method based on data source merging, applied to electronic devices, characterized in that: A database is built in the electronic device, and the method includes: Responding to a data query request, determining a request type and a query object corresponding to the data query request; Based on the request type, determining a search result of the query object corresponding to each preset data source in the database, wherein the database pre-stores data corresponding to the request type in multiple preset data sources; determining the coded data based on the plurality of search results; Based on the coding data and a preset mapping relationship, an evaluation result corresponding to the query object is determined, where the mapping relationship includes a correspondence between the preset coding and the evaluation result.
2. The data query method based on data source merging according to claim 1, characterized in that: A data table is created in the database, and the data table stores data obtained from multiple preset data sources and corresponding to multiple preset request types.
3. The data query method based on data source merging according to claim 1 or 2, characterized in that: The method further comprises: A preset identifier is determined according to the data category corresponding to each preset data source, and each data category corresponds to one or more bits in the preset identifier.
4. The data query method based on data source merging according to claim 3, characterized in that: The method further comprises: Based on the database, determining the search results corresponding to the query object in each preset data source; A first code is generated based on each search result and the preset identifier, where the number of bits of the first code is the same as the number of bits in the preset identifier.
5. The data query method based on data source merging according to claim 4, characterized in that: The generating of a first code based on each search result and the preset identifier includes: Determine 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; The preset identifier is updated 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.
6. The data query method based on data source merging according to claim 5, characterized in that: The updating of 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 includes: The bit value corresponding to the target bit in the preset identifier is set to a first preset value, and the bit values corresponding to other bits in the preset identifier are set to second preset values, to obtain the first code.
7. The data query method based on data source merging according to claim 5, characterized in that: The updating of 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 includes: Based on the position corresponding to the target bit on the preset identifier, a shift operation is performed on a bit value in the preset identifier whose value is a first preset value to obtain the first code.
8. The data query method based on data source merging according to claim 6 or 7, characterized in that: The step of determining the coded data based on the plurality of search results comprises: An exclusive OR operation is performed on the plurality of first codes to obtain the coded data.
9. The data query method based on data source merging according to claim 6 or 7, characterized in that: The step of determining the coded data based on the plurality of search results further comprises: Performing an XOR operation on the multiple first codes to obtain a second code; Based on a preset rule, the second code is converted into the coded data.
10. The data query method based on data source merging according to claim 3, characterized in that: The method further comprises: responding to a request for a change to any data source and updating the database based on the arbitrary data source; The length of the preset identifier is updated according to 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 according to claim 10, characterized in that: The updating of the length of the preset identifier according to 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, based on the number of the data categories, a corresponding bit is added to the preset identifier; If the change request is to delete a data source, corresponding bits in the preset identifier are reduced based on the number of the data categories.
12. The data query method based on data source merging according to claim 1, characterized in that: The method further comprises: The evaluation result is sent to the terminal device that initiated the data query request.
13. The data query method based on data source merging according to claim 1, characterized in that: The request type includes one or more of the following types: an incoming call request type, an application installation request type, and a web page access request type.
14. A data query method based on data source merging, characterized in that: The method comprises: In response to a data query request, determining a data table according to a request type of the data query request, wherein the data table pre-stores data corresponding to the request type from a plurality of preset data sources; Based on the data table, determining a first code corresponding to the query object in the data query request on each preset data source; Performing operations on the plurality of first codes to obtain coded data; Based on the coding data and a preset mapping relationship, an evaluation result corresponding to the query object is determined, where the mapping relationship includes a correspondence between the preset coding and the evaluation result.
15. The data query method based on data source merging according to claim 14, characterized in that: The data table is created based on data corresponding to multiple preset types obtained from the multiple preset data sources, and 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 according to claim 14, characterized in that: The performing operation on the plurality of first codes to obtain the coded data includes: Performing an XOR operation on the multiple first codes to obtain a second code; Based on a preset rule, the second code is converted into the coded data.
17. An electronic device, characterized in that: The electronic device comprises a memory and a processor: Wherein, the memory is used to store program instructions; The processor is configured to read and execute the program instructions stored in the memory. When the program instructions are executed by the processor, the electronic device executes 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, and when the program instructions are executed on an electronic device, the processor of the electronic device executes the data query method based on data source merging according to 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
Data query method and device, electronic equipment and storage medium
CN118349578A
Method and apparatus for identifying programming object attributes
US20020010809A1