CN109656900A - The server that the data that terminal is sent are handled in time - Google Patents
The server that the data that terminal is sent are handled in time Download PDFInfo
- Publication number
- CN109656900A CN109656900A CN201811586664.5A CN201811586664A CN109656900A CN 109656900 A CN109656900 A CN 109656900A CN 201811586664 A CN201811586664 A CN 201811586664A CN 109656900 A CN109656900 A CN 109656900A
- Authority
- CN
- China
- Prior art keywords
- data
- distribution type
- type file
- threshold value
- file storing
- 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.)
- Withdrawn
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention relates to field of terminal technology, disclose the server that the data of a kind of pair of terminal transmission are handled in time.The server includes processor, memory and communication bus;The communication bus is for realizing the connection communication between the processor and memory;The processor is for executing one or more program stored in the memory, the step of to realize following method: at least one performance indicator in monitoring distribution type file storing data library;When the performance indicator reaches pre-set level threshold value, enabling reaffirms that (Redis) is serviced;The Redis service includes: the data for receiving terminal and sending, and the data received are written in Redis.The data that server of the present invention can in time send terminal perform corresponding processing, and corresponding data is returned to terminal, guarantees the smoothness of the application of user side.
Description
Technical field
The present invention relates to field of terminal technology, and in particular to the server that the data that a kind of pair of terminal is sent are handled in time.
Background technique
With the continuous increase of user volume, the server side of application program all employs greatly distribution type file storing data library
(MongoDB) storage or transfer of Lai Jinhang high concurrent data.But the number received with distribution type file storing data library
According to the continuous increase of amount, influenced by distribution type file storing data library self-ability, it can in distribution type file storing data library
There can be the problems such as data can not be recycled from memory in time, which results in server write performances degradation occurs, influences
The concurrency of server side, while also causing server that can not handle in time the interface requests of user, to cause user side
Using Caton.
Summary of the invention
It is an object of the present invention to the following technical problems of solution: the data received with distribution type file storing data library
The continuous increase of amount, the problems such as can not being recycled from memory in time there may be data in distribution type file storing data library, this
Have led to server write performance and degradation occur, influence the concurrency of server side, at the same also cause server can not and
When handle user interface requests, to cause the application Caton of user side.For the technical problem, the present invention provides one kind
The server that the data that terminal is sent are handled in time.
In order to solve the above technical problems, the present invention provides the server that the data of a kind of pair of terminal transmission are handled in time, institute
Stating server includes processor, memory and communication bus;
The communication bus is for realizing the connection communication between the processor and memory;
The processor is for executing one or more program stored in the memory, to realize following method
Step:
Monitor at least one performance indicator in distribution type file storing data library;
When the performance indicator reaches pre-set level threshold value, enabling reaffirms that (Redis) is serviced;
The Redis service includes: the data for receiving terminal and sending, and Redis is written in the data received
In.
Optionally, the performance indicator includes data write performance and/or data record rate.
Optionally, in distribution type file storing data library be monitored performance indicator at least there are two types of;
It is described when the performance indicator reaches pre-set level threshold value, enable Redis service include: in any one a performance
When index reaches the performance indicator corresponding pre-set level threshold value, Redis service is enabled.
Optionally, after enabling Redis service, further includes:
Determine the non-thermal point data in distribution type file storing data library;
By the non-hot data compression;
It will be in the compressed non-thermal point data write-in disk.
Optionally, the non-hot data in determination distribution type file storing data library include: by with lower section
At least one of formula determines the non-thermal point data in distribution type file storing data library:
Mode one: the reading times of each data in distribution type file storing data library are detected;Reading times are small
It is determined as non-thermal point data in the data of the first reading times threshold value;
Mode two: the corresponding data of each data storage areas detected in distribution type file storing data library are always read
Number;The total reading times of the data are determined as less than all data in the data storage areas of the second reading times threshold value
Non-thermal point data;
Mode three: the corresponding data of all types of data in distribution type file storing data library are detected and are always read time
Number;The all types of data that the total reading times of the data are less than third reading times threshold value are determined as non-thermal point data.
Optionally, the first reading times threshold value is the reading of each data in distribution type file storing data library
The average value of number;
The second reading times threshold value is that each data storage areas is corresponding in distribution type file storing data library
The average value of the total reading times of data;
The third reading times threshold value is the corresponding data of data all types of in distribution type file storing data library
The average value of total reading times.
Optionally, after described by the compressed non-thermal point data write-in disk, further includes:
It will be in the data write-in distribution type file storing data library in the Redis.
Optionally, described to include: in the compressed non-thermal point data write-in disk
If size of data of the vacant memory space of the disk less than the compressed non-thermal point data or the magnetic
The vacant memory space of disk is less than preset spare space threshold value, applies for disk service automatically;The disk service includes for institute
It states disk and distributes bigger memory space;
In the disk after the compressed non-hot data compression write-in to have been applied to the disk service.
Optionally, when described by the non-hot data compression, further includes: establish the index of the non-thermal point data;
It is described by the compressed non-thermal point data write-in disk after, further includes:
When receiving the read requests to the non-thermal point data, according to the index of the non-thermal point data in disk
Find compressed non-thermal point data;
By the compressed non-hot data decompression, it is requested to return to read requests described in the non-thermal point data
Data.
Beneficial effect
The present invention provides the server that the data of a kind of pair of terminal transmission are handled in time, for now with distribution type file
The continuous increase for the data volume that storing data library receives, there may be data in distribution type file storing data library can not be timely
Situations such as recycling from memory results in server write performance and degradation occurs, influences the concurrency of server side, while
Cause server that can not handle in time the interface requests of user, so that the problem of causing the application Caton of user side, passes through monitoring
At least one performance indicator in distribution type file storing data library, and when performance indicator reaches pre-set level threshold value, it enables
Redis service, the data that the terminal received is sent are written in Redis.In this way, server is in distribution type file storing data
When the scarce capacity of library, data can be written by Redis, get around the distribution type file storing data library of scarce capacity, from
And ensured the write performance of server, it ensure that the concurrency of server side, while also ensuring that server can be in time to end
The data that end is sent perform corresponding processing, and corresponding data is returned to terminal, guarantees the smoothness of the application of user side.In addition,
Data are written by Redis in distribution type file storing data library scarce capacity for server, also store to distribution type file
Database reserves the time for carrying out recovery capability.
Detailed description of the invention
Present invention will be further explained below with reference to the attached drawings and examples, in attached drawing:
The structural schematic diagram of Fig. 1 server to realize the present invention;
Fig. 2 is a kind of method for writing data basic flow chart that a kind of specific embodiment of the invention provides;
Fig. 3 is a kind of flow chart for Redis service that a kind of specific embodiment of the invention provides.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
As shown in Figure 1, the structural schematic diagram of each embodiment one optional server to realize the present invention, the server
It includes at least: input and output (IO) bus 11, processor 12, memory 13, memory 14 and communication device 15.Wherein,
Input and output (IO) bus 11 respectively with itself belonging to server other components (processor 12, memory 13,
Memory 14 and communication device 15) connection, and transmission lines are provided for other components.
Processor 12 usually controls the overall operation of the server belonging to itself.For example, processor 12 execute calculate and really
The operation such as recognize.Wherein, processor 12 can be central processing unit (CPU).
Communication device 15, generally includes one or more components, allows server and wireless communication system belonging to itself
Radio communication between system or network.
The software code that 13 storage processor of memory is readable, processor is executable, it includes be used for control processor 12
Execute the instruction (i.e. software execution function) of functions described herein.
Based on above-mentioned server hardware structure, the service that the data of the present invention sent to terminal are handled in time is proposed
Device.
For the continuous increase for solving the data volume received now with distribution type file storing data library, distribution type file
Situations such as can not recycling from memory in time in storing data library there may be data, results in server write performance and occurs seriously
Decline, influences the concurrency of server side, while also causing server that can not handle in time the interface requests of user, to cause
The problem of application Caton of user side, present embodiments provide a kind of method for writing data.Referring to fig. 2, Fig. 2 mentions for the present embodiment
The method for writing data basic flow chart of confession, comprising:
S201: at least one performance indicator in monitoring distribution type file storing data library;
In the present embodiment, performance indicator includes at least one of data write performance, data record rate.The present embodiment
Middle data write performance can by the writing speed in distribution type file storing data library, data currently writable amount etc. come
It is embodied.Correspondingly, data record rate can data record duration by distribution type file storing data library, data record
Amount etc. is embodied.
It should be noted that data record referred to deletes data from memory in distribution type file storing data library
It removes.When deleting data from memory, data can be marked in server, and after a certain time delete the data being marked
It removes.Therefore, the data that data record duration described in the present embodiment refers to are from this duration for being tagged to deletion, the present embodiment
Described in the data volume deleted from memory in certain time length section that refers to of data record amount.
It should be understood that when the performance indicator in monitoring server distribution type file storing data library, monitored performance
The type of index is to predefine well.The a certain performance that server can only detect distribution type file storing data library refers to
Mark, also can detecte certain several performance indicator in distribution type file storing data library.For example, server can only monitoring data return
Yield, can also simultaneously monitoring data write performance and the data rate of recovery.Specifically monitoring any or which kind performance indicator can
To be preselected by related management personnel.
It is to be further understood that when the performance indicator of monitoring server includes data write performance, the practical inspection of server
What is surveyed is the specific targets of writing speed and/or the data currently embodiment such as writable amount data write performance.For example, service
Device is in monitoring data write performance, the writing speed sum number that can be distribution type file storing data library data of actual monitoring
According to current writable amount.
Correspondingly, when the performance indicator of monitoring server includes data record rate, server it is actually detected be data
Recycle the specific targets that duration and/or data record amount etc. embody data record rate.For example, server is in monitoring data write-in property
When energy, actual monitoring can be the corresponding data record duration in distribution type file storing data library and/or data record amount.
S202: when performance indicator reaches pre-set level threshold value, Redis service is enabled.
It should be understood that metrics-thresholds in the present embodiment can be by related management personnel based on practical experience or greatly
It is next preset to measure examination.Preset metrics-thresholds can be the critical value of each performance indicator in the present embodiment, i.e., super
Cross threshold value will lead to the ability rapid decrease in distribution type file storing data library later, influence user experience.
In the present embodiment, preset metrics-thresholds should be corresponding with the selected performance indicator to be monitored
's.For example, corresponding preset metrics-thresholds should when the performance indicator to be monitored includes data write performance
Including data write performance threshold value.In the present embodiment, since data write performance is by distribution type file storing data library
Writing speed, currently writable amount etc. is embodied data, therefore data write performance threshold value should be correspondence
The threshold value of the specific targets of data write performance is embodied, which can be one or multiple, data write performance threshold
The threshold number of value is determined by the number of the specific targets of the embodiment data write performance of actual monitoring.For example, server is supervised
Measured data write performance is that currently writable amount is realized by monitoring data, then the data write performance threshold being correspondingly arranged
The value as writable amount threshold value of data, only one.In another example monitoring server data write performance is write by monitoring data
Entering speed and data, currently writable amount is realized, then the data write performance threshold value that is correspondingly arranged is data write-in speed
Threshold value and the writable amount threshold value of data are spent, there are two.
Correspondingly, in the present embodiment, since data record rate is returned by the data in distribution type file storing data library
Time receiving length, data record amount etc. embodied, therefore data record rate threshold value should be the corresponding data record rate that embodies
The threshold value of specific targets, the threshold value can be for one or multiple, and the threshold number of data record rate threshold value is by actually supervising
The numbers of the specific targets of the embodiment data record rate of survey determines.For example, monitoring server data record rate is to pass through monitoring
Data record duration realizes, then the data record rate threshold value that is correspondingly arranged is data record duration threshold value, only one
It is a.In another example monitoring server data record rate be recycle duration and data yield by monitoring data to realize, then
The data record rate threshold value being correspondingly arranged is data record duration threshold value and data yield threshold value, there are two.
It should be understood that in a kind of specific embodiment of the present embodiment, in the corresponding index of a performance indicator
Threshold value reaches the corresponding finger of the specific targets in any one specific targets of the performance indicator there are when two or more
When marking threshold value, that is, determine that the performance indicator reaches pre-set level threshold value, enabling reaffirms that Redis is serviced.
It should be understood that certain specific targets may belong to just in the present embodiment for different specific targets
Index, and certain specific targets may belong to negative index.For direct index, sentence when being more than or equal to corresponding metrics-thresholds
The fixed index reaches corresponding metrics-thresholds, and enabling reaffirms that Redis is serviced, such as data record duration belongs to direct index.And
For negative index, determines that the index reaches corresponding metrics-thresholds when being less than or equal to corresponding metrics-thresholds, enable weight
Shen Redis service, such as currently writable amount, data record amount belong to negative index for writing speed, data.
In the present embodiment, if monitoring is that two or more the performance in distribution type file storing data library refers to
It is corresponding can to reach the performance indicator in any one a performance indicator then in a kind of specific embodiment of the present embodiment for mark
Pre-set level threshold value when, just enable Redis service.Certainly, it in a kind of specific embodiment of the present embodiment, can also set
When being scheduled on all properties index and reaching the corresponding pre-set level threshold value of each performance indicator, Redis service is just enabled;Or setting
When there is a performance indicator of N (N be more than or equal to 2) all to reach the corresponding pre-set level threshold value of each performance indicator, Redis is just enabled
Service.
In the present embodiment, shown in Figure 3, Redis service includes:
S301: the data that terminal is sent are received;
It should be noted that the data that terminal is sent in the present embodiment may include user's request and relevant user
Preference or behavioural information.User's request refers to that the requirement server that terminal is sent returns to the solicited message number of certain data
According to, such as can be and enter request etc. using unlatching request, purchase request, the page.In the present embodiment, user preference or behavior letter
Cease the information of the preference that can embody user or behavior that refer to, such as the game that the merchandise news of user's browsing, user are opened
Information, news information of user's browsing etc..In fact, user preference or behavioural information can be requested by a user carrying.Such as eventually
End sends a goods purchase request, then the merchandise news to be bought of user is often carried in the request.
It should be understood that server can also receive the data of terminal transmission, but at that time in not enabled Redis service
Server is that the data for sending terminal are write direct in distribution type file storing data library.In not enabled Redis service, eventually
End is to carry out data interaction with the distribution type file storing data library of server.When enabling Redis service, terminal is and services
The Redis of device carries out data interaction.
S302: the data received are written in Redis.
It should be noted that Redis is a high performance key-value database.It supports the value class of storage
Type includes string (character string), list (chained list), set (set) and zset (ordered set).These data types are all supported
Push/pop, add/remove and intersection union and difference set and richer operation are taken, and these operations are all atomicities.
On this basis, redis supports the sequence of various different modes.For guaranteed efficiency, data are all to cache in memory.
The data of update periodically can be written disk or modification is operated in the additional record file of write-in by redis.
In the present embodiment, after enabling Redis service, server can intercept the number called from user interface automatically
According to, and by write-in Redis in.
The preferred embodiment of the present invention has been described above in detail, and still, the present invention is not limited thereto.In skill of the invention
In art conception range, can with various simple variants of the technical solution of the present invention are made, including each technical characteristic with it is any its
Its suitable method is combined, and it should also be regarded as the disclosure of the present invention for these simple variants and combination, is belonged to
Protection scope of the present invention.
Claims (9)
1. the server that the data that a kind of pair of terminal is sent are handled in time, which is characterized in that the server includes processor, deposits
Reservoir and communication bus;
The communication bus is for realizing the connection communication between the processor and memory;
The processor is for executing one or more program stored in the memory, to realize the step of following method
It is rapid:
Monitor at least one performance indicator in distribution type file storing data library;
When the performance indicator reaches pre-set level threshold value, enabling reaffirms that (Redis) is serviced;
The Redis service includes: the data for receiving terminal and sending, and the data received are written in Redis.
2. server according to claim 1, which is characterized in that the performance indicator include data write performance and/or
Data record rate.
3. server according to claim 1, which is characterized in that be monitored property in distribution type file storing data library
Can index at least there are two types of;
It is described when the performance indicator reaches pre-set level threshold value, enable Redis service include: in any one a performance indicator
When reaching the corresponding pre-set level threshold value of the performance indicator, Redis service is enabled.
4. server described in any one of -3 according to claim 1, which is characterized in that after enabling Redis service, also
Include:
Determine the non-thermal point data in distribution type file storing data library;
By the non-hot data compression;
It will be in the compressed non-thermal point data write-in disk.
5. server according to claim 4, which is characterized in that in determination distribution type file storing data library
Non-hot data include: determine at least one of in the following manner it is non-thermal in distribution type file storing data library
Point data:
Mode one: the reading times of each data in distribution type file storing data library are detected;By reading times less than
The data of one reading times threshold value are determined as non-thermal point data;
Mode two: the corresponding data of each data storage areas in distribution type file storing data library are detected and are always read time
Number;The total reading times of the data are determined as less than all data in the data storage areas of the second reading times threshold value non-
Hot spot data;
Mode three: the total reading times of the corresponding data of all types of data in distribution type file storing data library are detected;It will
The all types of data that the total reading times of data are less than third reading times threshold value are determined as non-thermal point data.
6. server according to claim 5, which is characterized in that the first reading times threshold value is the distributed text
The average value of the reading times of each data in shelves storing data library;
The second reading times threshold value is the corresponding data of data storage areas each in distribution type file storing data library
The average value of total reading times;
The third reading times threshold value is always read for the corresponding data of data all types of in distribution type file storing data library
Take the average value of number.
7. server according to claim 4, which is characterized in that the compressed non-thermal point data is written described
After in disk, further includes:
It will be in the data write-in distribution type file storing data library in the Redis.
8. server according to claim 4, which is characterized in that described that magnetic is written in the compressed non-thermal point data
Include: in disk
If the vacant memory space of the disk be less than the compressed non-thermal point data size of data or the disk
Vacant memory space is less than preset spare space threshold value, applies for disk service automatically;The disk service includes for the magnetic
Disk distributes bigger memory space;
In the disk after the compressed non-hot data compression write-in to have been applied to the disk service.
9. server according to claim 4, which is characterized in that it is described by the non-hot data compression when, also wrap
It includes: establishing the index of the non-thermal point data;
It is described by the compressed non-thermal point data write-in disk after, further includes:
When receiving the read requests to the non-thermal point data, found in disk according to the index of the non-thermal point data
Compressed non-thermal point data;
By the compressed non-hot data decompression, the requested number of read requests described in the non-thermal point data is returned
According to.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811586664.5A CN109656900A (en) | 2018-12-25 | 2018-12-25 | The server that the data that terminal is sent are handled in time |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811586664.5A CN109656900A (en) | 2018-12-25 | 2018-12-25 | The server that the data that terminal is sent are handled in time |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109656900A true CN109656900A (en) | 2019-04-19 |
Family
ID=66115079
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811586664.5A Withdrawn CN109656900A (en) | 2018-12-25 | 2018-12-25 | The server that the data that terminal is sent are handled in time |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109656900A (en) |
-
2018
- 2018-12-25 CN CN201811586664.5A patent/CN109656900A/en not_active Withdrawn
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11645183B1 (en) | User interface for correlation of virtual machine information and storage information | |
CN103154912B (en) | For inserting the method and system of cache blocks | |
TWI430176B (en) | Methods, apparatus and computer programs for managing persistence | |
US8521986B2 (en) | Allocating storage memory based on future file size or use estimates | |
US8489816B1 (en) | Predicting and optimizing I/O performance characteristics in a multi-level caching system | |
US20090307329A1 (en) | Adaptive file placement in a distributed file system | |
CN109614377A (en) | File delet method, device, equipment and the storage medium of distributed file system | |
US11954128B2 (en) | Query alerts generation for virtual warehouse | |
CN109086141A (en) | EMS memory management process and device and computer readable storage medium | |
CN102542036B (en) | Use the table optimized | |
CN108984589A (en) | A kind of method for writing data and server | |
CN101626313A (en) | Network management system client and performance data display method thereof | |
CN109656479A (en) | A kind of method and device constructing memory command sequence | |
CN117235088A (en) | Cache updating method, device, equipment, medium and platform of storage system | |
CN116089477B (en) | Distributed training method and system | |
CN110427394B (en) | Data operation method and device | |
US20150242312A1 (en) | Method of managing memory, computer, and recording medium | |
CN109800208B (en) | Network traceability system and its data processing method, computer storage medium | |
CN106326400A (en) | Multi-dimension data set-based data processing system | |
CN109656900A (en) | The server that the data that terminal is sent are handled in time | |
US10067678B1 (en) | Probabilistic eviction of partial aggregation results from constrained results storage | |
CN101796493B (en) | information search system, information search method, and program | |
CN116048425B (en) | Hierarchical caching method, hierarchical caching system and related components | |
CN105740167A (en) | File system cache deletion method and system | |
CN117573756A (en) | Service counting method and device, storage medium and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20190419 |