WO2012151912A1 - 内存数据库对数据的操作方法及装置 - Google Patents

内存数据库对数据的操作方法及装置 Download PDF

Info

Publication number
WO2012151912A1
WO2012151912A1 PCT/CN2011/082467 CN2011082467W WO2012151912A1 WO 2012151912 A1 WO2012151912 A1 WO 2012151912A1 CN 2011082467 W CN2011082467 W CN 2011082467W WO 2012151912 A1 WO2012151912 A1 WO 2012151912A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
file
memory database
module
full
Prior art date
Application number
PCT/CN2011/082467
Other languages
English (en)
French (fr)
Inventor
王长征
冯亚军
邢刚
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012151912A1 publication Critical patent/WO2012151912A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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

Definitions

  • the present invention relates to the field of information processing technologies, and in particular to an in-memory database operation method and apparatus for data.
  • BACKGROUND With the development of information technology, the degree of social informatization is getting higher and higher, and the application of the database in various industries is more and more extensive.
  • the physical database stores the business related data and configuration data required for the operation of the product, and the physical The existence of the database guarantees the stability of the data.
  • high-speed real-time processing of data has become a common requirement. Therefore, more and more application systems have developed dedicated memory programs (in-memory databases) based on memory operations, and cache commonly used data in memory. Speed up access and improve product performance.
  • the generation of the in-memory database greatly reduces the I/O (input/output) operations on the physical database, and changes the operations of the physical database to memory operations, improving efficiency and weakening the dependence on the physical database.
  • the most important meaning of the existence of the database becomes the preservation of the data and the source of the loaded data.
  • the amount of data is large, the data is queried in real time, but the data itself changes less.
  • the operation of the data can be completed by interaction with the in-memory database.
  • an effective solution has not yet been proposed.
  • a primary object of the present invention is to provide an in-memory database operation method and apparatus for solving data to solve at least one of the above problems.
  • an in-memory database operation method for data including: an in-memory database loading all data required for a product stored in a file in advance; and an in-memory database responding to an external request to load the data. operating.
  • the above file includes: a full data file and a log file, wherein the full data file is used to represent the business data generated up to the specified time, and the log file is used to store the data operation record after the full data file is generated.
  • the following operations include: The operation corresponding to the operation record in the in-memory database re-execution log file.
  • the above method further includes: when the predetermined time point arrives, the in-memory database generates the current file and/or deletes the file that has expired.
  • the above file is in one of the following formats: Text txt format, SQL format, XLS format.
  • the above in-memory database performs at least one of the following operations on the loaded data: query, update, add, delete.
  • an apparatus for operating an in-memory database to data includes: a loading module configured to load all data required for a product stored in a file in advance; an operation module configured to respond to an outside world Request, operate on the loaded data.
  • the above file includes: a full data file and a log file, wherein the full data file is used to represent the business data generated up to the specified time, and the log file is used to store the data operation record after the full data file is generated.
  • the above loading module is also set to re-execute the operation corresponding to the operation record in the log file.
  • the above apparatus further includes: a timing task module configured to notify the operation module to generate a current file and/or delete a file that has expired when arriving at a predetermined time point.
  • the technical means for loading all the data required for the operation of the product stored in the file into the in-memory database is adopted, which solves the problems of low data operation efficiency and wasteful cost caused by the product running in the related art depending on the physical database. Furthermore, the use of an in-memory database to replace the physical database is achieved, thereby reducing the dependence on the physical database, improving the efficiency of data operation and saving costs.
  • FIG. 1 is a flow chart showing a method for operating an in-memory database to data according to an embodiment of the present invention
  • FIG. 2 is a block diagram showing an operation of an in-memory database for data according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of an operating system of an in-memory database versus data according to a preferred embodiment 3 of the present invention
  • FIG. 5 is a schematic diagram of an interaction process between a service invocation interface module and an in-memory database module according to a preferred embodiment 3 of the present invention
  • FIG. 6 is a schematic diagram of an interaction process between a timing task module and an in-memory database module according to a preferred embodiment 3 of the present invention
  • FIG. 8 is a schematic diagram of the loading process of the in-memory database module service startup.
  • Step S102 The in-memory database loads all data required for running the product stored in the file in advance
  • Step S104 The in-memory database operates the loaded data in response to an external request.
  • the above file includes: a full data file and a log file, wherein the full data file is used to represent the business data generated up to the specified time, and the log file is used to store the data operation record after the full data file is generated.
  • the operation record in the in-memory database re-execution log file corresponds to Operation.
  • the in-memory database In order to keep the data in the in-memory database updated and save memory space, the in-memory database generates the current file and/or deletes the expired file when the scheduled time arrives.
  • the data can be stored in a file in a predetermined format (the format should be a format that can be read by the memory data)
  • the format should be a format that can be read by the memory data
  • the above file can be in one of the following formats: text txt format, SQL format, XLS format, and the like.
  • the above in-memory database can perform at least one of the following operations on the loaded data: query, update, add, delete.
  • an apparatus for operating the data in the in-memory database is provided. The device is used to implement the above-mentioned embodiments and the preferred embodiments.
  • module may implement a combination of software and/or hardware of a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and conceivable.
  • 2 is a block diagram showing the structure of an operation device for in-memory database data according to an embodiment of the present invention. As shown in FIG. 2, the device includes: a loading module 20 configured to load all data required for running a product pre-stored in a file; an operation module 22 connected to the loading module 20, configured to be loaded in response to an external request The data is manipulated.
  • the foregoing includes: a full data file and a log file, wherein the full data file is used to represent the business data generated up to the specified time, and the log file is used to store the data operation record after the full data file is generated.
  • the apparatus may further include: a timing task module 24, connected to the operation module 22, configured to notify the operation module 22 to generate the current file and/or delete the expired when the predetermined time point arrives. file.
  • Preferred Embodiment 1 provides a method for replacing a physical database by using a text file and an in-memory database, and is particularly suitable for products with more data query interactions and less data changes, that is, by means of text files and in-memory databases.
  • the related functions of the in-memory database in conjunction with the timing tasks, replace the dependence of the product on the physical database, where the text file includes the full data file and the log file, which is used to store all the business data; the in-memory database reads the above file and provides data for the business query. Source, and update data based on business change requests.
  • the example can realize the database function at a lower cost, get rid of the dependence on the database, reduce the threshold for the product development and maintenance personnel to be familiar with the product, and is very helpful for improving the product competitiveness.
  • the specific implementation scheme of this embodiment is as follows: The data required for running the product is all stored in a text file, including a full data file and a log file, wherein the full data file is the full amount of service data for generating the specified time of the deadlined task, and the log file is stored in full. A record of the data change operation after the data file is generated.
  • all business data is loaded into the in-memory database by reading the full data file and log files.
  • the data information required by the business is completed by querying the in-memory database.
  • the data database is updated by operating the in-memory database to ensure the accuracy of the records in the in-memory database, and the log files are recorded, which provides data loading for the later business startup. data source.
  • set the timed task generate the full amount of data files from the in-memory database, and delete the expired full-size data files and log files.
  • the data is loaded by reading the latest full-size data file and subsequent log files to ensure data integrity.
  • the method of using the in-memory database and text file to replace the physical database has the following advantages: (1), reduce product cost, and save the expenditure of purchasing physical database and supporting services. (2) Improve product maintainability. It is no longer necessary to emphasize that product development and maintenance personnel are proficient in database knowledge, and development and maintenance personnel can quickly get started. (3) Reduce the risk of abnormalities caused by physical databases and third-party equipment.
  • Preferred Embodiment 2 This embodiment can replace the physical database required for the product at a lower cost, and the specific scheme is as follows:
  • the in-memory database reads the full data file and the subsequent log files, and re-executes the related operations in the log file, so that the data in the in-memory database is complete business data.
  • the data query operation in the product operation phase is completed by interacting with the in-memory database.
  • the addition, deletion, and modification operations in the operation phase need to update the in-memory database, and generate a synchronization log file for recording data modification operation information according to the agreed format, and the file is Saved on disk and loaded for use when the in-memory database module is started again.
  • Log files can be transferred between different devices, regardless of the operating system and database type, and have good versatility.
  • FIG. 4 is a schematic diagram showing the structure of an operating system of an in-memory database to data according to a preferred embodiment 3 of the present invention.
  • the system includes: a service invocation interface module 40 of a product and an in-memory database, which is an operation entry module for performing various data query, update, addition, and deletion of products.
  • the built-in timing task module 42 (corresponding to the timing task module 24) is configured to notify the in-memory database module 44 to perform operations such as data file generation, deletion of expired records, and periodic data verification.
  • the in-memory database module 44 which is the core module of the entire solution, replaces the functions of the physical database.
  • the module reads the full amount of data files and subsequent log files, loads all business data; provides data sources for business query operations; receives data update operations for services, updates in-memory databases and generates log files; receives scheduled tasks Notification, generate the current full data file and delete the expired file.
  • the full data file management module 46 is responsible for managing the full amount of data files.
  • the log file management module 48 is responsible for managing log files.
  • Step S502 During the product operation phase, the service call interface module 40 initiates a data query to the in-memory database module 44 by querying the request message (ServQryReq). Step S504, the in-memory database module 44 replies to the query result of the request message by querying the response message (ServQryRsp).
  • Step S506 the service invocation interface module 40 initiates a data modification operation by using a service data modification request message (ServDataModifyReq).
  • Step S508 the in-memory database module 44 replies with a response by a service data modification response message (ServDataModifyRsp).
  • Data update process Step S510, the in-memory database module 44 updates its own data according to the update record to ensure the accuracy of the later data query.
  • Step S512 the in-memory database module 44 notifies the log file management module 48 to record the log message through the log record request message (RecordLogRequest), and the record format needs to be pre-agreed with the in-memory database to ensure that the in-memory database module can be started normally again. Read and execute the records in this file. Step S514, the log file management module 48 sends back a response message log record response message.
  • Step S602 the timing task module 42 informs the in-memory database module 44 to generate the full data file by the full generation operation request message (FullListOperReq).
  • step S604 the in-memory database module 44 returns a full-quantity generation operation response message (FullListOperRsp).
  • the method may further include: Step S606: The in-memory database module 44 generates a full data file (Create FullFile) by using a predetermined rule, and the generated data file format is agreed in advance to ensure normal reading by the in-memory database module 44. take. Step S608, the in-memory database module 44 sends a notification request message (NotifySmReq) message to the full-size data file management module 46, and the NotifySmReq message is used to notify the full-size data file management module to acquire the newly generated full-size data file. In step S610, the full data file management module 46 replies to the notification response message (NotifySmRsp). Step S612, the full data file management module 46 passes the FTP function (by obtaining the file request message Get
  • FIG. 7 is a schematic diagram of another interaction process between the timing task module and the in-memory database module according to the preferred embodiment 3 of the present invention, as follows: Step S702: The timing task module 42 notifies the in-memory database module 44 by deleting the expired record request message (DellnvalidFlieReq). Deletion of expired records. In step S704, the in-memory database module 44 returns a delete expired record response message (DellnvalidFlieRsp) to the timed task module 42.
  • Step S702 The timing task module 42 notifies the in-memory database module 44 by deleting the expired record request message (DellnvalidFlieReq). Deletion of expired records.
  • step S704 the in-memory database module 44 returns a delete expired record response message (DellnvalidFlieRsp) to the timed task module 42.
  • step S706 the in-memory database module 44 notifies the full-size data file management module 46 to delete the expired data through the first notification request message (NotifySmReql).
  • step S708 the full data file management module 46 backs up and deletes the expired files according to the relevant configuration.
  • step S710 the full data file management module 46 sends back the first notification response message NotifySmRspl to the in-memory database module 44.
  • step S712 the in-memory database module 44 notifies the log file management module 48 of the deletion of the expired data by the second notification request message (NotifySmReq2).
  • step S714 the log file management module 48 backs up and deletes the expired files according to the relevant configuration.
  • step S716 the log file management module 48 sends back a second notification response message (NotifySmRsp2) to the in-memory database module 44.
  • FIG. 8 is a schematic diagram of a loading process when the in-memory database module service starts. The details are as follows: Step S802: When the in-memory database module 44 is started, it is set to the startup state (LockAllReq), and the external related request message is not processed. In step S804, the in-memory database module 44 acquires the latest full-size data file (ie, GetFullFile) from the full-size data file management module 46.
  • the latest full-size data file ie, GetFullFile
  • Step S806 the in-memory database module 44 acquires the incremental log file (ie, GetLogFile) after the full-size data file from the log file management module 48.
  • step S808 the in-memory database module 44 reads the full data file (ie, ReadFullFile) and loads it into the in-memory database module 44.
  • step S810 the in-memory database module 44 reads the delta log file (ReadLogFile) and loads the delta data into the in-memory database 44.
  • step S812 the in-memory database module 44 is set to the normal working state (UnLockAllReq), and receives various request operations.
  • the above embodiments can make a kind of data query interaction more, and the product with less data change can get rid of the dependence on the physical database, reduce the product cost, improve the product competitiveness, can achieve good promotion effect, and has strong versatility.
  • software is also provided for performing the technical solutions described in the above embodiments and preferred embodiments.
  • a storage medium is provided, the software being stored, including but not limited to: an optical disk, a floppy disk, a hard disk, a rewritable memory, and the like.
  • the computing device may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Landscapes

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

Abstract

本发明提供了一种内存数据库对数据的操作方法及装置,其中,上述方法包括:内存数据库加载预先存放在文件中的产品运行所需的全部数据;内存数据库响应于外界请求,对加载的数据进行操作。采用本发明提供的上述技术方案,解决了相关技术中产品运行依赖物理数据库而导致的数据操作效率较低及浪费成本等问题,进而实现了使用内存数据库取代物理数据库,从而取得了降低了对物理数据库的依赖,提高对数据的操作效率以及节省成本的效果。

Description

内存数据库对数据的操作方法及装置 技术领域 本发明涉及信息处理技术领域, 具体而言, 涉及一种内存数据库对数据的操作方 法及装置。 背景技术 随着信息技术的发展, 社会信息化程度越来越高, 数据库在各行各业中的应用越 来越广, 物理数据库中存放了产品运行所需的业务相关数据和配置数据等, 物理数据 库的存在保证了数据的稳定性。 但是随着信息技术的不断发展, 高速实时处理数据成 为普遍的需求, 所以越来越多的应用系统都开发了基于内存运算的专用存储程序 (内 存数据库), 将常用的数据缓存在内存中, 加快了访问速度, 提高了产品性能。 内存数 据库的产生大大减少了对物理数据库的 I/O (输入 /输出) 操作, 对物理数据库的各种 操作改成了对内存的操作, 提高效率的同时也弱化了对物理数据库的依赖, 物理数据 库存在的最主要意义就变成了对数据的保存, 以及加载数据的来源。 同时, 目前存在这样一类产品, 数据量较大, 数据实时查询较多, 但是数据本身 变动较少, 该类产品对数据的操作可以通过与内存数据库的交互完成, 此时如果再投 入较大成本购买数据库产品及配套服务, 而物理数据库只用于数据备份及加载, 显然 有些得不偿失。 针对相关技术中的上述问题, 目前尚未提出有效的解决方案。 发明内容 本发明的主要目的在于提供一种内存数据库对数据的操作方法及装置, 以解决上 述问题至少之一。 根据本发明的一个方面, 提供了一种内存数据库对数据的操作方法, 包括: 内存 数据库加载预先存放在文件中的产品运行所需的全部数据; 内存数据库响应于外界请 求, 对加载的数据进行操作。 上述文件包括: 全量数据文件和日志文件, 其中, 全量数据文件用于表示截止到 指定时间生成的业务数据,日志文件用于存放生成全量数据文件之后的数据操作记录。 上述内存数据库加载预先存放在文件中的产品运行所需的全部数据之后,还包括: 内存数据库重新执行日志文件中的操作记录所对应的操作。 上述方法还包括: 在预定时间点到达时, 内存数据库生成当前的文件和 /或删除已 经过期的文件。 上述文件为以下之一格式: 文本 txt格式、 SQL格式、 XLS格式。 上述内存数据库对加载的数据进行以下至少之一操作: 查询、 更新、 增加、 删除。 根据本发明的另一方面, 提供了一种内存数据库对数据的操作装置, 包括: 加载 模块, 设置为加载预先存放在文件中的产品运行所需的全部数据; 操作模块, 设置为 响应于外界请求, 对加载的数据进行操作。 上述文件包括: 全量数据文件和日志文件, 其中, 全量数据文件用于表示截止到 指定时间生成的业务数据,日志文件用于存放生成全量数据文件之后的数据操作记录。 上述加载模块, 还设置为重新执行日志文件中的操作记录所对应的操作。 上述装置还包括: 定时任务模块, 设置为在预定时间点到达时, 通知操作模块生 成当前的文件和 /或删除已经过期的文件。 通过本发明, 采用将预先存放在文件中的产品运行所需的全部数据加载到内存数 据库的技术手段, 解决了相关技术中产品运行依赖物理数据库而导致的数据操作效率 较低及浪费成本等问题, 进而实现了使用内存数据库取代物理数据库, 从而取得了降 低对物理数据库的依赖, 提高对数据的操作效率以及节省成本的效果。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部分, 本发 明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的不当限定。 在附图 中: 图 1为根据本发明实施例的内存数据库对数据的操作方法的流程图; 图 2为根据本发明实施例的内存数据库对数据的操作装置结构框图; 图 3为根据本发明实施例的内存数据库对数据的操作装置结构示意图; 图 4为根据本发明优选实施例 3的内存数据库对数据的操作系统结构示意图; 图 5为根据本发明优选实施例 3的业务调用接口模块与内存数据库模块的交互流 程示意图; 图 6为根据本发明优选实施例 3的定时任务模块与内存数据库模块的交互流程示 意图; 图 7为根据本发明优选实施例 3的定时任务模块与内存数据库模块的另外一个交 互流程示意图; 图 8是内存数据库模块业务启动时加载流程示意图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明。 需要说明的是, 在不冲突的 情况下, 本申请中的实施例及实施例中的特征可以相互组合。 图 1为根据本发明实施例的内存数据库对数据的操作方法的流程图。如图 1所示, 该方法包括: 步骤 S102, 内存数据库加载预先存放在文件中的产品运行所需的全部数据; 步骤 S104, 内存数据库响应于外界请求, 对加载的数据进行操作。 无论产品是否为数据量较大,数据实时操作较多,但是数据本身变动较少的产品, 均可以利用上述处理过程对数据进行操作, 可以有效提高对数据的操作效率。 尤其针 对数据量较大, 数据实时操作较多, 但是数据本身变动较少的产品, 可以利用上述处 理过程, 使用内存数据库取代物理数据库, 从而降低对物理数据库的依赖以及节省成 本。 上述文件包括: 全量数据文件和日志文件, 其中, 全量数据文件用于表示截止到 指定时间生成的业务数据,日志文件用于存放生成全量数据文件之后的数据操作记录。 为了保证内存数据库中的文件为完整的业务数据, 内存数据库加载预先存放在文 件中的产品运行所需的全部数据之后, 还可以包括以下处理过程: 内存数据库重新执 行日志文件中的操作记录所对应的操作。 为了保持内存数据库中数据及时更新以及节省内存空间, 在预定时间点到达时, 内存数据库生成当前文件和 /或删除已经过期的文件。 在上述内存数据库加载产品运行所需的全部数据时, 为了使内存数据库可以读取 需要加载的数据, 可以将数据存放在预定格式 (该格式应为可被内存数据读取的格式) 的文件中, 例如文本 txt本件、 XML文件、 SQL文件等。 因此, 上述文件可以为以下 之一格式: 文本 txt格式、 SQL格式、 XLS格式等。 上述内存数据库对加载的数据可以进行以下至少之一操作: 查询、 更新、 增加、 删除。 在本实施例中还提供了一种内存数据库对数据的操作装置, 该装置用于实现上述 实施例及优选实施方式, 已经进行过说明的不再赘述, 下面对该装置中涉及到的模块 进行说明。 如以下所使用的, 术语"模块"可以实现预定功能的软件和 /或硬件的组合。 尽管以下实施例所描述的装置较佳地以软件来实现, 但是硬件, 或者软件和硬件的组 合的实现也是可能并被构想的。 图 2为根据本发明实施例的内存数据库对数据的操作 装置结构框图。 如图 2所示, 该装置包括: 加载模块 20, 设置为加载预先存放在文件中的产品运行所需的全部数据; 操作模块 22, 与加载模块 20相连, 设置为响应于外界请求, 对加载的数据进行 操作。 优选地, 上述包括: 全量数据文件和日志文件, 其中, 全量数据文件用于表示截 止到指定时间生成的业务数据, 日志文件用于存放生成全量数据文件之后的数据操作 记录。 优选地, 如图 3所示, 上述装置还可以包括: 定时任务模块 24, 与操作模块 22 相连, 设置为在预定时间点到达时, 通知操作模块 22生成当前的文件和 /或删除已经 过期的文件。 下面结合优选实施例进行说明, 以下优选实施例结合了上述实施方式及其优选实 施方式。 优选实施例 1 本实施例提供一种使用文本文件和内存数据库取代物理数据库的方法, 特别适用 于一些数据查询交互较多, 数据变更较少的产品, 即通过文本文件和内存数据库的方 式, 扩展内存数据库的相关功能, 配合定时任务等, 取代产品对物理数据库的依赖, 其中文本文件包括全量数据文件和日志文件, 用于保存所有的业务数据; 内存数据库 读取上述文件, 为业务查询提供数据来源, 并根据业务变更请求更新数据。 应用实施 例能够以较低的成本实现数据库功能, 摆脱了对数据库的依赖, 降低了产品开发维护 人员熟悉产品的门槛, 对于提高产品竞争力具有很好的帮助作用。 本实施例的具体实 现方案如下: 将产品运行所需数据全部存放在文本文件中, 包括全量数据文件和日志文件, 其 中全量数据文件是生成截止定时任务指定时间的全量业务数据, 日志文件存放全量数 据文件生成之后的数据更改操作记录。 产品启动阶段, 通过读取全量数据文件及日志文件, 完成加载所有业务数据到内 存数据库中。 产品运行阶段, 业务所需的数据信息通过查询内存数据库完成。 产品运行阶段, 如果有数据的变更, 如增加、 删除、 更新, 则通过操作内存数据 库来完成数据更新, 保证内存数据库中的记录准确性, 同时记录日志文件, 为后期业 务启动时的数据加载提供数据源。 产品运行阶段, 设定定时任务, 由内存数据库生成全量数据文件, 并删除过期的 全量数据文件及日志文件。 产品再次启动时, 通过读取最新的全量数据文件及之后的日志文件, 完成数据的 加载, 保证数据完整性。 使用内存数据库及文本文件取代物理数据库的方法有以下优势: (1 )、降低产品成 本, 节省了购买物理数据库及配套服务的支出。 (2)、 提高产品可维护性, 不再需要强 调产品开发维护人员精通数据库知识, 开发维护人员可以快速上手。 (3 )、 降低产品因 物理数据库及第三方设备问题等引发异常的风险。 优选实施例 2 本实施例可以以较低成本取代产品所需的物理数据库, 具体方案如下:
1、 在产品中引入内存数据库。 这样可以提高查询速度, 优化产品性能。
2、把现有的业务数据整理成文件格式, 且定义格式与内存数据库读取文件格式保 持一致。 不同表结构的数据可以整理在同一个文件中, 使用配置段区分不同数据内容 段。 3、产品启动阶段, 内存数据库读取全量数据文件及之后的日志文件, 把日志文件 中的相关操作重新执行一次,这样就可以保证内存数据库中的数据是完整的业务数据。
4、产品运行阶段的数据查询操作通过与内存数据库交互完成,运行阶段的增删及 修改操作需要更新内存数据库, 并按照约定的格式生成用以记录数据修改操作信息的 同步日志文件, 并将该文件保存在磁盘上, 供内存数据库模块再次启动时加载使用。 日志文件可在不同设备间转移, 与操作系统及数据库类型无关, 通用性好。
5、产品运行阶段, 可以通过设定定时任务, 导出当前内存数据库中的业务信息到 全量数据文件中; 删除历史全量数据文件及历史日志文件。 优选实施例 3 图 4为根据本发明优选实施例 3的内存数据库对数据的操作系统结构示意图。 如 图 4所示, 该系统包括: 产品与内存数据库的业务调用接口模块 40, 是产品进行各种数据查询、 更新、 增 删的操作入口模块。 系统内置的定时任务模块 42 (相当于定时任务模块 24), 设置为通知内存数据库 模块 44进行数据文件生成、 删除过期记录、 定期数据核对等操作。 内存数据库模块 44, 是整个方案的核心模块, 取代了物理数据库的功能。 产品启 动阶段, 该模块读取全量数据文件及之后产生的日志文件, 加载所有业务数据; 为业 务查询操作提供数据来源; 接收业务的数据更新操作, 更新内存数据库并生成日志文 件; 接收定时任务的通知, 生成当前的全量数据文件并删除过期文件。 全量数据文件管理模块 46, 负责管理全量数据文件。 日志文件管理模块 48, 负责管理日志文件。 图 5为根据本发明优选实施例 3的业务调用接口模块 40与内存数据库模块 44的 交互流程示意图, 图 5所示流程中, 共包括 4个流程, 各个流程之间可以独立运行, 也可以按照特定顺序组合运行。 具体如下: 数据查询流程: 步骤 S502,产品运行阶段,业务调用接口模块 40通过查询请求消息(ServQryReq) 向内存数据库模块 44发起数据查询。 步骤 S504, 内存数据库模块 44通过查询响应消息 (ServQryRsp ) 回复请求消息 的查询结果。 数据修改流程: 步骤 S506, 业务调用接 口模块 40 通过业务数据修改请求消息 ( ServDataModifyReq) 发起数据修改操作。 步骤 S508 , 内存数据库模块 44通过业务数据修改响应消息(ServDataModifyRsp ) 回复响应。 数据更新流程: 步骤 S510, 内存数据库模块 44根据更新请求(Update record)更新自身数据, 保 证后期数据查询准确性。 日志记录流程: 步骤 S512, 内存数据库模块 44通过日志记录请求消息(RecordLogRequest)通知 日志文件管理模块 48进行日志消息的记录, 记录格式需要和内存数据库预先约定好, 保证内存数据库模块再次启动时能正常读取并执行该文件中的记录。 步骤 S514 , 日志文件管理模块 48 回送响应消息日志记录响应消息
( RecordLogRespond )。 图 6为根据本发明优选实施例 3的定时任务模块与内存数据库模块的交互流程示 意图。 和图 5类似, 图 6中包括以下几个流程, 各个流程之间可以独立运行, 也可以 按照特定顺序组合运行。 具体如下: 全量数据文件生成流程: 步骤 S602, 定时任务模块 42通过全量生成操作请求消息(FullListOperReq)告知 内存数据库模块 44生成全量数据文件。 步骤 S604, 内存数据库模块 44回送全量生成操作响应消息 (FullListOperRsp )。 在上述全量数据文件生成流程中, 还可以包括: 步骤 S606, 内存数据库模块 44 通过既定规则生成全量数据文件 (Create FullFile), 生成的数据文件格式要事先约定, 保证能被内存数据库模块 44正常读取。 步骤 S608, 内存数据库模块 44发送通知请求消息(NotifySmReq)消息给全量数 据文件管理模块 46,该 NotifySmReq消息用于通知全量数据文件管理模块获取新生成 的全量数据文件。 步骤 S610, 全量数据文件管理模块 46回复通知响应消息 (NotifySmRsp)。 步骤 S612,全量数据文件管理模块 46通过 FTP功能(通过获取文件请求消息 Get
FileReq) 从内存数据库模块 44获取全量内存数据文件。 图 7为根据本发明优选实施例 3的定时任务模块与内存数据库模块的另外一个交 互流程示意图, 具体如下: 步骤 S702, 定时任务模块 42通过删除过期记录请求消息 (DellnvalidFlieReq)通 知内存数据库模块 44进行过期记录的删除。 步骤 S704, 内存数据库模块 44回送删除过期记录响应消息 (DellnvalidFlieRsp) 给定时任务模块 42。 步骤 S706, 内存数据库模块 44通过第 1通知请求消息 (NotifySmReql ) 通知全 量数据文件管理模块 46删除过期数据。 步骤 S708, 全量数据文件管理模块 46根据相关配置备份并删除过期的文件。 步骤 S710,全量数据文件管理模块 46回送第 1通知响应消息 NotifySmRspl给内 存数据库模块 44。 步骤 S712, 内存数据库模块 44通过第 2通知请求消息 (NotifySmReq2) 通知日 志文件管理模块 48删除过期数据。 步骤 S714, 日志文件管理模块 48根据相关配置备份并删除过期的文件。 步骤 S716, 日志文件管理模块 48回送第 2通知响应消息 (NotifySmRsp2) 给内 存数据库模块 44。 图 8是内存数据库模块业务启动时加载流程示意图。 具体如下: 步骤 S802, 内存数据库模块 44启动时置位为启动状态(LockAllReq), 不处理外 部相关请求消息。 步骤 S804, 内存数据库模块 44从全量数据文件管理模块 46获取最新的全量数据 文件 (即 GetFullFile)。 步骤 S806, 内存数据库模块 44从日志文件管理模块 48获取上述全量数据文件之 后的增量日志文件 (即 GetLogFile)。 步骤 S808, 内存数据库模块 44读取全量数据文件 (即 ReadFullFile), 加载到内 存数据库模块 44中。 步骤 S810, 内存数据库模块 44读取增量日志文件(ReadLogFile ) , 加载增量数据 到内存数据库 44中。 步骤 S812, 内存数据库模块 44置位为正常工作状态(UnLockAllReq) , 接收各种 请求操作。 上述实施例可以使一类数据查询交互较多, 数据变更较少的产品摆脱对物理数据 库的依赖, 降低产品成本, 提高产品竞争力, 可以取得良好的推广效果, 具有很强的 通用性。 在另外一个实施例中, 还提供了一种软件, 该软件用于执行上述实施例及优选实 施方式中描述的技术方案。 在另外一个实施例中, 还提供了一种存储介质, 该存储介质中存储有上述软件, 该存储介质包括但不限于: 光盘、 软盘、 硬盘、 可擦写存储器等。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可以用通用 的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布在多个计算装置所 组成的网络上, 可选地, 它们可以用计算装置可执行的程序代码来实现, 从而, 可以 将它们存储在存储装置中由计算装置来执行, 并且在某些情况下, 可以以不同于此处 的顺序执行所示出或描述的步骤, 或者将它们分别制作成各个集成电路模块, 或者将 它们中的多个模块或步骤制作成单个集成电路模块来实现。 这样, 本发明不限制于任 何特定的硬件和软件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领域的技 术人员来说, 本发明可以有各种更改和变化。 凡在本发明的精神和原则之内, 所作的 任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。

Claims

权 利 要 求 书
1. 一种内存数据库对数据的操作方法, 包括:
内存数据库加载预先存放在文件中的产品运行所需的全部数据; 所述内存数据库响应于外界请求, 对所述加载的数据进行操作。
2. 根据权利要求 1所述的方法, 其中, 所述文件包括: 全量数据文件和日志文件, 其中, 所述全量数据文件用于表示截止到指定时间生成的业务数据, 所述日志 文件用于存放生成所述全量数据文件之后的数据操作记录。
3. 根据权利要求 2所述的方法, 其中, 所述内存数据库加载预先存放在文件中的 产品运行所需的全部数据之后, 还包括:
所述内存数据库重新执行所述日志文件中的所述操作记录所对应的操作。
4. 根据权利要求 1至 3任一项所述的方法, 其中, 还包括:
在预定时间点到达时,所述内存数据库生成当前的所述文件和 /或删除已经 过期的所述文件。
5. 根据权利要求 1至 3任一项所述的方法, 其中, 所述文件为以下之一格式: 文本 txt格式、 SQL格式、 XLS格式。
6. 根据权利要求 1至 3任一项所述的方法, 其中, 所述内存数据库对所述加载的 数据进行以下至少之一操作:
查询、 更新、 增加、 删除。
7. 一种内存数据库对数据的操作装置, 包括:
加载模块, 设置为加载预先存放在文件中的产品运行所需的全部数据; 操作模块, 设置为响应于外界请求, 对所述加载的数据进行操作。
8. 根据权利要求 7所述的装置, 其中, 所述文件包括: 全量数据文件和日志文件, 其中, 所述全量数据文件用于表示截止到指定时间生成的业务数据, 所述日志 文件用于存放生成所述全量数据文件之后的数据操作记录。
9. 根据权利要求 8所述的装置, 其中, 所述加载模块, 还设置为重新执行所述日 志文件中的所述操作记录所对应的操作。
10. 根据权利要求 7至 9任一项所述的装置, 其中, 还包括: 定时任务模块, 设置为在预定时间点到达时, 通知所述操作模块生成当前 的所述文件和 /或删除已经过期的所述文件。
PCT/CN2011/082467 2011-08-16 2011-11-18 内存数据库对数据的操作方法及装置 WO2012151912A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2011102348097A CN102279885A (zh) 2011-08-16 2011-08-16 内存数据库对数据的操作方法及装置
CN201110234809.7 2011-08-16

Publications (1)

Publication Number Publication Date
WO2012151912A1 true WO2012151912A1 (zh) 2012-11-15

Family

ID=45105327

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/082467 WO2012151912A1 (zh) 2011-08-16 2011-11-18 内存数据库对数据的操作方法及装置

Country Status (2)

Country Link
CN (1) CN102279885A (zh)
WO (1) WO2012151912A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105957339A (zh) * 2016-06-26 2016-09-21 龙彦旭 基于红外与射频技术的交通十字路口安全系统和控制方法

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103761248B (zh) * 2013-12-23 2018-04-17 远光软件股份有限公司 利用内存数据库进行数据查询的方法及系统
CN103870587B (zh) * 2014-03-27 2017-08-22 上海华力微电子有限公司 一种半导体制造试验工艺流程的建立方法
AU2015316450B2 (en) 2014-11-12 2016-11-03 Huawei Cloud Computing Technologies Co., Ltd. Method for updating data table of KeyValue database and apparatus for updating table data
CN105989163A (zh) * 2015-03-04 2016-10-05 中国移动通信集团福建有限公司 数据实时处理方法及系统
CN105701190A (zh) * 2016-01-07 2016-06-22 深圳市金证科技股份有限公司 一种数据同步的方法和装置
CN110050268A (zh) * 2016-09-30 2019-07-23 深圳市华傲数据技术有限公司 基于增量的数据处理方法及装置
CN106951311B (zh) * 2017-03-21 2021-04-13 联想(北京)有限公司 一种数据处理方法及服务器集群
CN110716984B (zh) * 2019-10-10 2023-06-20 北京字节跳动网络技术有限公司 数据处理方法、装置、电子设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1740978A (zh) * 2004-08-23 2006-03-01 华为技术有限公司 实现共享内存数据库的方法及内存数据库系统
CN101329685A (zh) * 2008-07-30 2008-12-24 烽火通信科技股份有限公司 一种家庭网关上内存数据库的实现方法
CN101887388A (zh) * 2010-06-18 2010-11-17 中兴通讯股份有限公司 基于内存数据库的数据备份系统和方法

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20020030223A (ko) * 2000-10-16 2002-04-24 주식회사 알라딘소프트 주기억장치 데이터베이스 시스템에서 고성능 트랜잭션을지원하기 위한 로깅 및 회복 방법
CN100562858C (zh) * 2007-09-12 2009-11-25 华为技术有限公司 内存数据库远程容灾的方法、装置和系统
CN101242356B (zh) * 2007-12-06 2010-08-18 中兴通讯股份有限公司 Iptv系统中内存数据库的实现方法及iptv系统
CN101706801A (zh) * 2009-11-17 2010-05-12 广州从兴电子开发有限公司 一种内存数据库数据的管理方法及系统
CN101901250A (zh) * 2010-06-08 2010-12-01 中兴通讯股份有限公司 一种内存数据库及其数据处理方法
CN102024051B (zh) * 2010-12-17 2012-12-05 北京世纪互联工程技术服务有限公司 分布式内存数据库数据更新方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1740978A (zh) * 2004-08-23 2006-03-01 华为技术有限公司 实现共享内存数据库的方法及内存数据库系统
CN101329685A (zh) * 2008-07-30 2008-12-24 烽火通信科技股份有限公司 一种家庭网关上内存数据库的实现方法
CN101887388A (zh) * 2010-06-18 2010-11-17 中兴通讯股份有限公司 基于内存数据库的数据备份系统和方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105957339A (zh) * 2016-06-26 2016-09-21 龙彦旭 基于红外与射频技术的交通十字路口安全系统和控制方法

Also Published As

Publication number Publication date
CN102279885A (zh) 2011-12-14

Similar Documents

Publication Publication Date Title
WO2012151912A1 (zh) 内存数据库对数据的操作方法及装置
US11941017B2 (en) Event driven extract, transform, load (ETL) processing
WO2020237797A1 (zh) 一种微服务框架下动态配置管理方法及系统
US8886609B2 (en) Backup and restore of data from any cluster node
JP6553822B2 (ja) 分散システムにおける範囲の分割および移動
JP5387757B2 (ja) 並列データ処理システム、並列データ処理方法及びプログラム
CN102142024B (zh) 在分布式数据库中使用递增捕捉来进行逻辑数据备份和回退
US8090917B2 (en) Managing storage and migration of backup data
US8140591B2 (en) Enabling workflow awareness within a business process management (BPM) system
US9424271B2 (en) Atomic incremental load for map-reduce systems on append-only file systems
US20160048408A1 (en) Replication of virtualized infrastructure within distributed computing environments
US10503905B1 (en) Data lineage management
EP3049968B1 (en) Master schema shared across multiple tenants with dynamic update
US10235382B2 (en) Transferring objects between different storage devices based on timestamps
US11860741B2 (en) Continuous data protection
US11042503B1 (en) Continuous data protection and restoration
US20140358844A1 (en) Workflow controller compatibility
WO2012045245A1 (zh) 一种保持数据一致性的方法及系统
US10909000B2 (en) Tagging data for automatic transfer during backups
US8805777B2 (en) Data record collapse and split functionality
US20120278429A1 (en) Cluster system, synchronization controlling method, server, and synchronization controlling program
WO2016192496A1 (zh) 数据迁移处理方法及装置
JP2019159556A (ja) Rpa保守支援装置及びrpa保守支援プログラム
US10855750B2 (en) Centralized management of webservice resources in an enterprise
JP2015064850A (ja) データベース監視装置、データベース監視方法、並びにコンピュータ・プログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11865342

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11865342

Country of ref document: EP

Kind code of ref document: A1