CN110020357A - Date storage method, device, storage medium and processor - Google Patents

Date storage method, device, storage medium and processor Download PDF

Info

Publication number
CN110020357A
CN110020357A CN201711048504.0A CN201711048504A CN110020357A CN 110020357 A CN110020357 A CN 110020357A CN 201711048504 A CN201711048504 A CN 201711048504A CN 110020357 A CN110020357 A CN 110020357A
Authority
CN
China
Prior art keywords
record
data
target
target data
classification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201711048504.0A
Other languages
Chinese (zh)
Other versions
CN110020357B (en
Inventor
杨孟娇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201711048504.0A priority Critical patent/CN110020357B/en
Publication of CN110020357A publication Critical patent/CN110020357A/en
Application granted granted Critical
Publication of CN110020357B publication Critical patent/CN110020357B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions

Abstract

The invention discloses a kind of date storage method, device, storage medium and processors, this method comprises: determining target data classification belonging to the target data in the text file wait store browser from least two preset data categories;Belong to the total number of the record of target data classification in inquiry this article this document;In the corresponding maximum limitation item number of total number miss the mark data category, is generated in this article this document and belong to target data classification and the target record for recording target data;When total number reaches the corresponding maximum of the target data classification and limits item number, from the record for belonging to the target data classification, determination currently meets the target record of replacement condition, and replaces the historical data in the target record using the target data.The more reasonable storage cookies data of browser may be implemented in this method, with reduce it is subsequent based on cookie data Website login when, due to the cookie data mistake of browser feedback, and cause to log in abnormal situation.

Description

Date storage method, device, storage medium and processor
Technical field
The present invention relates to technical field of data processing more particularly to a kind of date storage method, device, storage medium and places Manage device.
Background technique
After the server that user passes through browser Website login, the related information of user can be sent to clear by server Look at device, and by browser by the related information storage of user into the text file under some catalogue, this article this document is exactly popular The cookies of title.
However, the case where sharing a domain name presently, there are two or more websites, such as same enterprise or company can be with The domain name for two websites being had is set as same.And when two websites or multiple websites share a domain name, it is clear The related information of the two or more users can be considered that the data of the cookie of the same website are stored by device of looking at, this The log-on message of sample, multiple website can be stored in the same cookie file.When subsequent user logs in common domain again When some websites of name, browser can be using the user information of the last time storage as the information for logging in the website, and still, this is most Closely the user information that once stores, which is likely to be user and logs in user used by other websites under the domain name the last time, believes Breath, so that the cookie information that browser returns can not be parsed by website occur, or since the cookie that browser takes out believes Breath mismatches with website login information and leads to login failure.
Summary of the invention
In view of the above problems, overcome the above problem the present invention provides a kind of or at least be partially solved the above problem Date storage method, device, storage medium and processor.
In order to achieve the goal above, this application provides a kind of date storage methods, comprising:
From at least two preset data categories, the target data institute in the text file wait store browser is determined The target data classification of category, wherein at least two preset data categories characterize may store in the text file Data category;
Inquire the total number for belonging to the record of the target data classification in the text file;
When the total number is not up to the corresponding maximum of the target data classification and limits item number, in the text file Middle generation belongs to the target data classification and the target record for recording the target data;
When the total number reaches the corresponding maximum of the target data classification and limits item number, belong to the mesh from described In the record for marking data category, the target record for currently meeting replacement condition is determined, and using described in target data replacement Historical data in target record.
Preferably, before the item number for the record for belonging to the target data classification in the inquiry text file, Further include:
It inquires in the record for belonging to the target data classification in the text file, if exist and the target data In the identical record to be updated of critical data;
When there are the record to be updated, the data in the record to be updated are replaced using the target data.
Preferably, described generate in the text file belongs to the target data classification and for recording the target The target record of data, comprising:
The target record for recording the target data is generated in the text file, and raw for the target record At the record identification for marking the target data classification.
Preferably, before generating the record identification for marking the target data classification for the target record, further includes:
According to the total number, determine that the target record is the sequence valve in the record of the target data classification;
Correspondingly, generating the record identification for marking the target data classification for the target record, comprising:
The record identification comprising classification logotype and the sequence valve, the classification logotype table are generated for the target record It levies the target record and belongs to the target data classification.
Preferably, the total number of the record of the target data classification is belonged in the inquiry text file, comprising:
Successively at least one record identification of classification logotype of the inquiry comprising characterizing the target data classification, and will be described The maximum value for the sequence valve for including at least one record identification is determined to belong to total item of the record of the target data classification Number.
It preferably, include: the storage moment of the data stored in the record, Yi Jisuo in the record of the text file State one or both of the expired time of data stored in record;
The replacement condition includes any of the following or a variety of:
The data of storage are out of date;
The expired time of the data of storage is most short apart from current time;
The storage moment of the data of storage is apart from current time longest.
Another aspect, present invention also provides a kind of data storage devices, comprising:
Classification determination unit, for determining the text wait store browser from least two preset data categories Target data classification belonging to target data in file, wherein at least two preset data categories characterize the text The data category that may store in this document;
Item number query unit, for inquiring in the text file the total item for belonging to the record of the target data classification Number;
First storage unit, for being not up to the corresponding maximum limitation item number of the target data classification in the total number When, it is generated in the text file and belongs to the target data classification and the target record for recording the target data;
Second storage unit, for reaching the corresponding maximum limitation item number of the target data classification in the total number When, from the record for belonging to the target data classification, determine the target record for currently meeting replacement condition, and utilize institute It states target data and replaces historical data in the target record.
Preferably, further includes:
Record queries unit belongs to the target data for inquiring in the text file in the item number query unit Before the item number of the record of classification, inquire in the record for belonging to the target data classification in the text file, if exist Record to be updated identical with the critical data in the target data;
Third storage unit, for being replaced using the target data described to more when there are the record to be updated Data in new record.
Another aspect is stored with program on the storage medium present invention also provides a kind of storage medium, wherein in institute It states the equipment where controlling the storage medium when program operation and executes the as above any one date storage method.
Another aspect, present invention also provides a kind of processor, the processor is for running program, wherein the journey As above described in any item date storage methods are executed when sort run.
By above-mentioned technical proposal, the text file of browser can preset at least two kinds of data categories, in this way, After getting target data to be stored, target data classification belonging to the target data can determine whether, and according to the number of targets According in the corresponding maximum limitation item number of classification and this article this document the stored record for belonging to the target data classification it is total Item number is generated for recording the target record of the target data or determining from stored record the mesh for storage The target record of data is marked, the data of different data classification are subjected to classification storage to realize, in this way, subsequent browser can With according to the demand of login, from the record of multiple classifications, classification belonging to data needed for determining current log in, and from respective class The relevant log-on message of user is inquired in other record, and then can be reduced since browser obtains information errors, and leads to net The log-on message of browser return can not be parsed by standing, and cause to log in abnormal situation.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of flow diagram of date storage method one embodiment of the application;
Fig. 2 shows a kind of flow diagrams of another embodiment of date storage method of the application;
Fig. 3 shows a kind of composed structure schematic diagram of data storage device one embodiment of the application.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure It is fully disclosed to those skilled in the art.
The date storage method of the embodiment of the present application can apply in any terminal browser, e.g., mobile phone, plate electricity The browser of the terminals such as brain, computer, to pass through the storing data into the text file of browser of the browser in terminal.Its In, the text file of browser may be considered the cookies stored in browser.
Such as, referring to Fig. 1, it illustrates a kind of flow diagram of date storage method one embodiment of the application, this realities The method for applying example may include:
S101 determines the target in the text file wait store browser from least two preset data categories Target data classification belonging to data.
Wherein, which characterizes the data class that may store in the text file of the browser Not.Wherein, the text file of the browser refers to for text file set by the same domain name, correspondingly, this at least two Kind data category characterizes at least two data categories caused by the same domain name.It is understood that every kind of data category can Think data caused by a website under the domain name, data belonging to data caused by the different web sites under same domain name Classification is different.Correspondingly, can distinguish in the server of multiple websites of the same domain name preset respectively generated Data category corresponding to cookie data.
Such as, the data that browser may store in the cookie file for certain domain name can be divided into 3 classes, then illustrate Preset 3 kinds of data categories.And the mark of these three preset data categories is distinguished in corresponding three websites under the domain name, and e.g., net It stands 1 corresponding first data category, corresponding second data category in website 2, the corresponding third data category in website 3, in this way, working as When website 1 is that browser returns to the domain name corresponding cookie data, it may indicate that the data category of the cookie data is the One data category.
Wherein, data category can be set as needed, e.g., the data of character string forms in user data, as user name, Password etc. can be used as the first data category;And with data existing for array form in user data, e.g., comprising for accessing The array etc. of the mark of webpage and corresponding access duration, can be used as the second data category.
The data that may store in the text file of browser are divided into different classes of, are conducive to be set as needed not The corresponding data storage cap with data category, so that can more be stored in the text file of browser more crucial Data.
S102 is inquired in the text file of the browser in the record for belonging to the target data classification, if is existed and is somebody's turn to do The identical record to be updated of critical data in target data, if so, thening follow the steps S103;If not, thening follow the steps S104。
Wherein it is possible to all regard target data as critical data, some types in target data can also be chosen Data as critical data, e.g., will show the user name of user identity as critical data in data.
Wherein, for the ease of distinguishing, the data record identical with the critical data in the target data of storage will be present Record referred to as to be updated.If belonged in the record of the target data classification in the text file of browser, it is to be updated that there are this Record then illustrates before current time stored mistake target data or stored the data before the target data is updated Deng.
S103 replaces the data in the record to be updated using the target data when there are the record to be updated.
Wherein, replacing the data in the record to be updated using target data can be understood as deleting in the record to be updated The information stored before current time, and by target data storage into the record to be updated.
It is understood that therefore, it is necessary to protect since the newest target data got is comparatively important data The target data is deposited, and if there is the record to be updated, then illustrate that having passed through the record to be updated before current time deposits The target data or the relevant historical data of the target data are stored up, in that case, in order to enable the record to be updated In can store newest data, then the historical data stored in the record to be updated can be deleted, and target data is deposited It stores up in the record to be updated.
It illustrates, it is assumed that target data is the relevant user data that user is " Zhang San ", if belonging to the target data It is stored with the record of " Zhang San " in the record of classification, then the record is determined as record to be updated.In that case, then " Zhang San " that records before in the record to be updated and relevant character string are deleted, and are stored as the target data.
It is understood that the cookies data as caused by user not homogeneous debarkation net station are likely to be identical, Therefore, target data be possible to should before the information that stores in the record to be updated it is identical, in that case, updating should be to After more new record, the expired time of data in the record to be updated can be changed, to avoid due to storing in record to be updated Data it is expired, and target data can not be deleted.
It should be noted that above step S102 and step S103 holds just for the sake of avoiding relevant information from repeating storage Capable operation, do not consider cookies store same data related data repetition storage in the case where, can not also execute with Upper step S102 and S103.
S104 inquires the total number for belonging to the record of the target data classification in this article this document.
That is, inquiry will be stored in text file, and belong to the total number of the target data classification.
It is understood that inquiry belongs to the item number of the record of the target data classification from the text file of browser Mode can there are many, e.g., in the text file of browser by the record storage of different data classification text entry not When in memory space, then the item number recorded in the memory space of the target data classification can be traversed.
Optionally, in practical applications, it can be generated for every record and record corresponding data category for identifying this Record identification can determine the record for belonging to the target data classification by record identification, to obtain total item of this kind of record Number.Such as, it can be used for distinguishing this in the record name of every record and record corresponding data category, for example, in the record of record It include the mark of characterize data classification in title, in this way, the record name recorded by each item can be determined in each record The data category of the data of storage.
For example, being directed to different data classification, different classification logotypes is allocated in advance, it is assumed that primary sources classification Classification logotype is U, and the classification logotype of secondary sources classification is A, and may include classification in the record name of every record Mark, it is assumed that the data stored in certain record belong to primary sources classification, then can wrap in the record name of this record Containing " U ".For example, i.e. record name is U+ title using classification logotype as the prefix or suffix of record name;Or title+U. Assuming that the record name of certain record is Uuser1, then this can be determined according to first letter (i.e. prefix) in the record name The record name of item record.
Further, some data category is corresponding in the text file in order to more easily count the browser Record total number, each item can also be marked to record corresponding sequence valve in record identification, successively given birth in this article this document At each item record record identification in sequence valve be since 1 ing, up to sequence valve reaches the category and records corresponding maximum Number is limited, so that sequence valve included in the record identification of each record is continuous numerical value.Certainly, which can be with Characterize the time sequencing of record generation.
For example, by taking sequence valve of the title of record in the data category belonging to classification logotype and the record forms as an example It is illustrated, then title=classification logotype+the sequence valve or sequence valve+classification logotype recorded.For example, to belong to classification mark For record of the knowledge for the data category of U, it is assumed that the maximum limitation item number of the data category is 10 in text file, then belongs to class Not Biao Shi the title of record of data category of U at most may include: U1, U2, U3U10, this 10 records Title, and in practical applications, in this article this document before current time in the record name of the last record generated What sequence valve can characterize that the last time in text file generates be recorded as belonging in the record of the data category which. It, can be with if be currently generated the record for belonging to classification logotype U for example, it is assumed that there are U1, U2 two records in text file The record is named as U3.
As it can be seen that including sequence valve in the record identification (e.g., record name) of record, and the sequence valve recorded can characterize this In all records of data category belonging to being recorded in the case where genesis sequence sequence, can successively it inquire comprising characterizing the target At least one record identification of the classification logotype of data category, and most by the sequence valve for including at least one record identification Big value is determined to belong to the total number of the record of the target data classification.
S105, when the total number is not up to the corresponding maximum of the target data classification and limits item number, in this article this document Middle generation belongs to the target data classification and the target record for recording the target data.
Wherein, it for the ease of distinguishing with other records, is used for generation to store number of targets in the embodiment of the present application According to record be known as target record.
It is understood that when the total number does not reach maximum limitation item number, then in the text file that illustrates browser It still can store the record for belonging to the data of the target data classification, in that case, can be generated in this article this document The target record of the target data is stored, and the target record belongs to the target data classification.
Wherein, the target record that generation belongs to the target data classification, which can be, to be labeled as the target record to belong to the mesh Mark data category.
In a kind of optional embodiment, the target for recording the target data can be generated in this article this document While record, the record identification for marking the target data classification is generated for the target record.The concrete form of the record identification It may refer to the related introduction of preceding embodiment, e.g., the record name that can be generated for target record, and in the record name Record identification comprising characterizing the target data classification, specifically may refer to the related introduction of front.
Further, in order to subsequent after generating the target record, convenient for counting the note for belonging to the target data classification The total number of record, generate the target record record identification before, can also according to the total number determined in step S104, Determine sequence valve of the target record in the record of the target data classification.Wherein, which can add 1 for total number, Such as, which is 5, then the sequence valve is 6.Certainly, have in the record that the total number is the target data classification suitable When the maximum value of sequence value, determine that the corresponding sequence valve of the target record is similarly the maximum value and adds 1.
Correspondingly, the record identification comprising classification logotype and the sequence valve, category mark can be generated for target record Know the characterization target record and belongs to the target data classification.For example, the classification logotype of target record is U, and the sequence valve is 6, then the record identification generated for the target record can be U6.
Correspondingly, if browser gets the data for belonging to the target data classification again after generating target record Later, if necessary to the item number of the record for belonging to the target data classification stored in determining text file, then root can be inquired According to the record identification that each item records, all records for belonging to the target data classification are determined, and inquire from all records The maximum value for the sequence valve for including in record identification, that is, the corresponding sequence valve of record identification for inquiring target record is maximum, then Sequence valve in the record identification of the target record can be determined as currently belonging to all records of the target data classification The numerical value of total number.
S106 is subordinated to target data when the total number reaches the corresponding maximum of the target data classification and limits item number In the record of classification, determination currently meets the target record of replacement condition, and is replaced in the target record using the target data Historical data.
It is understood that if the total number inquired reaches the corresponding maximum limitation item number of the target data classification, The item number for the record of the target data classification that then illustrates that is stored in the text file of the browser belong to has arrived at maximum value, The record for belonging to the target data classification can not be increased newly again.In that case, then it needs stored from text file Belong in the record of the target data classification, determines the target record for needing to be replaced, and delete and remember in the target record The historical data of record, and by target data storage into the target record.
Due to meet replacement condition be recorded as determining record the record of the target data for replacing with, The record for meeting replacement condition is also referred to as target record in the embodiment of the present application.
It is understood that the replacement condition can be set as needed.Such as, which can be the data of storage Storage time longest.
Optionally, the data for including the storage moment of data stored in record in record and being stored in the record One or both of expired time.For example, the form of record can be with are as follows: " the bit string of storage;The expired time of setting ", In that case, the replacement condition may include it is following any one or more:
The data of storage are out of date;
The expired time of the data of storage is most short apart from current time;
The storage moment of the data of storage is apart from current time longest.
For example, it is assumed that the record for belonging to target category data includes U1, U2 ... U10, and wherein records and stored in U1 , then can be using record U1 as target record when data have arrived at the expired time of setting, and the information that will be stored in U1 String replaces with the target data, while updating the expired time being arranged in the U1.
To sum up, in the embodiment of the present application, can be with preset at least two data category in the text file of browser, this Sample can determine whether target data classification belonging to the target data, and according to the mesh after getting target data to be stored Mark the stored record for belonging to the target data classification in the corresponding maximum limitation item number of data category and this article this document Total number, generate for recording the target record of the target data or determining from stored record for storage The data of different data classification are carried out classification storage to realize by the target record of the target data.In this way, subsequent browsing Device can be according to the demand of login, from the record of multiple classifications, classification belonging to data needed for determining current log in, and from phase It answers and inquires the relevant log-on message of user in the record of classification, and then it is wrong to reduce the data returned due to browser to website Accidentally, lead to the situation of website log exception.
Meanwhile in the embodiment of the present application, it is provided with different classes of corresponding maximum limitation item number, thereby may be ensured that every The data of kind of data category can be stored into the cookie file of browser, avoid due to generated under same domain name one Class data storage capacity is excessive, and the case where cause the data of other classifications under the domain name that can not store.Further, according to data The significance level of classification, setting different data classification correspond to different maximum limitation item numbers, also help so that significant data class The item number of other record is more than the item number of relatively unessential record, is conducive to the memory space of reasonable distribution text file.
In order to make it easy to understand, below to be stored with the record of two class data categories in the text file of browser, it is such as a kind of The classification logotype of data category is A (hereinafter referred to as data category A), and corresponding maximum limitation item number is 20;And another kind of number Classification logotype according to classification is U (hereinafter referred to as data category U), and corresponding maximum limit for item number is 10 is introduced, And assume that the data category of target data currently to be stored is the data category that classification logotype is U, meanwhile, with the text of browser The record name of the record of each data category is situated between for being the sequence valve by classification logotype plus the record in this document It continues.
Such as, referring to fig. 2, it illustrates a kind of flow diagrams of another embodiment of date storage method of the application, originally The method of embodiment may include:
S201, based in preset data category A and data category U, browser determines number of targets currently to be stored According to belonging to data category U;
For example, it is assumed that there are two websites for corresponding domain name setting, then in the two websites caused by a website The data category of cookie data is data category U, and the data category for the cookie data that another website generates is data Classification A.If the website of target data to be stored from corresponding data classification U that browser is currently got, browser It can determine that data category belonging to the target data is data category U.
S202 is inquired in the text file of the browser in the record for belonging to data category U, if is existed and the target The identical record to be updated of critical data in data, if so, thening follow the steps S203;If not, thening follow the steps 204.
S203 replaces the data in the record to be updated using the target data when there are the record to be updated.
Step S202 and step S203 may refer to the related introduction of preceding embodiment, and details are not described herein.
S204 successively traverses the record name for belonging to the record of data category U in the text file of the browser, and determines The maximum value is determined as belonging to the data category in current this article this document by the maximum value for the sequence valve for including in record name The total number of the record of U.
Wherein, the record name of record can be " U+ sequence valve ", for example, it is assumed that certain is recorded as text and belongs in this document First record of data category U, then the title of the record can be U1, and what is generated after U1 belongs to data category U Record when, the title of the record can be U (1+1), i.e. U2, correspondingly, next generated after U2 belongs to the data Classification U's is recorded as U3, and so on, until what is generated is recorded as U10.It follows that if current time, the text In file, belong in the record of data category U, if record U6 in sequence valve 6 be each record name in sequence valve most Big value, then it is 6 that explanation, which belongs to the total number of the record of data category U,.
S205 is generated in this article this document when the total number of data category U is not up to 10 and is belonged to the data class Other U and the target record for being used to record the target data, and add 1 to be used as the target record corresponding target sequences the total number Value generates the record name comprising U and target sequences value for the target record.
Such as, it is assumed that traversing out before is U6 comprising the maximum record name of sequence valve, is less than 10 due to 6, then in text The record for storing target data is generated in this document, and the sequence valve in the record name of the newly-generated record is arranged For 6+1, the record name for obtaining the newly-generated record is U7.
S206 is subordinated in the record of data category U when the total number reaches 10, is determined out of date or expired Time gap current time nearest target record, and the historical data in the target record is replaced using the target data.
Such as, it is assumed that sequence valve is maximum in text file is recorded as U10, then illustrates to belong to data category U in text file Item number reach maximum item number, the record for belonging to data category U can not be increased newly again, in that case, can inquire and whether deposit In expired record;If there is no the record nearest apart from current time with the presence or absence of expired time can also be inquired, for example, Assuming that the target record inquired is U8, then the data recorded before in U8 are deleted, and by target data record into U8.
It is understood that in the embodiment of the present application, after browser stores target data into target record, If browser detects logging request, the website logged in can be requested according to logging request, determines the corresponding number in the website It according to classification, and is subordinated in the record of the corresponding data category in the website, obtains user information needed for logging in the website.
A kind of date storage method of corresponding the application, the embodiment of the present application also provides a kind of data storage devices.
Such as, referring to Fig. 3, it illustrates a kind of composed structure schematic diagram of data storage device one embodiment of the application, The data storage device of the present embodiment may include:
Classification determination unit 301, for determining the text wait store browser from least two preset data categories Target data classification belonging to target data in this document, wherein described in the preset at least two data categories characterization The data category that may store in text file;
Item number query unit 302, for inquire in the text file belong to the target data classification record it is total Item number;
First storage unit 303, for being not up to the corresponding maximum limitation of the target data classification in the total number When item number, is generated in the text file and belong to the target data classification and the target note for recording the target data Record;
Second storage unit 304, for reaching the corresponding maximum limitation item of the target data classification in the total number When number, from the record for belonging to the target data classification, determination currently meets the target record of replacement condition, and utilizes The target data replaces the historical data in the target record.
In one implementation, described device can also include:
Record queries unit 305 belongs to the target for inquiring in the text file in the item number query unit Before the item number of the record of data category, inquire in the record for belonging to the target data classification in the text file, if In the presence of record to be updated identical with the critical data in the target data;
Third storage unit 306, for when there are the record to be updated, using the target data replace it is described to Data in more new record.
In one implementation, first storage unit includes:
First storing sub-units, for being not up to the corresponding maximum limitation item of the target data classification in the total number When number, the target record for recording the target data is generated in the text file, and generate for the target record Mark the record identification of the target data classification.
Further, described device further include:
Sequence valve determination unit, for being that the target record generates the label target in first storing sub-units Before the record identification of data category, according to the total number, determine that the target record is in the target data classification Sequence valve in record;
Correspondingly, first storing sub-units are generating the note for marking the target data classification for the target record When record mark, it is specifically used for, generates the record identification comprising classification logotype and the sequence valve for the target record, it is described Classification logotype characterizes the target record and belongs to the target data classification.
In one implementation, the item number query unit, comprising:
Item number inquires subelement, for successively inquiring at least one of the classification logotype comprising characterizing the target data classification A record identification, and the maximum value for the sequence valve for including at least one described record identification is determined to belong to the number of targets According to the total number of the record of classification.
It include: to be stored in the record in the record of the text file in the embodiment of one device of any of the above Data the storage moment and the record in one or both of the expired time of data that stores;
The replacement condition in second storage unit includes any of the following or a variety of:
The data of storage are out of date;
The expired time of the data of storage is most short apart from current time;
The storage moment of the data of storage is apart from current time longest.
The data storage device includes processor and memory, above-mentioned classification determination unit, item number query unit unit, First storage unit and the second storage unit etc. store in memory as program unit, are stored in by processor execution Above procedure unit in reservoir realizes corresponding function.
Include kernel in processor, is gone in memory to transfer corresponding program unit by kernel.Kernel can be set one Or more, the more reasonable storage cookies data of browser are realized by adjusting kernel parameter, to reduce subsequent be based on When cookie data Website login, due to the cookie data mistake of browser feedback, and cause to log in abnormal situation.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/ Or the forms such as Nonvolatile memory, if read-only memory (ROM) or flash memory (flash RAM), memory include that at least one is deposited Store up chip.
The embodiment of the invention provides a kind of storage mediums, are stored thereon with program, wherein running time control in described program Equipment where making the storage medium executes the date storage method as described in any one embodiment.
The embodiment of the invention provides a kind of processor, the processor is for running program, wherein described program operation Date storage method described in Shi Zhihang any one embodiment as above.
The embodiment of the invention provides a kind of equipment, equipment include processor, memory and storage on a memory and can The program run on a processor, processor perform the steps of when executing program
From at least two preset data categories, the target data institute in the text file wait store browser is determined The target data classification of category, wherein at least two preset data categories characterize may store in the text file Data category;
Inquire the total number for belonging to the record of the target data classification in the text file;
When the total number is not up to the corresponding maximum of the target data classification and limits item number, in the text file Middle generation belongs to the target data classification and the target record for recording the target data;
When the total number reaches the corresponding maximum of the target data classification and limits item number, belong to the mesh from described In the record for marking data category, the target record for currently meeting replacement condition is determined, and using described in target data replacement Historical data in target record.
Wherein, before the item number for the record for belonging to the target data classification in the inquiry text file, also Include:
It inquires in the record for belonging to the target data classification in the text file, if exist and the target data In the identical record to be updated of critical data;
When there are the record to be updated, the data in the record to be updated are replaced using the target data.
Wherein, described generate in the text file belongs to the target data classification and for recording the number of targets According to target record, comprising:
The target record for recording the target data is generated in the text file, and raw for the target record At the record identification for marking the target data classification.
Wherein, before generating the record identification for marking the target data classification for the target record, further includes:
According to the total number, determine that the target record is the sequence valve in the record of the target data classification;
Correspondingly, generating the record identification for marking the target data classification for the target record, comprising:
The record identification comprising classification logotype and the sequence valve, the classification logotype table are generated for the target record It levies the target record and belongs to the target data classification.
Wherein, the total number of the record of the target data classification is belonged in the inquiry text file, comprising:
Successively at least one record identification of classification logotype of the inquiry comprising characterizing the target data classification, and will be described The maximum value for the sequence valve for including at least one record identification is determined to belong to total item of the record of the target data classification Number.
It wherein, include: storage moment of the data stored in the record in the record of the text file and described One or both of expired time of data stored in record;
The replacement condition includes any of the following or a variety of:
The data of storage are out of date;
The expired time of the data of storage is most short apart from current time;
The storage moment of the data of storage is apart from current time longest.Equipment herein can be server, PC, PAD, Mobile phone etc..
Present invention also provides a kind of computer program products, when executing on data processing equipment, are adapted for carrying out just The program of beginningization there are as below methods step:
From at least two preset data categories, the target data institute in the text file wait store browser is determined The target data classification of category, wherein at least two preset data categories characterize may store in the text file Data category;
Inquire the total number for belonging to the record of the target data classification in the text file;
When the total number is not up to the corresponding maximum of the target data classification and limits item number, in the text file Middle generation belongs to the target data classification and the target record for recording the target data;
When the total number reaches the corresponding maximum of the target data classification and limits item number, belong to the mesh from described In the record for marking data category, the target record for currently meeting replacement condition is determined, and using described in target data replacement Historical data in target record.
Wherein, before the item number for the record for belonging to the target data classification in the inquiry text file, also Include:
It inquires in the record for belonging to the target data classification in the text file, if exist and the target data In the identical record to be updated of critical data;
When there are the record to be updated, the data in the record to be updated are replaced using the target data.
Wherein, described generate in the text file belongs to the target data classification and for recording the number of targets According to target record, comprising:
The target record for recording the target data is generated in the text file, and raw for the target record At the record identification for marking the target data classification.
Wherein, before generating the record identification for marking the target data classification for the target record, further includes:
According to the total number, determine that the target record is the sequence valve in the record of the target data classification;
Correspondingly, generating the record identification for marking the target data classification for the target record, comprising:
The record identification comprising classification logotype and the sequence valve, the classification logotype table are generated for the target record It levies the target record and belongs to the target data classification.
Wherein, the total number of the record of the target data classification is belonged in the inquiry text file, comprising:
Successively at least one record identification of classification logotype of the inquiry comprising characterizing the target data classification, and will be described The maximum value for the sequence valve for including at least one record identification is determined to belong to total item of the record of the target data classification Number.
It wherein, include: storage moment of the data stored in the record in the record of the text file and described One or both of expired time of data stored in record;
The replacement condition includes any of the following or a variety of:
The data of storage are out of date;
The expired time of the data of storage is most short apart from current time;
The storage moment of the data of storage is apart from current time longest.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/ Or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable Jie The example of matter.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including element There is also other identical elements in process, method, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can provide as method, system or computer program product. Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application Form.It is deposited moreover, the application can be used to can be used in the computer that one or more wherein includes computer usable program code The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) Formula.
The above is only embodiments herein, are not intended to limit this application.To those skilled in the art, Various changes and changes are possible in this application.It is all within the spirit and principles of the present application made by any modification, equivalent replacement, Improve etc., it should be included within the scope of the claims of this application.

Claims (10)

1. a kind of date storage method characterized by comprising
From at least two preset data categories, determine belonging to the target data in the text file wait store browser Target data classification, wherein at least two preset data categories characterize the data that may store in the text file Classification;
Inquire the total number for belonging to the record of the target data classification in the text file;
It is raw in the text file when the total number is not up to the corresponding maximum of the target data classification and limits item number Target record at the target data classification is belonged to and for recording the target data;
When the total number reaches the corresponding maximum of the target data classification and limits item number, belong to the number of targets from described According in the record of classification, determination currently meets the target record of replacement condition, and replaces the target using the target data Historical data in record.
2. date storage method according to claim 1, which is characterized in that belong in the inquiry text file Before the item number of the record of the target data classification, further includes:
Inquire in the record for belonging to the target data classification in the text file, if exist in the target data The identical record to be updated of critical data;
When there are the record to be updated, the data in the record to be updated are replaced using the target data.
3. date storage method according to claim 1, which is characterized in that described generate in the text file belongs to The target data classification and the target record for being used to record the target data, comprising:
The target record for recording the target data is generated in the text file, and generates mark for the target record Remember the record identification of the target data classification.
4. date storage method according to claim 3, which is characterized in that generated described in label for the target record Before the record identification of target data classification, further includes:
According to the total number, determine that the target record is the sequence valve in the record of the target data classification;
Correspondingly, generating the record identification for marking the target data classification for the target record, comprising:
The record identification comprising classification logotype and the sequence valve is generated for the target record, the classification logotype characterizes institute It states target record and belongs to the target data classification.
5. date storage method according to claim 4, which is characterized in that belong to institute in the inquiry text file State the total number of the record of target data classification, comprising:
Successively at least one record identification of classification logotype of the inquiry comprising characterizing the target data classification, and by described at least The maximum value for the sequence valve for including in one record identification is determined to belong to the total number of the record of the target data classification.
6. date storage method according to claim 1, which is characterized in that include: institute in the record of the text file State one of expired time of data stored in the storage moment and the record of the data stored in record or two Kind;
The replacement condition includes any of the following or a variety of:
The data of storage are out of date;
The expired time of the data of storage is most short apart from current time;
The storage moment of the data of storage is apart from current time longest.
7. a kind of data storage device characterized by comprising
Classification determination unit, for determining the text file wait store browser from least two preset data categories In target data belonging to target data classification, wherein preset at least two data categories characterize the text text The data category that may store in part;
Item number query unit, for inquiring in the text file total number for belonging to the record of the target data classification;
First storage unit, for when the total number is not up to the corresponding maximum limitation item number of the target data classification, It is generated in the text file and belongs to the target data classification and the target record for recording the target data;
Second storage unit, for when the total number reaches the corresponding maximum limitation item number of the target data classification, from In the record for belonging to the target data classification, the target record for currently meeting replacement condition is determined, and utilize the mesh Mark data replace the historical data in the target record.
8. data storage device according to claim 7, which is characterized in that further include:
Record queries unit belongs to the target data classification for inquiring in the text file in the item number query unit Record item number before, inquire in the record for belonging to the target data classification in the text file, if exist and institute State the identical record to be updated of critical data in target data;
Third storage unit, for replacing the note to be updated using the target data when there are the record to be updated Data in record.
9. a kind of storage medium, which is characterized in that program is stored on the storage medium, wherein running time control in described program Equipment where making the storage medium executes any one of the claim 1-6 as above date storage method.
10. a kind of processor, which is characterized in that the processor is for running program, wherein executed such as when described program is run Upper date storage method described in any one of claims 1-6.
CN201711048504.0A 2017-10-31 2017-10-31 Data storage method, data storage device, storage medium and processor Active CN110020357B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711048504.0A CN110020357B (en) 2017-10-31 2017-10-31 Data storage method, data storage device, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711048504.0A CN110020357B (en) 2017-10-31 2017-10-31 Data storage method, data storage device, storage medium and processor

Publications (2)

Publication Number Publication Date
CN110020357A true CN110020357A (en) 2019-07-16
CN110020357B CN110020357B (en) 2021-08-24

Family

ID=67186722

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711048504.0A Active CN110020357B (en) 2017-10-31 2017-10-31 Data storage method, data storage device, storage medium and processor

Country Status (1)

Country Link
CN (1) CN110020357B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102799634A (en) * 2012-06-26 2012-11-28 中国农业银行股份有限公司 Data storage method and device
CN102915373A (en) * 2012-11-06 2013-02-06 无锡江南计算技术研究所 Data storage method and device
CN103425663A (en) * 2012-05-16 2013-12-04 中兴通讯股份有限公司 Method and device for creating tables, saving records and deleting records for embedded system database
US20150058330A1 (en) * 2013-08-01 2015-02-26 Go Daddy Operating Company, LLC Methods and systems for recommending packages of domain names for registration
CN105718515A (en) * 2016-01-14 2016-06-29 神策网络科技(北京)有限公司 Data storage system and method and data analysis system and method
CN106657044A (en) * 2016-12-12 2017-05-10 杭州电子科技大学 Webpage address hopping method for improving security defense of website system
CN106685973A (en) * 2016-12-30 2017-05-17 东软集团股份有限公司 Method and device for remembering log in information, log in control method and device
US20170278015A1 (en) * 2016-03-24 2017-09-28 Accenture Global Solutions Limited Self-learning log classification system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103425663A (en) * 2012-05-16 2013-12-04 中兴通讯股份有限公司 Method and device for creating tables, saving records and deleting records for embedded system database
CN102799634A (en) * 2012-06-26 2012-11-28 中国农业银行股份有限公司 Data storage method and device
CN102915373A (en) * 2012-11-06 2013-02-06 无锡江南计算技术研究所 Data storage method and device
US20150058330A1 (en) * 2013-08-01 2015-02-26 Go Daddy Operating Company, LLC Methods and systems for recommending packages of domain names for registration
CN105718515A (en) * 2016-01-14 2016-06-29 神策网络科技(北京)有限公司 Data storage system and method and data analysis system and method
US20170278015A1 (en) * 2016-03-24 2017-09-28 Accenture Global Solutions Limited Self-learning log classification system
CN106657044A (en) * 2016-12-12 2017-05-10 杭州电子科技大学 Webpage address hopping method for improving security defense of website system
CN106685973A (en) * 2016-12-30 2017-05-17 东软集团股份有限公司 Method and device for remembering log in information, log in control method and device

Also Published As

Publication number Publication date
CN110020357B (en) 2021-08-24

Similar Documents

Publication Publication Date Title
CN106980669B (en) A kind of storage of data, acquisition methods and device
CN105144142B (en) Use the information storage object of the multiple dimensions of object
US11481227B2 (en) Efficient sharing of artifacts between collaboration applications
CN105144159A (en) HIVE table links
CN105677904B (en) Small documents storage method and device based on distributed file system
CN107870802B (en) Virtual machine migration method and device
Zhang et al. A method to predict the performance and storage of executing contract for ethereum consortium-blockchain
CN106033461A (en) Sensitive information query method and apparatus
US20190362016A1 (en) Frequent pattern analysis for distributed systems
CN109657427A (en) The method and device of permission control
CN104461826A (en) Object flow monitoring method, device and system
CN106649602A (en) Way, device and server of processing business object data
CN110147203A (en) A kind of file management method, device, electronic equipment and storage medium
CN110019111A (en) Data processing method, device, storage medium and processor
CN108154024A (en) A kind of data retrieval method, device and electronic equipment
CN107515807A (en) A kind of method and device for storing monitoring data
CN106570005A (en) Database cleaning method and device
US10152477B2 (en) Communication method and system for accessing media data
CN105279166A (en) File management method and system
CN111131474A (en) Method, device and medium for managing user protocol based on block chain
CN106603727A (en) Method and device for integrating and accessing system data
CN110020357A (en) Date storage method, device, storage medium and processor
CN109684381A (en) Data hot statistics method and device
EP2819028A2 (en) Content management system
CN110866380A (en) Method and terminal for filling in information field content

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
CB02 Change of applicant information

Address after: 100080 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Beijing city Haidian District Shuangyushu Area No. 76 Zhichun Road cuigongfandian 8 layer A

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant