Data query method, data query device, equipment, storage medium and product
By generating a second query identifier in the cache database for reverse querying, the problem of database blocking and resource waste caused by large query result datasets is solved, achieving efficient and accurate data querying.
Patent Information
- Application Number
- CN202411391917.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-14
AI Technical Summary
During database queries, the large dataset of query results for a certain condition can cause database congestion and waste of computing resources. This is especially true when querying product promotional activities, where the cached database value is large and the query time for a single query condition key is long, affecting other business data operations and increasing cluster maintenance costs.
By obtaining the first query identifier corresponding to the information to be queried, a query operation is performed in the cache database to generate a second query identifier. Based on the second query identifier, a reverse query operation is performed to generate the target query result. This avoids the problem of excessively long query time caused by large parameter values in the first query and improves the accuracy of the query.
By performing a reverse query, query time is reduced, memory pressure on the cache database is lowered, query accuracy is improved, and resource waste and database congestion are avoided.
Smart Images

Figure CN119311736A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and more specifically, to a data query method, a data query device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the development of the Internet and big data technology, databases are widely used in all walks of life, such as program development and maintenance or online shopping. In the process of using a database, it is necessary to query or retrieve data in the database based on relevant query conditions to obtain corresponding data from the database.
[0003] For example, in online shopping, most products are traded on various e-commerce platforms. In order to recommend products, merchants can trade through various product discounts, such as issuing various coupons, but such product discount activities generally have specific usage conditions.
[0004] When a user purchases a product on the platform, the platform or the user himself needs to check whether the user can participate in the promotion. At this time, it is necessary to query and verify the user's information and the usage conditions of the product promotion. However, when the platform is verifying, the data set of the query result of a certain usage condition is large, which may cause the platform to be blocked. In addition, this query method will cause a large demand for matching resources, which seriously wastes the platform's computing resources. Summary of the invention
[0005] In view of this, the present disclosure provides a data query method, a data query device, an electronic device, a computer-readable storage medium, and a computer program product.
[0006] One aspect of the present disclosure provides a data query method, comprising:
[0007] In response to the data query instruction, obtaining a first query identifier corresponding to the information to be queried;
[0008] Based on the first query identifier, a query operation is performed in the cache database to obtain a first query result, wherein the first query result includes a parameter value corresponding to the first query parameter;
[0009] When the parameter value of the first query parameter is a first preset value, generating a second query identifier according to the first query parameter and the parameter value;
[0010] Based on the second query identifier, a query operation is performed in the cache database to obtain a second query result;
[0011] A target query result is generated based on the first query result and the second query result, wherein the target query result is used to characterize the compliance relationship between the information to be queried and the data indicator requirements corresponding to the first query identifier.
[0012] According to an embodiment of the present disclosure, generating a target query result according to the first query result and the second query result includes:
[0013] Analyze and process whether the second query result contains the first query identifier to obtain a first analysis result;
[0014] In the case where the parameter value of the first query parameter in the first query result is a second preset value, generating a second analysis result according to the parameter value of the first query parameter and the preset parameter value;
[0015] The target query result is generated based on the first analysis result and the second analysis result.
[0016] According to an embodiment of the present disclosure, generating the target query result according to the first analysis result and the second analysis result includes:
[0017] When the first analysis result represents that each of the second query identifiers has queried the first query identifier, and the second analysis result represents that the parameter value of each of the first query identifiers satisfies the preset parameter value, a first target result is generated, wherein the first target result represents that the information to be queried satisfies the compliance relationship, and the target query result includes the first target result.
[0018] According to an embodiment of the present disclosure, generating the target query result according to the first analysis result and the second analysis result further includes:
[0019] When the second analysis result indicates that at least one parameter value of the first query identifier does not satisfy the preset parameter value, a second target result is generated, wherein the second target result indicates that the information to be queried does not satisfy the compliance relationship, and the target query result also includes the second target result.
[0020] According to an embodiment of the present disclosure, generating the target query result according to the first analysis result and the second analysis result further includes:
[0021] When the first analysis result indicates that at least one of the second query identifiers does not find the first query identifier, a third target result is generated, wherein the third target result indicates that the information to be queried does not satisfy the compliance relationship, and the target query result also includes the third target result.
[0022] According to an embodiment of the present disclosure, the data query method further includes:
[0023] In the case that the first query result is empty, querying the query parameter set corresponding to the first query identifier from the backup database;
[0024] The first query identifier and the query parameter set are associated and stored in the cache database.
[0025] According to an embodiment of the present disclosure, the query parameter set includes a plurality of different initial query parameters and a preset condition parameter value corresponding to each of the initial query parameters;
[0026] The above method further comprises:
[0027] When any of the above preset condition parameter values is the first target information, the above preset condition parameter value is adjusted to obtain a new preset condition parameter value;
[0028] A new query parameter set is generated according to the new preset condition parameter value and the initial query parameter corresponding to the new preset condition parameter value, so as to store the new query parameter set in the cache database.
[0029] According to an embodiment of the present disclosure, the above-mentioned conformity relationship indicates whether the above-mentioned information to be queried meets the data indicator requirements corresponding to the above-mentioned first query identifier;
[0030] The above-mentioned information to be queried includes user account information or application information. When the above-mentioned information to be queried is the above-mentioned user account information, the above-mentioned first query identifier is a product discount identifier or a recommended product identifier, and the above-mentioned target query result represents whether the above-mentioned user account information satisfies the product discount activity corresponding to the above-mentioned product discount identifier, or whether the above-mentioned user account information satisfies the recommendation condition corresponding to the above-mentioned recommended product identifier; when the above-mentioned information to be queried is the above-mentioned application information, the above-mentioned first query identifier is a configuration update identifier, and the above-mentioned target query result represents whether the above-mentioned application information satisfies the update service requirement corresponding to the above-mentioned configuration update identifier.
[0031] According to an embodiment of the present disclosure, in the case where the first query identifier is the product discount identifier, the first query parameter includes at least one of the following: origin parameter, destination parameter, user number information, discount activity time parameter, delivery parameter, payment attribute information;
[0032] In the case where the first query identifier is the configuration update identifier, the first query parameters include function parameters of different program functions.
[0033] Another aspect of the present disclosure provides a data query device, comprising:
[0034] An acquisition module, configured to acquire a first query identifier corresponding to the information to be queried in response to a data query instruction;
[0035] A first query module, configured to perform a query operation in the cache database based on the first query identifier to obtain a first query result, wherein the first query result includes a parameter value corresponding to the first query parameter;
[0036] A first generating module, configured to generate a second query identifier according to the first query parameter and the parameter value when the parameter value of the first query parameter is a first preset value;
[0037] A second query module, configured to perform a query operation in the cache database based on the second query identifier to obtain a second query result;
[0038] The second generation module is used to generate a target query result based on the above-mentioned first query result and the above-mentioned second query result, wherein the above-mentioned target query result is used to characterize the compliance relationship between the above-mentioned information to be queried and the data indicator requirements corresponding to the above-mentioned first query identifier.
[0039] Another aspect of the present disclosure provides an electronic device, comprising:
[0040] one or more processors;
[0041] a memory for storing one or more programs,
[0042] When the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method.
[0043] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.
[0044] Another aspect of the present disclosure provides a computer program product, the computer program product comprising computer executable instructions, and the instructions are used to implement the above method when executed.
[0045] According to an embodiment of the present disclosure, by obtaining a first query identifier corresponding to the information to be queried, a query operation is performed in a cache database based on the first query identifier to obtain a first query result, and in the case where the parameter value of the first query parameter in the first query result is a first preset value, a second query identifier is generated based on the first query parameter and the parameter value, and a query operation is performed in the cache database based on the second query identifier to obtain a second query result, thereby generating a target query result based on the first query result and the second query result. By generating a second query identifier using the first query parameter and the parameter value in the first query result to perform a reverse query operation in the cache database, the problem of a long query time caused by a large parameter value of the first query parameter during the first query can be avoided, and at the same time, accurate search can be performed based on the first query parameter and its parameter value, thereby improving the accuracy of the query. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0047] Figure 1 An exemplary system architecture to which the data query method according to an embodiment of the present disclosure can be applied is schematically shown;
[0048] Figure 2 A flowchart of a data query method according to an embodiment of the present disclosure is schematically shown;
[0049] Figure 3 A flowchart of a data query method according to another embodiment of the present disclosure is schematically shown;
[0050] Figure 4 A block diagram schematically shows a data query device according to an embodiment of the present disclosure; and
[0051] Figure 5 A block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0052] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0053] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0054] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0055] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0056] When performing data queries, such as querying updated parameters or product promotions, the database may be blocked during verification due to the large data set of the query results for a certain usage condition. In addition, this query method will cause a large demand for matching resources, seriously wasting computing resources.
[0057] For example, in the query process of product discount activities, if the query is for user Zhang San, the product discount identifier needs to be used as the query condition key, and all the conditions of the product discount identifier need to be used as the query result value, including the validity period, customer attribute set, and delivery method set, as shown in Table 1. In this way, even if Li Si and Wang Wu have not queried, or even have not queried product discount activities until the key expires, the values of Li Si and Wang Wu must be put into the value. Therefore, the conditions in the value that have no correlation will be brought into the cache database because other conditions with the same key have triggered the query, and expire with the expiration of other conditions.
[0058] Table 1
[0059]
[0060] In addition, the set of some query conditions may be relatively large. For example, if a certain discount is configured with thousands of courier ERPs as discount conditions, the value of the cache database will be relatively large. When the value is large, the query result value of the query condition key will be very large, which is the big key problem. The big key problem causes the following disadvantages:
[0061] (1) When storing database query results in the cache database redis and querying and returning results from redis, the value is large and the query of a single query condition key takes a long time. Since redis stores and retrieves data in a single thread, the query of a single key takes a long time, causing the server to be blocked and affecting other business data operations;
[0062] (2) The data set returned from the cache database redis at one time is large, and each value in the set needs to be traversed in turn to see if it matches the query condition, which makes the matching time-consuming and wastes server CPU resources;
[0063] (3) When the query result value corresponding to each query condition key is large, the probability of cluster data skew will increase, that is, some cache database Redis instances have high space utilization rates, while some Redis instances have low space utilization rates, and the cluster maintenance cost will increase.
[0064] In view of this, the embodiments of the present disclosure provide a data query method, a data query device, an equipment, a storage medium and a product, which can be applied to the field of computer technology. The method includes obtaining a first query identifier corresponding to the information to be queried in response to a data query instruction; performing a query operation in a cache database based on the first query identifier to obtain a first query result, wherein the first query result includes a parameter value corresponding to the first query parameter; when the parameter value of the first query parameter is a first preset numerical value, generating a second query identifier according to the first query parameter and the parameter value; performing a query operation in the cache database based on the second query identifier to obtain a second query result; generating a target query result according to the first query result and the second query result, wherein the target query result is used to characterize the compliance relationship between the information to be queried and the data indicator requirement corresponding to the first query identifier.
[0065] In the embodiments of the present disclosure, the collection, updating, analysis, processing, use, transmission, provision, disclosure, storage, etc. of the data involved (for example, including but not limited to user personal information) are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information and network security.
[0066] In the embodiments of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0067] Figure 1 The exemplary system architecture 100 to which the data query method according to the embodiment of the present disclosure can be applied is schematically shown. It should be noted that: Figure 1What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0068] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0069] The user may use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (only for example).
[0070] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0071] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0072] It should be noted that the data query method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the data query device provided in the embodiment of the present disclosure can generally be set in the server 105. The data query method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Correspondingly, the data query device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Alternatively, the data query method provided in the embodiment of the present disclosure can also be executed by the first terminal device 101, the second terminal device 102 or the third terminal device 103, or can also be executed by other terminal devices that are different from the first terminal device 101, the second terminal device 102 or the third terminal device 103. Accordingly, the data query device provided in the embodiment of the present disclosure may also be arranged in the first terminal device 101, the second terminal device 102 or the third terminal device 103, or in other terminal devices different from the first terminal device 101, the second terminal device 102 or the third terminal device 103.
[0073] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0074] Figure 2 The flowchart of the data query method according to the embodiment of the present disclosure is schematically shown.
[0075] like Figure 2 As shown, the data query method includes operations S201 to S205.
[0076] In operation S201, in response to a data query instruction, a first query identifier corresponding to the information to be queried is obtained;
[0077] In operation S202, a query operation is performed in the cache database based on the first query identifier to obtain a first query result, wherein the first query result includes a parameter value corresponding to the first query parameter;
[0078] In operation S203, when the parameter value of the first query parameter is a first preset value, a second query identifier is generated according to the first query parameter and the parameter value;
[0079] In operation S204, a query operation is performed in the cache database based on the second query identifier to obtain a second query result;
[0080] In operation S205, a target query result is generated according to the first query result and the second query result, wherein the target query result is used to characterize the compliance relationship between the information to be queried and the data indicator requirement corresponding to the first query identifier.
[0081] According to an embodiment of the present disclosure, a data query instruction may be generated by an electronic device in response to an input operation of a user on the electronic device, and the electronic device may be a terminal device such as a mobile phone or a computer, or a handheld terminal of a delivery person, etc. The information to be queried may be an update program number or user account information input by a user (maintenance personnel, purchaser, or delivery person). The cache database may be a redis server.
[0082] According to an embodiment of the present disclosure, the information to be queried includes user account information or application information. When the information to be queried is user account information, the first query identifier is a product discount identifier or a recommended product identifier, and the target query result represents whether the user account information satisfies the product discount activity corresponding to the product discount identifier, or whether the user account information satisfies the recommendation condition corresponding to the recommended product identifier. When the information to be queried is application information, the first query identifier is a configuration update identifier, and the target query result represents whether the application information satisfies the update business requirement corresponding to the configuration update identifier. The compliance relationship represents whether the information to be queried meets the data indicator requirement corresponding to the first query identifier.
[0083] According to an embodiment of the present disclosure, when the information to be queried is user account information, the first preset value can be set to different preset values according to different preferential condition parameters. For example, when the preferential condition parameter is a user device number, considering that there are a large number of user device numbers under the preferential condition parameter set by the merchant, the number of first preset values can be set to 10,000.
[0084] According to an embodiment of the present disclosure, when the information to be queried is application information, the first preset value can be set to different preset values according to function parameters of different program functions. For example, the number of first preset values of the click function can be set to 1.
[0085] According to the embodiments of the present disclosure, in order to more specifically explain the technical solution of the present disclosure, the present disclosure uses product discount activities as an example. The discount product identifier can be the number of the product discount activity, for example, the number "0001" can be used to represent the product discount activity of "10 off for purchases over 100", or the number "0002" can be used to represent the product discount activity of "free shipping for purchases".
[0086] According to an embodiment of the present disclosure, when a user performs a query operation, the electronic device sends the user's target account information (i.e., the information to be queried) to the cache server, and the cache server queries the cache database based on the preferential product identifier (i.e., the first query identifier), thereby obtaining a first query result corresponding to the product preferential identifier, wherein the first query result includes multiple different preferential condition parameters (i.e., the first query parameters) and parameter values corresponding to the preferential condition parameters, for example, the preferential condition parameters may be at least one of the following: an origin parameter, a destination parameter, user number information, a preferential activity time parameter, a delivery parameter, and payment attribute information, and the parameter value is the specific parameter value of the above-mentioned different preferential condition parameters, for example, the parameter value of the user number information is num1000, and the parameter value of the origin parameter is city A, wherein the parameter value of each preferential condition parameter belongs to the parameter value of the target account information.
[0087] According to an embodiment of the present disclosure, if there is a preferential condition parameter whose parameter value is the first preset value among the above-mentioned multiple preferential condition parameters, a condition parameter query identifier (i.e., a second query identifier) is generated based on the preferential condition parameter and its corresponding parameter value. For example, if more than 10,000 target preferential condition parameters of the user device number are queried, then if the query of the target preferential condition parameter is insisted on, the result may be large, resulting in a longer query time. Therefore, the present disclosure determines that the user device number is "1000108" based on the target account information, and combines the target preferential condition parameter and the target condition parameter value into a condition parameter query identifier {user device number: 1000108}.
[0088] According to an embodiment of the present disclosure, a reverse query is performed in the cache database based on the above-mentioned condition parameter query identifier {user device number: 1000108}, thereby obtaining a second query result corresponding to the condition parameter query identifier, and searching in the second query result to see whether the product discount identifier "0001" of the product discount activity exists, and then combining with whether the target account information exists in the parameter values of other discount condition parameters in the first query result, it is possible to determine whether the parameter value complies with the product discount activity.
[0089] It should be noted that a normal query refers to querying the database based on the first condition, that is, querying the cache database based on the first query identifier. A reverse query refers to querying the database using the expected query result as the second condition, that is, the present disclosure queries the cache database based on the second query identifier generated by the first query parameter and the parameter value. If the query is successful, it indicates that the database contains data corresponding to the first condition.
[0090] According to an embodiment of the present disclosure, by obtaining a first query identifier corresponding to the information to be queried, a query operation is performed in a cache database based on the first query identifier to obtain a first query result, and in the case where the parameter value of the first query parameter in the first query result is a first preset value, a second query identifier is generated based on the first query parameter and the parameter value, and a query operation is performed in the cache database based on the second query identifier to obtain a second query result, thereby generating a target query result based on the first query result and the second query result. By generating a second query identifier using the first query parameter and the parameter value in the first query result to perform a reverse query operation in the cache database, the problem of a long query time caused by a large parameter value of the first query parameter during the first query can be avoided, and at the same time, accurate search can be performed based on the first query parameter and its parameter value, thereby improving the accuracy of the query.
[0091] Figure 3 The following schematically shows a flow chart of a data query method according to another embodiment of the present disclosure.
[0092] According to the embodiments of the present disclosure, Figure 3 As shown, according to the first analysis result and the first query result, a target query result is generated, including:
[0093] Analyze and process whether the second query result contains the first query identifier to obtain a first analysis result;
[0094] When the parameter value of the first query parameter in the first query result is a second preset value, generating a second analysis result according to the parameter value of the first query parameter and the preset parameter value;
[0095] A target query result is generated according to the first analysis result and the second analysis result.
[0096] According to an embodiment of the present disclosure, the second preset parameter value can be set with different parameter values according to different types of preferential condition parameters. For example, the preset parameter value of the origin parameter is limited to "City A, City B", the preset parameter value of the destination parameter is limited to "City C, City D", the preset parameter value of the user number information is limited to "the first 10,000 users participating in the activity", the preset parameter value of the preferential activity time parameter is limited to "January xx to December xx", the preset parameter value of the delivery parameter is limited to "land transportation", etc.
[0097] According to an embodiment of the present disclosure, Figure 3 The specific processing flow of the data query method disclosed in the present invention when applied to the product promotion activity query scenario is schematically shown. Figure 3 For each preferential condition parameter (i.e., the first query parameter) in the first query result, the parameter value of the first query parameter is analyzed and determined based on the second preset value, such as Figure 3 In the "determine whether the parameter value of each first query parameter is the preset parameter value in turn", the second analysis result is generated, for example, whether the parameter value Num1000 of the user number information corresponding to the target account information satisfies the preset parameter value "the first 10,000 users participating in the activity" of the user number information. Thus, based on the first analysis result obtained by the reverse query and the second analysis result representing whether each other preferential condition parameter in the first query result satisfies the corresponding second preset value, the target query result representing whether the current target account information can participate in the product preferential activity can be obtained, that is, the information to be queried meets the data indicator requirements corresponding to the first query identifier.
[0098] According to an embodiment of the present disclosure, by classifying the first query parameter and its parameter value in the first query result, the first query parameter whose parameter value is the first preset value is reversely queried, and the parameter values with smaller values are directly analyzed and judged, thereby avoiding reading a large amount of data from the cache database at one time, thereby reducing the memory pressure of the cache database.
[0099] According to the embodiments of the present disclosure, Figure 3 As shown, the data query method also includes:
[0100] When the first query result is empty, query the query parameter set corresponding to the first query identifier from the backup database;
[0101] The first query identifier and the query parameter set are associated and stored in the cache database.
[0102] According to an embodiment of the present disclosure, when the first query parameter and parameter value related to the information to be queried are not stored in the cache database, when a query is performed in the cache database based on the first query identifier, the first query result is displayed as an empty set. At this time, the query parameter set corresponding to the first query identifier can be found from the discount condition table or program condition table in the backup database, thereby associating the first query identifier and the query parameter set and storing them in the cache database.
[0103] According to an embodiment of the present disclosure, a discount condition table or a program condition table in a backup database may store a query parameter set corresponding to different information to be queried, and the query parameter set includes different initial query parameters and preset condition parameter values corresponding to each initial query parameter. For example, in a promotional activity, for the origin parameter, destination parameter, etc., the preset condition parameter value can be set to "City A, City B".
[0104] According to an embodiment of the present disclosure, a query parameter set includes a plurality of different initial query parameters and a preset condition parameter value corresponding to each initial query parameter.
[0105] According to the embodiments of the present disclosure, Figure 3 As shown, the data query method also includes:
[0106] When any preset condition parameter value is the first target information, the preset condition parameter value is adjusted to obtain a new preset condition parameter value;
[0107] A new query parameter set is generated according to the new preset condition parameter value and the initial query parameter corresponding to the new preset condition parameter value, so as to store the new query parameter set in the cache database.
[0108] According to an embodiment of the present disclosure, in a product promotion activity, the first target information may be a parameter value in an origin parameter, a destination parameter, a user number information, a promotion time parameter, a delivery parameter, or a payment attribute information. In an application query, the first target information may be a program name of different program functions.
[0109] According to an embodiment of the present disclosure, if the preset condition parameter value of the initial query parameter queried by the backup database has an actual parameter value, the preset condition parameter value can be assigned to empty (or other parameter values), thereby obtaining a new preset condition parameter value of the initial query parameter. At this time, a new query parameter set can be generated based on the new preset condition parameter value and the initial query parameter corresponding to the new preset condition parameter value, and the new query parameter set can be stored in the cache database.
[0110] According to the embodiments of the present disclosure, Figure 3 As shown, according to the first analysis result and the plurality of second analysis results, a target query result is generated, including:
[0111] When the first analysis result represents that each second query identifier has queried the first query identifier, and the second analysis result represents that the parameter value of each first query identifier satisfies the preset parameter value, a first target result is generated, wherein the first target result represents that the information to be queried satisfies the compliance relationship, and the target query result includes the first target result.
[0112] According to an embodiment of the present disclosure, in a query of product promotion activities, if in the second query result obtained when performing a reverse query in the cache database based on the condition parameter query identifier (i.e., the second query identifier), each second query result contains the product promotion identifier (i.e., the first query identifier) of the product promotion activity, then it can be confirmed that among the several target promotion condition parameters of the reverse query (i.e., the first query parameter whose parameter value is the first preset value), the target account information (i.e., the information to be queried) is able to participate in the product promotion activity, that is, it satisfies the compliance relationship between the data indicator requirements corresponding to the first query identifier, but it is also necessary to determine whether other promotion condition parameters in the first query result (i.e., the first query parameter whose parameter value is not the first preset value) meet the preset parameter value, thereby obtaining a second analysis result.
[0113] According to an embodiment of the present disclosure, if the second analysis result shows that other preferential condition parameters all meet their respective preset parameter values, then the first query result and the second query result both indicate that the target account information is able to participate in this product preferential activity, thereby ultimately determining that the target account information meets all conditions for participating in this product preferential activity, that is, the first target result.
[0114] According to the embodiments of the present disclosure, Figure 3 As shown, generating a target query result according to the first analysis result and the plurality of second analysis results also includes:
[0115] When the second analysis result indicates that the parameter value of at least one first query identifier does not satisfy the preset parameter value, a second target result is generated, wherein the second target result indicates that the information to be queried does not satisfy the compliance relationship, and the target query result also includes the second target result.
[0116] According to an embodiment of the present disclosure, if the first analysis result of the reverse query shows that the target account information is able to participate in the product promotion activity, but the target account information does not fully meet other preferential condition parameters in the first query result, it can be finally determined that the target account information cannot participate in this product promotion activity, that is, the second target result.
[0117] In a specific embodiment, assuming that the preferential condition parameters are the origin parameter (parameter value is City A), the destination parameter (parameter value is City C) and the user number information, if the user number information is used as the target preferential condition parameter for reverse query, the second query result obtained shows that the user number information (Num1098) satisfies the preset parameter value "the first 10,000 users participating in the activity", and at this time, it is necessary to judge the origin parameter and the destination parameter.
[0118] According to an embodiment of the present disclosure, when the preset parameter values of the origin parameter and the destination parameter are both limited to "City A, City B", the origin parameter in the first query result (parameter value is City A) satisfies the preset parameter value ("City A, City B"), but the destination parameter (parameter value is City C) does not satisfy the preset parameter value ("City A, City B"). At this time, a second target result can be generated, which indicates that the target account information cannot participate in this product promotion activity, that is, the information to be queried does not meet the data indicator requirements corresponding to the first query identifier.
[0119] According to the embodiments of the present disclosure, Figure 3 As shown, generating a target query result according to the first analysis result and the plurality of second analysis results also includes:
[0120] When the first analysis result indicates that at least one second query identifier does not find the first query identifier, a third target result is generated, wherein the third target result indicates that the information to be queried does not satisfy the conformity relationship, and the target query result also includes the third target result.
[0121] According to an embodiment of the present disclosure, if during the reverse query process, the product discount identifier of the product discount activity is not found in the reverse query result (i.e., the second query result) of as long as there is a condition parameter query identifier, it means that the target discount condition parameter of the target account information has not been configured with the product discount activity. At this time, a third target result can be generated that characterizes that the target account information does not comply with the product discount activity, that is, the information to be queried does not meet the data indicator requirements corresponding to the first query identifier.
[0122] In the above embodiment, in product promotion activities, the reverse query method is suitable for situations where the parameter value of a certain target preferential condition parameter is large in number (for example, tens of thousands). The basis for the reverse query is that the number of product preferential identifications (or product preferential activities) is small, usually only dozens or hundreds. If the parameter value corresponding to the target account information is searched from a large number of parameter values, the matching takes a long time, resulting in a waste of server computing resources. The reverse query method can perform accurate searches, improve the query hit rate, and facilitate the separate control of the effective time of a certain target preferential condition parameter corresponding to the target account information.
[0123] It should be noted that although the above embodiment is an illustrative description through product promotion activities, it can be applied to program development, updating, and maintenance. In program updating, the first query identifier is a configuration update identifier. At this time, the first query parameter includes functional parameters of different program functions.
[0124] Figure 4 A block diagram of a data query device according to an embodiment of the present disclosure is schematically shown.
[0125] like Figure 4 As shown, the data query device 400 includes an acquisition module 410 , a first query module 420 , a first generation module 430 , a second query module 440 , and a second generation module 450 .
[0126] The acquisition module 410 is used to acquire a first query identifier corresponding to the information to be queried in response to the data query instruction;
[0127] A first query module 420, configured to perform a query operation in the cache database based on the first query identifier to obtain a first query result, wherein the first query result includes a parameter value corresponding to the first query parameter;
[0128] A first generating module 430, configured to generate a second query identifier according to the first query parameter and the parameter value when the parameter value of the first query parameter is a first preset value;
[0129] A second query module 440 is used to perform a query operation in the cache database based on the second query identifier to obtain a second query result;
[0130] The second generation module 450 is used to generate a target query result according to the first query result and the second query result, wherein the target query result is used to characterize the compliance relationship between the information to be queried and the data indicator requirement corresponding to the first query identifier.
[0131] According to an embodiment of the present disclosure, by obtaining a first query identifier corresponding to the information to be queried, a query operation is performed in a cache database based on the first query identifier to obtain a first query result, and in the case where the parameter value of the first query parameter in the first query result is a first preset value, a second query identifier is generated based on the first query parameter and the parameter value, and a query operation is performed in the cache database based on the second query identifier to obtain a second query result, thereby generating a target query result based on the first query result and the second query result. By generating a second query identifier using the first query parameter and the parameter value in the first query result to perform a reverse query operation in the cache database, the problem of a long query time caused by a large parameter value of the first query parameter during the first query can be avoided, and at the same time, accurate search can be performed based on the first query parameter and its parameter value, thereby improving the accuracy of the query.
[0132] According to an embodiment of the present disclosure, the second generation module 450 includes:
[0133] A first generating unit, configured to analyze and process whether the second query result contains the first query identifier to obtain a first analysis result;
[0134] A second generating unit, configured to generate a second analysis result according to the parameter value of the first query parameter and the preset parameter value when the parameter value of the first query parameter in the first query result is a second preset value;
[0135] The third generating unit is used to generate a target query result according to the first analysis result and the second analysis result.
[0136] According to an embodiment of the present disclosure, the data query device 400 further includes:
[0137] A third query module, configured to query a query parameter set corresponding to the first query identifier from the backup database when the first query result is empty;
[0138] The storage module is used to associate and store the first query identifier and the query parameter set in a cache database.
[0139] According to an embodiment of the present disclosure, a query parameter set includes a plurality of different initial query parameters and a preset condition parameter value corresponding to each initial query parameter.
[0140] According to an embodiment of the present disclosure, the data query device 400 further includes:
[0141] An adjustment module, configured to adjust the preset condition parameter value to obtain a new preset condition parameter value when any preset condition parameter value is the first target information;
[0142] The third generating module is used to generate a new query parameter set according to the new preset condition parameter value and the initial query parameter corresponding to the new preset condition parameter value, so as to store the new query parameter set in the cache database.
[0143] According to an embodiment of the present disclosure, the third generating unit includes:
[0144] The first generating sub-unit is used to generate a first target result when the first analysis result represents that each second query identifier has queried the first query identifier, and the second analysis result represents that the parameter value of each first query identifier satisfies the preset parameter value, wherein the first target result represents that the information to be queried satisfies the compliance relationship, and the target query result includes the first target result.
[0145] According to an embodiment of the present disclosure, the third generating unit further includes:
[0146] The second generating subunit is used to generate a second target result when the second analysis result indicates that the parameter value of at least one first query identifier does not meet the preset parameter value, wherein the second target result indicates that the information to be queried does not meet the compliance relationship, and the target query result also includes the second target result.
[0147] According to an embodiment of the present disclosure, the third generating unit further includes:
[0148] The third generating subunit is used to generate a third target result when the first analysis result indicates that at least one second query identifier does not find the first query identifier, wherein the third target result indicates that the information to be queried does not satisfy the conformity relationship, and the target query result also includes the third target result.
[0149] According to an embodiment of the present disclosure, the conformity relationship represents whether the information to be queried meets the data indicator requirements corresponding to the first query identifier;
[0150] The information to be queried includes user account information or application information. When the information to be queried is user account information, the first query identifier is a product discount identifier or a recommended product identifier, and the target query result represents whether the user account information satisfies the product discount activity corresponding to the product discount identifier, or whether the user account information satisfies the recommendation condition corresponding to the recommended product identifier; when the information to be queried is application information, the first query identifier is a configuration update identifier, and the target query result represents whether the application information satisfies the update service requirement corresponding to the configuration update identifier.
[0151] According to an embodiment of the present disclosure, when the first query identifier is a product discount identifier, the first query parameter includes at least one of the following: an origin parameter, a destination parameter, user number information, a discount activity time parameter, a delivery parameter, and payment attribute information. When the first query identifier is a configuration update identifier, the first query parameter includes function parameters of different program functions.
[0152] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging circuits, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0153] For example, any of the acquisition module 410, the first query module 420, the first generation module 430, the second query module 440, and the second generation module 450 can be combined in one module / unit / sub-unit for implementation, or any of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the acquisition module 410, the first query module 420, the first generation module 430, the second query module 440, and the second generation module 450 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware, or by a suitable combination of any of them. Alternatively, at least one of the acquisition module 410, the first query module 420, the first generation module 430, the second query module 440, and the second generation module 450 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.
[0154] It should be noted that the data query system part in the embodiment of the present disclosure corresponds to the data query method part in the embodiment of the present disclosure. The description of the data query system part specifically refers to the data query method part, which will not be repeated here.
[0155] Figure 5 A block diagram of an electronic device suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0156] like Figure 5As shown, the electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 to a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0157] In RAM 503, various programs and data required for the operation of electronic device 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other via bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0158] According to an embodiment of the present disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the input / output (I / O) interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage portion 508 as needed.
[0159] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0160] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0161] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0162] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 502 and / or the RAM 503 described above and / or one or more memories other than the ROM 502 and the RAM 503 .
[0163] The embodiments of the present disclosure also include a computer program product, which includes a computer program, and the computer program contains program code for executing the method provided by the embodiments of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the method provided by the embodiments of the present disclosure.
[0164] When the computer program is executed by the processor 501, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0165] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 509, and / or installed from the removable medium 511. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0166] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0167] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0168] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A data query method, characterized in that: include: In response to the data query instruction, obtaining a first query identifier corresponding to the information to be queried; Performing a query operation in the cache database based on the first query identifier to obtain a first query result, wherein the first query result includes a parameter value corresponding to the first query parameter; When the parameter value of the first query parameter is a first preset value, generating a second query identifier according to the first query parameter and the parameter value; Performing a query operation in the cache database based on the second query identifier to obtain a second query result; A target query result is generated according to the first query result and the second query result, wherein the target query result is used to characterize the compliance relationship between the information to be queried and the data indicator requirement corresponding to the first query identifier.
2. The method according to claim 1, characterized in that Generating a target query result according to the first query result and the second query result includes: Analyzing and processing whether the second query result contains the first query identifier to obtain a first analysis result; In a case where the parameter value of the first query parameter in the first query result is a second preset value, generating a second analysis result according to the parameter value of the first query parameter and the preset parameter value; The target query result is generated according to the first analysis result and the second analysis result.
3. The method according to claim 2, characterized in that Generating the target query result according to the first analysis result and the second analysis result includes: When the first analysis result represents that each of the second query identifiers has queried the first query identifier, and the second analysis result represents that the parameter value of each of the first query identifiers satisfies the preset parameter value, a first target result is generated, wherein the first target result represents that the information to be queried satisfies the compliance relationship, and the target query result includes the first target result.
4. The method according to claim 3, characterized in that Also includes: When the second analysis result indicates that at least one parameter value of the first query identifier does not satisfy the preset parameter value, a second target result is generated, wherein the second target result indicates that the information to be queried does not satisfy the compliance relationship, and the target query result also includes the second target result.
5. The method according to claim 3, characterized in that: Also includes: When the first analysis result indicates that at least one of the second query identifiers does not find the first query identifier, a third target result is generated, wherein the third target result indicates that the information to be queried does not satisfy the compliance relationship, and the target query result also includes the third target result.
6. The method according to claim 1, characterized in that Also includes: When the first query result is empty, querying a query parameter set corresponding to the first query identifier from a backup database; The first query identifier and the query parameter set are associated and stored in the cache database.
7. The method according to claim 6, characterized in that The query parameter set includes a plurality of different initial query parameters and a preset condition parameter value corresponding to each of the initial query parameters; Wherein, the method further comprises: In the case where any of the preset condition parameter values is the first target information, adjusting the preset condition parameter value to obtain a new preset condition parameter value; A new query parameter set is generated according to the new preset condition parameter value and the initial query parameter corresponding to the new preset condition parameter value, so as to store the new query parameter set in the cache database.
8. The method according to claim 1, characterized in that The compliance relationship indicates whether the information to be queried meets the data indicator requirement corresponding to the first query identifier; The information to be queried includes user account information or application information. When the information to be queried is the user account information, the first query identifier is a product discount identifier or a recommended product identifier, and the target query result indicates whether the user account information satisfies the product discount activity corresponding to the product discount identifier, or whether the user account information satisfies the recommendation condition corresponding to the recommended product identifier; In the case where the information to be queried is the application information, the first query identifier is a configuration update identifier, and the target query result represents whether the application information meets the update service requirement corresponding to the configuration update identifier.
9. The method according to claim 8, characterized in that In the case where the first query identifier is the product discount identifier, the first query parameter includes at least one of the following: an origin parameter, a destination parameter, user number information, a discount activity time parameter, a delivery parameter, and payment attribute information; In the case where the first query identifier is the configuration update identifier, the first query parameters include function parameters of different program functions.
10. A data query device, comprising: An acquisition module, configured to acquire a first query identifier corresponding to the information to be queried in response to a data query instruction; A first query module, configured to perform a query operation in a cache database based on the first query identifier to obtain a first query result, wherein the first query result includes a parameter value corresponding to the first query parameter; A first generating module, configured to generate a second query identifier according to the first query parameter and the parameter value when the parameter value of the first query parameter is a first preset value; A second query module, configured to perform a query operation in the cache database based on the second query identifier to obtain a second query result; The second generation module is used to generate a target query result based on the first query result and the second query result, wherein the target query result is used to characterize the compliance relationship between the information to be queried and the data indicator requirements corresponding to the first query identifier.
11. An electronic device, comprising: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 9.
13. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 9.
Citation Information
Cited By
Data query method and device, equipment and medium
CN120470028A