CN107679088A - The file-type storage method and device of user behavior data - Google Patents
The file-type storage method and device of user behavior data Download PDFInfo
- Publication number
- CN107679088A CN107679088A CN201710787696.0A CN201710787696A CN107679088A CN 107679088 A CN107679088 A CN 107679088A CN 201710787696 A CN201710787696 A CN 201710787696A CN 107679088 A CN107679088 A CN 107679088A
- Authority
- CN
- China
- Prior art keywords
- data
- user
- user behavior
- behavior data
- save location
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1471—Saving, restoring, recovering or retrying involving logging of persistent data for recovery
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/13—File access structures, e.g. distributed indices
-
- 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/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Quality & Reliability (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention relates to the file-type storage method and device of a kind of user behavior data, methods described therein includes:While user journal data are read with single thread, qualified user behavior data is obtained;The user behavior data is write into internal memory;After the whole file where the user journal data, which is read, to be completed, each user behavior data write into Databasce by way of multithreading for will being preserved in the internal memory.Beneficial effects of the present invention are:User behavior data corresponding to being obtained while reading user journal data from disk, user behavior data is loaded into write-in internal memory, reading and write-in can simultaneously be carried out and completed by a thread, after the completion of the file analysis to a user journal data, the journey that bursts at the seams more to greatest extent is simultaneously preserved the user behavior data in internal memory to memory block using multithreading.
Description
Technical field
The present embodiments relate to the file-type storage of technical field of data processing, more particularly to a kind of user behavior data
Method and device.
Background technology
In Database Systems, log pattern includes log management module and journal file module, is carried out to daily record
During read-write operation, the existing practice of journal file module is that the logdata record of each daily record to daily record, data block is general
Disk Locality is written directly into, can so preserve file system structure, prevents from collapsing.
The problem of presently, there are is the journal file of the Disk Locality of write service device, may be included in one file
Tens thousand of user journal data, server read these journal files, it is necessary to read one by one, in the same of reading from disk
When obtain the user behavior data write-in internal memory needed, this process carries out with a thread.
In this process, the limitation in file processes to the disk input/output interface so as to the file
Write-in or read operation are restricted, and the cpu busy percentage of these servers is relatively low, when how to be lifted at the read-write of journal file
CPU utilization rate make it that maximum resource utilization is the problem of can solve the problem that there is presently no any of which or device.
The content of the invention
In order to overcome problem present in correlation technique, the present invention provides a kind of file-type storage side of user behavior data
Method and device, with realize the reading of behavioral data when reading daily record data and preserve by the thread progress of varying number with
Make maximum resource utilization and improve efficiency.
In a first aspect, the embodiments of the invention provide a kind of file-type storage method of user behavior data, methods described
Including:
While user journal data are read with single thread, qualified user behavior data is obtained;
The user behavior data is write into internal memory;
After the whole file where the user journal data, which is read, to be completed, each institute for will being preserved in the internal memory
State user behavior data write into Databasce by way of multithreading.
With reference on the other hand, in a kind of possible embodiment on the other hand, methods described also includes:
Obtain the first save location of the database and the second save location of the user journal data;
Detect first save location and whether second save location is identical;
When first save location is identical with second save location, it is different from first save location one
The 3rd save location create the database to preserve the user behavior data;
When first save location and second save location differ, institute is created in second save location
Database is stated to preserve the user behavior data.
With reference on the other hand, in a kind of possible embodiment on the other hand, every by what is preserved in the internal memory
One user behavior data by way of multithreading during write into Databasce, in addition to:
The operation of user journal data is read in pause, while is suspended in the disk to save location where user journal data
File analyzed;
The quantity for the multithreading that each user behavior data is preserved from the internal memory is promoted to limit quantity;
By the multithreading of the limit quantity rapidly by the user behavior data write into Databasce.
With reference on the other hand, in a kind of possible embodiment on the other hand, methods described also includes:
After the user behavior data write into Databasce, the database is backed up;
After respectively backuping to up to predetermined period, deletion action is carried out to each backup for reaching predetermined period.
With reference on the other hand, in a kind of possible embodiment on the other hand, the user journal data are with file
The disk of server is stored in for unit, each file is made up of a plurality of user journal data, when reading user journal data,
Read the user journal data every time in a manner of single thread.
Second aspect, present invention also offers a kind of file-type storage device of user behavior data, described device includes:
Acquisition module, for while user journal data are read with single thread, obtaining qualified user behavior
Data;
Writing module, for the user behavior data to be write into internal memory;
Preserving module, for when where the user journal data whole file read complete after, by the internal memory
Each user behavior data write into Databasce by way of multithreading of middle preservation.
Above-mentioned device, described device also include:
Save location acquisition module, obtain the database the first save location and the user journal data
Two save locations;
Whether detection module is identical for detecting first save location and second save location;
First creation module is different one for when first save location is identical with second save location
The database is created to preserve the user behavior data in the 3rd save location of first save location;
Second creation module, for when first save location and second save location differ, described
Second save location creates the database to preserve the user behavior data.
Above-mentioned device, the preserving module include:
Suspend module, the operation of user journal data is read for suspending, while suspend to being protected where user journal data
The file deposited in the disk of position is analyzed;
Thread increases module, for will preserve the quantity of the multithreading of each user behavior data from the internal memory
It is promoted to limit quantity;
The preserving module also includes:
No write de-lay submodule, rapidly the user behavior data is write for the multithreading by the limit quantity
Database.
Above-mentioned device, described device also include:
Backup module, for after the user behavior data write into Databasce, being backed up to the database;
Removing module, for after respectively backuping to up to predetermined period, deleting each backup for reaching predetermined period
Operation.
Above-mentioned device, the user journal data are stored in the disk of server in units of file, each file by
A plurality of user journal data composition, when reading user journal data, reads a user every time in a manner of single thread
Daily record data.
The method of the present invention, the disk of user journal data write service device in a manner of file, a file may wrap
Tens of thousands of user journal data down to hundreds of thousands bar are included, when the executive agent of the present invention reads the same of user journal data from disk
When, user behavior data corresponding to acquisition, user behavior data loading write-in internal memory, reading and write-in can simultaneously be carried out and led to
Cross thread to complete, and after the completion of a file is read, user's row corresponding to user journal data that this document includes
The internal memory is all stored in for data, now, the journeys that burst at the seams, and utilize multithreading by user's row in internal memory to greatest extent more
Preserved for data to memory block, in this way, user behavior data and user's day can be ensured by way of single thread when reading
Will data are read correspondingly and whole process does not malfunction, and then internal by multithreading after a file analysis is completed
User behavior data in depositing carries out rapid saving, maximally utilises cpu resource, reduces the wasting of resources.
It should be appreciated that the general description and following detailed description of the above are only exemplary and explanatory, not
Can the limitation present invention.
Brief description of the drawings
Accompanying drawing herein is merged in specification and forms the part of this specification, shows the implementation for meeting the present invention
Example, and for explaining principle of the invention together with specification.
Fig. 1 is a kind of flow of the file-type storage method of user behavior data according to an exemplary embodiment
Figure.
Flow chart when Fig. 2 is the save location detection according to an exemplary embodiment.
Flow chart when Fig. 3 is the log read pause according to an exemplary embodiment.
Fig. 4 is a kind of block diagram of the file-type storage device of user behavior data according to an exemplary embodiment.
Block diagram when Fig. 5 is the save location detection according to an exemplary embodiment.
Block diagram when Fig. 6 is the log read pause according to an exemplary embodiment.
Embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention, rather than limitation of the invention.It also should be noted that in order to just
Part related to the present invention rather than entire infrastructure are illustrate only in description, accompanying drawing.
It should be mentioned that some exemplary embodiments are described as before exemplary embodiment is discussed in greater detail
The processing described as flow chart or method.It is therein to be permitted although each step to be described as to the processing of order in flow chart
Multi-step can be implemented concurrently, concomitantly or simultaneously.In addition, the order of each step can be rearranged, when its operation
The processing can be terminated during completion, it is also possible to the other steps being not included in accompanying drawing.Processing can correspond to
In method, function, code, subroutine, subprogram etc..
The present invention relates to the file-type storage method and device of a kind of user behavior data, it mainly applies in server
User journal data need to read and user behavior data is needed in the scene that preserves, its basic thought is:Read from disk
User behavior data corresponding to being obtained while user journal data, user behavior data is loaded into write-in internal memory, reads and writes
Enter to carry out simultaneously and completed by a thread, after the completion of the file analysis to a user journal data, maximum limit
The journey that bursts at the seams simultaneously is preserved the user behavior data in internal memory to memory block using multithreading more on degree the ground, can not only be made when reading
Can be ensured by way of single thread user behavior data and user journal data read correspondingly and whole process not
Error, and then the user behavior data in internal memory is quickly protected by multithreading after a file analysis is completed
Deposit, maximally utilise cpu resource.
The present embodiment is applicable in the server with Users'Data Analysis module to carry out user behavior data storage
In the case of, this method can be performed by the central controller of server, and wherein the device can be by software and/or hardware
To realize, it can usually be integrated in server, as shown in figure 1, the text for user behavior data provided in an embodiment of the present invention
The flow chart of part formula storage method, methods described specifically comprise the following steps:
In step 110, while user journal data are read with single thread, qualified user behavior number is obtained
According to;
The method of the present invention, storage medium of the user journal data using file as unit write service device, Mei Yiwen
Part may include the user journal data of tens thousand of and hundreds thousand of and the above, and server is read one by one from its storage medium
User journal data, user behavior data corresponding to each user journal data, at least each institute are obtained while reading
State user journal data and accordingly preserve a user behavior data, or even tens so that the user journal of more than up to a hundred
Data, which are just corresponding with, preserves a user behavior data, therefore, the relation between user journal data and user behavior data
Can not be to correspond.
The user journal data are stored in the storage medium of server in units of file, and the storage medium can be magnetic
By the limitation of IO (input-output, input/output interface) between the middle control unit of disk, disk and server, therefore, right
The reading of user journal data is preferably read in a manner of single thread, and each file is made up of a plurality of user journal data,
When reading user journal data, the user journal data are read every time in a manner of single thread.
In the step 120, the user behavior data is write into internal memory;
The operational data for the temporary transient storage central control unit that the internal memory is used in server, and in time and storage medium
Such as hard disk external memory storage makees data exchange.
The user behavior data of acquisition is write into internal memory, can avoid the CPU of server will read one after another
The rule user behavior data got is respectively stored into the database of external memory storage.
In step 130, after the whole file where the user journal data, which is read, to be completed, by the internal memory
The each user behavior data write into Databasce by way of multithreading preserved.
Whole user journal data of one file all read and finished, then can now maximally utilise server
CPU all user behavior datas preserved in internal memory are preserved to external memory storage in a manner of multithreading, it is real
Now disposably all user behavior datas of user journal data acquisition corresponding to a file are preserved in a manner of file
To external memory storage.
The method of the present invention, the disk of user's daily record data write service device in a manner of file, a file can
Tens of thousands of user journal data down to hundreds of thousands bar can be included, when the executive agent of the present invention reads user journal data from disk
While, user behavior data corresponding to acquisition, user behavior data loading write-in internal memory, reading and write-in can be carried out simultaneously
And completed by thread, and after the completion of a file is read, the use corresponding to user journal data that this document includes
Family behavioral data is all stored in the internal memory, now, the journeys that burst at the seams, and utilize multithreading by the use in internal memory to greatest extent more
Family behavioral data is preserved to memory block, in this way, by way of single thread user behavior data can be ensured with using when reading
Family daily record data is read correspondingly and whole process does not malfunction, and then passes through multithreading after a file analysis is completed
Rapid saving is carried out to the user behavior data in internal memory, cpu resource is maximally utilised, reduces the wasting of resources.
In another implement scene of exemplary embodiment of the present, methods described also includes to the user journal number
According to this and user behavior data be stored in diverse location with avoid too much to same disk carry out it is erasable caused by hardware therefore
The situation of barrier occurs, as shown in Fig. 2 this process may include following steps:
In step 210, obtain the first save location of the database and the second of the user journal data protects
Deposit position;
First save location of the database, can be an external memory storage 1, the second of the user journal data protect
Deposit position, it can be external memory storage 2, when the external memory storage is a mechanical hard disk, the external memory storage 1 with
The external memory storage 2 can be the different subregions of the mechanical hard disk, different sectors, and it can also be different mechanical hard
Storage between disk, and the external memory storage can also be other types of storage medium, such as (ROM such as CDROM or
Semiconductor ROM) either magnetic recording media (such as floppy disk or hard disk).Further, storage medium can also be what can be transmitted
Carrier, such as electricity or optical signalling, it either optical cable or can pass through radio or other means and pass via cable
Pass.When program is embodied as such signal, carrier can be made up of such cable or device.
In a step 220, detect first save location and whether second save location is identical;
In step 230, when first save location is identical with second save location, it is different from one described
3rd save location of the first save location creates the database to preserve the user behavior data;
For example, when the preservation position in the disk 1 where the user journal data with the setting of the user behavior data
Put when being disk 1, now, the CPU of the server will select a new save location again, such as with outer
Portion memory CDROM etc. preserves the user behavior data.
In step 240, when first save location and second save location differ, protected described second
Deposit position and create the database to preserve the user behavior data.
When user journal data save location and user behavior data save location difference when, then can this first
Save location preserves the database for being used to store user behavior data.
The method of the present invention, by the detection to the user journal data and the save location of user behavior data,
So that the reading disk of user journal data and the preservation disk of user behavior data are stored in different storage mediums or deposited
The different zones of storage media so that originally avoid disk overheat etc. caused by being worked in same disk from influenceing digital independent or guarantor
The generation for the situation deposited, utilize the storage to user behavior data.
In another implement scene of exemplary embodiment of the present, in each use that will be preserved in the internal memory
Family behavioral data is by way of multithreading during write into Databasce, in addition to pausing operation, as shown in figure 3, this process can wrap
Include following steps:
In the step 310, the operation of user journal data is read in pause, while is suspended to being preserved where user journal data
File in the disk of position is analyzed;
In step 320, the quantity lifting of the multithreading of each user behavior data will be preserved from the internal memory
To limit quantity;
In a step 330, by the multithreading of the limit quantity rapidly by the user behavior data write into Databasce.
For example, the processing limit amount of CPU highest 8 threads of support when server, now, will open 8 threads
The operation write simultaneously to the user behavior data in the internal memory.
The method of the present invention, by writing data to the user behavior data in the internal memory with the multithreading of limit thread
Place storage medium so that whole ablation process is quick and precisely without error, and the contracting of the time to whole storing process
It is short to play a significant role.
In another implement scene of exemplary embodiment of the present, methods described also includes backup and deleted
Remove, to prevent the loss of user behavior data, this process may include:After the user behavior data write into Databasce,
The database is backed up;After respectively backuping to up to predetermined period, each backup for reaching predetermined period is deleted
Operation.
, can be to the text of the user behavior data after user behavior data is written in storage medium and preserves completion
Part or database are backed up, and backup file can be by user's unrestricted choice save location, and the save location can be external storage
Device or cloud storage space, in order to which user can be with after the database or file that preserve user behavior data are lost
Given for change from Backup Data.
, can be with during Backup Data reaches certain or after determining that Backup Data belongs to data out of date, hash
Selection deletes corresponding Backup Data from external memory storage or cloud storage space, to reduce the storage of Backup Data occupancy
Space.
The present invention method, by Backup Data and delete data operation user behavior data loss feelings
Under shape can also by backup give for change, and to expired Backup Data according to the date distance be optionally automatically deleted or
Cover the Backup Data stored at first automatically after memory space is used up, the security of the storage of user behavior data significantly carries
Rise.
Fig. 4 be a kind of user behavior data provided in an embodiment of the present invention file-type storage device signaling process figure/
Structural representation, the device can be realized by software and/or hardware, be usually integrated in server, can pass through user behavior number
According to file-type storage method realize.As illustrated, the present embodiment can be based on above-described embodiment, there is provided Yi Zhongyong
The file-type storage device of family behavioral data, it mainly includes acquisition module 410, writing module 420 and preserving module
430。
Acquisition module 410 therein, for while user journal data are read with single thread, obtaining qualified
User behavior data;
Writing module 420 therein, for the user behavior data to be write into internal memory;
Preserving module 430 therein, for after the whole file where the user journal data reads completion, inciting somebody to action
The each user behavior data write into Databasce by way of multithreading preserved in the internal memory.
In another implement scene of exemplary embodiment of the present, as shown in figure 5, described device also includes:
Save location acquisition module 510, obtain the first save location of the database and the user journal data
The second save location;
Whether detection module 520 is identical for detecting first save location and second save location;
First creation module 530, for when first save location is identical with second save location, one not
The 3rd save location for being same as first save location creates the database to preserve the user behavior data;
Second creation module 540, for when first save location and second save location differ, in institute
State the second save location and create the database to preserve the user behavior data.
In another implement scene of exemplary embodiment of the present, as shown in fig. 6, the preserving module 430 includes:
Suspend module 431, the operation of user journal data is read for suspending, while suspend to where user journal data
File in the disk of save location is analyzed;
Thread increases module 432, for will preserve the multithreading of each user behavior data from the internal memory
Quantity is promoted to limit quantity;
The preserving module 430 also includes:
No write de-lay submodule 433, for the multithreading by the limit quantity rapidly by the user behavior data
Write into Databasce.
In another implement scene of exemplary embodiment of the present, described device also includes:
Backup module, for after the user behavior data write into Databasce, being backed up to the database;
Removing module, for after respectively backuping to up to predetermined period, deleting each backup for reaching predetermined period
Operation.
In another implement scene of exemplary embodiment of the present, the user journal data are protected in units of file
The disk of server is stored in, each file is made up of a plurality of user journal data, when reading user journal data, with single thread
Mode every time read the user journal data.
There is provided in above-described embodiment each module between any two can be achieved communication connection, and each module can with platform
The communication of heart control device connects, the executable present invention of file-type storage device of the user behavior data provided in above-described embodiment
The file-type storage method of user behavior data provided in middle any embodiment, possess and perform the corresponding function mould of this method
Block and beneficial effect, the ins and outs not being described in detail in the above-described embodiments, reference can be made to being carried in any embodiment of the present invention
The file-type storage method of the user behavior data of confession.
It will be appreciated that the present invention also extends to the computer program for being suitable for putting the invention into practice, particularly
Computer program on carrier or in carrier.Program can be with source code, object code, code intermediate source and such as part volume
The form of the object code for the form translated, or with any other shape for being adapted to use in the realization according to the method for the present invention
Formula.Also it will be noted that, such program may have many different frame designs.For example, realize the side according to the present invention
Functional program code of method or system may be subdivided into one or more subroutine.
For that will be obvious for technical personnel in the functional many different modes of these subroutine intermediate distributions.
Subroutine can be collectively stored in an executable file, so as to form self-contained program.Such executable file can
With including computer executable instructions, such as processor instruction and/or interpreter instruction (for example, Java interpreter instruction).Can
Alternatively, one or more or all subroutines of subroutine may be stored at least one external library file, and
And statically or dynamically (such as at runtime) links with main program.Main program contains at least one in subroutine
At least one calling.Subroutine can also include to mutual function call.It is related to the embodiment bag of computer program product
Include the computer executable instructions corresponding at least one of illustrated method each step of the processing step of method.These refer to
Order can be subdivided into subroutine and/or be stored in one or more possible static or dynamic link file.
Another embodiment for being related to computer program product includes corresponding in illustrated system and/or product at least
The computer executable instructions of each device in the device of one.These instructions can be subdivided into subroutine and/or be stored
In one or more possible static or dynamic link file.
Should be noted that embodiment mentioned above is to illustrate the present invention, rather than the limitation present invention, and this
The technical staff in field can design many alternate embodiments, without departing from scope of the following claims.Weighing
During profit requires, any reference symbol being placed between round parentheses is not to be read as being limitations on claims.Verb " bag
Include " and its is paradigmatic using being not excluded for depositing for element in addition to those recorded in the claims or step
.Article " one " before element or "one" be not excluded for the presence of a plurality of such elements.The present invention can pass through
Include the hardware of several visibly different components, and realized by properly programmed computer.Enumerating several devices
In device claim, several in these devices can be embodied by the same item of hardware.In mutually different appurtenance
Profit states that the simple fact of some measures is not intended that the combination of these measures can not be used to benefit in requiring.
If desired, difference in functionality discussed herein can be performed with different order and/or performed simultaneously with one another.
In addition, if desired, one or more functions described above can be optional or can be combined.
If desired, each step is not limited to the execution sequence in each embodiment, different step as discussed above
It can be performed with different order and/or performed simultaneously with one another.In addition, in other embodiments, described above one or more
Individual step can be optional or can be combined.
Although various aspects of the invention provide in the independent claim, the other side of the present invention includes coming from
The feature of described embodiment and/or with independent claims feature dependent claims combination, and not only
It is the combination clearly provided in claim.
Although it is to be noted here that the foregoing describing the example embodiment of the present invention, these descriptions are not
It should be understood in a limiting sense.Will without departing from such as appended right on the contrary, several change and modifications can be carried out
The scope of the present invention defined in asking.
Will be appreciated by those skilled in the art that each module in the device of the embodiment of the present invention can use general meter
Device is calculated to realize, each module can be concentrated in the group of networks of single computing device or computing device composition, and the present invention is real
The method that the device in example corresponds in previous embodiment is applied, it can be realized by executable program code, can also be led to
The mode of integrated circuit combination is crossed to realize, therefore the invention is not limited in specific hardware or software and its combination.
Will be appreciated by those skilled in the art that each module in the device of the embodiment of the present invention can use general shifting
Dynamic terminal realizes that each module can be concentrated in the device combination of single mobile terminal or mobile terminal composition, the present invention
The method that device in embodiment corresponds in previous embodiment, it can be realized by editing executable program code,
It can be realized by way of integrated circuit combination, therefore the invention is not limited in specific hardware or software and its knot
Close.
Pay attention to, above are only the exemplary embodiment and institute's application technology principle of the present invention.Those skilled in the art can manage
Solution, the invention is not restricted to specific embodiment described here, can carry out various obvious changes for a person skilled in the art
Change, readjust and substitute without departing from protection scope of the present invention.Therefore, although being entered by above example to the present invention
Go and be described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept,
Other more equivalent embodiments can also be included, and the scope of the present invention is determined by scope of the appended claims.
Claims (10)
1. the file-type storage method of a kind of user behavior data, it is characterised in that methods described includes:
While user journal data are read with single thread, qualified user behavior data is obtained;
The user behavior data is write into internal memory;
After the whole file where the user journal data, which is read, to be completed, each use for will being preserved in the internal memory
Family behavioral data write into Databasce by way of multithreading.
2. according to the method for claim 1, it is characterised in that methods described also includes:
Obtain the first save location of the database and the second save location of the user journal data;
Detect first save location and whether second save location is identical;
When first save location is identical with second save location, it is different from the of first save location one
Three save locations create the database to preserve the user behavior data;
When first save location and second save location differ, the number is created in second save location
According to storehouse to preserve the user behavior data.
3. method according to claim 1 or 2, it is characterised in that in each user that will be preserved in the internal memory
Behavioral data by way of multithreading during write into Databasce, in addition to:
The operation of user journal data is read in pause, while suspends the text in the disk to save location where user journal data
Part is analyzed;
The quantity for the multithreading that each user behavior data is preserved from the internal memory is promoted to limit quantity;
By the multithreading of the limit quantity rapidly by the user behavior data write into Databasce.
4. according to the method for claim 1, it is characterised in that methods described also includes:
After the user behavior data write into Databasce, the database is backed up;
After respectively backuping to up to predetermined period, deletion action is carried out to each backup for reaching predetermined period.
5. according to the method for claim 1, it is characterised in that the user journal data are stored in clothes in units of file
The disk of business device, each file is made up of a plurality of user journal data, when reading user journal data, in a manner of single thread
The user journal data are read every time.
6. the file-type storage device of a kind of user behavior data, it is characterised in that described device includes:
Acquisition module, for while user journal data are read with single thread, obtaining qualified user behavior data;
Writing module, for the user behavior data to be write into internal memory;
Preserving module, for after the whole file where the user journal data reads completion, will be protected in the internal memory
The each user behavior data write into Databasce by way of multithreading deposited.
7. device according to claim 6, it is characterised in that described device also includes:
Save location acquisition module, obtains the first save location of the database and the second of the user journal data protects
Deposit position;
Whether detection module is identical for detecting first save location and second save location;
First creation module, for when first save location is identical with second save location, being different from institute one
The 3rd save location for stating the first save location creates the database to preserve the user behavior data;
Second creation module, for when first save location and second save location differ, described second
Save location creates the database to preserve the user behavior data.
8. the device according to claim 6 or 7, it is characterised in that the preserving module includes:
Suspend module, the operation of user journal data is read for suspending, while suspend to preserving position where user journal data
File in the disk put is analyzed;
Thread increases module, for the quantity that the multithreading of each user behavior data is preserved from the internal memory to be lifted
To limit quantity;
The preserving module also includes:
No write de-lay submodule, the user behavior data is rapidly write into data for the multithreading by the limit quantity
Storehouse.
9. device according to claim 6, it is characterised in that described device also includes:
Backup module, for after the user behavior data write into Databasce, being backed up to the database;
Removing module, for after respectively backuping to up to predetermined period, deletion action to be carried out to each backup for reaching predetermined period.
10. device according to claim 6, it is characterised in that the user journal data are stored in units of file
The disk of server, each file are made up of a plurality of user journal data, when reading user journal data, with the side of single thread
Formula reads the user journal data every time.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710787696.0A CN107679088A (en) | 2017-09-04 | 2017-09-04 | The file-type storage method and device of user behavior data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710787696.0A CN107679088A (en) | 2017-09-04 | 2017-09-04 | The file-type storage method and device of user behavior data |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107679088A true CN107679088A (en) | 2018-02-09 |
Family
ID=61134721
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710787696.0A Pending CN107679088A (en) | 2017-09-04 | 2017-09-04 | The file-type storage method and device of user behavior data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107679088A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111061690A (en) * | 2019-11-22 | 2020-04-24 | 武汉达梦数据库有限公司 | RAC-based database log file reading method and device |
CN112631733A (en) * | 2020-12-31 | 2021-04-09 | 中电长城网际安全技术研究院(北京)有限公司 | Data acquisition method and device |
CN115329391A (en) * | 2022-10-18 | 2022-11-11 | 成都卫士通信息产业股份有限公司 | Protection method, device, equipment and medium for text database |
-
2017
- 2017-09-04 CN CN201710787696.0A patent/CN107679088A/en active Pending
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111061690A (en) * | 2019-11-22 | 2020-04-24 | 武汉达梦数据库有限公司 | RAC-based database log file reading method and device |
CN111061690B (en) * | 2019-11-22 | 2023-08-22 | 武汉达梦数据库股份有限公司 | RAC-based database log file reading method and device |
CN112631733A (en) * | 2020-12-31 | 2021-04-09 | 中电长城网际安全技术研究院(北京)有限公司 | Data acquisition method and device |
CN112631733B (en) * | 2020-12-31 | 2024-01-02 | 中电长城网际安全技术研究院(北京)有限公司 | Data acquisition method and device |
CN115329391A (en) * | 2022-10-18 | 2022-11-11 | 成都卫士通信息产业股份有限公司 | Protection method, device, equipment and medium for text database |
CN115329391B (en) * | 2022-10-18 | 2023-01-24 | 成都卫士通信息产业股份有限公司 | Text database protection method, device, equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111625452A (en) | Flow playback method and system | |
KR101903926B1 (en) | Efficient query processing using histograms in a columnar database | |
US20150150138A1 (en) | Application monitoring through collective record and replay | |
CN108255429B (en) | Write operation control method, system, device and computer readable storage medium | |
JP2010541080A (en) | Service-oriented pipeline structure | |
CN108459962A (en) | Code specification detection method, device, terminal device and storage medium | |
CN107679088A (en) | The file-type storage method and device of user behavior data | |
CN110716714B (en) | Component creation method, device, computer system and computer readable storage medium | |
WO2019047442A1 (en) | Method and system for bypassing function call chain detection in ios application | |
CN115686932B (en) | Backup set file recovery method and device and computer equipment | |
CN111459948B (en) | Transaction integrity verification method based on centralized block chain type account book | |
US9804903B2 (en) | Data processing apparatus for pipeline execution acceleration and method thereof | |
CN104536892B (en) | A kind of software on-line debugging method and system | |
CN110020074A (en) | Determine the method and device of webpage turnover rate | |
CN112035156A (en) | E-commerce platform docking device, method, equipment and medium | |
CN105630526B (en) | The loading control method and device of script | |
US9262304B2 (en) | Methods and systems for testing interactions between mobile applications | |
CN115757639A (en) | Data source synchronization method and device, electronic equipment and storage medium | |
US9990274B2 (en) | Testing integrated business systems | |
CN106610833B (en) | Method and device for triggering overlapped HTML element mouse event | |
CN110221952B (en) | Service data processing method and device and service data processing system | |
Yamane et al. | Systematic analysis of micro dynamics in agent based simulation | |
US8977814B1 (en) | Information lifecycle management for binding content | |
CN106227839A (en) | The expansion method of a kind of lustre file system and device | |
CN105279122A (en) | XML-based data exchange system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20180209 |