WO2023116827A1 - 高并发存储数据的方法及*** - Google Patents

高并发存储数据的方法及*** Download PDF

Info

Publication number
WO2023116827A1
WO2023116827A1 PCT/CN2022/141043 CN2022141043W WO2023116827A1 WO 2023116827 A1 WO2023116827 A1 WO 2023116827A1 CN 2022141043 W CN2022141043 W CN 2022141043W WO 2023116827 A1 WO2023116827 A1 WO 2023116827A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
operation object
data operation
module
cache
Prior art date
Application number
PCT/CN2022/141043
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 WO2023116827A1 publication Critical patent/WO2023116827A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements

Definitions

  • the invention relates to the technical field of data storage, in particular to a method and system for storing data with high concurrency.
  • the technical problem to be solved by the present invention is to provide a method and system for storing data with high concurrency in view of at least one defect in the prior art.
  • the technical solution adopted by the present invention to solve the technical problem is: to construct a method for storing data with high concurrency, comprising the following steps:
  • the method further includes:
  • the method further includes:
  • step S10 it further includes:
  • the persistent cache data includes:
  • S502 Persistently cache the acquired cache data, clear the cache and log files of the data operation object, and return to step S502.
  • the method further includes:
  • S70 Generate a data operation object, and write the log file data into the cache of the data operation object;
  • the present invention also constructs a system for storing data with high concurrency, including:
  • the object obtaining module is used to obtain a data operation object from the data operation object queue according to the write data request;
  • a write module used to write the data to be written into the cache and log files of the data operation object
  • the cache judgment module is used to judge whether the cache size has exceeded the set object cache threshold, if not, execute the return module; if so, execute the cache module;
  • a return module configured to put the data operation object back into the data operation object queue
  • the cache module is used to persist the cache data; wherein, the cache module runs concurrently with other modules.
  • the system further includes:
  • a receiving module configured to receive a write data request
  • a thread obtaining module used to obtain a thread from the write data thread pool to process the request
  • the locking module is used to lock the data operation object queue to prohibit other threads from obtaining the data operation object from the data operation object queue;
  • An unlocking module configured to unlock the data operation object queue
  • the object judging module is used to judge whether there is a data operation object in the data operation object queue, if so, execute the unlocking module; if not, execute the first generation module;
  • the first generating module is configured to generate a data operation object and add it to the queue of data operation objects.
  • the cache module includes:
  • a move-in module configured to move the data operation object into the data completion operation object list
  • a data acquisition module configured to acquire cached data of a data operation object from the list of data completion operation objects
  • the data caching module is used for persistently caching the obtained cached data, and clearing the cache and log files of the data operation object.
  • the system further includes:
  • the log reading module is used to read the object log file when the process of writing data is interrupted and restarted;
  • the second generation module is used to generate a data operation object, write the log file data into the cache of the data operation object, add the data operation object to the queue of the data operation object, and complete the startup.
  • the present invention can store data in a storage file or a storage library in a high-concurrency manner by running the persistent cache data and object cache processes concurrently, thereby increasing the number of service requests and the storage speed.
  • Fig. 1 is a schematic flow diagram of a method for storing data with high concurrency in the present invention
  • Fig. 2 is the second schematic flow diagram of the method for storing data with high concurrency in the present invention
  • Fig. 3 is a schematic flow chart of the method for restarting after the process of writing data is interrupted according to the present invention
  • Fig. 4 is a schematic diagram of the system module 1 of the present invention for storing data with high concurrency
  • Fig. 5 is a schematic diagram 2 of the system module for storing data with high concurrency in the present invention
  • Fig. 6 is a block diagram of the system restarted after the process of writing data is interrupted in the present invention.
  • the present invention discloses a method for storing data with high concurrency, including the following steps:
  • Step S10 Acquire a data operation object from the data operation object queue according to the data write request.
  • Step S20 Write the data to be written into the cache and log files of the data operation object.
  • Step S30 Determine whether the cache size has exceeded the set object cache threshold.
  • Step S40 If not, put the data operation object back into the data operation object queue, so that other threads can also write data into the cache and log files of the data operation object.
  • Step S50 If yes, persist the cached data, and execute other steps concurrently, that is, other steps except step S50.
  • step S50 Since the process of persisting cached data is relatively long, by running the process of persisting cached data and object caching concurrently (other steps except step S50), it is possible to store data in a storage file or a repository with high concurrency, improving The number of service requests and the speed of storage can be several times higher than the general method of storing data.
  • step S10 before step S10, it also includes:
  • Step S01 Receive a data write request.
  • Step S02 Obtain a thread processing request from the data writing thread pool.
  • the number of threads in the data thread pool is variable and can be configured according to business requirements and computer performance.
  • step S10 before step S10, it also includes:
  • Step S03 lock the data operation object queue to prohibit other threads from obtaining data operation objects from the data operation object queue, thereby preventing multiple threads from obtaining the same object and causing disordered operation data.
  • Step S13 Unlock the data operation object queue.
  • locking is to set a lock flag.
  • the flag is in the lock state, other threads cannot obtain the data operation object from the data operation object queue, and can only wait. After the flag is unlocked, the data operation can be obtained from the data operation object queue. object.
  • the lock is to lock the process of obtaining the data operation object from the data operation object queue.
  • step S10 in order to ensure that there is always a data operation object in the data operation object queue, after step S10, it also includes:
  • Step S11 Determine whether there is a data operation object in the data operation object queue.
  • step S13 unlock the data operation object queue; if not, perform step S12.
  • Step S12 Generate a data operation object and add it to the queue of data operation objects.
  • the persistent cache data in step S50 further includes:
  • Step S501 Move the data operation object into the data completion operation object list.
  • Step S502 Obtain cached data of a data operation object from the data completion operation object list.
  • Step S502 Perform persistent caching of the acquired cache data, for example, write the data in the computer memory to the hard disk of the computer, and clear the cache and log files of the data operation object, and return to step S502 to continue to complete the operation from the data Obtain the cached data of the next data operation object in the object list.
  • the method further includes:
  • Step S60 When the process of writing data is interrupted and restarted, read the object log file.
  • Step S70 Generate a data operation object, and write the log file data into the cache of the data operation object.
  • Step S80 Add the data operation object to the data operation object queue, and the startup is completed.
  • the present invention also discloses a system for storing data with high concurrency, including:
  • the object obtaining module is used to obtain a data operation object from the data operation object queue according to the data write request.
  • the write module is used to write the data to be written into the cache and log files of the data operation object.
  • the cache judging module is used to judge whether the cache size has exceeded the set object cache threshold, if not, execute the return module; if yes, execute the cache module.
  • the return module is used to put the data operation object back into the data operation object queue, so that other threads can also write data into the cache and log files of the data operation object.
  • the cache module is used to persist the cache data; wherein, the cache module runs concurrently with other modules, that is, other modules except the cache module.
  • the system also includes:
  • the receiving module is used for receiving the write data request.
  • the thread obtaining module is used to obtain a thread processing request from the data writing thread pool.
  • the number of threads in the data thread pool is variable and can be configured according to business requirements and computer performance.
  • the system also includes:
  • the locking module is used to lock the data operation object queue, so as to prohibit other threads from obtaining data operation objects from the data operation object queue, so as to prevent multiple threads from obtaining the same object and operating data disorder.
  • the unlocking module is used to unlock the data operation object queue.
  • locking is to set a lock flag.
  • the flag is in the lock state, other threads cannot obtain the data operation object from the data operation object queue, and can only wait. After the flag is unlocked, the data operation can be obtained from the data operation object queue. object.
  • the lock is to lock the process of obtaining the data operation object from the data operation object queue.
  • the system further includes:
  • the object judging module is used to judge whether there is a data operation object in the data operation object queue, if yes, execute the unlocking module; if not, execute the first generation module.
  • the first generation module is used to generate a data operation object and add it to the queue of data operation objects.
  • the caching module includes:
  • the move-in module is used to move data operation objects into the data completion operation object list.
  • the data obtaining module is used to obtain cached data of a data operation object from the list of data completion operation objects.
  • the data cache module is used for persistently caching the obtained cached data, for example, writing the data in the computer memory to the hard disk of the computer, and clearing the cache and log files of the data operation object.
  • the system in order to avoid the problem of data loss in case of power failure or crash during data writing, the system also includes:
  • the log reading module is used to read the object log file when the process of writing data is interrupted and restarted.
  • the second generating module is used to generate the data operation object, write the log file data into the cache of the data operation object, add the data operation object to the queue of the data operation object, and the startup is completed.
  • the present invention can store data in a storage file or a storage library in a high-concurrency manner by running the persistent cache data and object cache processes concurrently, thereby increasing the number of service requests and the storage speed.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

本发明公开了高并发存储数据的方法及***,该方法包括S10:根据写数据请求,从数据操作对象队列中获取一个数据操作对象;S20:将需要写的数据写入数据操作对象的缓存和日志文件中;S30:判断缓存大小是否已超过设置的对象缓存阈值;S40:若否,则将数据操作对象放回至数据操作对象队列中;S50:若是,则持久化缓存数据,且并发执行其他步骤。本发明通过并发运行持久化缓存数据和对象缓存流程(除步骤S50以外的其他步骤流程),从而可以高并发地向一个存储文件或一个存储库存储数据,提高服务请求的数量和存储的速度。

Description

高并发存储数据的方法及*** 技术领域
本发明涉及数据存储技术领域,尤其涉及一种高并发存储数据的方法及***。
背景技术
随着信息时代的不断发展,需要记录数据的需求越来越多,而一般能提供存储数据服务的服务,同时能提供的请求数和存储效率都不是很高,为存储数据的用户带来不少的麻烦,现有技术又没有一个能很好地解决提升存储数据服务的请求数和存储效率的方法。
技术问题
本发明要解决的技术问题在于,针对现有技术存在的至少一个缺陷,提供一种高并发存储数据的方法及***。
技术解决方案
本发明解决其技术问题所采用的技术方案是:构造一种高并发存储数据的方法,包括以下步骤:
S10:根据写数据请求,从数据操作对象队列中获取一个数据操作对象;
S20:将需要写的数据写入所述数据操作对象的缓存和日志文件中;
S30:判断缓存大小是否已超过设置的对象缓存阈值;
S40:若否,则将所述数据操作对象放回至所述数据操作对象队列中;
S50:若是,则持久化缓存数据,且并发执行其他步骤。
优选地,在本发明所述的高并发存储数据的方法中,步骤S10之前还包括:
S01:接收写数据请求;
S02:从写数据线程池中获取一个线程处理所述请求。
优选地,在本发明所述的高并发存储数据的方法中,步骤S10之前还包括:
S03:对数据操作对象队列进行加锁,以禁止其他线程从数据操作对象队列中获取数据操作对象;
步骤S10之后还包括:
S13:对所述数据操作对象队列进行解锁。
优选地,在本发明所述的高并发存储数据的方法中,步骤S10之后还包括:
S11:判断所述数据操作对象队列中是否有数据操作对象;
若是,则执行步骤S13;若否,执行步骤S12;
S12:生成一个数据操作对象,并添加到所述数据操作对象队列中。
优选地,在本发明所述的高并发存储数据的方法中,所述持久化缓存数据包括:
S501:将所述数据操作对象移入数据完成操作对象列表;
S502:从所述数据完成操作对象列表中获取一个数据操作对象的缓存数据;
S502:将获取到的缓存数据进行持久化缓存,并清除数据操作对象的缓存和日志文件,且返回执行步骤S502。
优选地,在本发明所述的高并发存储数据的方法中,所述方法还包括:
S60:当写数据过程中断后重新启动,则读取对象日志文件;
S70:生成数据操作对象,将日志文件数据写入所述数据操作对象的缓存中;
S80:将所述数据操作对象添加到所述数据操作对象队列中,启动完成。
本发明还构造了一种高并发存储数据的***,包括:
对象获取模块,用于根据写数据请求,从数据操作对象队列中获取一个数据操作对象;
写入模块,用于将需要写的数据写入所述数据操作对象的缓存和日志文件中;
缓存判断模块,用于判断缓存大小是否已超过设置的对象缓存阈值,若否,则执行返回模块;若是,则执行缓存模块;
返回模块,用于将所述数据操作对象放回至所述数据操作对象队列中;
缓存模块,用于持久化缓存数据;其中,所述缓存模块与其他模块并发运行。
优选地,在本发明所述的高并发存储数据的***中,所述***还包括:
接收模块,用于接收写数据请求;
线程获取模块,用于从写数据线程池中获取一个线程处理所述请求;
加锁模块,用于对数据操作对象队列进行加锁,以禁止其他线程从数据操作对象队列中获取数据操作对象;
解锁模块,用于对所述数据操作对象队列进行解锁;
对象判断模块,用于判断所述数据操作对象队列中是否有数据操作对象,若是,则执行所述解锁模块;若否,则执行第一生成模块;
第一生成模块,用于生成一个数据操作对象,并添加到所述数据操作对象队列中。
优选地,在本发明所述的高并发存储数据的***中,所述缓存模块包括:
移入模块,用于将所述数据操作对象移入数据完成操作对象列表;
数据获取模块,用于从所述数据完成操作对象列表中获取一个数据操作对象的缓存数据;
数据缓存模块,用于将获取到的缓存数据进行持久化缓存,并清除数据操作对象的缓存和日志文件。
优选地,在本发明所述的高并发存储数据的***中,所述***还包括:
日志读取模块,用于当写数据过程中断后重新启动,则读取对象日志文件;
第二生成模块,用于生成数据操作对象,将日志文件数据写入所述数据操作对象的缓存中,将所述数据操作对象添加到所述数据操作对象队列中,启动完成。
有益效果
通过实施本发明,具有以下有益效果:
本发明通过并发运行持久化缓存数据和对象缓存流程,从而可以高并发地向一个存储文件或一个存储库存储数据,提高服务请求的数量和存储的速度。
附图说明
下面将结合附图及实施例对本发明作进一步说明,附图中:
图1是本发明高并发存储数据的方法流程示意图一;
图2是本发明高并发存储数据的方法流程示意图二;
图3是本发明写数据过程中断后重新启动的方法流程示意图;
图4是本发明高并发存储数据的***模块示意图一;
图5是本发明高并发存储数据的***模块示意图二;
图6是本发明写数据过程中断后重新启动的***模块图。
本发明的实施方式
为了对本发明的技术特征、目的和效果有更加清楚的理解,现对照附图详细说明本发明的具体实施方式。
需要说明的是,附图中所示的流程图仅是示例性说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解,而有的操作/步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。
附图中所示的方框图仅仅是功能实体,不一定必须与物理上独立的实体相对应。 即,可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。
如图1所示,本发明公开了一种高并发存储数据的方法,包括以下步骤:
步骤S10:根据写数据请求,从数据操作对象队列中获取一个数据操作对象。
步骤S20:将需要写的数据写入数据操作对象的缓存和日志文件中。
步骤S30:判断缓存大小是否已超过设置的对象缓存阈值。
步骤S40:若否,则将数据操作对象放回至数据操作对象队列中,令其他线程也能将数据写入数据操作对象的缓存和日志文件中。
步骤S50:若是,则持久化缓存数据,且并发执行其他步骤,即除步骤S50以外的其他步骤。
由于持久化缓存数据该过程比较漫长,因此通过并发运行持久化缓存数据和对象缓存流程(除步骤S50以外的其他步骤流程),从而可以高并发地向一个存储文件或一个存储库存储数据,提高服务请求的数量和存储的速度,能比一般的存储数据方法,高出数倍的服务请求的数量和存储的速度。
在一些实施例中,如图2所示,步骤S10之前还包括:
步骤S01:接收写数据请求。
步骤S02:从写数据线程池中获取一个线程处理请求。其中,数据线程池中线程数的多少是可变的,可根据业务的需要和电脑的性能来配置。
在一些实施例中,步骤S10之前还包括:
步骤S03:对数据操作对象队列进行加锁,以禁止其他线程从数据操作对象队列中获取数据操作对象,从而避免多个线程获取到同一对象,操作数据错乱。
步骤S10之后还包括:
步骤S13:对数据操作对象队列进行解锁。
其中,加锁是设置一个锁标识,当标识为锁状态时,其他线程就不能从数据操作对象队列中获取数据操作对象,只能等待,标识解锁后,才能从数据操作对象队列中获取数据操作对象。锁是对从数据操作对象队列中获取数据操作对象过程进行加锁。
在一些实施例中,为了保证数据操作对象队列中一直有数据操作对象,步骤S10之后还包括:
步骤S11:判断数据操作对象队列中是否有数据操作对象。
若是,则执行步骤S13:对数据操作对象队列进行解锁;若否,执行步骤S12。
步骤S12:生成一个数据操作对象,并添加到数据操作对象队列中。
在一些实施例中,步骤S50中的持久化缓存数据,进一步包括:
步骤S501:将数据操作对象移入数据完成操作对象列表。
步骤S502:从数据完成操作对象列表中获取一个数据操作对象的缓存数据。
步骤S502:将获取到的缓存数据进行持久化缓存,例如将电脑内存的数据写入到电脑的硬盘中,并清除数据操作对象的缓存和日志文件,且返回执行步骤S502,继续从数据完成操作对象列表中获取下一个数据操作对象的缓存数据。
在一些实施例中,如图3所示,为了避免写数据过程中发生断电或死机情况下数据丢失的问题,本方法还包括:
步骤S60:当写数据过程中断后重新启动,则读取对象日志文件。
步骤S70:生成数据操作对象,将日志文件数据写入数据操作对象的缓存中。
步骤S80:将数据操作对象添加到数据操作对象队列中,启动完成。
如图4所示,本发明还公开了一种高并发存储数据的***,包括:
对象获取模块,用于根据写数据请求,从数据操作对象队列中获取一个数据操作对象。
写入模块,用于将需要写的数据写入数据操作对象的缓存和日志文件中。
缓存判断模块,用于判断缓存大小是否已超过设置的对象缓存阈值,若否,则执行返回模块;若是,则执行缓存模块。
返回模块,用于将数据操作对象放回至数据操作对象队列中,令其他线程也能将数据写入数据操作对象的缓存和日志文件中。
缓存模块,用于持久化缓存数据;其中,缓存模块与其他模块并发运行,即除缓存模块以外的其他模块。
由于持久化缓存数据该过程比较漫长,因此通过并发运行持久化缓存数据和对象缓存流程,从而可以高并发地向一个存储文件或一个存储库存储数据,提高服务请求的数量和存储的速度,能比一般的存储数据方法,高出数倍的服务请求的数量和存储的速度。
在一些实施例中,如图5所示,本***还包括:
接收模块,用于接收写数据请求。
线程获取模块,用于从写数据线程池中获取一个线程处理请求。其中,数据线程池中线程数的多少是可变的,可根据业务的需要和电脑的性能来配置。
在一些实施例中,本***还包括:
加锁模块,用于对数据操作对象队列进行加锁,以禁止其他线程从数据操作对象队列中获取数据操作对象,从而避免多个线程获取到同一对象,操作数据错乱。
解锁模块,用于对数据操作对象队列进行解锁。
其中,加锁是设置一个锁标识,当标识为锁状态时,其他线程就不能从数据操作对象队列中获取数据操作对象,只能等待,标识解锁后,才能从数据操作对象队列中获取数据操作对象。锁是对从数据操作对象队列中获取数据操作对象过程进行加锁。
在一些实施例中,为了保证数据操作对象队列中一直有数据操作对象,本***还包括:
对象判断模块,用于判断数据操作对象队列中是否有数据操作对象,若是,则执行解锁模块;若否,则执行第一生成模块。
第一生成模块,用于生成一个数据操作对象,并添加到数据操作对象队列中。
在一些实施例中,该缓存模块包括:
移入模块,用于将数据操作对象移入数据完成操作对象列表。
数据获取模块,用于从数据完成操作对象列表中获取一个数据操作对象的缓存数据。
数据缓存模块,用于将获取到的缓存数据进行持久化缓存,例如将电脑内存的数据写入到电脑的硬盘中,并清除数据操作对象的缓存和日志文件。
在一些实施例中,如图6所示,为了避免写数据过程中发生断电或死机情况下数据丢失的问题,本***还包括:
日志读取模块,用于当写数据过程中断后重新启动,则读取对象日志文件。
第二生成模块,用于生成数据操作对象,将日志文件数据写入数据操作对象的缓存中,将数据操作对象添加到数据操作对象队列中,启动完成。
通过实施本发明,具有以下有益效果:
本发明通过并发运行持久化缓存数据和对象缓存流程,从而可以高并发地向一个存储文件或一个存储库存储数据,提高服务请求的数量和存储的速度。
可以理解的,以上实施例仅表达了本发明的优选实施方式,其描述较为具体和详细,但并不能因此而理解为对本发明专利范围的限制;应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,可以对上述技术特点进行自由组合,还可以做出若干变形和改进,这些都属于本发明的保护范围;因此,凡跟本发明权利要求范围所做的等同变换与修饰,均应属于本发明权利要求的涵盖范围。

Claims (10)

  1. 一种高并发存储数据的方法,其特征在于,包括以下步骤:
    S10:根据写数据请求,从数据操作对象队列中获取一个数据操作对象;
    S20:将需要写的数据写入所述数据操作对象的缓存和日志文件中;
    S30:判断缓存大小是否已超过设置的对象缓存阈值;
    S40:若否,则将所述数据操作对象放回至所述数据操作对象队列中;
    S50:若是,则持久化缓存数据,且并发执行其他步骤。
  2. 根据权利要求1所述的高并发存储数据的方法,其特征在于,步骤S10之前还包括:
    S01:接收写数据请求;
    S02:从写数据线程池中获取一个线程处理所述请求。
  3. 根据权利要求2所述的高并发存储数据的方法,其特征在于,步骤S10之前还包括:
    S03:对数据操作对象队列进行加锁,以禁止其他线程从数据操作对象队列中获取数据操作对象;
    步骤S10之后还包括:
    S13:对所述数据操作对象队列进行解锁。
  4. 根据权利要求3所述的高并发存储数据的方法,其特征在于,步骤S10之后还包括:
    S11:判断所述数据操作对象队列中是否有数据操作对象;
    若是,则执行步骤S13;若否,执行步骤S12;
    S12:生成一个数据操作对象,并添加到所述数据操作对象队列中。
  5. 根据权利要求1所述的高并发存储数据的方法,其特征在于,所述持久化缓存数据包括:
    S501:将所述数据操作对象移入数据完成操作对象列表;
    S502:从所述数据完成操作对象列表中获取一个数据操作对象的缓存数据;
    S502:将获取到的缓存数据进行持久化缓存,并清除数据操作对象的缓存和日志文件,且返回执行步骤S502。
  6. 根据权利要求1所述的高并发存储数据的方法,其特征在于,所述方法还包括:
    S60:当写数据过程中断后重新启动,则读取对象日志文件;
    S70:生成数据操作对象,将日志文件数据写入所述数据操作对象的缓存中;
    S80:将所述数据操作对象添加到所述数据操作对象队列中,启动完成。
  7. 一种高并发存储数据的***,其特征在于,包括:
    对象获取模块,用于根据写数据请求,从数据操作对象队列中获取一个数据操作对象;
    写入模块,用于将需要写的数据写入所述数据操作对象的缓存和日志文件中;
    缓存判断模块,用于判断缓存大小是否已超过设置的对象缓存阈值,若否,则执行返回模块;若是,则执行缓存模块;
    返回模块,用于将所述数据操作对象放回至所述数据操作对象队列中;
    缓存模块,用于持久化缓存数据;其中,所述缓存模块与其他模块并发运行。
  8. 根据权利要求7所述的高并发存储数据的***,其特征在于,所述***还包括:
    接收模块,用于接收写数据请求;
    线程获取模块,用于从写数据线程池中获取一个线程处理所述请求;
    加锁模块,用于对数据操作对象队列进行加锁,以禁止其他线程从数据操作对象队列中获取数据操作对象;
    解锁模块,用于对所述数据操作对象队列进行解锁;
    对象判断模块,用于判断所述数据操作对象队列中是否有数据操作对象,若是,则执行所述解锁模块;若否,则执行第一生成模块;
    第一生成模块,用于生成一个数据操作对象,并添加到所述数据操作对象队列中。
  9. 根据权利要求7所述的高并发存储数据的***,其特征在于,所述缓存模块包括:
    移入模块,用于将所述数据操作对象移入数据完成操作对象列表;
    数据获取模块,用于从所述数据完成操作对象列表中获取一个数据操作对象的缓存数据;
    数据缓存模块,用于将获取到的缓存数据进行持久化缓存,并清除数据操作对象的缓存和日志文件。
  10. 根据权利要求7所述的高并发存储数据的***,其特征在于,所述***还包括:
    日志读取模块,用于当写数据过程中断后重新启动,则读取对象日志文件;
    第二生成模块,用于生成数据操作对象,将日志文件数据写入所述数据操作对象的缓存中,将所述数据操作对象添加到所述数据操作对象队列中,启动完成。
PCT/CN2022/141043 2021-12-23 2022-12-22 高并发存储数据的方法及*** WO2023116827A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111592146.6 2021-12-23
CN202111592146.6A CN114489480A (zh) 2021-12-23 2021-12-23 高并发存储数据的方法及***

Publications (1)

Publication Number Publication Date
WO2023116827A1 true WO2023116827A1 (zh) 2023-06-29

Family

ID=81494057

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/141043 WO2023116827A1 (zh) 2021-12-23 2022-12-22 高并发存储数据的方法及***

Country Status (2)

Country Link
CN (1) CN114489480A (zh)
WO (1) WO2023116827A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114489480A (zh) * 2021-12-23 2022-05-13 深圳市世强元件网络有限公司 高并发存储数据的方法及***

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021335A (zh) * 2016-05-06 2016-10-12 北京奇虎科技有限公司 访问数据库的方法及装置
US20170206147A1 (en) * 2015-01-20 2017-07-20 Breville Pty Limited Log management method and computer system
CN109144413A (zh) * 2018-07-27 2019-01-04 郑州云海信息技术有限公司 一种元数据管理方法及装置
CN110365752A (zh) * 2019-06-27 2019-10-22 北京大米科技有限公司 业务数据的处理方法、装置、电子设备和存储介质
CN112306811A (zh) * 2020-11-09 2021-02-02 重庆易宠科技有限公司 一种php微服务控制方法、***、终端及介质
CN113467719A (zh) * 2021-06-25 2021-10-01 阿里巴巴新加坡控股有限公司 数据写入方法及装置
CN114489480A (zh) * 2021-12-23 2022-05-13 深圳市世强元件网络有限公司 高并发存储数据的方法及***

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102945278B (zh) * 2012-11-09 2015-12-09 华为技术有限公司 一种数据库记录重做日志的方法和装置
CN107562367B (zh) * 2016-07-01 2021-04-02 阿里巴巴集团控股有限公司 基于软件化存储***读写数据的方法以及装置
CN111381987A (zh) * 2020-03-13 2020-07-07 北京金山云网络技术有限公司 一种消息处理方法、装置、电子设备及介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170206147A1 (en) * 2015-01-20 2017-07-20 Breville Pty Limited Log management method and computer system
CN106021335A (zh) * 2016-05-06 2016-10-12 北京奇虎科技有限公司 访问数据库的方法及装置
CN109144413A (zh) * 2018-07-27 2019-01-04 郑州云海信息技术有限公司 一种元数据管理方法及装置
CN110365752A (zh) * 2019-06-27 2019-10-22 北京大米科技有限公司 业务数据的处理方法、装置、电子设备和存储介质
CN112306811A (zh) * 2020-11-09 2021-02-02 重庆易宠科技有限公司 一种php微服务控制方法、***、终端及介质
CN113467719A (zh) * 2021-06-25 2021-10-01 阿里巴巴新加坡控股有限公司 数据写入方法及装置
CN114489480A (zh) * 2021-12-23 2022-05-13 深圳市世强元件网络有限公司 高并发存储数据的方法及***

Also Published As

Publication number Publication date
CN114489480A (zh) 2022-05-13

Similar Documents

Publication Publication Date Title
KR101203297B1 (ko) 직접 업데이트 소프트웨어 트랜잭션 메모리
US7293145B1 (en) System and method for data transfer using a recoverable data pipe
US11709803B2 (en) Data transaction processing method, apparatus, and electronic device
US9430160B2 (en) Consistency without ordering dependency
US8819059B2 (en) Facilitation of search, list, and retrieval operations on persistent data set using distributed shared memory
KR20030075854A (ko) 공유 디스크 파일 시스템의 저널링 및 회복 방법
KR20130115995A (ko) 파일 시스템에 대한 체크포인트
WO2021169342A1 (zh) 一种Kubernetes中节点的资源管理方法、设备以及介质
WO2019228440A1 (zh) 数据页访问方法、存储引擎以及计算机可读存储介质
EP4315098A1 (en) Rowgroup consolidation with global delta accumulation and versioning in distributed systems
US11880318B2 (en) Local page writes via pre-staging buffers for resilient buffer pool extensions
US20230305724A1 (en) Data management method and apparatus, computer device, and storage medium
WO2022048358A1 (zh) 数据处理方法、装置及存储介质
WO2023016414A1 (zh) 凭据的轮转方法、计算设备及存储介质
WO2023116827A1 (zh) 高并发存储数据的方法及***
US11880290B2 (en) Scalable exactly-once data processing using transactional streaming writes
WO2022242372A1 (zh) 对象处理方法、装置、计算机设备和存储介质
US6968432B2 (en) Method and system for altering a sequence number assignment pattern while preserving integrity and high concurrency in a multi-system shared disk environment
CN116226232A (zh) 面向分布式数据库的持久内存数据存储方法及***
US20210357385A1 (en) In-place garbage collection for state machine replication
US20090187589A1 (en) Method and system for managing data clusters
WO2020107352A1 (zh) 日志序列号生成方法、装置及可读存储介质
CN111104070A (zh) 分布式***中数据一致性的实现方法及***
US10706012B2 (en) File creation
US20230409608A1 (en) Management device, database system, management method, and computer program product

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: 22910138

Country of ref document: EP

Kind code of ref document: A1