CN109359118A - A kind of method for writing data and device - Google Patents

A kind of method for writing data and device Download PDF

Info

Publication number
CN109359118A
CN109359118A CN201811009759.0A CN201811009759A CN109359118A CN 109359118 A CN109359118 A CN 109359118A CN 201811009759 A CN201811009759 A CN 201811009759A CN 109359118 A CN109359118 A CN 109359118A
Authority
CN
China
Prior art keywords
data
database
written
load
preset threshold
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.)
Granted
Application number
CN201811009759.0A
Other languages
Chinese (zh)
Other versions
CN109359118B (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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201811009759.0A priority Critical patent/CN109359118B/en
Priority to CN202110777407.5A priority patent/CN113535721B/en
Publication of CN109359118A publication Critical patent/CN109359118A/en
Application granted granted Critical
Publication of CN109359118B publication Critical patent/CN109359118B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • 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
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • 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
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • 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
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • 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
    • 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/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/065Replication mechanisms
    • 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
    • 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/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Landscapes

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

Abstract

Disclose a kind of method for writing data and device.A kind of method for writing data is pre-configured with data buffer storage corresponding with database, and the first process, the second process that configuration works independently from each other, this method comprises: the first process receives the write data requests that service server issues;The data to be written carried in parsing write data request;Whether the load for judging database is more than preset threshold value;If so, storing the data to be written to the data buffer storage;Second process determines the load state of database;In the case where determining that the load of database is less than preset threshold value, the data to be written in the data buffer storage are read, database is written into read data to be written.

Description

A kind of method for writing data and device
Technical field
This specification embodiment is related to technical field of data storage more particularly to a kind of method for writing data and device.
Background technique
TPS (Transaction Per Second, issued transaction amount per second), the performance of an expression system processing capacity Index can usually use it as the important indicator of measure database data writing capability.
In Third-party payment, with increasing for number of users, Third-party payment real-time deal magnitude increasingly increases, tradition Has there is bottleneck in the mode of write-in data in real time in the database, such as the TPS of single machine oracle is 10,000 or so, it is clear that nothing Method meets the needs of real-time deal magnitude increasingly increases.
And to solve the above-mentioned problems, the mode generallyd use at present is: increasing more storage servers, deposits increased Storage server on be respectively configured with the consistent database of legacy data library type, by Third-party payment service server generate Data are split, the database being written in more storage servers.In this way, will increase hardware cost accordingly, together When also add additional the maintenance cost of storage server.
Summary of the invention
In view of the above technical problems, this specification embodiment provides a kind of method for writing data and device, and technical solution is such as Under:
A kind of method for writing data is pre-configured with data buffer storage corresponding with database, and configuration works independently from each other The first process, the second process, this method comprises:
First process receives the write data requests that service server issues;
The data to be written carried in parsing write data request;
Whether the load for judging database is more than preset threshold value;
If so, storing the data to be written to the data buffer storage;
Second process determines the load state of database;
In the case where determining that the load of database is less than preset threshold value, read to be written in the data buffer storage Database is written in read data to be written by data.
A kind of data transfer apparatus is pre-configured with data buffer storage corresponding with database, and configuration works independently from each other The first process, the second process, which includes:
Request receiving module receives the write data requests that service server issues for the first process;
Request analysis module, for parsing the data to be written carried in write data request;
Judgment module, for judging whether the load of database is more than preset threshold value;
Data memory module, for if so, storing the data to be written to the data buffer storage;
Determining module determines the load state of database for the second process;
Data read module, in the case where determining that the load of database is less than preset threshold value, described in reading Data to be written in data buffer storage;
Data write. module, for database to be written in read data to be written.
Technical solution provided by this specification embodiment meets real-time deal magnitude in the case where not increasing cost The demand increasingly increased.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not This specification embodiment can be limited.
In addition, any embodiment in this specification embodiment does not need to reach above-mentioned whole effects.
Detailed description of the invention
In order to illustrate more clearly of this specification embodiment or technical solution in the prior art, below will to embodiment or Attached drawing needed to be used in the description of the prior art is briefly described, it should be apparent that, the accompanying drawings in the following description is only The some embodiments recorded in this specification embodiment for those of ordinary skill in the art can also be attached according to these Figure obtains other attached drawings.
Fig. 1 is the connection schematic diagram of service server and storage server in prior art;
Fig. 2 is the database point library of this specification embodiment and the correspondence diagram of data buffer storage file;
Fig. 3 is the flow diagram of the method for writing data of this specification embodiment;
Fig. 4 is the structural schematic diagram of the data transfer apparatus of this specification embodiment;
Fig. 5 is the structural schematic diagram for configuring a kind of equipment of this specification embodiment device.
Specific embodiment
Performance indicator of the TPS as an expression system processing capacity is generally also write with it come the data of measure database Enter ability, the data writing capability of different types of database is different.Such as the TPS of single machine oracle is 10,000 or so.
In Third-party payment, with increasing for number of users, Third-party payment real-time deal magnitude increasingly increases, especially At the time of specific, real-time deal magnitude increases severely, and bottleneck, example has occurred in traditional mode that data are written in real time in the database The TPS of single machine oracle as stated above is 10,000 or so, it is clear that is unable to satisfy the demand that real-time deal magnitude increasingly increases.
And to solve the above-mentioned problems, the mode generallyd use at present is: increasing on the basis of original storage server More storage servers, such as increase by three storage servers, it is respectively configured in increased storage server and legacy data The consistent database of library type, such as the database configured on original storage server A is oracle, then in storage server B, oracle database is respectively configured on storage server C, storage server D, service server in Third-party payment is generated Data split, such as data a is split into data a1, data a2, data a3, data a4, data a1 is written and is stored Storage server B is written in server A, data a2, and storage server C is written in data a3, and storage server D is written in data a4, Connection schematic diagram is as shown in Figure 1.In this way, will increase hardware cost accordingly, while also adding additional storage server Maintenance cost.
Technical solution provided by this specification embodiment is pre-configured with and number under the premise of the configuration of original server According to the corresponding data buffer storage in library, during data write-in, by judging the load state of database, to determine number to be written According to database is write direct, still store to data buffer storage, it is subsequent that number is written into the data to be written in data buffer storage in idle According to library.In this way, still can satisfy the demand that real-time deal magnitude increasingly increases in the case where not increasing cost.
Specifically, the technical solution that this specification embodiment provides is as follows:
Be pre-configured with data buffer storage corresponding with database, and configuration work independently from each other the first process, second into Journey;
First process receives the write data requests that service server issues;It is carried in parsing write data request to be written Enter data;Whether the load for judging database is more than preset threshold value;If so, storing the data to be written to the data Caching;Second process determines the load state of database;In the case where determining that the load of database is less than preset threshold value, The data to be written in the data buffer storage are read, database is written into read data to be written.
In order to make those skilled in the art more fully understand the technical solution in this specification embodiment, below in conjunction with this Attached drawing in specification embodiment is described in detail the technical solution in this specification embodiment, it is clear that described Embodiment is only a part of the embodiment of this specification, instead of all the embodiments.The embodiment of base in this manual, Those of ordinary skill in the art's every other embodiment obtained, all should belong to the range of protection.
Before executing the technical solution that this specification embodiment provides, it is slow to be pre-configured with data corresponding with database It deposits, and the first process, the second process that configuration works independently from each other;
Generally in the use process of database, in order to sufficiently use some database, generally all a point library can be selected to divide table, Such as oracle database, multiple points of libraries can be generally established, each there are different tables of data in point library, such as are established Divide library be DB_1, DB_2 ... DB_N.In the above scenario, it is pre-configured with data buffer storage corresponding with database, as in advance First configuration divides library corresponding data buffer storage with database, wherein the data buffer storage established can be Cache memory headroom, it can also To be data buffer storage file, this specification embodiment is not construed as limiting this.By taking data buffer storage file as an example, it is pre-configured with and data Library divides library corresponding data buffer storage file, i.e. File_1, File_2 ... File_N, and database divides library and data buffer storage file Corresponding relationship is as shown in Figure 2.
In addition, the first process and the second process that configuration works independently from each other, wherein the first process and the second process The step of execution, is as follows:
As shown in figure 3, the flow diagram of the method for writing data provided for this specification embodiment, this method can wrap Include following steps:
S301, the first process receive the write data requests that service server issues;
In the case where original service server and storage server are attached, such as service server and storage server In the case where A connection, the first process receives the write data requests that service server issues, wherein in synchronization, the first process Multiple write data requests can be received simultaneously, such as receive 20,000 write data requests.
S302 parses the data to be written carried in write data request;
For the received write data requests of institute in S301, the data to be written carried in write data requests are parsed.Generally write Request of data has fixed format, and position of the data to be written in write data requests is fixed, it is meant that write data requests Sender and recipient make an appointment stitching position of the data to be written in write data requests, and the sender of write data requests will Data to be written splice the designated position into write data requests, the spelling that the recipient of subsequent write data requests arranges according to both sides Position is connect, parses data to be written from the designated position in write data requests.For example, in the case where paying scene, data to be written It can be transaction data, transaction data can be transaction journal number, beneficiary ID, beneficiary account, paying party ID, paying party account Family, spending amount etc..
S303 judges whether the load of database is more than preset threshold value;
Generally with TPS come the data writing capability of measure database, it is meant that there are upper for the every second data writing of database Limit, for example, the TPS for clicking oracle is 10,000 or so, if the every second data writing of database is more than the upper limit, database is super negative Lotus operation, may cause database corruption, can not provide data write-in or reading service, it is therefore desirable to determine the load of database Situation judges whether the load of database is more than preset threshold value.
The TPS of different types of database is different, and threshold value can be set with reference to the type of the database of actual use It sets, such as by taking oracle database as an example, the TPS of oracle database is 10000, and threshold value then can be the write-in upper limit per second 10000 (threshold value being generally arranged can be slightly less than the TPS of database, such as 9500), accordingly judge database load whether More than preset threshold value, it can be and judge whether the every second data writing of current database is more than the preset write-in upper limit per second 10000, such as database is oracle, the current every second data writing of oracle database is 9000, oracle database TPS is 10000, it is evident that the load of database is less than preset threshold value.
S304, if so, storing the data to be written to the data buffer storage;
For the judging result in S303, if the load of database is more than preset threshold value, then it represents that database may be Overload operation needs the data to be written that script will be written to database temporarily to store to data buffer storage.
During wherein data to be written are temporarily stored to data buffer storage, such as database point library DB_1 to be written originally Data to be written, temporarily store to data buffer storage file File_1 corresponding with database point library DB_1, number to be written originally The data to be written for dividing library DB_2 according to library are temporarily stored to data buffer storage file File_2 corresponding with database point library DB_2, And so on.
It wherein stores to before data buffer storage being written into data, determines the corresponding type of service of write data requests, sentence Whether the disconnected corresponding type of service of write data requests meets default rule, if the load of database is more than preset threshold value and writes The corresponding type of service of request of data meets default rule, is written into data and temporarily stores to data buffer storage.Wherein it is worth It is noted that whether the load for judging database is more than preset threshold value and determines the corresponding type of service of write data requests, Judge whether the corresponding type of service of write data requests meets default rule, the two does not have strict sequence, can also be with It is to first carry out the former, then executes the latter, or first carry out the latter, then executes the former, or both and be performed simultaneously, this explanation Book is not construed as limiting this.
For the business of certain particular traffic types, can according to real-time (real-time indicate be business generate to Write-in data whether need that database is written in real time) divided rank, for the business of certain particular traffic types, generation it is to be written Enter data and need write-in database in real time, which can be divided into the first estate (highest priority), for certain The data to be written of the business of particular traffic type, generation do not have higher demand for real-time, can be by the type of service It is divided into the second grade (weak priority), and so on, it can divided rank according to actual needs.Therefore data are write in above-mentioned judgement Request whether corresponding type of service meets default rule, can be judge the corresponding type of service of write data requests whether The first estate or the second grade.
Database load be more than preset threshold value and data to be written without write-in database in real time in the case where, Data can be written into temporarily to store to data buffer storage.
In addition, indicating that database operates normally if the load of database is less than preset threshold value, then can be written into Data write direct database, it is not necessary to consider the factor of above-mentioned real-time.
S305, the second process determine the load state of database;
For the data to be written in data buffer storage, database can be written in idle, i.e. the load of database is less than Be written database in the case where preset threshold value, thus the second process it needs to be determined that database load state, it is specific to determine There are following manner for the load state of database:
One: the second process of mode judges whether the load of database is more than preset threshold value according to the preset period, with true Determine the load state of database.Such as second process it is primary every the judgement of 6 hours, to determine the load state of database.
Two: the second process of mode receives whether the load for database that the first process is sent is more than sentencing for preset threshold It is disconnected as a result, according to the first process judge database load whether be more than preset threshold as a result, load shape to determine database Condition.Such as first process judge that the load of database is less than preset threshold value, this result is sent to the second process, second into Journey receives judging result, determines that the load of database is less than preset threshold value.
S306 is read in the data buffer storage in the case where determining that the load of database is less than preset threshold value Database is written in read data to be written by data to be written.
For the load state of database identified in S305, preset threshold value is less than in the load for determining database In the case where, the data to be written in data buffer storage are read, it will be in the data to be written write-in database of reading.
Wherein during database is written in the data to be written that will read, such as from database caches file File_1 Data to be written are read, database corresponding with database caches file File_1 is written into the data to be written of reading and divides library DB_1 reads data to be written from database caches file File_2, data to be written write-in and database caches by reading The corresponding database of file File_2 divides library DB_2, and so on.
By the description of the above-mentioned technical solution provided this specification, under the premise of the configuration of original server, in advance Data buffer storage corresponding with database is configured, during data write-in, by judging the load state of database and sentencing Whether the disconnected corresponding type of service of write data requests meets default rule, to determine that data to be written write direct database, Still temporarily store to data buffer storage, it is subsequent in idle (in the case that the load of database is less than preset threshold value) by data Database is written in data to be written in caching.In this way, still can satisfy real-time friendship in the case where not increasing cost The demand that easy magnitude increasingly increases.
Relative to the technical solution of above-mentioned offer, this specification embodiment provides another technical solution, and the second process can To receive the data buffer storage data read command of user's input, i.e., triggered by artificial mode to be written in reading data buffer storage Enter data, database is written in the data to be written of reading by subsequent second process, slow as data corresponding with database are configured It deposits, the operation for configuring the first process and the execution of the first process is similar with above-mentioned technical proposal, and this is no longer going to repeat them.
Relative to above method embodiment, this specification embodiment also provides a kind of data transfer apparatus, as shown in figure 4, It may include: request receiving module 410, request analysis module 420, judgment module 430, data memory module 440, determining module 450, data read module 460, Data write. module 470.
Request receiving module 410 receives the write data requests that service server issues for the first process;
Request analysis module 420, for parsing the data to be written carried in write data request;
Judgment module 430, for judging whether the load of database is more than preset threshold value;
Data memory module 440, for if so, storing the data to be written to the data buffer storage;
Determining module 450 determines the load state of database for the second process;
Data read module 460, for reading institute in the case where determining that the load of database is less than preset threshold value State the data to be written in data buffer storage;
Data write. module 470, for database to be written in read data to be written.
According to a kind of specific embodiment that this specification provides, the data memory module 440 is specifically used for:
Determine that write data request corresponding type of service;
Judge that write data request whether corresponding type of service meets default rule;
If the load of database is more than that request corresponding type of service to meet preset for preset threshold value and write data Rule stores the data to be written to the data buffer storage.
According to a kind of specific embodiment that this specification provides, described device further include:
Writing module 480 directly writes the data to be written if the load for database is less than preset threshold value Enter database.
According to a kind of specific embodiment that this specification provides, the determining module 450 is specifically used for:
Second process judges whether the load of database is more than preset threshold value according to the preset period, to determine database Load state.
According to a kind of specific embodiment that this specification provides, the determining module 450 is specifically used for:
Second process receive the first process send for database load whether be more than preset threshold judging result, To determine the load state of database.
The function of modules and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus Realization process, details are not described herein.
By the description of the above-mentioned technical solution provided this specification, under the premise of the configuration of original server, in advance Data buffer storage corresponding with database is configured, during data write-in, by judging the load state of database and sentencing Whether the disconnected corresponding type of service of write data requests meets default rule, to determine that data to be written write direct database, Still temporarily store to data buffer storage, it is subsequent in idle (in the case that the load of database is less than preset threshold value) by data Database is written in data to be written in caching.In this way, still can satisfy real-time friendship in the case where not increasing cost The demand that easy magnitude increasingly increases.
This specification embodiment also provides a kind of computer equipment, as shown in figure 5, the equipment may include: processor 510, memory 520, input/output interface 530, communication interface 540 and bus 550.Wherein processor 510, memory 520, Input/output interface 530 and communication interface 540 pass through the communication connection between the realization of bus 550 inside equipment.
Processor 510 can use general CPU (Central Processing Unit, central processing unit), micro process Device, application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or one or The modes such as multiple integrated circuits are realized, for executing relative program, to realize technical solution provided by this specification embodiment.
Memory 520 can use ROM (Read Only Memory, read-only memory), RAM (Random Access Memory, random access memory), static storage device, the forms such as dynamic memory realize.Memory 520 can store Operating system and other applications are realizing technical solution provided by this specification embodiment by software or firmware When, relevant program code is stored in memory 520, and execution is called by processor 510.
Input/output interface 530 is for connecting input/output module, to realize information input and output.Input and output/ Module can be used as component Configuration (not shown) in a device, can also be external in equipment to provide corresponding function.Wherein Input equipment may include keyboard, mouse, touch screen, microphone, various kinds of sensors etc., output equipment may include display, Loudspeaker, vibrator, indicator light etc..
Communication interface 540 is used for connection communication module (not shown), to realize the communication of this equipment and other equipment Interaction.Wherein communication module can be realized by wired mode (such as USB, cable etc.) and be communicated, can also be wirelessly (such as mobile network, WIFI, bluetooth etc.) realizes communication.
Bus 550 includes an access, in various components (such as the processor 510, memory 520, input/output of equipment Interface 530 and communication interface 540) between transmit information.
It should be noted that although above equipment illustrates only processor 510, memory 520, input/output interface 530, communication interface 540 and bus 550, but in the specific implementation process, which can also include realizing to operate normally Necessary other assemblies.In addition, it will be appreciated by those skilled in the art that, it can also be only comprising realizing in above equipment Component necessary to this specification example scheme, without including all components shown in figure.
This specification embodiment also provides a kind of computer readable storage medium, is stored thereon with computer program, the journey Method for writing data above-mentioned is realized when sequence is executed by processor.This method includes at least:
A kind of method for writing data is pre-configured with data buffer storage corresponding with database, and configuration works independently from each other The first process, the second process, this method comprises:
First process receives the write data requests that service server issues;
The data to be written carried in parsing write data request;
Whether the load for judging database is more than preset threshold value;
If so, storing the data to be written to the data buffer storage;
Second process determines the load state of database;
In the case where determining that the load of database is less than preset threshold value, read to be written in the data buffer storage Database is written in read data to be written by data.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
As seen through the above description of the embodiments, those skilled in the art can be understood that this specification Embodiment can be realized by means of software and necessary general hardware platform.Based on this understanding, this specification is implemented Substantially the part that contributes to existing technology can be embodied in the form of software products the technical solution of example in other words, The computer software product can store in storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions are to make It is each to obtain computer equipment (can be personal computer, server or the network equipment etc.) execution this specification embodiment Method described in certain parts of a embodiment or embodiment.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity, Or it is realized by the product with certain function.A kind of typically to realize that equipment is computer, the concrete form of computer can To be personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play In device, navigation equipment, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment The combination of any several equipment.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device reality For applying example, since it is substantially similar to the method embodiment, so describing fairly simple, related place is referring to embodiment of the method Part explanation.The apparatus embodiments described above are merely exemplary, wherein described be used as separate part description Module may or may not be physically separated, can be each module when implementing this specification example scheme Function realize in the same or multiple software and or hardware.Can also select according to the actual needs part therein or Person's whole module achieves the purpose of the solution of this embodiment.Those of ordinary skill in the art are not the case where making the creative labor Under, it can it understands and implements.
The above is only the specific embodiment of this specification embodiment, it is noted that for the general of the art For logical technical staff, under the premise of not departing from this specification embodiment principle, several improvements and modifications can also be made, this A little improvements and modifications also should be regarded as the protection scope of this specification embodiment.

Claims (11)

1. a kind of method for writing data, it is pre-configured with data buffer storage corresponding with database, and configuration works independently from each other First process, the second process, this method comprises:
First process receives the write data requests that service server issues;
The data to be written carried in parsing write data request;
Whether the load for judging database is more than preset threshold value;
If so, storing the data to be written to the data buffer storage;
Second process determines the load state of database;
In the case where determining that the load of database is less than preset threshold value, the number to be written in the data buffer storage is read According to by read data write-in database to be written.
2. according to the method described in claim 1, described if so, storing the data to be written to the data buffer storage, packet It includes:
Determine that write data request corresponding type of service;
Judge that write data request whether corresponding type of service meets default rule;
If the load of database is more than preset threshold value and write data request corresponding type of service to meet default rule, The data to be written are stored to the data buffer storage.
3. according to the method described in claim 1, the method also includes:
If the load of database is less than preset threshold value, the data to be written are write direct into database.
4. according to the method described in claim 1, second process determines the load state of database, comprising:
Second process judges whether the load of database is more than preset threshold value according to the preset period, to determine the negative of database Load situation.
5. according to the method described in claim 1, second process determines the load state of database, comprising:
Second process receive the first process send for database load whether be more than preset threshold judging result, with true Determine the load state of database.
6. a kind of data transfer apparatus, it is pre-configured with data buffer storage corresponding with database, and configuration works independently from each other First process, the second process, the device include:
Request receiving module receives the write data requests that service server issues for the first process;
Request analysis module, for parsing the data to be written carried in write data request;
Judgment module, for judging whether the load of database is more than preset threshold value;
Data memory module, for if so, storing the data to be written to the data buffer storage;
Determining module determines the load state of database for the second process;
Data read module, for reading the data in the case where determining that the load of database is less than preset threshold value Data to be written in caching;
Data write. module, for database to be written in read data to be written.
7. device according to claim 6, the data memory module is specifically used for:
Determine that write data request corresponding type of service;
Judge that write data request whether corresponding type of service meets default rule;
If the load of database is more than preset threshold value and write data request corresponding type of service to meet default rule, The data to be written are stored to the data buffer storage.
8. device according to claim 6, described device further include:
The data to be written are write direct data if the load for database is less than preset threshold value by writing module Library.
9. device according to claim 6, the determining module is specifically used for:
Second process judges whether the load of database is more than preset threshold value according to the preset period, to determine the negative of database Load situation.
10. device according to claim 6, the determining module is specifically used for:
Second process receive the first process send for database load whether be more than preset threshold judging result, with true Determine the load state of database.
11. a kind of computer equipment including memory, processor and stores the meter that can be run on a memory and on a processor Calculation machine program, wherein the processor realizes such as method described in any one of claim 1 to 5 when executing described program.
CN201811009759.0A 2018-08-31 2018-08-31 Data writing method and device Active CN109359118B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201811009759.0A CN109359118B (en) 2018-08-31 2018-08-31 Data writing method and device
CN202110777407.5A CN113535721B (en) 2018-08-31 2018-08-31 Data writing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811009759.0A CN109359118B (en) 2018-08-31 2018-08-31 Data writing method and device

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202110777407.5A Division CN113535721B (en) 2018-08-31 2018-08-31 Data writing method and device

Publications (2)

Publication Number Publication Date
CN109359118A true CN109359118A (en) 2019-02-19
CN109359118B CN109359118B (en) 2021-06-01

Family

ID=65350375

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202110777407.5A Active CN113535721B (en) 2018-08-31 2018-08-31 Data writing method and device
CN201811009759.0A Active CN109359118B (en) 2018-08-31 2018-08-31 Data writing method and device

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202110777407.5A Active CN113535721B (en) 2018-08-31 2018-08-31 Data writing method and device

Country Status (1)

Country Link
CN (2) CN113535721B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111444225A (en) * 2020-03-27 2020-07-24 中国人民银行清算总中心 General index analysis method and device
CN111797089A (en) * 2019-04-09 2020-10-20 Oppo广东移动通信有限公司 Data writing method and device, storage medium and electronic equipment
CN112527809A (en) * 2020-12-10 2021-03-19 盛立金融软件开发(杭州)有限公司 Database data writing method, device, equipment and storage medium
CN113297232A (en) * 2020-07-31 2021-08-24 阿里巴巴集团控股有限公司 Data updating method, device and system based on database partition
CN113553372A (en) * 2020-04-26 2021-10-26 北京沃东天骏信息技术有限公司 Writing method and device for database, computing equipment and medium
CN113641709A (en) * 2021-08-11 2021-11-12 杭州安恒信息技术股份有限公司 Database data writing method, database data reading method and database
CN113835225A (en) * 2020-06-24 2021-12-24 宏碁股份有限公司 Head-mounted display device and image display method using same

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118332054A (en) * 2024-04-29 2024-07-12 深圳市路特创新科技有限公司 Real-time data warehouse management method and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1928872A (en) * 2005-09-09 2007-03-14 国际商业机器公司 Device and method for writing data into disc by dynamic switching
CN101799832A (en) * 2010-03-31 2010-08-11 山东高效能服务器和存储研究院 Method for rapidly writing mass data into database once
CN103870570A (en) * 2014-03-14 2014-06-18 广州携智信息科技有限公司 HBase (Hadoop database) data usability and durability method based on remote log backup
CN105760232A (en) * 2016-02-19 2016-07-13 四川长虹电器股份有限公司 Offline cache method and system for IOS application
CN105956063A (en) * 2016-04-27 2016-09-21 华自科技股份有限公司 Method and system for storing data of multiple detecting points
CN107357915A (en) * 2017-07-19 2017-11-17 郑州云海信息技术有限公司 A kind of date storage method and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631940B (en) * 2013-12-09 2017-02-08 中国联合网络通信集团有限公司 Data writing method and data writing system applied to HBASE database
CN105447136A (en) * 2015-11-20 2016-03-30 上海斐讯数据通信技术有限公司 Method and system for improving database writing speed on the basis of WiFi (Wireless Fidelity) smart socket
US10769123B2 (en) * 2016-09-30 2020-09-08 Microsoft Technology Licensing, Llc Workload-driven recommendations for Columnstore and Rowstore indexes in relational databases
CN107122457A (en) * 2017-04-26 2017-09-01 努比亚技术有限公司 Record the method and its device, computer-readable medium of networks congestion control data
CN107577810A (en) * 2017-09-27 2018-01-12 北京小米移动软件有限公司 Method for writing data, device and computer-readable recording medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1928872A (en) * 2005-09-09 2007-03-14 国际商业机器公司 Device and method for writing data into disc by dynamic switching
CN101799832A (en) * 2010-03-31 2010-08-11 山东高效能服务器和存储研究院 Method for rapidly writing mass data into database once
CN103870570A (en) * 2014-03-14 2014-06-18 广州携智信息科技有限公司 HBase (Hadoop database) data usability and durability method based on remote log backup
CN105760232A (en) * 2016-02-19 2016-07-13 四川长虹电器股份有限公司 Offline cache method and system for IOS application
CN105956063A (en) * 2016-04-27 2016-09-21 华自科技股份有限公司 Method and system for storing data of multiple detecting points
CN107357915A (en) * 2017-07-19 2017-11-17 郑州云海信息技术有限公司 A kind of date storage method and system

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111797089A (en) * 2019-04-09 2020-10-20 Oppo广东移动通信有限公司 Data writing method and device, storage medium and electronic equipment
CN111444225A (en) * 2020-03-27 2020-07-24 中国人民银行清算总中心 General index analysis method and device
CN111444225B (en) * 2020-03-27 2024-03-26 中国人民银行清算总中心 Universal index analysis method and device
CN113553372A (en) * 2020-04-26 2021-10-26 北京沃东天骏信息技术有限公司 Writing method and device for database, computing equipment and medium
CN113553372B (en) * 2020-04-26 2024-10-18 北京沃东天骏信息技术有限公司 Writing method and device for database, computing equipment and medium
CN113835225A (en) * 2020-06-24 2021-12-24 宏碁股份有限公司 Head-mounted display device and image display method using same
CN113835225B (en) * 2020-06-24 2023-08-08 宏碁股份有限公司 Head-mounted display device and picture display method using same
CN113297232A (en) * 2020-07-31 2021-08-24 阿里巴巴集团控股有限公司 Data updating method, device and system based on database partition
CN113297232B (en) * 2020-07-31 2024-03-01 阿里巴巴集团控股有限公司 Data updating method, device and system based on database partition
CN112527809A (en) * 2020-12-10 2021-03-19 盛立金融软件开发(杭州)有限公司 Database data writing method, device, equipment and storage medium
CN112527809B (en) * 2020-12-10 2023-10-27 盛立安元科技(杭州)股份有限公司 Database data writing method, device, equipment and storage medium
CN113641709A (en) * 2021-08-11 2021-11-12 杭州安恒信息技术股份有限公司 Database data writing method, database data reading method and database

Also Published As

Publication number Publication date
CN109359118B (en) 2021-06-01
CN113535721B (en) 2024-06-04
CN113535721A (en) 2021-10-22

Similar Documents

Publication Publication Date Title
CN109359118A (en) A kind of method for writing data and device
TWI743458B (en) Method, device and system for parallel execution of blockchain transactions
CN110046023B (en) Data processing method and system based on intelligent contract of block chain
CN109933404B (en) Encoding and decoding method and system based on block chain intelligent contract
CN110011785A (en) A kind of method and device that based on block chain structuring works deposit with card
CN110048846B (en) Signature verification method and system based on block chain intelligent contract
CN107861691B (en) Load balancing method and device of multi-control storage system
CN106899666A (en) A kind of data processing method and device for service identification
US11961039B2 (en) Linked blockchain structures for accelerated multi-chain verification
CN110362272A (en) A kind of block chain date storage method and device
CN109284301A (en) Verification of data method and device
CN111913807B (en) Event processing method, system and device based on multiple storage areas
CN110046991B (en) Data processing method and system based on intelligent contract of block chain
CN110020846A (en) A kind of transferred account service processing method and system
CN109509020A (en) A kind of discount coupon amount of money checking method and device
CN110046994A (en) A kind of method and system for accepting block chain and depositing card transaction
CN111506580B (en) Transaction storage method based on centralized block chain type account book
CN108459910A (en) A kind of method and apparatus for deleting resource
CN108763358A (en) A kind of data verification method and device
CN108694664A (en) Checking method and device, the electronic equipment of operation system
CN110347645A (en) A kind of electronic document deposits card method and device
CN110019538A (en) A kind of tables of data switching method and device
CN110347497A (en) A kind of method and device that multiple storage equipment are divided to equipment group
CN109271438A (en) A kind of data bank access method and its system
CN111464319B (en) Transaction storage and signature verification method based on centralized block chain type account book

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200928

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200928

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

GR01 Patent grant
GR01 Patent grant