[go: up one dir, main page]

CN110413679B - Database information processing method, device, equipment and readable storage medium - Google Patents

Database information processing method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN110413679B
CN110413679B CN201910716597.2A CN201910716597A CN110413679B CN 110413679 B CN110413679 B CN 110413679B CN 201910716597 A CN201910716597 A CN 201910716597A CN 110413679 B CN110413679 B CN 110413679B
Authority
CN
China
Prior art keywords
information
information set
database
downgrade
information processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910716597.2A
Other languages
Chinese (zh)
Other versions
CN110413679A (en
Inventor
刘高亮
卫劲波
李凌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201910716597.2A priority Critical patent/CN110413679B/en
Publication of CN110413679A publication Critical patent/CN110413679A/en
Application granted granted Critical
Publication of CN110413679B publication Critical patent/CN110413679B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the field of financial science and technology, and discloses a database information processing method, which comprises the following steps: when an information query instruction of a user side is received, judging whether a first information set corresponding to the information query instruction exists in a cached current information set or not; if a first information set corresponding to the information query instruction exists in the current information set, judging whether a degradation record corresponding to a preset identifier of the first information set exists in a degradation table; and if the degradation record exists in the degradation table, acquiring a second information set corresponding to the preset identification from a database, and sending the second information set to the user side. The invention also discloses a database information processing device, equipment and a readable storage medium. The invention effectively reduces the dependence on the cache through the downgrade table, and does not influence the maintenance transaction and the information access transaction under the condition that the cache system has a fault.

Description

数据库信息处理方法、装置、设备及可读存储介质Database information processing method, device, equipment and readable storage medium

技术领域technical field

本发明涉及金融科技(Fintech)技术领域,尤其涉及金融行业的数据库信息处理方法、装置、设备及可读存储介质。The invention relates to the technical field of financial technology (Fintech), in particular to a database information processing method, device, equipment and readable storage medium in the financial industry.

背景技术Background technique

随着计算机技术的发展,越来越多的技术(如分布式、区块链Blockchain、人工智能等)应用在金融领域,传统金融业正在逐步向金融科技(Fintech)转变,越来越多的技术应用于金融行业。在金融行业中,银行账户的常用信息集通常会存储在数据库中,由于数据库的查询通常较慢,对于频繁使用的信息集,会加载在高速缓存中,以便于用户快速查询到所需信息集。With the development of computer technology, more and more technologies (such as distributed, blockchain, artificial intelligence, etc.) are applied in the financial field. The traditional financial industry is gradually transforming into financial technology (Fintech). Technology applied to the financial industry. In the financial industry, the commonly used information sets of bank accounts are usually stored in the database. Since the query of the database is usually slow, the frequently used information sets will be loaded in the cache, so that users can quickly query the required information sets .

现有技术中,在用户查询高速缓存中没有查询到对应的信息集时,会继续查询较慢的数据库,这种方案为了保证高速缓存中的信息集不是老旧过时信息,在信息发生变更时,将高速缓存中的信息集进行删除,以便于使用者降级到查询较慢的数据库中获取最新的信息集;在异步线程加载最新信息集至高速缓存时,需要缓存操作同步锁,才能将信息集加载至高速缓存中;在信息维护过程中,通过同步锁,进行清除高速缓存操作,以便于最新的信息集能够加载至高速缓存中。然而,为了保证缓存中的信息集是最新的,信息维护过程与异步线程加载过程需要保持同步,对信息维护的吞吐量影响较大,并且,由于对高速缓存的依赖较强,在高速缓存系统出现故障时,导致查询失败。In the existing technology, when the user does not find the corresponding information set in the query cache, it will continue to query the slower database. In order to ensure that the information set in the cache is not old and outdated information, when the information changes , to delete the information set in the cache, so that users can downgrade to the database with slower queries to obtain the latest information set; when the asynchronous thread loads the latest information set to the cache, the cache operation synchronization lock is required to update the information Sets are loaded into the cache; in the information maintenance process, the operation of clearing the cache is performed through a synchronization lock, so that the latest information set can be loaded into the cache. However, in order to ensure that the information set in the cache is up-to-date, the information maintenance process and the asynchronous thread loading process need to be synchronized, which has a great impact on the throughput of information maintenance. When a failure occurs, it causes the query to fail.

发明内容Contents of the invention

本发明的主要目的在于提出一种数据库信息处理方法、装置、设备及可读存储介质,旨在解决现有技术中用户查询数据库信息集时,通过高速缓存查询时对高速缓存过于依赖,在高速缓存出现故障时容易导致查询失败的问题。The main purpose of the present invention is to propose a database information processing method, device, equipment and readable storage medium, aiming at solving the problem of relying too much on the cache when the user queries the database information set in the prior art. When the cache fails, it is easy to cause the query to fail.

为实现上述目的,本发明提供一种数据库信息处理方法,所述数据库信息处理方法包括如下步骤:In order to achieve the above object, the present invention provides a database information processing method, the database information processing method includes the following steps:

在接收到用户端的信息查询指令时,判断高速缓存的当前信息集是否存在与所述信息查询指令对应的第一信息集;When receiving an information query instruction from the client, judging whether there is a first information set corresponding to the information query instruction in the cached current information set;

若所述当前信息集中存在与所述信息查询指令对应的第一信息集,则判断降级表中是否存在与所述第一信息集的预设标识对应的降级记录;If there is a first information set corresponding to the information query instruction in the current information set, then judging whether there is a downgrade record corresponding to the preset identifier of the first information set in the downgrade table;

若所述降级表中存在所述降级记录,则在数据库中获取与所述预设标识对应的第二信息集,并将所述第二信息集发送至所述用户端。If the downgrade record exists in the downgrade table, a second information set corresponding to the preset identifier is obtained from a database, and the second information set is sent to the user terminal.

可选地,所述判断降级表中是否存在所述第一信息集对应的降级记录的步骤之后,所述数据库信息处理方法包括:Optionally, after the step of judging whether there is a degraded record corresponding to the first information set in the degraded table, the database information processing method includes:

若所述降级表中不存在所述降级记录,则在所述高速缓存中获取所述当前信息集;If the downgrade record does not exist in the downgrade table, then acquire the current information set in the cache;

将所述当前信息集中与所述信息查询指令对应的第三信息集发送至所述用户端。Sending a third information set in the current information set corresponding to the information query instruction to the client.

可选地,所述判断高速缓存的当前信息集是否存在与所述信息查询指令对应的第一信息集的步骤之后,所述数据库信息处理方法包括:Optionally, after the step of judging whether there is a first information set corresponding to the information query instruction in the current cached information set, the database information processing method includes:

若所述当前信息集不存在与所述信息查询指令对应的第一信息集,则在所述数据库中获取所述信息查询指令对应的第四信息集,并将所述第四信息集发送至所述用户端。If the current information set does not have the first information set corresponding to the information query instruction, then obtain the fourth information set corresponding to the information query instruction from the database, and send the fourth information set to the client.

可选地,所述在接收到用户端的信息查询指令时,判断高速缓存的当前信息集是否存在与所述信息查询指令对应的第一信息集的步骤之前,所述数据库信息处理方法还包括:Optionally, before the step of judging whether there is a first information set corresponding to the information query instruction in the cached current information set when receiving the information query instruction from the client, the database information processing method further includes:

获取所述数据库的实时信息集,其中,所述实时信息集为数据库中实时更新的数据集合;Obtaining a real-time information set of the database, wherein the real-time information set is a data set updated in real time in the database;

判断所述实时信息集是否发生改变;judging whether the real-time information set has changed;

若是,则基于所述实时信息集,在所述降级表中登记降级记录。If yes, register a downgrade record in the downgrade table based on the real-time information set.

可选地,所述判断所述实时信息集中是否发生改变的步骤包括:Optionally, the step of judging whether a change occurs in the real-time information set includes:

判断所述实时信息集中是否存在信息标识;Judging whether there is an information identifier in the real-time information set;

若是,则判定所述实时信息集发生改变;If so, determine that the real-time information set has changed;

若否,则判定所述实时信息集未发生改变。If not, it is determined that the real-time information set has not changed.

可选地,所述降级记录包括信息索引项,所述基于所述实时信息集,在所述降级表中登记降级记录的步骤包括:Optionally, the degraded record includes an information index item, and the step of registering the degraded record in the degraded table based on the real-time information set includes:

基于所述信息标识,获取对应的所述预设标识;Acquiring the corresponding preset identifier based on the information identifier;

生成将所述预设标识对应的降级记录并存储于所述降级表中,以使所述降级记录登记于所述降级表中。A downgrade record corresponding to the preset identifier is generated and stored in the downgrade table, so that the downgrade record is registered in the downgrade table.

可选地,在所述数据库中获取所述降级记录对应的第二信息集的步骤之后,所述数据库信息处理方法包括:Optionally, after the step of obtaining the second information set corresponding to the degraded record in the database, the database information processing method includes:

将所述第二信息集加载至所述当前信息集中,以对所述第一信息集进行替换;loading the second set of information into the current set of information to replace the first set of information;

在所述第二信息集加载完毕后,在所述降级表中删除所述降级记录。After the loading of the second information set is completed, the downgrade record is deleted in the downgrade table.

此外,为实现上述目的,本发明还提供一种数据库信息处理装置,所述数据库信息处理装置包括:In addition, in order to achieve the above object, the present invention also provides a database information processing device, the database information processing device includes:

第一判断模块,用于在接收到用户端的信息查询指令时,判断高速缓存的当前信息集是否存在与所述信息查询指令对应的第一信息集;The first judging module is configured to judge whether there is a first information set corresponding to the information query instruction in the cached current information set when receiving an information query instruction from the client;

第二判断模块,用于若所述当前信息集中存在与所述信息查询指令对应的第一信息集,则判断降级表中是否存在与所述第一信息集的预设标识对应的降级记录;The second judging module is configured to judge whether there is a downgrade record corresponding to the preset identifier of the first information set in the downgrade table if the first information set corresponding to the information query instruction exists in the current information set;

处理模块,用于若所述降级表中存在所述降级记录,则在数据库中获取与所述预设标识对应的第二信息集,并将所述第二信息集发送至所述用户端。A processing module, configured to acquire a second information set corresponding to the preset identifier from a database if the downgrade record exists in the downgrade table, and send the second information set to the client.

可选地,在所述第二判断模块执行判断降级表中是否存在所述第一信息集对应的降级记录的步骤之后,所述数据库信息处理装置包括第一执行模块,用于:Optionally, after the second judging module executes the step of judging whether there is a degraded record corresponding to the first information set in the degraded table, the database information processing device includes a first executing module, configured to:

若所述降级表中不存在所述降级记录,则在所述高速缓存中获取所述当前信息集;If the downgrade record does not exist in the downgrade table, then acquire the current information set in the cache;

将所述当前信息集中与所述信息查询指令对应的第三信息集发送至所述用户端。Sending a third information set in the current information set corresponding to the information query instruction to the client.

可选地,在所述第一判断模块执行判断高速缓存的当前信息集是否存在与所述信息查询指令对应的第一信息集的步骤之后;所述数据库信息处理装置包括第二执行模块,用于:Optionally, after the first judging module executes the step of judging whether there is a first information set corresponding to the information query instruction in the current cached information set; the database information processing device includes a second execution module, using At:

若所述当前信息集不存在与所述信息查询指令对应的第一信息集,则在所述数据库中获取所述信息查询指令对应的第四信息集,并将所述第四信息集发送至所述用户端。If the current information set does not have the first information set corresponding to the information query instruction, then obtain the fourth information set corresponding to the information query instruction from the database, and send the fourth information set to the client.

可选地,在执行第一查询模块之前,所述数据库信息处理装置还包括登记模块,用于:Optionally, before executing the first query module, the database information processing device further includes a registration module, configured to:

获取所述数据库的实时信息集,其中,所述实时信息集为数据库中实时更新的数据集合;Obtaining a real-time information set of the database, wherein the real-time information set is a data set updated in real time in the database;

判断所述实时信息集是否发生改变;judging whether the real-time information set has changed;

若是,则基于所述实时信息集,在所述降级表中登记降级记录。If yes, register a downgrade record in the downgrade table based on the real-time information set.

可选地,在所述处理模块执行在所述数据库中获取所述预设标识对应的第二信息集的步骤之后,所述数据库信息处理装置还包括加载模块,用于:Optionally, after the processing module executes the step of acquiring the second information set corresponding to the preset identifier in the database, the database information processing device further includes a loading module, configured to:

将所述第二信息集加载至所述当前信息集中,以对所述第一信息集进行替换;loading the second set of information into the current set of information to replace the first set of information;

在所述第二信息集加载完毕后,在所述降级表中删除所述降级记录。After the loading of the second information set is completed, the downgrade record is deleted in the downgrade table.

此外,为实现上述目的,本发明还提供一种数据库信息处理设备,所述数据库信息处理设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的数据库信息处理程序,所述数据库信息处理程序被所述处理器执行时实现如上所述的数据库信息处理方法的步骤。In addition, in order to achieve the above object, the present invention also provides a database information processing device, which includes: a memory, a processor, and a database information processing system stored in the memory and operable on the processor. A program, when the database information processing program is executed by the processor, implements the steps of the database information processing method described above.

此外,为实现上述目的,本发明还提供一种可读存储介质,所述可读存储介质上存储有数据库信息处理程序,所述数据库信息处理程序被处理器执行时实现如上所述的数据库信息处理方法的步骤。In addition, in order to achieve the above object, the present invention also provides a readable storage medium, on which a database information processing program is stored, and when the database information processing program is executed by a processor, the above-mentioned database information The steps of the processing method.

本发明提出的数据库信息处理方法,在数据库端引入降级表,在接收到信息查询指令时,首先对高速缓存的当前信息集进行查询,若高速缓存中存在对应的第一信息集,且降级表中存在降级记录,则说明高速缓存中的当前信息集为老旧过时信息,不应该被使用,否则会导致数据的一致性问题;此时,需要从数据库中获取第二信息集,即获取最新的信息集,以保证用户端获取到的是最新的信息集。本发明通过降级表,有效降低对高速缓存的依赖,在高速缓存系统出现故障的情况下,不影响维护交易,也不影响信息访问交易。In the database information processing method proposed by the present invention, a downgrade table is introduced at the database side. When an information query instruction is received, the current information set in the cache is first queried. If there is a corresponding first information set in the cache, and the downgrade table If there is a degraded record in the cache, it means that the current information set in the cache is old and outdated information and should not be used, otherwise it will cause data consistency problems; at this time, it is necessary to obtain the second information set from the database, that is, to obtain the latest information set to ensure that the user end obtains the latest information set. The invention effectively reduces the dependence on the high-speed cache through the downgrade table, and does not affect the maintenance transaction or the information access transaction in the case of a failure of the high-speed cache system.

附图说明Description of drawings

图1是本发明实施例方案涉及的硬件运行环境的设备结构示意图;Fig. 1 is a schematic diagram of the device structure of the hardware operating environment involved in the solution of the embodiment of the present invention;

图2为本发明数据库信息处理方法第一实施例的流程示意图;Fig. 2 is a schematic flow chart of the first embodiment of the database information processing method of the present invention;

图3为本发明数据库信息处理方法第二实施例的流程示意图;FIG. 3 is a schematic flowchart of a second embodiment of the database information processing method of the present invention;

图4为本发明数据库信息处理方法第三实施例的流程示意图。FIG. 4 is a schematic flowchart of a third embodiment of the database information processing method of the present invention.

本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose of the present invention, functional characteristics and advantages will be further described in conjunction with the embodiments and with reference to the accompanying drawings.

具体实施方式Detailed ways

应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

如图1所示,图1是本发明实施例方案涉及的硬件运行环境的设备结构示意图。As shown in FIG. 1 , FIG. 1 is a schematic diagram of the equipment structure of the hardware operating environment involved in the solution of the embodiment of the present invention.

本发明实施例数据库信息处理设备可以是PC机或服务器设备。The database information processing device in this embodiment of the present invention may be a PC or a server device.

如图1所示,该数据库信息处理设备可以包括:处理器1001,例如CPU,网络接口1004,用户接口1003,存储器1005,通信总线1002。其中,通信总线1002用于实现这些组件之间的连接通信。用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口1003还可以包括标准的有线接口、无线接口。网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1005可选的还可以是独立于前述处理器1001的存储装置。As shown in FIG. 1 , the database information processing device may include: a processor 1001 , such as a CPU, a network interface 1004 , a user interface 1003 , a memory 1005 , and a communication bus 1002 . Wherein, the communication bus 1002 is used to realize connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. Optionally, the network interface 1004 may include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 can be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001 .

本领域技术人员可以理解,图1中示出的设备结构并不构成对设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the device structure shown in FIG. 1 does not constitute a limitation to the device, and may include more or less components than shown in the figure, or combine some components, or arrange different components.

如图1所示,作为一种计算机可读存储介质的存储器1005中可以包括操作系统、网络通信模块、用户接口模块以及数据库信息处理程序。As shown in FIG. 1 , the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a database information processing program.

在图1所示的设备中,网络接口1004主要用于连接后台服务器,与后台服务器进行数据通信;用户接口1003主要用于连接客户端,与客户端进行数据通信;而处理器1001可以用于调用存储器1005中存储的数据库信息处理程序,并执行下述数据库信息处理方法各个实施例中的操作。In the device shown in Figure 1, the network interface 1004 is mainly used to connect to the background server and perform data communication with the background server; the user interface 1003 is mainly used to connect to the client and perform data communication with the client; and the processor 1001 can be used for Call the database information processing program stored in the memory 1005, and execute the operations in the various embodiments of the database information processing method described below.

基于上述硬件结构,提出本发明数据库信息处理方法实施例。Based on the above hardware structure, an embodiment of the database information processing method of the present invention is proposed.

参照图2,图2为本发明数据库信息处理方法第一实施例的流程示意图,所述方法包括:Referring to FIG. 2, FIG. 2 is a schematic flowchart of the first embodiment of the database information processing method of the present invention, the method includes:

步骤S10,在接收到用户端的信息查询指令时,判断高速缓存的当前信息集是否存在与所述信息查询指令对应的第一信息集;Step S10, when receiving an information query instruction from the client, judging whether there is a first information set corresponding to the information query instruction in the cached current information set;

本实施例中,银行账户的常用信息集通常会存储在数据库上,由于数据库中存在很多用户高频访问的信息集,为了便于用户快速查询到所需信息集,通常会将用户高频访问的信息集加载在高速缓存中,以便于用户即使获取。In this embodiment, the commonly used information sets of bank accounts are usually stored in the database. Since there are many information sets frequently accessed by users in the database, in order to facilitate users to quickly query the required information sets, the frequently accessed information sets are usually stored in the database. Information sets are loaded in the cache for easy retrieval by the user.

当接收到用户端的信息查询指令时,开始对高速缓存进行查询,查看高速缓存中的当前信息集是否存在与信息查询指令对应的第一信息集。When receiving an information query instruction from the client, it starts to query the cache to check whether there is a first information set corresponding to the information query instruction in the current information set in the cache.

信息查询指令可以包括信息ID、信息内容及存储位置等,高速缓存的当前信息可以缓存有用户高频使用的信息集。The information query instruction may include information ID, information content, storage location, etc., and the cached current information may cache information sets frequently used by users.

高速缓存中存储有很多使用频繁的信息集,以便于用户能够及时调用,在接收到用户的信息查询指令时,获取高速缓存的当前信息集,并且,将信息查询指令对应的第一信息集与高速缓存中的当前信息集进行对比,若当前信息集中存在第一信息集,则判定高速缓存存在该第一信息集。There are many frequently used information sets stored in the cache, so that the user can call them in time. When receiving the information query instruction from the user, the current information set in the cache is obtained, and the first information set corresponding to the information query instruction is compared with the first information set corresponding to the information query instruction. The current information set in the cache is compared, and if the first information set exists in the current information set, it is determined that the first information set exists in the cache.

为了判断高速缓存的信息集是否为最新的信息集,还需要进行后续判断,避免高速缓存中的当前信息集是老旧过时而被拿来使用。In order to judge whether the information set in the cache is the latest information set, a subsequent judgment is required to prevent the current information set in the cache from being used because it is old and outdated.

步骤S20,若所述当前信息集中存在与所述信息查询指令对应的第一信息集,则判断降级表中是否存在所述第一信息集的预设标识对应的降级记录;Step S20, if the first information set corresponding to the information query instruction exists in the current information set, then judge whether there is a downgrade record corresponding to the preset identifier of the first information set in the downgrade table;

该步骤中,在认为高速缓存中存在第一信息集时,为了确定高速缓存的当前信息集是否为最新信息集,需要去查询降级表。In this step, when it is considered that the first information set exists in the cache, in order to determine whether the current information set in the cache is the latest information set, it is necessary to query the degradation table.

本案的降级表,降级是指如果高速缓存上没有获取到获取获取到的信息集被判定为过时而无法使用时,则下降到较慢速度的数据库中执行信息查询,本案的降级表,是相对于高速缓存的查询速度较低、而相对于数据库的查询速度较高的一个数据表,可以是一列,或者是几列组成,同时,也是一个数据量较小的表,按照一定的时间频度,根据降级表中的信息集标识从数据库中将最新的信息集加载至高速缓存中,并删除降级记录,从而,该降级表的体量维持在一个很小的水平。The downgrading table in this case, downgrading means that if the obtained information set is judged to be outdated and unusable if it is not obtained from the cache, it will drop to a slower database to perform information query. The degrading table in this case is relatively A data table with a lower query speed due to the cache and a higher query speed than the database can be composed of one column or several columns. At the same time, it is also a table with a small amount of data. According to a certain time frequency , load the latest information set from the database into the cache according to the information set identifier in the downgrade table, and delete the downgrade record, so that the size of the downgrade table is kept at a small level.

由于降级表的轻量化存储方式,能够简单记录数据库中改变的信息集,在降级表中的降级记录对应的信息加载至高速缓存后,可把该项降级记录删除掉,使得降级表的体量维持在一个很小的水平,查询速度快。Due to the lightweight storage method of the downgrade table, the changed information set in the database can be simply recorded. After the information corresponding to the downgrade record in the downgrade table is loaded into the cache, the downgrade record can be deleted, making the volume of the downgrade table Maintained at a small level, the query speed is fast.

通过降级表,存储最新信息集的相关信息,在降级表中存在与预设标识对应的降级记录时,说明高速缓存中的当前信息集已发生变更,是老旧过时的信息,需要去数据库获取最新的信息,才能避免数据一致性问题。Use the downgrade table to store the relevant information of the latest information set. When there is a downgrade record corresponding to the preset identifier in the downgrade table, it means that the current information set in the cache has changed, and it is old and outdated information, which needs to be obtained from the database. Only the latest information can avoid data consistency problems.

在判定降级表中存在第一信息集的预设标识对应的降级记录时,说明高速缓存的当前信息集已发生变更,是老旧过时的信息,此时,需要对高速缓存的当前信息集进行更新。When it is determined that there is a degraded record corresponding to the preset identifier of the first information set in the degraded table, it means that the current information set in the cache has been changed and is old and outdated information. At this time, the current information set in the cache needs to be renew.

在判定降级表中不存在第一信息集的预设标识对应的降级记录时,说明高速缓存的当前信息集并没有发生变更,此时,高速缓存中的当前信息与数据库中的最新信息集一致,则可直接调用该信息集,执行对应的逻辑操作。When it is determined that there is no degraded record corresponding to the preset identifier of the first information set in the degraded table, it means that the current information set in the cache has not changed. At this time, the current information in the cache is consistent with the latest information set in the database , then the information set can be called directly to execute the corresponding logical operation.

步骤S30,若所述降级表中存在所述降级记录,则在数据库中获取与所述预设标识对应的第二信息集,并将所述第二信息集发送至所述用户端。Step S30, if the downgrade record exists in the downgrade table, obtain a second information set corresponding to the preset identifier from a database, and send the second information set to the client.

该步骤中,对降级表是否存在第一信息集对应的降级记录进行判断,在判定降级表中存在第一信息集的预设标识对应的降级记录时,说明高速缓存的当前信息集已发生变更,是老旧过时的信息,即数据库中存在的最新信息明显与高速缓存的当前信息集不一致,由于数据库中的最新信息在信息维护阶段时,信息发生更改,已登记于降级表中,所以,能够在降级表中查询到该降级记录。In this step, it is judged whether there is a degraded record corresponding to the first information set in the degraded table, and when it is determined that there is a degraded record corresponding to the preset identifier of the first information set in the degraded table, it means that the current information set in the cache has been changed , is old and outdated information, that is, the latest information in the database is obviously inconsistent with the current information set in the cache. Since the latest information in the database is in the information maintenance phase, the information has changed and has been registered in the downgrade table. Therefore, The downgrade record can be found in the downgrade table.

通过依次对高速缓存、降级表,甚至是数据库的查询,保证用户端查询到的信息集是最新的;并且,由于增加了降级表,有效降低高速缓存的依赖性。By sequentially querying the cache, the downgrade table, and even the database, the information set queried by the client is guaranteed to be up-to-date; and, due to the addition of the downgrade table, the dependency of the cache is effectively reduced.

本发明提出的数据库信息处理方法,在数据库端引入降级表,在接收到信息查询指令时,首先对高速缓存的当前信息集进行查询,若高速缓存中存在对应的第一信息集,且降级表中存在降级记录,则说明高速缓存中的当前信息集为老旧过时信息,不应该被使用,否则会导致数据的一致性问题;此时,需要从数据库中获取第二信息集,即获取最新的信息集,以保证用户端获取到的是最新的信息集。本发明通过降级表,有效降低对高速缓存的依赖,在高速缓存系统出现故障的情况下,不影响维护交易,也不影响信息访问交易。In the database information processing method proposed by the present invention, a downgrade table is introduced at the database side. When an information query instruction is received, the current information set in the cache is first queried. If there is a corresponding first information set in the cache, and the downgrade table If there is a degraded record in the cache, it means that the current information set in the cache is old and outdated information and should not be used, otherwise it will cause data consistency problems; at this time, it is necessary to obtain the second information set from the database, that is, to obtain the latest information set to ensure that the user end obtains the latest information set. The invention effectively reduces the dependence on the high-speed cache through the downgrade table, and does not affect the maintenance transaction or the information access transaction in the case of a failure of the high-speed cache system.

进一步地,在步骤S20之后,所述数据库信息处理方法包括:Further, after step S20, the database information processing method includes:

步骤S21,若所述降级表中不存在所述降级记录,则在所述高速缓存中获取所述当前信息集;Step S21, if the degraded record does not exist in the degraded table, obtain the current information set in the cache;

步骤S22,将所述当前信息集中与所述信息查询指令对应的第三信息集发送至所述用户端。Step S22, sending a third information set in the current information set corresponding to the information query instruction to the client.

在本实施例中,在判定降级表中不存在第一信息集对应的降级记录时,说明高速缓存的当前信息集并没有发生变更,此时,高速缓存中的当前信息与数据库中的最新信息集一致,将当前信息集中与所述信息查询指令对应的第三信息集发送至所述用户端,使得用户端可直接调用该信息集,执行对应的逻辑操作。In this embodiment, when it is determined that there is no degraded record corresponding to the first information set in the degraded table, it means that the current information set in the cache has not changed. At this time, the current information in the cache and the latest information in the database The sets are consistent, and the third information set corresponding to the information query instruction in the current information set is sent to the client, so that the client can directly call the information set and execute the corresponding logical operation.

通过降级表与高速缓存的配合,保证高速缓存与数据库中的数据一致,从而有效保证用户查询到的信息集为最新信息集。Through the cooperation of the downgrade table and the cache, the data in the cache and the database are guaranteed to be consistent, thereby effectively ensuring that the information set queried by the user is the latest information set.

进一步地,在步骤S10之后,所述数据库信息处理方法包括:Further, after step S10, the database information processing method includes:

步骤S11,若所述当前信息集不存在与所述信息查询指令对应的第一信息集,则在所述数据库中获取所述信息查询指令对应的第四信息集,并将所述第四信息集发送至所述用户端。Step S11, if the current information set does not have the first information set corresponding to the information query instruction, then obtain the fourth information set corresponding to the information query instruction from the database, and store the fourth information The set is sent to the client.

本实施例中,若所述当前信息集不存在与所述信息查询指令对应的第一信息集,则说明高速缓存中不存在该第一信息集,该第一信息集可判定为从来没有用户使用过的信息集,即属于低频信息,所以,此时只需直接降级去数据库查找,即查找数据库中信息查询指令对应的第四信息集,且将第四信息集发送至用户端,以便于用户端执行相应的逻辑操作。In this embodiment, if the first information set corresponding to the information query instruction does not exist in the current information set, it means that the first information set does not exist in the cache, and it can be determined that the first information set has never had a user The used information set belongs to low-frequency information, so at this time, it is only necessary to directly downgrade to the database to search, that is, to find the fourth information set corresponding to the information query command in the database, and send the fourth information set to the client for convenience. The user end executes the corresponding logical operation.

针对低频信息,无需使用高速缓存及降级表,仅仅存储与数据库中,有效减小高速缓存的使用压力。For low-frequency information, there is no need to use a cache or a downgrade table, and it is only stored in the database, effectively reducing the pressure on the cache.

进一步地,基于本发明的第一实施例,提出数据库信息处理方法的第二实施例子,请参阅图3,在步骤S10之前,所述数据库信息处理方法还包括:Further, based on the first embodiment of the present invention, a second implementation example of the database information processing method is proposed, please refer to FIG. 3 , before step S10, the database information processing method further includes:

步骤S101,获取所述数据库的实时信息集,其中,所述实时信息集为数据库中实时更新的数据集合;Step S101, acquiring a real-time information set of the database, wherein the real-time information set is a data set updated in real time in the database;

步骤S102,判断所述实时信息集是否发生改变;Step S102, judging whether the real-time information set has changed;

步骤S103,若是,则基于所述实时信息集,在所述降级表中登记降级记录。Step S103, if yes, register a downgrade record in the downgrade table based on the real-time information set.

本实施例中,在信息维护阶段,获取所述数据库的实时信息集;判断所述实时信息集是否发生改变;若是,则基于所述实时信息集,在所述降级表中登记降级记录。In this embodiment, in the information maintenance phase, the real-time information set of the database is obtained; it is judged whether the real-time information set has changed; if so, a downgrade record is registered in the downgrade table based on the real-time information set.

判断所述实时信息集是否发生改变具体为:判断所述实时信息集中是否存在信息标识;若是,则判定所述实时信息集发生改变。Judging whether the real-time information set has changed is specifically: judging whether there is an information identifier in the real-time information set; if so, determining that the real-time information set has changed.

实时信息集为数据库中实时更新的数据集合,信息维护时,通过对信息集的增删改即可使得信息集发生改变,若数据库的实时信息集发生改变,则登记到降级表中。降级表存在记录表明该信息标识对应的高速缓存信息集已经是老旧过时的,信息使用者需要降级到较慢的关系数据库中获取最新信息;降级记录也驱动异步处理线程加载更新老旧过时的高速缓存信息。The real-time information set is a data set that is updated in real time in the database. During information maintenance, the information set can be changed by adding, deleting, and modifying the information set. If the real-time information set of the database changes, it will be registered in the downgrade table. The existence of a record in the downgrade table indicates that the cache information set corresponding to the information identifier is outdated, and the information user needs to downgrade to a slower relational database to obtain the latest information; the downgrade record also drives the asynchronous processing thread to load and update the old and outdated Cache information.

进一步地,在步骤S102可以包括:Further, step S102 may include:

判断所述实时信息集中是否存在信息标识;Judging whether there is an information identifier in the real-time information set;

若是,则判定所述实时信息集发生改变;If so, determine that the real-time information set has changed;

若否,则判定所述实时信息集未发生改变。If not, it is determined that the real-time information set has not changed.

在本实施例中,实时信息集是否发生改变的判断依据在于是否存在信息标识,在对信息集的增、删、改这些改变时,进行面向截面编程(AOP),会形成信息标识,该信息标识可以让业务无感知地登记降级记录中。维护时也无需进行同步锁,不用针对维护的目标信息集先行删除对应的高速缓存,维护失败时负责恢复缓存这些比较笨重的操作。In this embodiment, the basis for judging whether the real-time information set changes is whether there is an information identifier. When adding, deleting, or modifying the information set, section-oriented programming (AOP) will be performed to form an information identifier. The logo allows the business to register in the downgrade record without awareness. There is no need to perform synchronization locks during maintenance, and it is not necessary to delete the corresponding cache for the target information set for maintenance. When maintenance fails, it is responsible for restoring the cache. These relatively cumbersome operations.

进一步地,步骤S103可以包括:Further, step S103 may include:

基于所述信息标识,获取对应的所述预设标识;Acquiring the corresponding preset identifier based on the information identifier;

生成所述预设标识对应的降级记录并存储于所述降级表,以使所述降级记录登记于所述降级表中。A downgrade record corresponding to the preset identifier is generated and stored in the downgrade table, so that the downgrade record is registered in the downgrade table.

本实施例中,数据库中的实时信息集同样可以包括信息ID及信息内容等,还可以包括信息发生改变时的信息标识,信息ID作为一个查找关键词,且信息ID与信息内容相对应,一个信息ID对应一段信息内容;信息标识对应一个信息ID,一段信息内容;降级表中的降级记录集,包括多条降级记录,罗列于一个表格中,降级记录只记录某个信息ID、信息ID对应的索引项、更改的时间以及存储位置信息简单信息,如第一信息ID的预设标识为1,第二信息ID的预设标识为2,在某个时间点修改。In this embodiment, the real-time information set in the database can also include information ID and information content, etc., and can also include information identification when the information changes. The information ID is used as a search keyword, and the information ID corresponds to the information content. The information ID corresponds to a piece of information content; the information ID corresponds to an information ID and a piece of information content; the downgrade record set in the downgrade table includes multiple downgrade records, which are listed in a table, and the downgrade record only records a certain information ID, and the information ID corresponds to Simple information such as the index item of the index item, the time of modification, and the storage location information, such as the default identifier of the first information ID is 1, and the preset identifier of the second information ID is 2, which are modified at a certain point in time.

降级表是一个结构简单的表,根据信息集唯一标识的组成情况,可能只有一列,也可以由几列组成,简单且易于实现。The degraded table is a table with a simple structure. According to the composition of the unique identifier of the information set, there may be only one column or several columns. It is simple and easy to implement.

进一步地,基于本发明的第一实施例,提出数据库信息处理方法的第三实施例子,请参阅图4,步骤S30之后,数据库信息处理方法包括:Further, based on the first embodiment of the present invention, a third implementation example of the database information processing method is proposed, please refer to FIG. 4 , after step S30, the database information processing method includes:

步骤S40,将所述第二信息集加载至所述当前信息集中,以对所述第一信息集进行替换;Step S40, loading the second information set into the current information set to replace the first information set;

步骤S50,在所述第二信息集加载完毕后,在所述降级表中删除所述降级记录。Step S50, after the second information set is loaded, delete the downgrade record in the downgrade table.

本实施例中,在异步处理线程中,将所述第二信息集加载至所述当前信息集中,以对所述第一信息集进行替换,在第二信息集缓存加载/更新完毕后删除该信息标识的降级记录,当检测不存在信息集标识的降级记录时,从高速缓存获取信息可以保证是最新的。In this embodiment, in the asynchronous processing thread, the second information set is loaded into the current information set to replace the first information set, and the second information set cache is deleted after loading/updating. The degraded record identified by the information, when it is detected that there is no degraded record identified by the information set, the information obtained from the cache can be guaranteed to be up-to-date.

降级记录也驱动异步处理线程加载更新老旧过时的高速缓存信息,按照一定的时间频度根据降级表中信息集标识从数据库加载最新的信息集到高速缓存并删除降级记录,这样就使降级表的体量维持在一个很小的水平。The degraded record also drives the asynchronous processing thread to load and update the old and outdated cache information, and loads the latest information set from the database to the cache according to the information set identifier in the degraded table according to a certain time frequency and deletes the degraded record, thus making the degraded table The volume is kept at a small level.

本发明还提供一种数据库信息处理装置。本发明所述数据库信息处理装置包括:The invention also provides a database information processing device. The database information processing device of the present invention includes:

第一判断模块,用于在接收到用户端的信息查询指令时,判断高速缓存的当前信息集是否存在与所述信息查询指令对应的第一信息集;The first judging module is configured to judge whether there is a first information set corresponding to the information query instruction in the cached current information set when receiving an information query instruction from the client;

第二判断模块,用于若所述当前信息集中存在与所述信息查询指令对应的第一信息集,则判断降级表中是否存在与所述第一信息集的预设标识对应的降级记录;The second judging module is configured to judge whether there is a downgrade record corresponding to the preset identifier of the first information set in the downgrade table if the first information set corresponding to the information query instruction exists in the current information set;

处理模块,用于若所述降级表中存在所述降级记录,则在数据库中获取与所述预设标识对应的第二信息集,并将所述第二信息集发送至所述用户端。A processing module, configured to obtain a second information set corresponding to the preset identifier from a database if the downgrade record exists in the downgrade table, and send the second information set to the client.

进一步地,在所述第二判断模块执行判断降级表中是否存在所述第一信息集对应的降级记录的步骤之后,所述数据库信息处理装置包括第一执行模块,用于:Further, after the second judging module executes the step of judging whether there is a degraded record corresponding to the first information set in the degraded table, the database information processing device includes a first executing module, configured to:

若所述降级表中不存在所述降级记录,则在所述高速缓存中获取所述当前信息集;If the downgrade record does not exist in the downgrade table, then acquire the current information set in the cache;

将所述当前信息集中与所述信息查询指令对应的第三信息集发送至所述用户端。Sending a third information set in the current information set corresponding to the information query instruction to the client.

进一步地,在所述第一判断模块执行判断高速缓存的当前信息集是否存在与所述信息查询指令对应的第一信息集的步骤之后;所述数据库信息处理装置包括第二执行模块,用于:Further, after the first judging module executes the step of judging whether there is a first information set corresponding to the information query instruction in the current cached information set; the database information processing device includes a second execution module for :

若所述当前信息集不存在与所述信息查询指令对应的第一信息集,则在所述数据库中获取所述信息查询指令对应的第四信息集,并将所述第四信息集发送至所述用户端。If the current information set does not have the first information set corresponding to the information query instruction, then obtain the fourth information set corresponding to the information query instruction from the database, and send the fourth information set to the client.

进一步地,在执行第一查询模块之前,所述数据库信息处理装置还包括登记模块,用于:Further, before executing the first query module, the database information processing device also includes a registration module for:

获取所述数据库的实时信息集,其中,所述实时信息集为数据库中实时更新的数据集合;Obtaining a real-time information set of the database, wherein the real-time information set is a data set updated in real time in the database;

判断所述实时信息集是否发生改变;judging whether the real-time information set has changed;

若是,则基于所述实时信息集,在所述降级表中登记降级记录。If yes, register a downgrade record in the downgrade table based on the real-time information set.

进一步地,所述登记模块,还用于:Further, the registration module is also used for:

判断所述实时信息集中是否存在信息标识;Judging whether there is an information identifier in the real-time information set;

若是,则判定所述实时信息集发生改变If so, it is determined that the real-time information set has changed

若否,则判定所述实时信息集未发生改变。If not, it is determined that the real-time information set has not changed.

进一步地,所述降级记录包括信息索引项,所述登记模块还用于:Further, the degraded record includes information index items, and the registration module is also used for:

基于所述信息标识,获取对应的所述预设标识;Acquiring the corresponding preset identifier based on the information identifier;

生成所述预设标识对应的降级记录并存储于所述降级表,以使所述降级记录登记于所述降级表中。A downgrade record corresponding to the preset identifier is generated and stored in the downgrade table, so that the downgrade record is registered in the downgrade table.

进一步地,在所述处理模块执行在所述数据库中获取所述预设标识对应的第二信息集的步骤之后,所述数据库信息处理装置还包括加载模块,用于:Further, after the processing module executes the step of acquiring the second information set corresponding to the preset identifier in the database, the database information processing device further includes a loading module, configured to:

将所述第二信息集加载至所述当前信息集中,以对所述第一信息集进行替换;loading the second set of information into the current set of information to replace the first set of information;

在所述第二信息集加载完毕后,在所述降级表中删除所述降级记录。After the loading of the second information set is completed, the downgrade record is deleted in the downgrade table.

本发明还提供一种计算机可读存储介质。The present invention also provides a computer-readable storage medium.

本发明计算机可读存储介质上存储有数据库信息处理程序,所述数据库信息处理程序被处理器执行时实现如上所述的数据库信息处理方法的步骤。The computer-readable storage medium of the present invention stores a database information processing program, and when the database information processing program is executed by a processor, the steps of the above-mentioned database information processing method are realized.

其中,在所述处理器上运行的数据库信息处理程序被执行时所实现的方法可参照本发明数据库信息处理方法各个实施例,此处不再赘述。For the method implemented when the database information processing program running on the processor is executed, reference may be made to various embodiments of the database information processing method of the present invention, which will not be repeated here.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that, as used herein, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or system comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or system. Without further limitations, an element defined by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, article or system comprising that element.

上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present invention are for description only, and do not represent the advantages and disadvantages of the embodiments.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个可读存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台数据库信息处理设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product in essence or in other words, the part that contributes to the prior art, and the computer software product is stored in a readable storage medium (such as ROM) as described above /RAM, magnetic disk, optical disk), including several instructions to make a database information processing device (which can be a mobile phone, computer, server, air conditioner, or network equipment, etc.) execute the methods described in various embodiments of the present invention.

以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process conversion made by using the description of the present invention and the contents of the accompanying drawings, or directly or indirectly used in other related technical fields , are all included in the scope of patent protection of the present invention in the same way.

Claims (12)

1.一种数据库信息处理方法,其特征在于,所述数据库信息处理方法包括如下步骤:1. A database information processing method, characterized in that, said database information processing method comprises the steps: 在接收到用户端的信息查询指令时,判断高速缓存的当前信息集是否存在与所述信息查询指令对应的第一信息集;When receiving an information query instruction from the client, judging whether there is a first information set corresponding to the information query instruction in the cached current information set; 若所述当前信息集中存在与所述信息查询指令对应的第一信息集,则判断降级表中是否存在与所述第一信息集的预设标识对应的降级记录;If there is a first information set corresponding to the information query instruction in the current information set, then judging whether there is a downgrade record corresponding to the preset identifier of the first information set in the downgrade table; 若所述降级表中存在所述降级记录,则在数据库中获取与所述预设标识对应的第二信息集,并将所述第二信息集发送至所述用户端;If the downgrade record exists in the downgrade table, obtain a second information set corresponding to the preset identifier from a database, and send the second information set to the client; 其中,在所述在数据库中获取与所述预设标识对应的第二信息集步骤之后,所述数据库信息处理方法还包括:Wherein, after the step of obtaining the second information set corresponding to the preset identifier in the database, the database information processing method further includes: 将所述第二信息集加载至所述当前信息集中,以对所述第一信息集进行替换;loading the second set of information into the current set of information to replace the first set of information; 在所述第二信息集加载完毕后,在所述降级表中删除所述降级记录。After the loading of the second information set is completed, the downgrade record is deleted in the downgrade table. 2.如权利要求1所述的数据库信息处理方法,其特征在于,所述判断降级表中是否存在与所述第一信息集的预设标识对应的降级记录的步骤之后,所述数据库信息处理方法包括:2. The database information processing method according to claim 1, wherein after the step of judging whether there is a degraded record corresponding to the preset identifier of the first information set in the degraded table, the database information processing Methods include: 若所述降级表中不存在所述降级记录,则在所述高速缓存中获取所述当前信息集;If the downgrade record does not exist in the downgrade table, then acquire the current information set in the cache; 将所述当前信息集中与所述信息查询指令对应的第三信息集发送至所述用户端。Sending a third information set in the current information set corresponding to the information query instruction to the client. 3.如权利要求1所述的数据库信息处理方法,其特征在于,所述判断高速缓存的当前信息集是否存在与所述信息查询指令对应的第一信息集的步骤之后,所述数据库信息处理方法包括:3. The database information processing method according to claim 1, wherein after the step of determining whether the current information set of the cache has a first information set corresponding to the information query instruction, the database information processing Methods include: 若所述当前信息集不存在与所述信息查询指令对应的第一信息集,则在所述数据库中获取所述信息查询指令对应的第四信息集,并将所述第四信息集发送至所述用户端。If the current information set does not have the first information set corresponding to the information query instruction, then obtain the fourth information set corresponding to the information query instruction from the database, and send the fourth information set to the client. 4.如权利要求1所述的数据库信息处理方法,其特征在于,所述在接收到用户端的信息查询指令时,判断高速缓存的当前信息集是否存在与所述信息查询指令对应的第一信息集的步骤之前,所述数据库信息处理方法还包括:4. The database information processing method according to claim 1, characterized in that, when receiving an information query instruction from the client, it is judged whether there is a first information corresponding to the information query instruction in the current information set of the cache Before the set step, the database information processing method also includes: 获取所述数据库的实时信息集,其中,所述实时信息集为数据库中实时更新的数据集合;Obtaining a real-time information set of the database, wherein the real-time information set is a data set updated in real time in the database; 判断所述实时信息集是否发生改变;judging whether the real-time information set has changed; 若是,则基于所述实时信息集,在所述降级表中登记降级记录。If yes, register a downgrade record in the downgrade table based on the real-time information set. 5.如权利要求4所述的数据库信息处理方法,其特征在于,所述判断所述实时信息集中是否发生改变的步骤包括:5. The database information processing method according to claim 4, wherein the step of judging whether a change occurs in the real-time information set comprises: 判断所述实时信息集中是否存在信息标识;Judging whether there is an information identifier in the real-time information set; 若是,则判定所述实时信息集发生改变;If so, determine that the real-time information set has changed; 若否,则判定所述实时信息集未发生改变。If not, it is determined that the real-time information set has not changed. 6.如权利要求5所述的数据库信息处理方法,其特征在于,所述在所述降级表中登记降级记录的步骤包括:6. The database information processing method according to claim 5, wherein the step of registering a degraded record in the degraded table comprises: 基于所述信息标识,获取对应的所述预设标识;Acquiring the corresponding preset identifier based on the information identifier; 生成所述预设标识对应的降级记录并存储于所述降级表,以使所述降级记录登记于所述降级表中。A downgrade record corresponding to the preset identifier is generated and stored in the downgrade table, so that the downgrade record is registered in the downgrade table. 7.一种数据库信息处理装置,其特征在于,所述数据库信息处理装置包括:7. A database information processing device, characterized in that the database information processing device comprises: 第一判断模块,用于在接收到用户端的信息查询指令时,判断高速缓存的当前信息集是否存在与所述信息查询指令对应的第一信息集;The first judging module is configured to judge whether there is a first information set corresponding to the information query instruction in the cached current information set when receiving an information query instruction from the client; 第二判断模块,用于若所述当前信息集中存在与所述信息查询指令对应的第一信息集,则判断降级表中是否存在与所述第一信息集的预设标识对应的降级记录;The second judging module is configured to judge whether there is a downgrade record corresponding to the preset identifier of the first information set in the downgrade table if the first information set corresponding to the information query instruction exists in the current information set; 处理模块,用于若所述降级表中存在所述降级记录,则在数据库中获取与所述预设标识对应的第二信息集,并将所述第二信息集发送至所述用户端;A processing module, configured to obtain a second information set corresponding to the preset identifier from a database if the downgrade record exists in the downgrade table, and send the second information set to the client; 所述数据库信息处理装置还包括加载模块,用于:The database information processing device also includes a loading module for: 将所述第二信息集加载至所述当前信息集中,以对所述第一信息集进行替换;loading the second set of information into the current set of information to replace the first set of information; 在所述第二信息集加载完毕后,在所述降级表中删除所述降级记录。After the loading of the second information set is completed, the downgrade record is deleted in the downgrade table. 8.如权利要求7所述的数据库信息处理装置,其特征在于,在所述第二判断模块执行判断降级表中是否存在所述第一信息集对应的降级记录的步骤之后,所述数据库信息处理装置包括第一执行模块,用于:8. The database information processing device according to claim 7, wherein after the second judging module executes the step of judging whether there is a degraded record corresponding to the first information set in the degraded table, the database information The processing device includes a first execution module for: 若所述降级表中不存在所述降级记录,则在所述高速缓存中获取所述当前信息集;If the downgrade record does not exist in the downgrade table, then acquire the current information set in the cache; 将所述当前信息集中与所述信息查询指令对应的第三信息集发送至所述用户端。Sending a third information set in the current information set corresponding to the information query instruction to the client. 9.如权利要求7所述的数据库信息处理装置,其特征在于,在所述第一判断模块执行判断所述判断高速缓存的当前信息集是否存在与所述信息查询指令对应的第一信息集的步骤之后;所述数据库信息处理装置包括第二执行模块,用于:9. The database information processing device according to claim 7, wherein, in the first judging module, it is judged whether the current information set in the judging cache has a first information set corresponding to the information query instruction. After the step; the database information processing device includes a second execution module for: 若所述当前信息集不存在与所述信息查询指令对应的第一信息集,则在所述数据库中获取所述信息查询指令对应的第四信息集,并将所述第四信息集发送至所述用户端。If the current information set does not have the first information set corresponding to the information query instruction, then obtain the fourth information set corresponding to the information query instruction from the database, and send the fourth information set to the client. 10.如权利要求7所述的数据库信息处理装置,其特征在于,在执行第一查询模块之前,所述数据库信息处理装置还包括登记模块,用于:10. The database information processing device according to claim 7, characterized in that, before executing the first query module, the database information processing device further comprises a registration module for: 获取所述数据库的实时信息集,其中,所述实时信息集为数据库中实时更新的数据集合;Obtaining a real-time information set of the database, wherein the real-time information set is a data set updated in real time in the database; 判断所述实时信息集是否发生改变;judging whether the real-time information set has changed; 若是,则基于所述实时信息集,在所述降级表中登记降级记录。If yes, register a downgrade record in the downgrade table based on the real-time information set. 11.一种数据库信息处理设备,其特征在于,所述数据库信息处理设备包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的数据库信息处理程序,所述数据库信息处理程序被所述处理器执行时实现如权利要求1至6中任一项所述的数据库信息处理方法的步骤。11. A database information processing device, characterized in that the database information processing device comprises: a memory, a processor, and a database information processing program stored on the memory and operable on the processor, the database When the information processing program is executed by the processor, the steps of the database information processing method according to any one of claims 1 to 6 are realized. 12.一种可读存储介质,其特征在于,所述可读存储介质上存储有数据库信息处理程序,所述数据库信息处理程序被处理器执行时实现如权利要求1至6中任一项所述的数据库信息处理方法的步骤。12. A readable storage medium, characterized in that, a database information processing program is stored on the readable storage medium, and when the database information processing program is executed by a processor, it realizes the process described in any one of claims 1 to 6. Steps of the database information processing method described above.
CN201910716597.2A 2019-07-31 2019-07-31 Database information processing method, device, equipment and readable storage medium Active CN110413679B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910716597.2A CN110413679B (en) 2019-07-31 2019-07-31 Database information processing method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910716597.2A CN110413679B (en) 2019-07-31 2019-07-31 Database information processing method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN110413679A CN110413679A (en) 2019-11-05
CN110413679B true CN110413679B (en) 2023-01-24

Family

ID=68365781

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910716597.2A Active CN110413679B (en) 2019-07-31 2019-07-31 Database information processing method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN110413679B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111865721B (en) * 2020-07-20 2021-11-02 普华云创科技(北京)有限公司 Method, system and storage medium for preventing transaction loss after abnormal node communication
CN112035529B (en) * 2020-09-11 2024-07-02 北京字跳网络技术有限公司 Caching method, caching device, electronic equipment and computer readable storage medium
CN113778980B (en) * 2021-02-02 2025-02-25 北京沃东天骏信息技术有限公司 DAO layer downgrading method and device
CN113868259A (en) * 2021-10-09 2021-12-31 咪咕文化科技有限公司 Data processing method, device, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101090401A (en) * 2007-05-25 2007-12-19 金蝶软件(中国)有限公司 Data buffer store method and system at duster environment
EP2698729A1 (en) * 2012-08-14 2014-02-19 Amadeus S.A.S. Updating cached database query results
CN106682197A (en) * 2016-12-29 2017-05-17 北京奇艺世纪科技有限公司 Search cache updating method and device
CN107122410A (en) * 2017-03-29 2017-09-01 武汉斗鱼网络科技有限公司 A kind of buffering updating method and device
CN108647357A (en) * 2018-05-17 2018-10-12 阿里巴巴集团控股有限公司 The method and device of data query
CN109388656A (en) * 2018-09-04 2019-02-26 中国建设银行股份有限公司 Data processing method and system, device and storage medium based on multi-level buffer
CN109684358A (en) * 2017-10-18 2019-04-26 北京京东尚科信息技术有限公司 The method and apparatus of data query

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3554459B2 (en) * 1997-02-26 2004-08-18 株式会社日立製作所 Text data registration search method
US7624126B2 (en) * 2003-06-25 2009-11-24 Microsoft Corporation Registering for and retrieving database table change information that can be used to invalidate cache entries
US7461239B2 (en) * 2006-02-02 2008-12-02 International Business Machines Corporation Apparatus and method for handling data cache misses out-of-order for asynchronous pipelines
JP2009211416A (en) * 2008-03-04 2009-09-17 Toyota Motor Corp Processor cache control device and method, processor, and computer
CN100594497C (en) * 2008-07-31 2010-03-17 中国科学院计算技术研究所 System for implementing network search caching and search method
CN102937980B (en) * 2012-10-18 2016-04-13 亿赞普(北京)科技有限公司 A kind of Cluster Database data enquire method
CN104375903A (en) * 2014-10-29 2015-02-25 中国建设银行股份有限公司 Asynchronous data processing method and device for trading flow records
CN104572920A (en) * 2014-12-27 2015-04-29 北京奇虎科技有限公司 Data arrangement method and data arrangement device
CN106326293A (en) * 2015-07-01 2017-01-11 阿里巴巴集团控股有限公司 Access method and device based on dynamic webpage
CN105426467B (en) * 2015-11-16 2018-11-20 北京京东尚科信息技术有限公司 A kind of SQL query method and system for Presto
CN108932236B (en) * 2017-05-22 2021-05-07 北京金山云网络技术有限公司 File management method and device
US12135655B2 (en) * 2017-07-27 2024-11-05 International Business Machines Corporation Saving track metadata format information for tracks demoted from cache for use when the demoted track is later staged into cache
CN109725825B (en) * 2017-10-27 2022-03-11 伊姆西Ip控股有限责任公司 Method, apparatus and computer program product for managing a cache

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101090401A (en) * 2007-05-25 2007-12-19 金蝶软件(中国)有限公司 Data buffer store method and system at duster environment
EP2698729A1 (en) * 2012-08-14 2014-02-19 Amadeus S.A.S. Updating cached database query results
CN106682197A (en) * 2016-12-29 2017-05-17 北京奇艺世纪科技有限公司 Search cache updating method and device
CN107122410A (en) * 2017-03-29 2017-09-01 武汉斗鱼网络科技有限公司 A kind of buffering updating method and device
CN109684358A (en) * 2017-10-18 2019-04-26 北京京东尚科信息技术有限公司 The method and apparatus of data query
CN108647357A (en) * 2018-05-17 2018-10-12 阿里巴巴集团控股有限公司 The method and device of data query
CN109388656A (en) * 2018-09-04 2019-02-26 中国建设银行股份有限公司 Data processing method and system, device and storage medium based on multi-level buffer

Also Published As

Publication number Publication date
CN110413679A (en) 2019-11-05

Similar Documents

Publication Publication Date Title
CN110413679B (en) Database information processing method, device, equipment and readable storage medium
US10649964B2 (en) Incorporating external data into a database schema
CN106802932B (en) Database routing method, device and database system
CN109977129A (en) Multi-stage data caching method and equipment
CN110134705A (en) A data query method, cache server and terminal
US20120158795A1 (en) Entity triggers for materialized view maintenance
CN102780603B (en) Web traffic control method and device
US8793288B2 (en) Online access to database snapshots
CN104537013B (en) A kind of method and apparatus of processing data
US9930113B2 (en) Data retrieval via a telecommunication network
CN111753141B (en) A data management method and related equipment
CN111367925A (en) Data dynamic real-time updating method, device and storage medium
CN105740383A (en) Method and system for realizing data consistency of database and cache in big data platform
CN115729912A (en) Database access system, database access method, computer device, and storage medium
CN110888847A (en) Recycle bin system and file recycling method
WO2020211363A1 (en) Method and apparatus for improving efficiency of program loading, computer device and storage medium
CN100383793C (en) A method and system for updating data in a real-time database
US10572450B2 (en) Reducing database fragmentation
CN103036948A (en) Network file processing method and execution node and software as a service (SaaS) platform
US10606805B2 (en) Object-level image query and retrieval
CN104461929A (en) Distributed type data caching method based on interceptor
CN112214521A (en) Rule query method, device, equipment and computer storage medium
CN116233254A (en) Service switching method, device, computer equipment and storage medium
US12386811B2 (en) Method, apparatus, and computer program product for improved tracking of state data
CN106934044B (en) Data processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant