CN108038171A - Method for writing data, device and data server - Google Patents
Method for writing data, device and data server Download PDFInfo
- Publication number
- CN108038171A CN108038171A CN201711284851.3A CN201711284851A CN108038171A CN 108038171 A CN108038171 A CN 108038171A CN 201711284851 A CN201711284851 A CN 201711284851A CN 108038171 A CN108038171 A CN 108038171A
- Authority
- CN
- China
- Prior art keywords
- data
- user terminal
- write
- user
- user behavior
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/26—Functional testing
- G06F11/263—Generation of test inputs, e.g. test vectors, patterns or sequences ; with adaptation of the tested hardware for testability with external testers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
Abstract
The present invention provides a kind of method for writing data, device and data server, the described method includes:The user behavior data that at least one user terminal is sent is received, and user behavior data is mapped in shared drive;Data merging is carried out to all user behavior datas in shared drive in preset time period, obtains the corresponding behavioral data situation of change of each user terminal;The data write-in pressure for storing database is detected, obtains the current write-in pressure condition of storage database;According to the current write-in pressure condition of storage database, and the behavioral data situation of change of each user terminal, distribute data for corresponding user terminal and write number;According to the corresponding data write-in number of each user terminal and preset rules, corresponding user behavior data in shared drive is written in storage database.The method can save the free memory of data server, alleviate the data storage pressure of database, improve data write efficiency.
Description
Technical field
The present invention relates to technical field of data storage, is taken in particular to a kind of method for writing data, device and data
Business device.
Background technology
Existing server, can root when the corresponding user behavior data of user is written in database to be stored
Write-in user behavior data is corresponded to according to the change frequency of user behavior data, i.e. how many time change of user behavior data, just needs
The behavioral data after how many times change is write, therefore in this case, the free memory of server can correspondingly subtract
Small, overall data write efficiency is not high, and the data storage pressure of database will greatly increase.
The content of the invention
In order to overcome above-mentioned deficiency of the prior art, it is an object of the invention to provide a kind of method for writing data, dress
Put and data server, the method for writing data can save the free memory of data server, alleviate database
Data store pressure, and correspondingly improve data write efficiency.
For method for writing data, preferred embodiments of the present invention provide a kind of method for writing data, and the method should
For the data server being connected with least one user terminal communication, the data server includes shared drive and storage number
According to storehouse, the described method includes:
Receive the user behavior data that at least one user terminal is sent, and by the corresponding user's row of each user terminal
It is mapped to for data in the shared drive;
All user behavior datas corresponding to each user terminal in the shared drive in preset time period carry out data
Merge, obtain behavioral data situation of change of each user terminal within the corresponding period;
The data write-in pressure of the storage database is detected, obtains the current write-in pressure of the storage database
Power situation;
According to the current write-in pressure condition of the storage database, and behavior of each user terminal in preset time period
Data situation, distributes data for corresponding user terminal and writes number;
According to the corresponding data write-in number of each user terminal and preset rules, by each user terminal in the shared drive
Corresponding user behavior data is written in the storage database.
For data transfer apparatus, preferred embodiments of the present invention provide a kind of data transfer apparatus, and described device should
For the data server being connected with least one user terminal communication, the data server includes shared drive and storage number
According to storehouse, described device includes:
Data mapping module, the user behavior data sent for receiving at least one user terminal, and by each use
Terminal corresponding user behavior data in family is mapped in the shared drive;
Data combiners block, for the corresponding all users of each user terminal in the shared drive in preset time period
Behavioral data carries out data merging, obtains behavioral data situation of change of each user terminal within the corresponding period;
Pressure detecting module, for being detected to the data write-in pressure of the storage database, obtains the storage
The current write-in pressure condition of database;
Number distribution module, for being existed according to the current write-in pressure condition of the storage database, and each user terminal
Behavioral data situation of change in preset time period, distributes data for corresponding user terminal and writes number;
Data write. module, will be described common for writing number and preset rules according to the corresponding data of each user terminal
The corresponding user behavior data of each user terminal in memory is enjoyed to be written in the storage database.
For data server, preferred embodiments of the present invention provide a kind of data server, the data server
Including:
Storage medium;
Processor;And
Data transfer apparatus, described device is stored in the storage medium and the software including being performed by the processor
Function module, the data server, which includes shared drive and storage database, described device, to be included:
Data mapping module, the user behavior data sent for receiving at least one user terminal, and each user is whole
Corresponding user behavior data is held to be mapped in the shared drive;
Data combiners block, for the corresponding all users of each user terminal in the shared drive in preset time period
Behavioral data carries out data merging, obtains behavioral data situation of change of each user terminal within the corresponding period;
Pressure detecting module, for being detected to the data write-in pressure of the storage database, obtains the storage
The current write-in pressure condition of database;
Number distribution module, for being existed according to the current write-in pressure condition of the storage database, and each user terminal
Behavioral data situation of change in preset time period, distributes data for corresponding user terminal and writes number;
Data write. module, will be described common for writing number and preset rules according to the corresponding data of each user terminal
The corresponding user behavior data of each user terminal in memory is enjoyed to be written in the storage database.
In terms of existing technologies, method for writing data, device and the data clothes that preferred embodiments of the present invention provide
Business device has the advantages that:The method for writing data can save the free memory of data server, alleviate number
Pressure is stored according to the data in storehouse, and correspondingly improves data write efficiency.The method is applied to and at least one user terminal
The data server of communication connection, the method is after the user behavior data that at least one user terminal is sent is received, meeting
The corresponding user behavior data of each user terminal is mapped in the shared drive of the data server;It is right that the method passes through
The corresponding all user behavior datas of each user terminal carry out data merging in the shared drive in preset time period, obtain each
Behavioral data situation of change of the user terminal within the corresponding period;The method is by writing the data of the data server
Enter pressure to be detected, obtain the current write-in pressure condition of the storage database;The method can be according to the storage number
According to the current write-in pressure condition in storehouse, and behavioral data situation of change of each user terminal in preset time period, for application
Family terminal distribution data write-in number, will be described common to write number and preset rules according to the corresponding data of each user terminal
Enjoy the corresponding user behavior data of each user terminal in memory to be written in the storage database, so that the data take
Device be engaged in the case where not losing data, free memory can be saved, alleviates the data storage pressure of storage database, subtracts
The data write-in number of small storage database, and correspondingly improve data write efficiency.
To enable the above objects, features and advantages of the present invention to become apparent, present pre-ferred embodiments cited below particularly,
And attached drawing appended by coordinating, it is described in detail below.
Brief description of the drawings
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached
Figure is briefly described, it will be appreciated that the following drawings illustrate only certain embodiments of the present invention, therefore be not construed as pair
The restriction of the claims in the present invention protection domain, for those of ordinary skill in the art, what is do not made the creative labor
Under the premise of, other relevant attached drawings can also be obtained according to these attached drawings.
Fig. 1 is that the data server that preferred embodiments of the present invention provide shows with interacting at least one user terminal communication
It is intended to.
Fig. 2 is the block diagram of the data server shown in Fig. 1 that preferred embodiments of the present invention provide.
Fig. 3 is the flow diagram for the method for writing data that preferred embodiments of the present invention provide.
Fig. 4 is the flow diagram for the sub-step that the step S320 shown in Fig. 3 includes.
Fig. 5 is the flow diagram for the sub-step that the step S330 shown in Fig. 3 includes.
Fig. 6 is the flow diagram for the sub-step that the step S350 shown in Fig. 3 includes.
Fig. 7 is the block diagram of the data transfer apparatus shown in Fig. 2.
Fig. 8 is the block diagram of the data combiners block shown in Fig. 7.
Fig. 9 is the block diagram of the pressure detecting module shown in Fig. 7.
Figure 10 is the block diagram of the Data write. module shown in Fig. 7.
Icon:10- data servers;20- user terminals;30- networks;100- data transfer apparatus;11- buses;At 12-
Manage device;13- storage mediums;14- bus interface;15- network adapter;16- user interfaces;110- data mapping modules;120-
Data combiners block;121- data extracting sub-modules;122- data divide submodule;123- data comparison sub-modules;130- is pressed
Power detection module;131- quantity detection sub-modules;132- ratio calculation submodules;133- multilevel iudge submodules;140- number
Distribution module;150- Data write. modules;151- data decimation submodules;152- data write submodule.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, the technical solution in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
Part of the embodiment of the present invention, instead of all the embodiments.The present invention implementation being usually described and illustrated herein in the accompanying drawings
The component of example can be arranged and designed with a variety of configurations.
Therefore, below the detailed description of the embodiment of the present invention to providing in the accompanying drawings be not intended to limit it is claimed
The scope of the present invention, but be merely representative of the present invention selected embodiment.Based on the embodiments of the present invention, this area is common
Technical staff's all other embodiments obtained without creative efforts, belong to the model that the present invention protects
Enclose.
It should be noted that:Similar label and letter represents similar terms in following attached drawing, therefore, once a certain Xiang Yi
It is defined, then it further need not be defined and explained in subsequent attached drawing in a attached drawing.
Below in conjunction with the accompanying drawings, elaborate to some embodiments of the present invention.In the case where there is no conflict, it is following
Feature in embodiment and embodiment can be mutually combined.
Fig. 1 is refer to, is data server 10 and at least one user terminal 20 that preferred embodiments of the present invention provide
The interaction schematic diagram of communication.In embodiments of the present invention, the data server 10 can by network 30 with it is at least one described
User terminal 20 communicates to connect, and the data interaction between the user terminal 20 is completed, to be sent to the user terminal 20
User behavior data carry out write efficiency it is high data write-in.In the present embodiment, the data server 10 can be, but
It is not limited to, cloud server, cluster server, distribution server etc.;The user terminal 20 may be, but not limited to, intelligence
Mobile phone, PC (personal computer, PC), tablet computer, personal digital assistant (personal digital
Assistant, PDA), mobile internet surfing equipment (mobile Internet device, MID) etc.;The network 30 can be, but
It is not limited to, cable network or wireless network.
Fig. 2 is refer to, is the square frame signal of the data server 10 shown in Fig. 1 of preferred embodiments of the present invention offer
Figure.In embodiments of the present invention, the data server 10 should be understood offer processing, data bank, the business of communications service
Point.For example, the data server 10 can refer to the single physics with related communication and data storage and document library facility
Processor, or it can refer to the aggregate of networking or the processor gathered, related network and storing unit, and to software and one
The application software for the service that a or multiple document library systems and support data server 10 are provided is operated.Data server
10 can be widely different in configuration or performance, but data server 10 can generally include one or more central processing lists
Member and storage unit.Data server 10 can also include one or more large-scale storage area equipment, one or more power supplys, one
A or multiple wired or wireless network components, one or more input output assemblies or one or more operating systems, such as,
Windows Server、Mac OS X、Unix、Linux、FreeBSD。
In the present embodiment, the data server 10 can make general bus architecture to realize by bus 11.
According to the concrete application of data server 10 and overall design constraints condition, the bus 11 can include any number of interconnection
Bus and bridge joint.The bus 11 is electrically connected to various together, these circuits include processor 12, storage medium 13 and total
Line interface 14.Alternatively, data server 10 can be connected the grade of network adapter 15 via bus 11 using bus interface 14.
Network adapter 15 can be used for the signal processing function for realizing physical layer in radio-based electronic devices, and realize that radio frequency is believed by antenna
Number send and receive.User interface 16 can connect outer access device, such as:Keyboard, display, mouse or control stick
Deng.Bus 11 can also connect various other circuits, such as timing source, ancillary equipment, voltage regulator or management circuit
Deng these circuits are known in the art, therefore are no longer described in detail.
Interchangeable, data server 10 may also be configured to generic processing system, such as be commonly referred to as chip, the general procedure
System includes:The one or more microprocessors of processing function are provided, and at least one of outer of storage medium 13 is provided
Portion's memory, it is all these all to be linked together by external bus architecture and other support circuits.
Interchangeable, data server 10 can be realized using following:With processor 12, bus interface 14, user
The ASIC (application-specific integrated circuit) of interface 16;And at least a portion of the storage medium 13 in one single chip is integrated in, alternatively,
Data server 10 can be realized using following:One or more FPGA (field programmable gate array), PLD are (programmable to patrol
Volume device), controller, state machine, gate logic, discrete hardware components, any other suitable circuit or be able to carry out this hair
Any combination of the circuit of bright various functions described in the whole text.
Wherein, processor 12 be responsible for bus 11 and general processing (including perform be stored in it is soft on storage medium 13
Part).Processor 12 can be realized using one or more general processors and/or application specific processor.The example of processor 12
Including microprocessor, microcontroller, dsp processor and the other circuits for being able to carry out software.Software should be construed broadly
To represent instruction, data or its any combination, regardless of whether being to call it as retouching for software, firmware, middleware, microcode, hardware
Predicate say or it is other.
Storage medium 13 is illustrated as separating with processor 12 in fig. 2, however, it will be readily understood by those of skill in the art,
Storage medium 13 or its arbitrary portion can be located at outside the data server 10.For example, storage medium 13 can include
Transmission line, the carrier waveform modulated with data, and/or the computer product that is separated with radio node, these media can be with
Accessed by processor 12 by bus interface 14.Alternatively, storage medium 13 or its arbitrary portion are desirably integrated into processing
In device 12, for example, it may be cache and/or general register.
In the present embodiment, data transfer apparatus 100, the data write-in dress can be stored with the storage medium 13
Put 100 to can be used in the case where the data server 10 does not lose data, storage can be used by saving the data server 10
Space, alleviates the data storage pressure of the data server 10, reduces corresponding data write-in number, and correspondingly improve number
According to write efficiency.Wherein, the data transfer apparatus 100 can be performed by the processor 12.
Fig. 3 is refer to, is the flow diagram for the method for writing data that preferred embodiments of the present invention provide.In the present invention
In embodiment, the method for writing data is applied to the data server 10 with the communication connection of at least one user terminal 20, institute
Stating data server 10 includes shared drive and storage database, wherein the shared drive and the storage database are arranged at
In the storage medium 13.The idiographic flow and step of the method for writing data shown in Fig. 3 are described in detail below.
In embodiments of the present invention, the method for writing data comprises the following steps:
Step S310, receives the user behavior data that at least one user terminal 20 is sent, and each user terminal 20 is right
The user behavior data answered is mapped in shared drive.
In the present embodiment, the shared drive is individually drawn for the data server 10 in the memory of storage medium 13
Separate, the user behavior data for being sent to each user terminal 20 carries out the memory space of mapping storage.The data clothes
Business device 10, can be by the user behavior data after the user behavior data that at least one user terminal 20 is sent is received
It is mapped in the shared drive, to ensure all user's rows that the data server 10 receives by the shared drive
It will not be lost for data.
Step S320, all user behavior numbers corresponding to each user terminal 20 in the shared drive in preset time period
According to data merging is carried out, behavioral data situation of change of each user terminal 20 within the corresponding period is obtained.
In the present embodiment, period of the preset time period between adjacent prefixed time interval, the data clothes
Business device 10 can complete the setting to the preset time period by way of being configured to prefixed time interval.
Alternatively, Fig. 4 is refer to, is the flow diagram for the sub-step that the step S320 shown in Fig. 3 includes.In this reality
Apply in example, the step S320 can include sub-step S321, sub-step S322 and sub-step S323, the sub-step S321,
Sub-step S322 and sub-step S323 are as follows:
Sub-step S321, carries the user behavior data that the shared drive is mapped in the preset time period
Take.
In the present embodiment, the data server 10 can pass through the user behavior data mapped in the shared drive
The mode that mapping time is read out, user behavior data in the preset time period is in from all users by mapping time
Extracted in behavioral data.
Sub-step S322, terminal recognition is carried out to each user behavior data extracted, and each user behavior data is drawn
Assign under corresponding user terminal 20.
In the present embodiment, the data server 10 is extracting all user's rows for being mapped in the preset time period
After data, each user behavior data extracted will be identified, so as to judge that each user behavior data is corresponding
User terminal 20, and the user behavior data of the same user terminal 20 of correspondence is divided into together.
Sub-step S323, arranges all user behavior datas of same user terminal 20 according to mapping sequencing
Sequence, and all user behavior datas are compared to each other, corresponding user terminal 20 is obtained in the preset time period
Behavioral data situation of change.
In the present embodiment, the behavioral data situation of change is each user behavior data of corresponding user terminal 20 in institute
Corresponding behavioral data change frequency in preset time period is stated, for example, the user behavior data of a user terminal 20 was at 5 minutes
In from 1 be changed into 10, then corresponding behavioral data change frequency is 9.
Referring once again to Fig. 3, step S330, the data write-in pressure for storing database is detected, obtains described deposit
Store up the current write-in pressure condition of database.
In the present embodiment, the storage database is used for certain user's behavioral data to being mapped in the shared drive
Write-in storage is carried out, so as to save the free memory of the data server 10, reduces depositing for the data server 10
Pressure is stored up, improves the data write efficiency of whole data writing process.
Alternatively, Fig. 5 is refer to, is the flow diagram for the sub-step that the step S330 shown in Fig. 3 includes.In this reality
Apply in example, the step S330 can include sub-step S331, sub-step S332 and sub-step S333, the sub-step S331,
Sub-step S332 and sub-step S333 are as follows:
Sub-step S331, to 20 corresponding user behavior data of each user terminal currently stored in the storage database
Amount is detected.
In the present embodiment, the data server 10 can be by the way of classification storage by the user of each user terminal 20
Behavioral data write-in storage is into the storage database.
Sub-step S332, the user behavior based on each user terminal 20 in the storage database and the shared drive
Data volume, is calculated user behavior data amount and the storage data that each user terminal 20 maps in preset time period
The data volume ratio between user behavior data amount in storehouse.
In the present embodiment, the data server 10 can obtain each user terminal 20 default at the shared drive
The user behavior data amount of mapping in period, can obtain the use of each write-in of user terminal 20 storage at the storage database
Family behavioral data amount, and correspond to by above two user behavior data amount to obtain the corresponding data volume of each user terminal 20
Ratio.
Sub-step S333, by the corresponding data volume ratio of each user terminal 20 respectively compared with default fractional threshold,
If more than then judging that the storage database is excessive to the write-in pressure of the user behavior data of corresponding user terminal 20.
Step S340, according to the current write-in pressure condition of the storage database, and each user terminal 20 is when default
Between behavioral data situation of change in section, distribute data for corresponding user terminal 20 and write number.
In the present embodiment, the write-in pressure condition current according to the storage database, and each user terminal 20
Behavioral data situation of change in preset time period, the step of data write number is distributed for corresponding user terminal 20, including:
If the storage database is excessive to the write-in pressure of the user behavior data of corresponding user terminal 20, according to institute
State behavioral data change frequency of the user terminal 20 in preset time period, and default write-in number allocation strategy, accordingly for
The user terminal 20 distributes the data write-in number of Corresponding matching.
Wherein, it is described it is default write-in number allocation strategy can be, by a number preset value respectively with each user terminal
The difference that 20 behavioral data change frequency is subtracted each other, the data write-in time of distribution is corresponded to as each user terminal 20
Number, for example, a number preset value is 100, the behavioral data change frequency of a user terminal 20 is 99, another user is whole
When the behavioral data change frequency at end 20 is 80, the data write-in number that previous user terminal 20 is assigned to is 1 time, latter user
The data write-in number that terminal 20 is assigned to is 20 times.The default write-in number allocation strategy can also be, by a ratio
The product value that preset value is multiplied with the behavioral data change frequency of each user terminal 20 respectively, as each user terminal 20
The data write-in number of corresponding distribution, for example, a number preset value is 0.5, the behavioral data change of a user terminal 20
Number is 10, when the behavioral data change frequency of another user terminal 20 is 14, data that previous user terminal 20 is assigned to
It is 5 times to write number, and the data write-in number that latter user terminal 20 is assigned to is 7 times.Wherein described default write-in number point
Different settings can be carried out according to demand with strategy.
Step S350, writes number and preset rules, by the shared drive according to each 20 corresponding data of user terminal
In each 20 corresponding user behavior data of user terminal be written to it is described storage database in.
In the present embodiment, the data server 10 is getting each 20 corresponding data of user terminal write-in number
Afterwards, each 20 corresponding user behavior data of user terminal write-in in the shared drive will be stored to described according to preset rules
Store in database, to realize that data write.
Alternatively, Fig. 6 is refer to, is the flow diagram for the sub-step that the step S350 shown in Fig. 3 includes.In this reality
Apply in example, the step S350 can include sub-step S351 and sub-step S352, the sub-step S351 and sub-step S352
It is as follows:
Sub-step S351, number and the number of each user terminal 20 are chosen according to preset rules are corresponding from the shared drive
According to the identical user behavior data of write-in number.
In the present embodiment, the preset rules can write number from the shared drive according to corresponding data
Middle corresponding user terminal 20 corresponds in all user behavior datas that preset time period internal sort has been got well and chooses average decile
User behavior data, for example, user behavior data of the user terminal 20 in preset time period changes to 100 by 1, and is somebody's turn to do
User terminal 20 is assigned to data write-in number when being 5, the corresponding user behavior data chosen would is that 20,40,60,80 and
100.The preset rules can also be that user terminal 20 is corresponded to from the shared drive according to corresponding data write-in number
It is corresponding to choose to number reciprocal and data write-in time in all user behavior datas that preset time period internal sort has been got well
The identical user behavior data of number, for example, user behavior data of the user terminal 20 in preset time period is changed to by 1
100, and the user's terminal 20 is assigned to data write-in number when being 5, the corresponding user behavior data chosen would is that 96,
97th, 98,99 and 100.Wherein described preset rules can carry out different settings according to demand.
Sub-step S352, the 20 corresponding user behavior data of each user terminal chosen is corresponded to and is written to the storage
In database.
In the present embodiment, the data server 10 can be according to same 20 times each user behaviors chosen of user terminal
The selection order of data, same 20 times user behavior datas chosen of user terminal are corresponded to be written to the storage number successively
According in storehouse.
Fig. 7 is refer to, is the block diagram of the data transfer apparatus 100 shown in Fig. 2.In embodiments of the present invention,
The data transfer apparatus 100 can include data mapping module 110, data combiners block 120, pressure detecting module 130, secondary
Number distribution module 140 and Data write. module 150.
The data mapping module 110, the user behavior data sent for receiving at least one user terminal 20, and will
Each 20 corresponding user behavior data of user terminal is mapped in shared drive.
In the present embodiment, the data mapping module 110 can perform the step S310 shown in Fig. 3, specifically hold
Row process can refer to above to the detailed description of step S310.
The data combiners block 120, for being corresponded to each user terminal 20 in the shared drive in preset time period
All user behavior datas carry out data merging, obtain behavioral data of each user terminal 20 within the corresponding period and change feelings
Condition.
In the present embodiment, the data combiners block 120 can perform the step S320 shown in Fig. 3, specifically hold
Row process can refer to above to the detailed description of step S320.
Alternatively, Fig. 8 is refer to, is the block diagram of the data combiners block 120 shown in Fig. 7.In the present embodiment
In, it is more sub that the data combiners block 120 can include data extracting sub-module 121, data division submodule 122 and data
Module 123.
The data extracting sub-module 121, for the user to being mapped to the shared drive in the preset time period
Behavioral data is extracted.
The data divide submodule 122, for carrying out terminal recognition to each user behavior data extracted, and will be each
User behavior data is divided under corresponding user terminal 20.
The data comparison sub-module 123, for all users according to mapping sequencing to same user terminal 20
Behavioral data is ranked up, and all user behavior datas are compared to each other, and obtains corresponding user terminal 20 in institute
State the behavioral data situation of change in preset time period.
Referring once again to Fig. 7, the pressure detecting module 130, for being carried out to the data write-in pressure for storing database
Detection, obtains the current write-in pressure condition of the storage database.
In the present embodiment, the pressure detecting module 130 can perform the step S330 shown in Fig. 3, specifically hold
Row process can refer to above to the detailed description of step S330.
Alternatively, Fig. 9 is refer to, is the block diagram of the pressure detecting module 130 shown in Fig. 7.In the present embodiment
In, the pressure detecting module 130 can include quantity detection sub-module 131, ratio calculation submodule 132 and multilevel iudge
Module 133.
The quantity detection sub-module 131, for right to each user terminal 20 currently stored in the storage database
The user behavior data amount answered is detected.
The ratio calculation submodule 132, for based on each user terminal 20 in the storage database and described shared
User behavior data amount in memory, is calculated the user behavior data that each user terminal 20 maps in preset time period
The data volume ratio between user behavior data amount in amount and the storage database.
The multilevel iudge submodule 133, for by the corresponding data volume ratio of each user terminal 20 respectively with default ratio
Value threshold value is compared, if more than the storage database writing to the user behavior data of corresponding user terminal 20 is then judged
It is excessive to enter pressure.
The number distribution module 140, for according to the current write-in pressure condition of the storage database, and each user
Behavioral data situation of change of the terminal 20 in preset time period, distributes data for corresponding user terminal 20 and writes number.
In the present embodiment, the number distribution module 140 can perform the step S340 shown in Fig. 3, specifically hold
Row process can refer to above to the detailed description of step S340.
The Data write. module 150, for writing number and preset rules according to each 20 corresponding data of user terminal,
Each 20 corresponding user behavior data of user terminal in the shared drive is written in the storage database.
Alternatively, Figure 10 is refer to, is the block diagram of the Data write. module 150 shown in Fig. 7.In the present embodiment
In, the Data write. module 150 can include data decimation submodule 151 and data write-in submodule 152.
The data decimation submodule 151, for according to preset rules from the shared drive it is corresponding choose number with
The data of each user terminal 20 write the identical user behavior data of number.
The data write submodule 152, for the 20 corresponding user behavior data pair of each user terminal that will be chosen
It should be written in the storage database.
In conclusion in the method for writing data, device and data server that preferred embodiments of the present invention provide, institute
The free memory of data server can be saved by stating method for writing data, alleviate the data storage pressure of database, and phase
Should ground raising data write efficiency.The method is applied to the data server being connected with least one user terminal communication, institute
Method is stated after the user behavior data that at least one user terminal is sent is received, can be by the corresponding user's row of each user terminal
It is mapped to for data in the shared drive of the data server;The method passes through to the shared drive in preset time period
In the corresponding all user behavior datas of each user terminal carry out data merging, obtain each user terminal within the corresponding period
Behavioral data situation of change;The method is detected by writing pressure to the data of the data server, is obtained described
Store the current write-in pressure condition of database;The method can store the current write-in pressure condition of database according to described,
And behavioral data situation of change of each user terminal in preset time period, distribute data for corresponding user terminal and write number,
It is to write number and preset rules according to the corresponding data of each user terminal, each user terminal in the shared drive is corresponding
User behavior data is written in the storage database, so that the data server is not losing the situation of data
Under, free memory can be saved, alleviates the data storage pressure of storage database, reduces the data write-in of storage database
Number, and correspondingly improve data write efficiency.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the invention, for the skill of this area
For art personnel, the invention may be variously modified and varied.Within the spirit and principles of the invention, that is made any repaiies
Change, equivalent substitution, improvement etc., should all be included in the protection scope of the present invention.
Claims (10)
1. a kind of method for writing data, it is characterised in that applied to the data service being connected with least one user terminal communication
Device, the data server include shared drive and storage database, the described method includes:
Receive the user behavior data that at least one user terminal is sent, and by the corresponding user behavior number of each user terminal
According to being mapped in the shared drive;
All user behavior datas corresponding to each user terminal in the shared drive in preset time period carry out data merging,
Obtain behavioral data situation of change of each user terminal within the corresponding period;
The data write-in pressure of the storage database is detected, obtains the current write-in pressure feelings of the storage database
Condition;
According to the current write-in pressure condition of the storage database, and behavioral data of each user terminal in preset time period
Situation of change, distributes data for corresponding user terminal and writes number;
According to the corresponding data write-in number of each user terminal and preset rules, each user terminal in the shared drive is corresponded to
User behavior data be written to it is described storage database in.
It is 2. according to the method described in claim 1, it is characterized in that, described to respectively being used in the shared drive in preset time period
Terminal corresponding all user behavior datas in family carry out data merging, obtain behavior number of each user terminal within the corresponding period
The step of according to situation of change, including:
The user behavior data that the shared drive is mapped in the preset time period is extracted;
Terminal recognition is carried out to each user behavior data extracted, and each user behavior data is divided into corresponding user terminal
Under;
All user behavior datas of same user terminal are ranked up according to mapping sequencing, and to all users
Behavioral data is compared to each other, and obtains corresponding behavioral data situation of change of the user terminal in the preset time period.
3. according to the method described in claim 1, it is characterized in that, it is described to it is described storage database data write pressure into
Row detection, the step of obtaining the storage database current write-in pressure condition, include:
The corresponding user behavior data amount of each user terminal currently stored in the storage database is detected;
User behavior data amount based on each user terminal in the storage database and the shared drive, is calculated every
The user behavior data amount that a user terminal maps in preset time period and the user behavior data in the storage database
Data volume ratio between amount;
By the corresponding data volume ratio of each user terminal respectively compared with default fractional threshold, if more than then described in judgement
The write-in pressure that database is stored to the user behavior data of corresponding user terminal is excessive.
4. the according to the method described in claim 3, it is characterized in that, write-in pressure current according to the storage database
Situation, and behavioral data situation of change of each user terminal in preset time period, data write-in is distributed for corresponding user terminal
The step of number, including:
If the storage database is excessive to the write-in pressure of the user behavior data of corresponding user terminal, according to the user
Behavioral data change frequency of the terminal in preset time period, and default write-in number allocation strategy, are accordingly the user
The data write-in number of terminal distribution Corresponding matching.
5. according to the method described in claim 1, it is characterized in that, described write number according to the corresponding data of each user terminal
And preset rules, the corresponding user behavior data of each user terminal in the shared drive is written in the storage database
The step of, including:
According to preset rules, corresponding selection number is identical with the data write-in number of each user terminal from the shared drive
User behavior data;
The corresponding user behavior data of each user terminal chosen is corresponded to and is written in the storage database.
6. a kind of data transfer apparatus, it is characterised in that applied to the data service being connected with least one user terminal communication
Device, the data server, which includes shared drive and storage database, described device, to be included:
Data mapping module, the user behavior data sent for receiving at least one user terminal, and each user is whole
Corresponding user behavior data is held to be mapped in the shared drive;
Data combiners block, for the corresponding all user behaviors of each user terminal in the shared drive in preset time period
Data carry out data merging, obtain behavioral data situation of change of each user terminal within the corresponding period;
Pressure detecting module, for being detected to the data write-in pressure of the storage database, obtains the storage data
The current write-in pressure condition in storehouse;
Number distribution module, for being preset according to the current write-in pressure condition of the storage database, and each user terminal
Behavioral data situation of change in period, distributes data for corresponding user terminal and writes number;
Data write. module, for that according to the corresponding data write-in number of each user terminal and preset rules, described will share interior
The corresponding user behavior data of each user terminal is deposited to be written in the storage database.
7. device according to claim 6, it is characterised in that the data combiners block includes:
Data extracting sub-module, for being carried out to the user behavior data that the shared drive is mapped in the preset time period
Extraction;
Data divide submodule, for carrying out terminal recognition to each user behavior data for extracting, and by each user behavior number
According to being divided under corresponding user terminal;
Data comparison sub-module, for being arranged according to mapping sequencing all user behavior datas of same user terminal
Sequence, and all user behavior datas are compared to each other, corresponding user terminal is obtained in the preset time period
Behavioral data situation of change.
8. device according to claim 6, it is characterised in that the pressure detecting module includes:
Quantity detection sub-module, for the corresponding user behavior number of each user terminal currently stored in the storage database
It is detected according to amount;
Ratio calculation submodule, for user's row based on each user terminal in the storage database and the shared drive
For data volume, user behavior data amount and the storage data that each user terminal maps in preset time period are calculated
The data volume ratio between user behavior data amount in storehouse;
Multilevel iudge submodule, for the corresponding data volume ratio of each user terminal to be compared with default fractional threshold respectively
Compared with if more than then judging that the storage database is excessive to the write-in pressure of the user behavior data of corresponding user terminal.
9. device according to claim 6, it is characterised in that the Data write. module includes:
Data decimation submodule, for choosing number and each user terminal according to preset rules are corresponding from the shared drive
The identical user behavior data of data write-in number;
Data write submodule, and described deposit is written to for the corresponding user behavior data of each user terminal chosen to be corresponded to
Store up in database.
10. a kind of data server, it is characterised in that the data server includes:
Storage medium;
Processor;And
Data transfer apparatus, described device is stored in the storage medium and the software function including being performed by the processor
Module, the data server, which includes shared drive and storage database, described device, to be included:
Data mapping module, the user behavior data sent for receiving at least one user terminal, and by each user terminal pair
The user behavior data answered is mapped in the shared drive;
Data combiners block, for the corresponding all user behaviors of each user terminal in the shared drive in preset time period
Data carry out data merging, obtain behavioral data situation of change of each user terminal within the corresponding period;
Pressure detecting module, for being detected to the data write-in pressure of the storage database, obtains the storage data
The current write-in pressure condition in storehouse;
Number distribution module, for being preset according to the current write-in pressure condition of the storage database, and each user terminal
Behavioral data situation of change in period, distributes data for corresponding user terminal and writes number;
Data write. module, for that according to the corresponding data write-in number of each user terminal and preset rules, described will share interior
The corresponding user behavior data of each user terminal is deposited to be written in the storage database.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711284851.3A CN108038171B (en) | 2017-12-07 | 2017-12-07 | Data writing method and device and data server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711284851.3A CN108038171B (en) | 2017-12-07 | 2017-12-07 | Data writing method and device and data server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108038171A true CN108038171A (en) | 2018-05-15 |
CN108038171B CN108038171B (en) | 2020-07-03 |
Family
ID=62096228
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711284851.3A Active CN108038171B (en) | 2017-12-07 | 2017-12-07 | Data writing method and device and data server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108038171B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110275882A (en) * | 2019-05-08 | 2019-09-24 | 平安科技(深圳)有限公司 | Method for writing data, system, device and readable storage medium storing program for executing based on HBASE |
CN113411503A (en) * | 2021-07-01 | 2021-09-17 | 上海卓易科技股份有限公司 | Cloud mobile phone camera preview method and device, computer equipment and storage medium |
WO2022151989A1 (en) * | 2021-01-14 | 2022-07-21 | 苏州浪潮智能科技有限公司 | Data i/o processing method and apparatus, storage medium, and device |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101719260A (en) * | 2009-12-01 | 2010-06-02 | 中国建设银行股份有限公司 | Data monitoring method, data monitoring system and monitoring service terminal |
CN102420814A (en) * | 2011-11-21 | 2012-04-18 | 航天科工深圳(集团)有限公司 | Data access method and device, and server |
CN102891873A (en) * | 2011-07-21 | 2013-01-23 | 腾讯科技(深圳)有限公司 | Method for storing log data and log data storage system |
CN103778041A (en) * | 2012-10-18 | 2014-05-07 | 腾讯科技(北京)有限公司 | Data monitoring method and device for internet |
CN105005617A (en) * | 2015-07-21 | 2015-10-28 | 领航动力信息系统有限公司 | Storage method and device of time sequence data |
CN105095240A (en) * | 2014-05-04 | 2015-11-25 | 中国银联股份有限公司 | Database data sample acquisition |
CN105589881A (en) * | 2014-10-23 | 2016-05-18 | 大唐软件技术股份有限公司 | Data processing method and device |
CN107229673A (en) * | 2017-04-20 | 2017-10-03 | 努比亚技术有限公司 | Method for writing data, Hbase terminals and the storage medium of Hbase databases |
-
2017
- 2017-12-07 CN CN201711284851.3A patent/CN108038171B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101719260A (en) * | 2009-12-01 | 2010-06-02 | 中国建设银行股份有限公司 | Data monitoring method, data monitoring system and monitoring service terminal |
CN102891873A (en) * | 2011-07-21 | 2013-01-23 | 腾讯科技(深圳)有限公司 | Method for storing log data and log data storage system |
CN102420814A (en) * | 2011-11-21 | 2012-04-18 | 航天科工深圳(集团)有限公司 | Data access method and device, and server |
CN103778041A (en) * | 2012-10-18 | 2014-05-07 | 腾讯科技(北京)有限公司 | Data monitoring method and device for internet |
CN105095240A (en) * | 2014-05-04 | 2015-11-25 | 中国银联股份有限公司 | Database data sample acquisition |
CN105589881A (en) * | 2014-10-23 | 2016-05-18 | 大唐软件技术股份有限公司 | Data processing method and device |
CN105005617A (en) * | 2015-07-21 | 2015-10-28 | 领航动力信息系统有限公司 | Storage method and device of time sequence data |
CN107229673A (en) * | 2017-04-20 | 2017-10-03 | 努比亚技术有限公司 | Method for writing data, Hbase terminals and the storage medium of Hbase databases |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110275882A (en) * | 2019-05-08 | 2019-09-24 | 平安科技(深圳)有限公司 | Method for writing data, system, device and readable storage medium storing program for executing based on HBASE |
WO2022151989A1 (en) * | 2021-01-14 | 2022-07-21 | 苏州浪潮智能科技有限公司 | Data i/o processing method and apparatus, storage medium, and device |
CN113411503A (en) * | 2021-07-01 | 2021-09-17 | 上海卓易科技股份有限公司 | Cloud mobile phone camera preview method and device, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN108038171B (en) | 2020-07-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110650347B (en) | Multimedia data processing method and device | |
US9280370B2 (en) | System structure management device, system structure management method, and program | |
CN106909333B (en) | Screen configuration method and device for display screen | |
CN108365967A (en) | Method, system, terminal and the computer readable storage medium of dynamic configuration communications parameter | |
CN108038171A (en) | Method for writing data, device and data server | |
CN105163135B (en) | Method for down loading, apparatus and system and the mobile terminal of Internet resources | |
CN110365536A (en) | A kind of the fault cues method and relevant apparatus of internet of things equipment | |
CN114244717B (en) | Configuration method and device of virtual network card resources, computer equipment and medium | |
CN107729570A (en) | Data migration method and device for server | |
CN106534281A (en) | Data request responding method, apparatus and system | |
CN110221822A (en) | Merging method, device, electronic equipment and the computer readable storage medium of special efficacy | |
CN108733787A (en) | Database operation method, device, electronic equipment and storage medium | |
US11036797B2 (en) | Efficient storage and utilization of a hierarchical data set | |
CN104267974B (en) | The call method and device of business interface | |
CN110300165A (en) | A kind of call method of function program, device, equipment and storage medium | |
CN108369538A (en) | Download vision assets | |
CN107506494B (en) | Document handling method, mobile terminal and computer readable storage medium | |
CN115665284A (en) | Message processing method and device based on distributed configuration center and computer equipment | |
CN108595211A (en) | Method and apparatus for output data | |
CN107423395A (en) | Navigation data processing system | |
CN110286981A (en) | The display methods and display system of the use state of virtual cloud desktop server | |
CN109165723A (en) | Method and apparatus for handling data | |
CN106067158B (en) | A kind of feature comparison method and device based on GPU | |
CN109542625A (en) | A kind of storage resource control method, device and electronic equipment | |
CN113254215B (en) | Data processing method and device, storage medium and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
EE01 | Entry into force of recordation of patent licensing contract | ||
EE01 | Entry into force of recordation of patent licensing contract |
Application publication date: 20180515 Assignee: Hangzhou spoon Network Technology Co., Ltd Assignor: Hangzhou dianhun Network Technology Co., Ltd Contract record no.: X2021330000727 Denomination of invention: Data writing method, device and data server Granted publication date: 20200703 License type: Common License Record date: 20211109 |