Data query method, device, computer equipment and storage medium

By combining local storage and Redis cluster cache in the insurance claims system, the problems of long response time for user information query and a lot of redundant data in large insurance claims systems are solved, and the efficiency of rapid query is improved.

CN111737303BActive Publication Date: 2025-03-28CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010600092.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-28
Publication Date
2025-03-28
Estimated Expiration
2040-06-28

AI Technical Summary

Technical Problem

In large insurance claims systems, due to the dependency database when querying user information, the response time is long and the query is large, making it difficult to meet the needs of fast query.

Method used

By combining local storage and Redis cluster cache, after receiving data query requests, detecting whether there are new data change records in the Redis cluster, analyzing data change records, and detecting the consistency of data processor identification. If inconsistent, query data from the Redis cluster and store it in the target local storage.

Benefits of technology

It effectively avoids frequent acquisition of resource data from Redis clusters, improves data processing efficiency, shortens query response time, and reduces query of redundant data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111737303B_ABST
    Figure CN111737303B_ABST
Patent Text Reader

Abstract

The present invention relates to blockchain technology, and provides a data query method, which includes: receiving a data query request; detecting whether there is a newly added data change record in a redis cluster; when the detection result is yes, parsing the data change record to obtain a changed data processor identifier; detecting whether the changed data processor identifier is consistent with the target identifier; when the detection result is no, querying the cached data in the redis cluster according to the data query request to obtain target query data; storing the target query data in a target local storage corresponding to the target identifier. The present invention also provides a data query device and related equipment. The present invention avoids frequently obtaining resource data from a redis cluster by combining local storage with redis cache, thereby improving data processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data query method, device, computer equipment and storage medium. Background Art

[0002] In the insurance claims system, each link of the insurance claims process may involve the intervention of claims personnel to conduct manual claims. Each link in a large-scale insurance claims system requires querying information such as user roles and affiliated institutions to assign tasks, control permissions, verify data, etc. Therefore, in order to improve the data processing capabilities of insurance claims, it is necessary to increase the query rate of user information.

[0003] In the traditional user information query process, user information is generally stored in a relational database, such as a MySQL database or an Oracle database. User information queries generally need to be implemented based on database queries. However, when the amount of user information is large, relying solely on a relational database to implement information queries will result in a long response time and a lot of redundant data being queried.

[0004] Therefore, there is an urgent need to provide a data query method to adapt to the rapid query of large amounts of resource data. Summary of the invention

[0005] In view of the above, it is necessary to propose a data query method, a data query device, a computer device and a computer-readable storage medium to increase the data query rate.

[0006] An embodiment of the present invention provides a data query method, which is applied to a target data processor. The data query method includes:

[0007] Receive data query requests;

[0008] Check whether there are new data change records in the redis cluster;

[0009] When the detection result is that there is a new data change record in the redis cluster, parsing the data change record to obtain a changed data processor identifier;

[0010] Detecting whether the changed data processor identifier is consistent with a target identifier corresponding to the target data processor;

[0011] When the detection result is that the changed data processor identifier is inconsistent with the target identifier, querying the data cached in the redis cluster according to the data query request to obtain target query data;

[0012] The target query data is stored in the target local storage corresponding to the target identifier.

[0013] Furthermore, in the above data query method provided by the embodiment of the present invention, before receiving the data query request, the method further includes:

[0014] Get the current remaining resources;

[0015] Detecting whether the current remaining resource amount is greater than a preset resource amount;

[0016] When the detection result is that the current remaining resource amount is greater than the preset resource amount, a data query request is received.

[0017] Furthermore, in the above data query method provided by the embodiment of the present invention, the detecting whether there is a new data change record in the redis cluster includes:

[0018] Detecting whether there is data in a preset data format in the redis cluster, and when the detection result is that the redis cluster has data in the preset data format, determining whether there is a newly added data change record in the redis cluster; or

[0019] It is detected whether a preset tag exists in the redis cluster. When the detection result shows that the preset tag exists in the redis cluster, it is determined that a newly added data change record exists in the redis cluster.

[0020] Furthermore, in the above data query method provided by the embodiment of the present invention, after receiving the data query request, the method further includes:

[0021] Detect whether the redis cluster has a preset mark;

[0022] When the detection result shows that the Redis cluster has the preset mark, adding the data change record;

[0023] When the detection result is that the preset mark does not exist in the redis cluster, it is detected whether there is a new data change record in the redis cluster.

[0024] Furthermore, in the above data query method provided by the embodiment of the present invention, the adding of the data change record includes:

[0025] Query a preset database, which is a database in the blockchain and stores the latest user information;

[0026] Acquire the latest user information corresponding to the preset mark;

[0027] Storing the latest user information in the target local storage corresponding to the target identifier;

[0028] The latest user information is stored in the redis cluster, and a data change record is generated according to the target identifier.

[0029] Furthermore, in the above data query method provided by the embodiment of the present invention, after storing the target query data in the target local storage corresponding to the target identifier, the method further includes:

[0030] Generate a target data change record according to the target identifier;

[0031] Storing the target data change record in the redis cluster;

[0032] Obtain the number of data change records corresponding to the updated user information in the redis cluster;

[0033] Detecting whether the number of the data change records is consistent with the number of the data processors;

[0034] When the number of the data change records is consistent with the number of the data processors according to the detection result, the data change records corresponding to the same updated user information in the redis cluster are deleted.

[0035] Furthermore, in the above data query method provided by the embodiment of the present invention, the method further includes:

[0036] When the detection result is that the changed data processor identifier is consistent with the target identifier, determining the target local storage corresponding to the target identifier;

[0037] The target local storage is queried according to the data query request to obtain query data.

[0038] A second aspect of an embodiment of the present invention further provides a data query device, the data query device comprising:

[0039] A request receiving module, used for receiving a data query request;

[0040] The record detection module is used to detect whether there are new data change records in the redis cluster;

[0041] An identification parsing module, used for parsing the data change record to obtain the changed data processor identification when the detection result shows that there is a new data change record in the redis cluster;

[0042] A consistency detection module, used to detect whether the changed data processor identifier is consistent with the target identifier of the target data processor;

[0043] A data query module, configured to query the data cached in the redis cluster according to the data query request to obtain target query data when a detection result shows that the changed data processor identifier is inconsistent with the target identifier;

[0044] The data storage module is used to store the target query data in the target local storage corresponding to the target identifier.

[0045] A third aspect of an embodiment of the present invention further provides a computer device, the computer device comprising a processor, the processor being configured to implement any one of the above-mentioned data query methods when executing a computer program stored in a memory.

[0046] A fourth aspect of an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, any one of the above-mentioned data query methods is implemented.

[0047] The embodiments of the present invention provide a data query method, a data query device, a computer device and a computer-readable storage medium, which avoid frequently obtaining resource data from a redis cluster by combining local storage with a redis cluster cache, thereby improving data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a flow chart of a data query method provided by the first embodiment of the present invention.

[0049] Figure 2 It is a schematic diagram of the structure of a computer device according to one embodiment of the present invention.

[0050] Figure 3 yes Figure 2 An exemplary functional module diagram of a computer device is shown.

[0051] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0052] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0053] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The embodiments described are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0055] Figure 1 It is a flow chart of the data query method of the first embodiment of the present invention. The data query method can be applied to the insurance claim system, which includes an insurance claim execution terminal, a redis cluster, a preset database for maintaining user information, a data processor and corresponding local storage. It should be emphasized that in order to further ensure the privacy and security of user information, the preset database can also be a database in the blockchain. Figure 1 As shown, the data query method is applied to a target data processor, and the target data processor refers to a data processor that receives the data query method. The data query method may include the following steps:

[0056] S11. Receive a data query request.

[0057] In at least one embodiment of the present invention, the insurance claim execution terminal is used to execute the relevant insurance claim process, which may include: reporting, collecting, verifying, settling, reviewing, closing and paying. From the reporting link to the payment link, each link may involve the intervention of the claims personnel to conduct manual claims. Therefore, each link of the insurance claim process needs to query the user role, affiliated organization and other information of the claims personnel for the purpose of allocating tasks, controlling permissions and verifying data.

[0058] The data query request is a request output by the insurance claim execution end for querying user hotspot information, and the data query request carries the user hotspot information to be queried. The user hotspot information is information that appears frequently during query, and the user hotspot information includes user ID, user role R, and affiliated institution D, where the same user can correspond to different user roles and belong to different institutions. For example, user U1 can correspond to role R1 in institution D1, or role R2 in institution D2, without limitation here.

[0059] In at least one embodiment of the present invention, the insurance claim execution end establishes a communication connection with a data processor, and the data processor is essentially an execution unit for information query and processing, and the data processor is used to receive a data query request output by the insurance claim execution end. For each of the data processors, there is a unique identifier IP. For example, the number of the data processors is 4, namely data processors A, B, C and D, and the corresponding identifiers are IP_A, IP_B, IP_C and IP_D, respectively. Among them, the data processor that receives the data query request is determined to be the target data processor, and its corresponding identifier is the target identifier.

[0060] In an insurance claims system, the number of data processors can be multiple, and the number of data processors is determined according to the load balancing requirements of actual data query requests, and the data processors are all used to respond to the data query requests and perform data queries. Specifically, the method also includes: obtaining a first number of data query requests received within a preset time period; determining a second number of data query requests that each data processor branches within the preset time period; and determining the number of data processors based on the first number and the second number. The preset time period is pre-set, for example, the preset time period can be 24 hours. The first number of data query requests received within the preset time period can be obtained by querying logs.

[0061] In at least one embodiment of the present invention, when there are multiple data processors, before receiving the data query request, the method further includes: obtaining the current remaining amount of resources; detecting whether the current remaining amount of resources is greater than the preset amount of resources; when the detection result is that the current remaining amount of resources is greater than the preset amount of resources, receiving the data query request. Among them, the multiple data processors are correspondingly provided with initial resources for processing data query requests. When a data query request is received, the data processor allocates relevant resources to the insurance claim execution end for executing the current request. The preset amount of resources is the amount of resources required to process a data query request. The preset amount of resources can be obtained based on neural network learning or based on empirical values, and is not limited here.

[0062] Specifically, when a user submits a data query request at the insurance claim execution end, the user needs to input relevant user information (including but not limited to user ID, user role, affiliated organization, etc.) into the user interface program corresponding to the insurance claim execution end, and the user interface program will pass the relevant user information to the task scheduler of the data processor to implement the submission process of the data query request. Among them, the user interface program can be a web application, and the user needs to operate the user interface program through a web browser; the task scheduler is used to analyze and schedule the tasks submitted by the insurance claim execution end.

[0063] In at least one embodiment of the present invention, after receiving the data query request, the method further includes: detecting whether the redis cluster has a preset mark; when the detection result is that the redis cluster has the preset mark, adding the data change record; when the detection result is that the redis cluster does not have the preset mark, detecting whether there is a newly added data change record in the redis cluster. Specifically, adding the data change record includes: querying a preset database, which stores the latest user information; obtaining the latest user information corresponding to the preset mark; storing the latest user information in the target local storage corresponding to the target identifier; storing the updated user information in the redis cluster, and generating a data change record according to the target identifier.

[0064] In one embodiment, when the preset database updates user information, an update indication is output to the redis cluster, and a preset mark is added to the redis cluster, wherein the preset mark includes user hot spot information. In other embodiments, the method further includes: when the detection result is that the redis cluster has a preset mark, verify whether the first user hot spot information carried in the data query request is associated with the second user hot spot information represented by the preset mark; when the verification result is that the first user hot spot information carried in the data query request is associated with the second user hot spot information represented by the preset mark, add the data change record; when the verification result is that the first user hot spot information carried in the data query request is not associated with the second user hot spot information represented by the preset mark, detect whether there is a newly added data change record in the redis cluster. Among them, verifying whether the first user hot spot information carried in the data query request is associated with the second user hot spot information represented by the preset mark is to verify whether the first user hot spot information and the second user hot spot information have the same information item (the information item may include user ID, user role R and affiliated institution D, etc.), if there is the same information item, the two are associated. It is understandable that, in the case where the first user hotspot information is not associated with the second user hotspot information, temporarily stopping the addition of the data change record can reduce the operations required to be performed for the current data query to a certain extent, thereby improving data query efficiency.

[0065] In one embodiment, when the detection result is that there is no preset mark in the redis cluster, it means that the user hotspot information in the preset database has not been updated, and the step of detecting whether there is a new data change record in the redis cluster can be executed; when the detection result is that there is a preset mark in the redis cluster, it means that the user hotspot information in the preset database has been updated, and it is necessary to query the preset database to obtain the updated user hotspot information.

[0066] In one embodiment, a processing mechanism is set, and when a preset database is updated, an update indication is output to the redis cluster, and a preset mark is added to the redis cluster. For the target data processor that currently receives the data query request, when the preset mark is detected in the redis cluster, the updated user information needs to be obtained from the preset database.

[0067] In one embodiment, each data processor has a corresponding local storage, and the local storage is used to store all user information. For example, for the data processors A, B, C, and D, the corresponding local storage includes local storage A, B, C, and D. The data format stored in the local storage includes a Map format, in which the key is the user ID and the value is the user's role, organization, and other information.

[0068] S12: Detect whether there is a new data change record in the redis cluster. When the detection result shows that there is a new data change record in the redis cluster, execute step S13.

[0069] In at least one embodiment of the present invention, the redis cluster is associated with a preset database for maintaining user information, and the preset database may be a Mysql type database, and all user information is stored in the preset database, including user hotspot information and user non-hotspot information, wherein user non-hotspot information includes user phone number, email address, gender, etc. The Redis cluster caches all user hotspot information in the preset database, and utilizes the load balancing and error recovery capabilities of the redis cluster to achieve scalability and high availability of resource data caching, avoid frequent acquisition of data from the preset database, and thus speed up data reading.

[0070] In at least one embodiment of the present invention, the data processor may output a detection instruction to the Redis cluster, and the detection instruction is used to detect whether there is a new data change record in the Redis cluster. The data change record is stored in a preset data format, and a label may be provided on the data change record to identify the data change record. The data change record includes: the changed data processor IP, whether it has been changed, and the changed user ID. The data change record is used to indicate that the data processor corresponding to the current IP has changed the relevant data of the user ID.

[0071] In at least one embodiment of the present invention, the step of detecting whether there is a newly added data change record in the redis cluster includes: detecting whether there is data in a preset data format in the redis cluster, and when the detection result is that the redis cluster has data in the preset data format, determining that there is a newly added data change record in the redis cluster. Alternatively, the step of detecting whether there is a newly added data change record in the redis cluster also includes: detecting whether there is a preset tag in the redis cluster, and when the detection result is that the redis cluster has the preset tag, determining that there is a newly added data change record in the redis cluster.

[0072] S13: Parse the data change record to obtain a changed data processor identifier.

[0073] In at least one embodiment of the present invention, the data change record includes the changed data processor IP, whether it has been changed, and the changed user hotspot information. The data change record is used to indicate that the data processor corresponding to the current IP has changed the relevant data of the user ID.

[0074] In other embodiments, before parsing the data change record to obtain the changed data processor identifier, the method may also include: parsing the data change record to obtain the changed user hotspot information; verifying whether the first user hotspot information carried in the data query request is associated with the changed user hotspot information; when the verification result is that the first user hotspot information carried in the data query request is associated with the changed user hotspot information, continuing to execute step S13; when the verification result is that the first user hotspot information carried in the data query request is not associated with the changed user hotspot information, determining the target local storage corresponding to the target data processor, and executing the data query request in the target local storage. It can be understood that, for the case where the first user hotspot information is not associated with the changed user hotspot information, the first user hotspot information has not changed, the first user hotspot information is stored in the target local storage, and the target local storage is directly queried, thereby improving data query efficiency.

[0075] S14, detecting whether the changed data processor identifier is consistent with the target identifier corresponding to the target data processor. When the detection result is that the changed data processor identifier is inconsistent with the target identifier, executing step S15.

[0076] In at least one embodiment of the present invention, detecting whether the data processor IP is consistent with the target identifier is to detect whether the local storage of the data processor corresponding to the target identifier is the latest user information. When the detection result is that the changed data processor identifier is inconsistent with the target identifier, it is determined that the user information stored in the local storage of the data processor corresponding to the target identifier needs to be updated, and step S15 is executed. When the detection result is that the changed data processor identifier is consistent with the target identifier, it is determined that the local storage of the data processor corresponding to the target identifier stores the latest user information.

[0077] Specifically, the method further includes: when the detection result is that the changed data processor identifier is consistent with the target identifier, determining the target local storage corresponding to the target identifier; querying the target local storage according to the data query request to obtain query data. It can be understood that when the detection result is that the changed data processor identifier is consistent with the target identifier, querying the local storage according to the data query request can improve data query efficiency.

[0078] S15. Query the data cached in the redis cluster according to the data query request to obtain target query data.

[0079] In at least one embodiment of the present invention, when the detection result is that the changed data processor identifier is inconsistent with the target identifier, the user hotspot information in the redis cluster is the latest. Therefore, the target data processor is called to query the cached data in the redis cluster to obtain the target query data. The target query data is the data corresponding to the data query request.

[0080] S16. Store the target query data in the target local storage corresponding to the target identifier.

[0081] In at least one embodiment of the present invention, when the detection result is that the changed data processor identifier is inconsistent with the target identifier, the user hotspot information in the preset database is updated, and the local storage corresponding to the changed data processor IP in the data change record and the user hotspot information in the redis cluster have been updated, while the user hotspot information in the local storage corresponding to other data processors has not been updated. Therefore, the target query data is stored in the target local storage corresponding to the target identifier.

[0082] In at least one embodiment of the present invention, after the step of storing the target query data in the target local storage corresponding to the target identifier, the method further includes: generating a target data change record according to the target identifier; storing the target data change record in the redis cluster; obtaining the number of data change records corresponding to the same updated user information in the redis cluster; detecting whether the number of data change records is consistent with the number of data processors; when the detection result shows that the number of data change records is consistent with the number of data processors, deleting the data change record corresponding to the same updated user information in the redis cluster.

[0083] It can be understood that when the detection result is that the number of the data change records is consistent with the number of the data processors, deleting the data change records corresponding to the same updated user information in the redis cluster can reduce the storage space for the data change records in the redis cluster and avoid wasting storage space.

[0084] In at least one embodiment of the present invention, the method may further include: within a preset time interval, detecting whether the number of data change records is consistent with the number of data processors; when the detection result is that the number of data change records is inconsistent with the number of data processors, determining the identifier of the corresponding data processor that has not yet updated the data; outputting a prompt to the data processor corresponding to the identifier to prompt the data processor to update the data in a timely manner. The preset time interval is pre-set by the computer device, for example, the preset time interval is 30 days. By outputting a prompt to prompt the data processor to update the data, it is possible to ensure that the information in the local storage corresponding to multiple data processors is up to date, thereby improving data query efficiency.

[0085] A data query method provided by an embodiment of the present invention avoids frequently obtaining resource data from a redis cluster by combining local storage with a redis cluster cache, thereby improving data processing efficiency.

[0086] The above is a detailed description of the method provided by the embodiment of the present invention. According to different requirements, the execution order of the blocks in the flowchart can be changed, and some blocks can be omitted. The computer device 1 provided by the embodiment of the present invention is described below.

[0087] Figure 2 Schematic diagram of the structure of a computer device according to an embodiment of the present invention. Figure 2As shown, the computer device 1 includes a memory 10, in which the data query device 100 is stored. The computer device 1 can be an electronic device such as a computer, a tablet computer, a personal digital assistant, etc., which has functions such as data processing, analysis, program execution and display. The data query device 100 can receive a data query request; detect whether there is a new data change record in the redis cluster; when the detection result is that there is a new data change record in the redis cluster, parse the data change record to obtain the changed data processor identifier; detect whether the changed data processor identifier is consistent with the target identifier corresponding to the target data processor; when the detection result is that the changed data processor identifier is inconsistent with the target identifier, query the cached data in the redis cluster according to the data query request to obtain the target query data; store the target query data in the target local storage corresponding to the target identifier. By using the present invention, by combining local storage with redis cluster cache, frequent acquisition of resource data from the redis cluster is avoided, thereby improving data processing efficiency.

[0088] In this embodiment, the computer device 1 may further include a display screen 20 and a processor 30. The memory 10 and the display screen 20 may be electrically connected to the processor 30 respectively.

[0089] The memory 10 can be different types of storage devices for storing various types of data. For example, it can be the memory or internal memory of the computer device 1, or it can be a memory card that can be externally connected to the computer device 1, such as a flash memory, a SM card (SmartMedia Card), an SD card (Secure Digital Card), etc. In addition, the memory 10 can include a non-volatile memory, such as a hard disk, an internal memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. The memory 10 is used to store various types of data, for example, various types of applications installed in the computer device 1, data set and obtained by applying the above-mentioned data query method, and other information.

[0090] The display screen 20 is installed on the computer device 1 and is used to display information.

[0091] The processor 30 is used to execute the data query method and various software installed in the computer device 1, such as an operating system and application display software. The processor 30 includes but is not limited to a processor (Central Processing Unit, CPU), a microcontroller unit (Micro Controller Unit, MCU) and other devices used to interpret computer instructions and process data in computer software.

[0092] The data query device 100 may include one or more modules, which are stored in the memory 10 of the computer device 1 and configured to be executed by one or more processors (a processor 30 in this embodiment) to complete the embodiment of the present invention. Figure 3 As shown, the data query device 100 may include a request receiving module 101, a record detection module 102, an identification resolution module 103, a consistency detection module 104, a data query module 105, and a data storage module 106. The module referred to in the embodiment of the present invention may be a program segment that performs a specific function, which is more suitable for describing the execution process of software in the processor 30 than a program.

[0093] It can be understood that, corresponding to each implementation of the above data query method, the data query device 100 may include Figure 3 The functions of each module will be specifically described below. It should be noted that the same nouns, related nouns and their specific explanations in each implementation of the above data query method can also be applied to the following functional introduction of each module. In order to save space and avoid repetition, they will not be repeated here.

[0094] The request receiving module 101 may be used to receive a data query request.

[0095] The record detection module 102 can be used to detect whether there is a new data change record in the redis cluster.

[0096] The identifier resolution module 103 may be configured to resolve the data change record to obtain the identifier of the changed data processor when the detection result indicates that there is a newly added data change record in the redis cluster.

[0097] The consistency detection module 104 may be used to detect whether the changed data processor identifier is consistent with a target identifier corresponding to the target data processor.

[0098] The data query module 105 may be configured to query the data cached in the redis cluster according to the data query request to obtain target query data when the detection result is that the changed data processor identifier is inconsistent with the target identifier.

[0099] The data storage module 106 may be configured to store the target query data in a target local storage corresponding to the target identifier.

[0100] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by the processor 30, the steps of the data query method in any of the above-mentioned embodiments are implemented.

[0101] If the module / unit integrated in the data query device 100 / computer device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned implementation method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor 30. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable storage medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), etc.

[0102] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 30 is the control center of the data query device 100 / computer device 1, and uses various interfaces and lines to connect various parts of the entire data query device 100 / computer device 1.

[0103] The memory 10 is used to store the computer program and / or module, and the processor 30 implements various functions of the data query device 100 / computer device 1 by running or executing the computer program and / or module stored in the memory 10, and calling the data stored in the memory 10. The memory 10 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device 1, etc.

[0104] In the several specific embodiments provided by the present invention, it should be understood that the disclosed computer device and method can be implemented in other ways. For example, the system implementation described above is only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0105] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0106] It is obvious to those skilled in the art that the embodiments of the present invention are not limited to the details of the exemplary embodiments described above, and that the embodiments of the present invention can be implemented in other specific forms without departing from the spirit or essential features of the embodiments of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the embodiments of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the embodiments of the present invention. Any figure mark in a claim should not be regarded as limiting the claim involved. Multiple units, modules or devices stated in a system, device or computer equipment claim may also be implemented by the same unit, module or device through software or hardware.

[0107] The above implementation modes are only used to illustrate the technical solutions of the embodiments of the present invention and are not intended to limit the present invention. Although the embodiments of the present invention are described in detail with reference to the above preferred implementation modes, those skilled in the art should understand that the technical solutions of the embodiments of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data query method, applied to a target data processor, characterized in that: The data query method comprises: Receive data query requests; Check whether there are new data change records in the redis cluster; When the detection result is that there is a new data change record in the redis cluster, parsing the data change record to obtain a changed data processor identifier; Detecting whether the changed data processor identifier is consistent with a target identifier corresponding to the target data processor; When the detection result is that the changed data processor identifier is inconsistent with the target identifier, querying the data cached in the redis cluster according to the data query request to obtain target query data; Storing the target query data in the target local storage corresponding to the target identifier; Generate a target data change record according to the target identifier; Storing the target data change record in the redis cluster; Obtain the number of data change records corresponding to the same updated user information in the redis cluster; Detecting whether the number of the data change records is consistent with the number of the data processors; When the number of the data change records is consistent with the number of the data processors according to the detection result, the data change records corresponding to the same updated user information in the redis cluster are deleted.

2. The data query method according to claim 1, characterized in that: Before receiving the data query request, the method further includes: Get the current remaining resources; Detecting whether the current remaining amount of resources is greater than a preset amount of resources; When the detection result is that the current remaining resource amount is greater than the preset resource amount, a data query request is received.

3. The data query method according to claim 1, characterized in that: The detecting whether there is a new data change record in the redis cluster includes: Detecting whether there is data in a preset data format in the redis cluster, and when the detection result is that the redis cluster has data in the preset data format, determining whether there is a newly added data change record in the redis cluster; or It is detected whether a preset tag exists in the redis cluster. When the detection result shows that the preset tag exists in the redis cluster, it is determined that a newly added data change record exists in the redis cluster.

4. The data query method according to claim 1, characterized in that: After receiving the data query request, the method further includes: Detect whether the redis cluster has a preset mark; When the detection result shows that the Redis cluster has the preset mark, adding the data change record; When the detection result is that the preset mark does not exist in the redis cluster, it is detected whether there is a new data change record in the redis cluster.

5. The data query method according to claim 4, characterized in that: The newly added data change record includes: Query a preset database, which is a database in the blockchain and stores the latest user information; Acquire the latest user information corresponding to the preset mark; Storing the latest user information in the target local storage corresponding to the target identifier; The latest user information is stored in the redis cluster, and a data change record is generated according to the target identifier.

6. The data query method according to claim 1, characterized in that: The method further comprises: When the detection result is that the changed data processor identifier is consistent with the target identifier, determining the target local storage corresponding to the target identifier; The target local storage is queried according to the data query request to obtain query data.

7. A data query device, applied to a target data processor, for implementing the data query method according to any one of claims 1 to 6, characterized in that: The data query device comprises: A request receiving module, used for receiving a data query request; The record detection module is used to detect whether there are new data change records in the redis cluster; An identification parsing module, used for parsing the data change record to obtain the changed data processor identification when the detection result shows that there is a new data change record in the redis cluster; A consistency detection module, used to detect whether the changed data processor identifier is consistent with the target identifier of the target data processor; A data query module, configured to query the data cached in the redis cluster according to the data query request to obtain target query data when a detection result shows that the changed data processor identifier is inconsistent with the target identifier; The data storage module is used to store the target query data in the target local storage corresponding to the target identifier.

8. A computer device, characterized in that: The computer device comprises a processor, and the processor is used to implement the data query method according to any one of claims 1 to 6 when executing a computer program stored in a memory.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data query method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Query method, query client side and query system of resource data

    CN107025243A

  • Access request processing method and device

    CN109597915A