CN107741962A - Data cache method and server - Google Patents

Data cache method and server Download PDF

Info

Publication number
CN107741962A
CN107741962A CN201710880106.9A CN201710880106A CN107741962A CN 107741962 A CN107741962 A CN 107741962A CN 201710880106 A CN201710880106 A CN 201710880106A CN 107741962 A CN107741962 A CN 107741962A
Authority
CN
China
Prior art keywords
variable data
weight
data
identification information
significance level
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
CN201710880106.9A
Other languages
Chinese (zh)
Other versions
CN107741962B (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201710880106.9A priority Critical patent/CN107741962B/en
Priority to PCT/CN2018/074849 priority patent/WO2019061978A1/en
Publication of CN107741962A publication Critical patent/CN107741962A/en
Application granted granted Critical
Publication of CN107741962B publication Critical patent/CN107741962B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists

Landscapes

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

Abstract

The present invention is applied to technical field of data processing, there is provided data cache method and server.This method includes:Each variable data is stored in ordered sequence, each variable data is correspondingly arranged on a weight;Monitor whether each variable data performs operation, and when monitoring that variable data performs operation, the weight for the variable data for performing operation is adjusted;According to the weight of each variable data after adjustment, the variable data that weight meets preparatory condition is inserted in single-track link table by gauge outfit inserted mode;Wherein, the single-track link table has preset length.The data cache method and server, search can be reduced by directly invoking variable data from single-track link table, save the consumption of program operation, a number of js variables can be kept to obtain variable using without frequent visit prototype chain for developer in internal memory, so as to be greatly enhanced the performance of variable acquisition.

Description

Data cache method and server
Technical field
The invention belongs to technical field of data processing, more particularly to data cache method and server.
Background technology
Front-end technology developed rapidly in recent years, and the performance of front-end code increasingly attracts attention, and javascript is preceding Play the role of very important in the technology of end, as the experience of user and enterprise to system is more paid attention to, special effects of webpage progressively rises Level, dom operation is more frequent, the performance of the extremely consumption program operation of the search based on js prototype chains.
The content of the invention
In view of this, the embodiments of the invention provide data cache method and server, to solve to be based in the prior art The problem of search on variable data of js prototype chains influences program runnability.
The first aspect of the embodiment of the present invention provides a kind of data cache method, including:
Each variable data is stored in ordered sequence, each variable data is correspondingly arranged on a significance level mark letter Breath;
Monitor whether each variable data performs operation, and when monitoring that variable data performs operation, operation will be performed The significance level identification information of variable data be adjusted;
According to the significance level identification information of each variable data after adjustment, significance level identification information is met default The variable data of condition is inserted in single-track link table by gauge outfit inserted mode;Wherein, the single-track link table has preset length.
Optionally, it is described to include each variable data deposit ordered sequence:
If the type of target variable data is Object, the address of the target variable data is obtained, according to described Location calculates the Hash codes of the target variable data, and the target variable data are any one variable in each variable data Data;
If the type string of the target variable data, obtain the character included in the target variable data String, the Hash codes of the target variable data are calculated according to the character string;
If the type of the target variable data is Integer, the numeral included in the target variable data is obtained, According to the Hash codes of target variable data described in the numerical calculation;
After the Hash codes of each variable data are calculated, according to the Hash codes being calculated by corresponding variable data It is stored in ordered sequence.
Optionally, the significance level identification information includes weight;It is described monitor variable data perform operation when, will Perform operation variable data weight be adjusted including:
When monitoring that variable data performs operation, the weight that will perform the variable data of operation increases preset value.
Optionally, the significance level identification information includes weight;It is described monitor variable data perform operation when, will Perform operation variable data weight be adjusted including:
When monitoring that variable data performs operation, the weight that the variable data of operation will be performed according to the operation increases Preset value.
Optionally, the weight of each variable data according to after adjustment, weight is met to the variable number of preparatory condition Include according to single-track link table is inserted by gauge outfit inserted mode:
The variable data that weight is maximum in once each variable data is obtained every preset time;
The maximum variable data of weight is inserted in the single-track link table by gauge outfit inserted mode.
The second aspect of the embodiment of the present invention provides a kind of server, including memory, processor and is stored in institute The computer program that can be run in memory and on the processor is stated, it is real during computer program described in the computing device Existing following steps:
Each variable data is stored in ordered sequence, each variable data is correspondingly arranged on a significance level mark letter Breath;
Monitor whether each variable data performs operation, and when monitoring that variable data performs operation, operation will be performed The significance level identification information of variable data be adjusted;
According to the significance level identification information of each variable data after adjustment, significance level identification information is met default The variable data of condition is inserted in single-track link table by gauge outfit inserted mode;Wherein, the single-track link table has preset length.
Optionally, it is described to include each variable data deposit ordered sequence:
If the type of target variable data is Object, the address of the target variable data is obtained, according to described Location calculates the Hash codes of the target variable data, and the target variable data are any one variable in each variable data Data;
If the type string of the target variable data, obtain the character included in the target variable data String, the Hash codes of the target variable data are calculated according to the character string;
If the type of the target variable data is Integer, the numeral included in the target variable data is obtained, According to the Hash codes of target variable data described in the numerical calculation;
After the Hash codes of each variable data are calculated, according to the Hash codes being calculated by corresponding variable data It is stored in ordered sequence.
Optionally, the significance level identification information includes weight;It is described monitor variable data perform operation when, will Perform operation variable data weight be adjusted including:
When monitoring that variable data performs operation, the weight that will perform the variable data of operation increases preset value;Or
When monitoring that variable data performs operation, increased according to the weight of the variable data for operating and operating execution pre- If value.
Optionally, the significance level identification information includes weight;The power of each variable data according to after adjustment Weight, weight is met that the variable data of preparatory condition is inserted single-track link table by gauge outfit inserted mode and included:
The variable data that weight is maximum in once each variable data is obtained every preset time;
The maximum variable data of weight is inserted in the single-track link table by gauge outfit inserted mode.
The third aspect of the embodiment of the present invention provides a kind of computer-readable recording medium, the computer-readable storage Media storage has computer program, and the step such as above-mentioned data cache method is realized when the computer program is executed by processor Suddenly.
Existing beneficial effect is the embodiment of the present invention compared with prior art:The embodiment of the present invention, by each variable number According in deposit ordered sequence, and each variable data is correspondingly arranged on a weight, monitors whether each variable data performs behaviour Make, and when monitoring that variable data performs operation, the weight for the variable data for performing operation is adjusted, after adjustment Each variable data weight, by weight meet preparatory condition variable data pass through gauge outfit inserted mode insert single-track link table In, and single-track link table has fixed length, when being stored in new variable data, the data of table tail will be washed in a pan in single-track link table Eliminate, therefore the variable data in individual event chained list is more commonly used variable, by directly invoking variable number from single-track link table According to search can be reduced, the consumption of program operation is saved, a number of js variables can be kept to be used for developer in internal memory Variable is obtained without frequent visit prototype chain, so as to be greatly enhanced the performance of variable acquisition.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art In the required accompanying drawing used be briefly described, it should be apparent that, drawings in the following description be only the present invention some Embodiment, for those of ordinary skill in the art, without having to pay creative labor, can also be according to these Accompanying drawing obtains other accompanying drawings.
Fig. 1 is the flow chart of data cache method provided in an embodiment of the present invention;
Fig. 2 is the implementation process figure of step S101 in Fig. 1;
Fig. 3 is the implementation process figure of step S103 in Fig. 1;
Fig. 4 is the flow chart of another data cache method provided in an embodiment of the present invention;
Fig. 5 is the flow chart of another data cache method provided in an embodiment of the present invention;
Fig. 6 is the running environment schematic diagram of data buffer storage program provided in an embodiment of the present invention
Fig. 7 is the functional block diagram of data buffer storage program provided in an embodiment of the present invention.
Embodiment
In describing below, in order to illustrate rather than in order to limit, it is proposed that such as tool of particular system structure, technology etc Body details, thoroughly to understand the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific The present invention can also be realized in the other embodiments of details.In other situations, omit to well-known system, device, electricity Road and the detailed description of method, in case unnecessary details hinders description of the invention.
Technical term " first ", " second " in the specification and claims of the embodiment of the present invention etc. are to be used to distinguish Similar object, without for describing specific order precedence.It should be appreciated that the data so used are in appropriate situation Under can exchange, so that embodiments of the invention described herein can be with addition to those for illustrating or describing herein Order is implemented.
In order to illustrate technical solutions according to the invention, illustrated below by specific embodiment.
Embodiment one
Fig. 1 shows the implementation process for the data cache method that the embodiment of the present invention one provides, and details are as follows:
Step S101, by each variable data be stored in ordered sequence in, each variable data be correspondingly arranged on one it is important Degree identification information.
Wherein it is possible to by the form of key-value pair come access variable data.For example, all variable datas be encapsulated in one it is right As in obj, sealed storage has the key (key value) comprising hash for index (index), object weight sum in object obj According to entity object.Index according to user configuration this value can be from 0 to can cached variable maximum.
In the present embodiment, the significance level identification information is specifically as follows weight, i.e., each variable data is correspondingly arranged One weight, the initial value of the weight of each variable data can be with identical, after subsequent execution operation, the weight of variable data Change, such as become big or diminish.Here, weight is a relative concept, for a certain index.A certain index Weight refers to relative importance of the index in the overall evaluation.Specifically, each variable data can be correspondingly arranged one Identical weight initial value, preset and perform operation and the corresponding relation of weight rank, and weight rank and weight adjusting range Corresponding relation, if it is follow-up monitor a certain variable data perform operation, according to above-mentioned execution operation and weight rank Corresponding relation, it is determined that the variable data monitored execution operation corresponding to weight rank, further, according to the weight of determination The corresponding relation of rank and above-mentioned weight rank and weight adjusting range, it is determined that corresponding weight adjusting range, according to determination Weight adjusting range is adjusted to the weight of the above-mentioned variable data monitored.
Referring to Fig. 2, in one embodiment, step S101 can be realized by procedure below:
Step S201, if the type of target variable data is Object, obtain the address of the target variable data, root According to the Hash codes of target variable data described in the address computation, the target variable data are any in each variable data One variable data.
Step S202, if the type string of the target variable data, obtain and wrapped in the target variable data The character string contained, the Hash codes of the target variable data are calculated according to the character string.
Step S203, if the type of the target variable data is Integer, obtains and wrapped in the target variable data The numeral contained, according to the Hash codes of target variable data described in the numerical calculation.
Wherein it is possible to by setData methods, H (key) is called to calculate the Hash codes of each variable by index values.Meter Method well-known to those skilled in the art can also be used by calculating the Hash codes of variable data, not repeated herein.In this step, Using the Hash codes calculated as corresponding to variable data.
Step S204, will be corresponding according to the Hash codes being calculated after the Hash codes of each variable data are calculated Variable data deposit ordered sequence in.
Specifically, corresponding variable data can be stored in the sequence Item of ordered sequence according to the Hash codes calculated, Specific how corresponding variable data is stored in the sequence Item of ordered sequence according to the Hash codes calculated is referred to ability Technology known to field technique personnel is completed, and will not be repeated here.
It should be understood that the Hash codes by calculating each variable, then deposit corresponding variable data according to Hash codes Enter in ordered sequence, enable to variable data to be stored in ordered sequence more uniform
Step S102, monitors whether each variable data performs operation, and when monitoring that variable data performs operation, will The significance level identification information for performing the variable data of operation is adjusted.
Wherein, the operation is specifically as follows called, but is not limited to this.If some variable data performs behaviour recently Make, then illustrate the variable data for more conventional variable data;If some variable data is not held always within a period of time Row operation, then the variable data can be illustrated for less conventional variable data.
If it should be understood that monitor some variable data perform operation when, can be by the important of the variable data The mode that degree identification information is adjusted, the variable data is embodied as comparatively conventional variable data.And certain , can also be by being identified to the significance level of the variable data when not monitoring that some variable data performs operation in the time always The mode that information is adjusted, the variable data is embodied as relatively less conventional variable data.Or within a certain period of time When not monitoring that some variable data performs operation always, the significance level identification information of the variable data can not be adjusted It is whole.
As a kind of embodiment, the significance level identification information includes weight, step S102 specific implementation processes Can be:When monitoring that variable data performs operation, the weight that will perform the variable data of operation increases preset value.
In the present embodiment, various operations are not distinguished, as long as monitoring that variable data performs operation, then will perform operation Variable data weight increase a preset value.For example, before monitoring that variable data performs operation, the power of variable data Weight is A, preset value B, then when monitoring that variable data performs operation, the weight for the variable data for performing operation is adjusted to A+B.Wherein, preset value can be configured according to being actually needed.
As another embodiment, the significance level identification information includes weight, and step S102 was implemented Journey can be:When monitoring that variable data performs operation, the weight that the variable data of operation will be performed according to the operation increases Preset value.
In the present embodiment, various operations are made a distinction, such as at least two generic operations can be turned to, corresponding to per generic operation Preset value is different, and the larger operation of preset value can be relatively more important operation, and the less operation of preset value can attach most importance to Want the operation that degree is told somebody what one's real intentions are.
For example, the various operations to variable data can be divided into the first operation and the second operation, wherein the first operation is relative It is even more important in the second operation, therefore preset value C1 corresponding to the first operation is more than preset value C2 corresponding to the second operation.Supervising Measure some variable data perform operation when, then detect the operation species and with the species corresponding to preset value, then will hold The weight of the variable data of row operation increases corresponding preset value (being, for example, C1 or C2).
By the species for setting operation and corresponding preset value, the significance level of various operations can be taken into account, from And to improve the probability by variable data insertion single-track link table corresponding to the higher operation of significance level in step S103.
In addition, step S102 specific implementations process can also be:When monitoring that variable data performs operation, behaviour will be performed The weight of the variable data of work reduces preset value.Now, the weight of variable data is smaller, then illustrates the variable data for relatively For conventional variable data;And the weight of variable data is bigger, then it is the variable being comparatively of little use to illustrate the variable data Data.When monitoring that variable data performs operation, the significance level identification information for the variable data for performing operation is adjusted Whole can be to reduce the weight for the variable data for performing operation.
In addition, step S102 specific implementations process can also be:When monitoring that variable data performs operation, according to the behaviour Make the weight for performing the variable data of operation reducing preset value.For example, the various operations to variable data can be divided into first Operation and the second operation, wherein the first operation is even more important relative to the second operation, therefore preset value C1 corresponding to the first operation Less than preset value C2 corresponding to the second operation.When monitoring that some variable data performs operation, then detect the species of the operation With with the species corresponding to preset value, the smaller corresponding preset value of weight for the variable data that then will perform operation (is, for example, C1 or C2).
Step S103, according to the significance level identification information of each variable data after adjustment, significance level is identified and believed Breath meets that the variable data of preparatory condition is inserted in single-track link table by gauge outfit inserted mode;Wherein, the single-track link table has Preset length.
Wherein, significance level identification information can be weight, and preparatory condition can be that weight highest or weight are minimum.
Referring to Fig. 3, in one embodiment, step S103 can be realized by procedure below:
Step S301, the variable data that weight is maximum in once each variable data is obtained every preset time.
Wherein, preset time can be set according to being actually needed, such as obtain once each variable number every 30 seconds According to the variable data that middle weight is maximum.
For example, can be in the way of the weight size of each variable data be ranked up to each variable data, to obtain Take the variable data that weight is maximum in each variable data.
Step S302, the maximum variable data of weight is inserted in the single-track link table by gauge outfit inserted mode.
Wherein, single-track link table has fixed length, when being stored in a new variable data, table tail in single-track link table Data will be eliminated.Therefore, the variable data in individual event chained list is more commonly used variable, by straight from single-track link table Connect and call variable data to reduce search, save the consumption of program operation, a number of js variables can be kept in internal memory For developer using variable is obtained without frequent visit prototype chain, so as to be greatly enhanced the property of variable acquisition Energy.
Furthermore it is also possible to the variable data that weight is minimum in once each variable data is obtained every preset time, then The minimum variable data of weight is inserted in the single-track link table by gauge outfit inserted mode.
Above-mentioned data cache method, each variable data is stored in ordered sequence, and each variable data is correspondingly arranged There is a weight, monitor whether each variable data performs operation, and when monitoring that variable data performs operation, behaviour will be performed The weight of the variable data of work is adjusted, and according to the weight of each variable data after adjustment, weight is met into preparatory condition Variable data inserted by gauge outfit inserted mode in single-track link table, and single-track link table has fixed length, new in deposit During variable data, the data of table tail will be eliminated in single-track link table, therefore the variable data in individual event chained list is that comparison is normal Variable, it can reduce search by directly invoking variable data from single-track link table, save the consumption of program operation, can be Keep a number of js variables for developer using obtaining variable without frequent visit prototype chain in internal memory, so as to Enough it is greatly enhanced the performance of variable acquisition.
It should be understood that the size of the sequence number of each step is not meant to the priority of execution sequence, each process in above-described embodiment Execution sequence should determine that the implementation process without tackling the embodiment of the present invention forms any limit with its function and internal logic It is fixed.
Embodiment two
Referring to Fig. 4, the flow chart for the data cache method that the embodiment of the present invention two provides is shown, details are as follows:
Step S401, if the type of target variable data is Object, obtain the address of the target variable data, root According to the Hash codes of target variable data described in the address computation, the target variable data are any in each variable data One variable data.
Step S402, if the type string of the target variable data, obtain and wrapped in the target variable data The character string contained, the Hash codes of the target variable data are calculated according to the character string.
Step S403, if the type of the target variable data is Integer, obtains and wrapped in the target variable data The numeral contained, according to the Hash codes of target variable data described in the numerical calculation.
Step S404, will be corresponding according to the Hash codes being calculated after the Hash codes of each variable data are calculated Variable data deposit ordered sequence in.
Step S405, monitors whether each variable data performs operation, and when monitoring that variable data performs operation, will Perform the weight increase preset value of the variable data of operation.
Step S406, the variable data that weight is maximum in once each variable data is obtained every preset time, by weight Maximum variable data is inserted in the single-track link table by gauge outfit inserted mode.
In addition, step S405 can also be:Monitor whether each variable data performs operation, and monitoring variable data When performing operation, the weight that will perform the variable data of operation reduces preset value.Corresponding, step S406 can be:Every pre- If the time obtains the variable data that weight is minimum in once each variable data, the minimum variable data of weight is inserted by gauge outfit Enter mode to insert in the single-track link table.
Embodiment three
Referring to Fig. 5, the flow chart for the data cache method that the embodiment of the present invention three provides is shown, details are as follows:
Step S501, if the type of target variable data is Object, obtain the address of the target variable data, root According to the Hash codes of target variable data described in the address computation, the target variable data are any in each variable data One variable data.
Step S502, if the type string of the target variable data, obtain and wrapped in the target variable data The character string contained, the Hash codes of the target variable data are calculated according to the character string.
Step S503, if the type of the target variable data is Integer, obtains and wrapped in the target variable data The numeral contained, according to the Hash codes of target variable data described in the numerical calculation.
Step S504, will be corresponding according to the Hash codes being calculated after the Hash codes of each variable data are calculated Variable data deposit ordered sequence in.
Step S505, monitors whether each variable data performs operation, and when monitoring that variable data performs operation, root The weight that the variable data of operation will be performed according to the operation increases preset value.
Step S506, the variable data that weight is maximum in once each variable data is obtained every preset time, by weight Maximum variable data is inserted in the single-track link table by gauge outfit inserted mode.
In addition, step S505 can also be:Monitor whether each variable data performs operation, and monitoring variable data When performing operation, the weight that the variable data of operation will be performed according to the operation reduces preset value.Corresponding, step S506 can Think:The variable data that weight is minimum in once each variable data is obtained every preset time, by the variable number that weight is minimum Inserted according to by gauge outfit inserted mode in the single-track link table.
Example IV
Corresponding to the data cache method described in foregoing embodiments, Fig. 6 shows that data provided in an embodiment of the present invention are delayed Deposit the running environment schematic diagram of program.For convenience of description, it illustrate only part related to the present embodiment.
In the present embodiment, described data buffer storage program 600 is installed and run in server 60.The server 60 can It include but not limited to, memory 601 and processor 602.Fig. 6 illustrate only the server 60 with component 601-602, but It is that should be understood that, it is not required that implement all components shown, the more or less component of the implementation that can be substituted.
The memory 601 can be the internal storage unit of the server 60 in certain embodiments, such as the clothes The hard disk or internal memory of business device 60.The memory 601 can also be that the outside of the server 60 is deposited in further embodiments The plug-in type hard disk being equipped with storage equipment, such as the server 60, intelligent memory card (Smart Media Card, SMC), peace Digital (Secure Digital, SD) blocks, flash card (Flash Card) etc..Further, the memory 601 can be with Both the internal storage unit of the server 60 had been included or including External memory equipment.The memory 601, which is used to store, to be installed In the application software and Various types of data of the server 60, such as program code of the data buffer storage program 600 etc..It is described to deposit Reservoir 601 can be also used for temporarily storing the data that has exported or will export.
The processor 602 can be a central processing unit (Central Processing in certain embodiments Unit, CPU), microprocessor or other data processing chips, for run the program code that is stored in the memory 601 or Processing data, such as perform described data buffer storage program 600 etc..
Display can also be included.The display can be in certain embodiments light-emitting diode display, liquid crystal display, Touch-control liquid crystal display and OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) touch device Deng.The display is used to be shown in the information that handles in the server 60 and for showing visual user interface, Such as application menu interface, application icon interface etc..The part 601-602 of the server 60 passes through system bus phase intercommunication Letter.
Referring to Fig. 7, it is the functional block diagram of data buffer storage program 600 provided in an embodiment of the present invention.In the present embodiment In, described data buffer storage program 600 can be divided into one or more modules, and one or more of modules are stored In the memory 601, and it is performed by one or more processors (the present embodiment is the processor 602), to complete The present invention.For example, in the figure 7, described data buffer storage program 600 can be divided into variable storage module 701, detection adjustment Module 702 and processing module 703.Module alleged by the present invention is that the series of computation machine program for referring to completion specific function refers to Section is made, than program more suitable for describing implementation procedure of the data buffer storage program 600 in the server 60.Describe below The function of the module 701-703 will specifically be introduced.
Wherein, variable storage module 701, for each variable data to be stored in ordered sequence, each variable data pair A weight should be provided with.
Adjusting module 702 is detected, operation whether is performed for monitoring each variable data, and is monitoring that variable data holds During row operation, the weight for the variable data for performing operation is adjusted
Processing module 703, for the weight according to each variable data after adjustment, weight is met to the change of preparatory condition Data are measured to insert in single-track link table by gauge outfit inserted mode;Wherein, the single-track link table has preset length.
Optionally, variable storage module 701 can include the first computing unit, the second computing unit, the 3rd computing unit And memory cell.
First computing unit, if the type for target variable data is Object, obtain the target variable The address of data, according to the Hash codes of target variable data described in the address computation, the target variable data are each change Measure any one variable data in data.
Second computing unit, if the type string for the target variable data, obtains the target The character string included in variable data, the Hash codes of the target variable data are calculated according to the character string.
3rd computing unit, if the type for the target variable data is Integer, obtain the target The numeral included in variable data, according to the Hash codes of target variable data described in the numerical calculation.
The memory cell, for after the Hash codes of each variable data are calculated, according to the Hash being calculated Corresponding variable data is stored in ordered sequence by code.
Optionally, monitoring adjusting module 702 is specifically used for:
When monitoring that variable data performs operation, the weight that will perform the variable data of operation increases preset value;Or
When monitoring that variable data performs operation, the weight that the variable data of operation will be performed according to the operation increases Preset value.
Optionally, processing module 703 can include acquiring unit and insertion unit.
The acquiring unit, for obtaining the variable number that weight is maximum in once each variable data every preset time According to.
The insertion unit, for the maximum variable data of weight to be inserted into the single-track link table by gauge outfit inserted mode In.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each work( Can unit, module division progress for example, in practical application, can be as needed and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device are divided into different functional units or module, more than completion The all or part of function of description.Each functional unit, module in embodiment can be integrated in a processing unit, also may be used To be that unit is individually physically present, can also two or more units it is integrated in a unit, it is above-mentioned integrated Unit can both be realized in the form of hardware, can also be realized in the form of SFU software functional unit.In addition, each function list Member, the specific name of module are not limited to the protection domain of the application also only to facilitate mutually distinguish.Said system The specific work process of middle unit, module, the corresponding process in preceding method embodiment is may be referred to, will not be repeated here.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and is not described in detail or remembers in some embodiment The part of load, it may refer to the associated description of other embodiments.
Those of ordinary skill in the art are it is to be appreciated that the list of each example described with reference to the embodiments described herein Member and algorithm steps, it can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually Performed with hardware or software mode, application-specific and design constraint depending on technical scheme.Professional and technical personnel Described function can be realized using distinct methods to each specific application, but this realization is it is not considered that exceed The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, can be with Realize by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute The division of module or unit is stated, only a kind of division of logic function, there can be other dividing mode when actually realizing, such as Multiple units or component can combine or be desirably integrated into another system, or some features can be ignored, or not perform.Separately A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be by some interfaces, device Or INDIRECT COUPLING or the communication connection of unit, can be electrical, mechanical or other forms.
The unit illustrated as separating component can be or may not be physically separate, show as unit The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list Member can both be realized in the form of hardware, can also be realized in the form of SFU software functional unit.
If the integrated module/unit realized in the form of SFU software functional unit and as independent production marketing or In use, it can be stored in a computer read/write memory medium.Based on such understanding, the present invention realizes above-mentioned implementation All or part of flow in example method, by computer program the hardware of correlation can also be instructed to complete, described meter Calculation machine program can be stored in a computer-readable recording medium, and the computer program can be achieved when being executed by processor The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation Code can be source code form, object identification code form, executable file or some intermediate forms etc..The computer-readable medium It can include:Any entity or device, recording medium, USB flash disk, mobile hard disk, the magnetic of the computer program code can be carried Dish, CD, computer storage, read-only storage (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It is it should be noted that described The content that computer-readable medium includes can carry out appropriate increasing according to legislation in jurisdiction and the requirement of patent practice Subtract, such as in some jurisdictions, electric carrier signal and electricity are not included according to legislation and patent practice, computer-readable medium Believe signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although with reference to foregoing reality Example is applied the present invention is described in detail, it will be understood by those within the art that:It still can be to foregoing each Technical scheme described in embodiment is modified, or carries out equivalent substitution to which part technical characteristic;And these are changed Or replace, the essence of appropriate technical solution is departed from the spirit and scope of various embodiments of the present invention technical scheme, all should Within protection scope of the present invention.

Claims (10)

  1. A kind of 1. data cache method, it is characterised in that including:
    Each variable data is stored in ordered sequence, each variable data is correspondingly arranged on a significance level identification information;
    Monitor whether each variable data performs operation, and when monitoring that variable data performs operation, the change of operation will be performed The significance level identification information of amount data is adjusted;
    According to the significance level identification information of each variable data after adjustment, significance level identification information is met into preparatory condition Variable data pass through gauge outfit inserted mode insert single-track link table in;Wherein, the single-track link table has preset length.
  2. 2. data cache method as claimed in claim 1, it is characterised in that described that each variable data is stored in ordered sequence Include:
    If the type of target variable data is Object, the address of the target variable data is obtained, is counted according to the address The Hash codes of the target variable data are calculated, the target variable data are any one variable number in each variable data According to;
    If the type string of the target variable data, obtain the character string included in the target variable data, root The Hash codes of the target variable data are calculated according to the character string;
    If the type of the target variable data is Integer, the numeral included in the target variable data is obtained, according to The Hash codes of target variable data described in the numerical calculation;
    After the Hash codes of each variable data are calculated, corresponding variable data is stored according to the Hash codes being calculated In ordered sequence.
  3. 3. data cache method as claimed in claim 1, it is characterised in that the significance level identification information includes weight; It is described when monitoring that variable data performs operation, the significance level identification information of variable data for performing operation is adjusted Including:
    When monitoring that variable data performs operation, the weight that will perform the variable data of operation increases preset value.
  4. 4. data cache method as claimed in claim 1, it is characterised in that the significance level identification information includes weight; It is described monitor variable data perform operation when, by perform operation variable data weight be adjusted including:
    When monitoring that variable data performs operation, increased according to the weight of the variable data for operating and operating execution default Value.
  5. 5. the data cache method as described in any one of Claims 1-4, it is characterised in that the significance level identification information Including weight;The significance level identification information of each variable data according to after adjustment, significance level identification information is expired The variable data of sufficient preparatory condition inserts single-track link table by gauge outfit inserted mode to be included:
    The variable data that weight is maximum in once each variable data is obtained every preset time;
    The maximum variable data of weight is inserted in the single-track link table by gauge outfit inserted mode.
  6. 6. a kind of server, it is characterised in that including memory, processor and be stored in the memory and can be described The computer program run on processor, following steps are realized during computer program described in the computing device:
    Each variable data is stored in ordered sequence, each variable data is correspondingly arranged on a significance level identification information;
    Monitor whether each variable data performs operation, and when monitoring that variable data performs operation, the change of operation will be performed The significance level identification information of amount data is adjusted;
    According to the significance level identification information of each variable data after adjustment, significance level identification information is met into preparatory condition Variable data pass through gauge outfit inserted mode insert single-track link table in;Wherein, the single-track link table has preset length.
  7. 7. server as claimed in claim 6, it is characterised in that described each variable data is stored in ordered sequence is wrapped Include:
    If the type of target variable data is Object, the address of the target variable data is obtained, is counted according to the address The Hash codes of the target variable data are calculated, the target variable data are any one variable number in each variable data According to;
    If the type string of the target variable data, obtain the character string included in the target variable data, root The Hash codes of the target variable data are calculated according to the character string;
    If the type of the target variable data is Integer, the numeral included in the target variable data is obtained, according to The Hash codes of target variable data described in the numerical calculation;
    After the Hash codes of each variable data are calculated, corresponding variable data is stored according to the Hash codes being calculated In ordered sequence.
  8. 8. server as claimed in claim 6, it is characterised in that the significance level identification information includes weight;It is described Monitor variable data perform operation when, by perform operation variable data significance level identification information be adjusted including:
    When monitoring that variable data performs operation, the weight that will perform the variable data of operation increases preset value.
  9. 9. server as claimed in claim 8, it is characterised in that the significance level identification information includes weight;Described According to the weight of each variable data after adjustment, the variable data that weight meets preparatory condition is inserted by gauge outfit inserted mode Single-track link table includes:
    The variable data that weight is maximum in once each variable data is obtained every preset time;
    The maximum variable data of weight is inserted in the single-track link table by gauge outfit inserted mode.
  10. 10. a kind of computer-readable recording medium, the computer-readable recording medium storage has computer program, and its feature exists In when the computer program is executed by processor the step of realization such as any one of claim 1 to 5 methods described.
CN201710880106.9A 2017-09-26 2017-09-26 Data caching method and server Active CN107741962B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710880106.9A CN107741962B (en) 2017-09-26 2017-09-26 Data caching method and server
PCT/CN2018/074849 WO2019061978A1 (en) 2017-09-26 2018-01-31 Data caching method and apparatus, server and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710880106.9A CN107741962B (en) 2017-09-26 2017-09-26 Data caching method and server

Publications (2)

Publication Number Publication Date
CN107741962A true CN107741962A (en) 2018-02-27
CN107741962B CN107741962B (en) 2020-09-29

Family

ID=61235361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710880106.9A Active CN107741962B (en) 2017-09-26 2017-09-26 Data caching method and server

Country Status (2)

Country Link
CN (1) CN107741962B (en)
WO (1) WO2019061978A1 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101131673A (en) * 2006-08-22 2008-02-27 中兴通讯股份有限公司 General caching method
CN101692229A (en) * 2009-07-28 2010-04-07 武汉大学 Self-adaptive multilevel cache system for three-dimensional spatial data based on data content
CN102663096A (en) * 2012-04-11 2012-09-12 北京像素软件科技股份有限公司 Method for reading data based on data cache technology
CN102932389A (en) * 2011-08-11 2013-02-13 阿里巴巴集团控股有限公司 Request processing method and device, and server system
CN103514106A (en) * 2012-06-20 2014-01-15 北京神州泰岳软件股份有限公司 Method for caching data
CN103984736A (en) * 2014-05-21 2014-08-13 西安交通大学 Efficient buffer management method for NAND flash memory database system
CN104572784A (en) * 2013-10-27 2015-04-29 西安群丰电子信息科技有限公司 Database backup method and system
WO2016122550A1 (en) * 2015-01-29 2016-08-04 Hewlett Packard Enterprise Development Lp Heap data structure

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102456026A (en) * 2010-10-21 2012-05-16 中国移动通信集团浙江有限公司 Data acquisition device and method
US20130275951A1 (en) * 2012-04-16 2013-10-17 International Business Machines Corporation Race detection for web applications
CN104516823B (en) * 2013-09-30 2018-04-27 华为技术有限公司 A kind of date storage method and device
CN107179933A (en) * 2017-06-08 2017-09-19 成都未来之门科技有限公司 Dynamic language identification variables method, device, interpretation method and software transplanting method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101131673A (en) * 2006-08-22 2008-02-27 中兴通讯股份有限公司 General caching method
CN101692229A (en) * 2009-07-28 2010-04-07 武汉大学 Self-adaptive multilevel cache system for three-dimensional spatial data based on data content
CN102932389A (en) * 2011-08-11 2013-02-13 阿里巴巴集团控股有限公司 Request processing method and device, and server system
CN102663096A (en) * 2012-04-11 2012-09-12 北京像素软件科技股份有限公司 Method for reading data based on data cache technology
CN103514106A (en) * 2012-06-20 2014-01-15 北京神州泰岳软件股份有限公司 Method for caching data
CN104572784A (en) * 2013-10-27 2015-04-29 西安群丰电子信息科技有限公司 Database backup method and system
CN103984736A (en) * 2014-05-21 2014-08-13 西安交通大学 Efficient buffer management method for NAND flash memory database system
WO2016122550A1 (en) * 2015-01-29 2016-08-04 Hewlett Packard Enterprise Development Lp Heap data structure

Also Published As

Publication number Publication date
WO2019061978A1 (en) 2019-04-04
CN107741962B (en) 2020-09-29

Similar Documents

Publication Publication Date Title
CN110321344A (en) Information query method, device, computer equipment and the storage medium of associated data
CN109240613A (en) Data cache method, device, computer equipment and storage medium
CN108388604A (en) User right data administrator, method and computer readable storage medium
CN109472568A (en) A kind of block chain method of commerce, device, management system, equipment and storage medium
CN107784596A (en) Insurance kind state information statistics method, terminal device and the storage medium of declaration form
CN107918642A (en) Data query method, server and computer-readable recording medium
CN110442773A (en) Distributed system interior joint caching method, system, device and computer media
CN108334408A (en) code execution method, device, terminal device and computer readable storage medium
CN107704546A (en) Page configuration method and server
CN108446989A (en) Service charge determines method and terminal device
CN106372008A (en) Data caching method and device
CN107085615A (en) Duplicated text removal system, method, server and computer-readable storage medium
CN105389346A (en) Bidding clearing method and apparatus in electronic bidding evaluation system
CN109783321A (en) Monitoring data management method, device, terminal device
CN110245281A (en) Internet assets information collection method and terminal device
CN104516823B (en) A kind of date storage method and device
CN109240893A (en) Using operating status querying method and terminal device
CN107729407A (en) User behavior analysis method and server
CN107977504A (en) A kind of asymmetric in-core fuel management computational methods, device and terminal device
CN107741962A (en) Data cache method and server
CN108256816A (en) A kind of commission data processing method, device and equipment
CN108256005A (en) Internet product monitoring method and terminal device
CN107645583A (en) A kind of contact sequencing method, mobile terminal and computer-readable recording medium
CN107798508A (en) Monthly settlement management method and terminal device
CN107464334A (en) Recognition methods, identification device and the terminal device of bank note

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant