CN105354088B - Message delet method and device - Google Patents

Message delet method and device Download PDF

Info

Publication number
CN105354088B
CN105354088B CN201510641251.2A CN201510641251A CN105354088B CN 105354088 B CN105354088 B CN 105354088B CN 201510641251 A CN201510641251 A CN 201510641251A CN 105354088 B CN105354088 B CN 105354088B
Authority
CN
China
Prior art keywords
message
current cache
threshold
time interval
deleted
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.)
Active
Application number
CN201510641251.2A
Other languages
Chinese (zh)
Other versions
CN105354088A (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.)
Guangzhou Kugou Computer Technology Co Ltd
Original Assignee
Guangzhou Kugou Computer 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 Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN201510641251.2A priority Critical patent/CN105354088B/en
Publication of CN105354088A publication Critical patent/CN105354088A/en
Application granted granted Critical
Publication of CN105354088B publication Critical patent/CN105354088B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of message delet method and devices, belong to field of computer technology.The method includes:By counting the number of the message of current cache every first time interval, first time interval is greater than the average time interval between adjacent two message;Whether the number for detecting the message of current cache is greater than first threshold;If the number of the message of current cache is greater than first threshold, a part of message in the message of current cache is deleted according to receiving time;When the frequency for generating message between multiple users is higher, browser can continually be in detecting state, cause the serious consumption of cpu resource, in some instances it may even be possible to the problem of leading to browser crash;Reach the message in interval deletion current cache at predetermined time intervals, reduces the effect that cpu resource consumes during message is deleted.

Description

Message delet method and device
Technical field
The present invention relates to field of computer technology, in particular to a kind of message delet method and device.
Background technique
In Web chat system, carried out immediately between user and user by the Web Chat page of operation in a browser Communication.
When this end subscriber or peer user generate a piece of news every time, browser can all detect in Web Chat page when With the presence or absence of the message for reaching deletion condition in the message of preceding caching, deleted when existing to reach in the message of current cache in browser Except condition message when, browser deletes the message for reaching deletion condition.
In the implementation of the present invention, the inventor finds that the existing technology has at least the following problems:
When the frequency for generating message between multiple users is higher, browser can continually be in detecting state, cause The serious consumption of CPU (Central Processing Unit, central processing unit) resource, in some instances it may even be possible to lead to browser crash The problem of.
Summary of the invention
In order to solve when the frequency for generating message between multiple users is higher, browser can be continually in detection shape State causes the serious consumption of cpu resource, in some instances it may even be possible to which the problem of leading to browser crash, the embodiment of the invention provides one Kind message delet method and device.The technical solution is as follows:
In a first aspect, providing a kind of message delet method, this method includes:
Every the number of the message of first time interval statistics current cache, first time interval is greater than adjacent two message Between average time interval;
Whether the number for detecting the message of current cache is greater than first threshold;
If the number of the message of current cache is greater than first threshold, according to receiving time in the message of current cache A part of message is deleted.
In one possible implementation, this method further includes:
The generation frequency of the message in nearest second time interval is calculated every the second time interval;
Detection generates whether frequency is more than second threshold;
If generating frequency is more than second threshold, the number every the message of first time interval statistics current cache is executed The step of.
In one possible implementation, this method further includes:
If generating frequency is no more than second threshold, when generating message every time, the number of the message of current cache is counted;
Whether the number for detecting the message of current cache is greater than first threshold;
If the number of the message of current cache is greater than first threshold, according to receiving time in the message of current cache A part of message is deleted.
In one possible implementation, message is using the DOM Document Object Model DOM node storage in Web page;
A part of message in the message of current cache is deleted according to receiving time, including:
Create document fragment;
DOM node corresponding to message to be deleted is selected from the message of current cache according to receiving time;
DOM node is added to document fragment;
Delete document fragment.
In one possible implementation, to be deleted disappear is selected from the message of current cache according to receiving time The corresponding DOM node of breath, including:
DOM node corresponding to message by current cache is successively arranged according to receiving time;
It selects and is arranged in DOM node corresponding to the message to be deleted of top N, N is positive integer.
Second aspect, provides a kind of message deletion device, which includes:
First statistical module, for the number of the message every first time interval statistics current cache, between first time Every the average time interval being greater than between adjacent two message;
Number detection module, for detecting whether the number of message of current cache is greater than first threshold;
Message deletion module, when the number for the message in current cache is greater than first threshold, according to receiving time pair A part of message in the message of current cache is deleted.
In one possible implementation, the device further includes:
Frequency computing module, for calculating the production of the message in nearest second time interval every the second time interval Raw frequency;
Frequency detection module generates whether frequency is more than second threshold for detecting;
First statistical module, for counting current slow every first time interval when generating frequency more than second threshold The number for the message deposited.
In one possible implementation, the device further includes:
Second statistical module, for when generating frequency no more than second threshold, when generating message every time, statistics to be current The number of the message of caching;
Number detection module, for detecting whether the number of message of current cache is greater than first threshold;
Message deletion module, when the number for the message in current cache is greater than first threshold, according to receiving time pair A part of message in the message of current cache is deleted.
In one possible implementation, message is using the DOM Document Object Model DOM node storage in Web page;
Message deletion module, including:
Document creation submodule, for creating document fragment;
Node selects submodule, for selecting message institute to be deleted from the message of current cache according to receiving time Corresponding DOM node;
Node adds submodule, for DOM node to be added to document fragment;
Document deletes submodule, for deleting document fragment.
In one possible implementation, node selects submodule, including:
Node arrangement units, it is laggard according to the elder generation of receiving time for DOM node corresponding to the message by current cache Row arrangement;
Selecting unit is arranged, is arranged in DOM node corresponding to the message to be deleted of top N for selecting, N is positive Integer.
Technical solution bring beneficial effect provided in an embodiment of the present invention is:
By counting the number of the message of current cache every first time interval, first time interval is greater than adjacent two Average time interval between message;Whether the number for detecting the message of current cache is greater than first threshold;If current cache The number of message is greater than first threshold, then is deleted according to receiving time a part of message in the message of current cache; When the frequency for generating message between multiple users is higher, browser can continually be in detecting state, cause cpu resource Serious consumption, in some instances it may even be possible to the problem of leading to browser crash;Reach interval at predetermined time intervals to delete in current cache Message reduces the effect that cpu resource consumes during message is deleted.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is the method flow diagram of message delet method provided by one embodiment of the present invention;
Fig. 2 is the method flow diagram for the message delet method that another embodiment of the present invention provides;
Fig. 3 is the method flow diagram for the message delet method that another embodiment of the present invention provides;
Fig. 4 is the structural block diagram that message provided by one embodiment of the present invention deletes device;
Fig. 5 is the structural block diagram that the message that another embodiment of the present invention provides deletes device;
Fig. 6 A is the structural block diagram that the message that another embodiment of the present invention provides deletes device;
Fig. 6 B is the structural block diagram of the unit for the node selection submodule that another embodiment of the present invention provides.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
The message delet method that each embodiment of the present invention provides is applied to the browsing of Web page chat system in this way Come in device for example, the Web page chat system can be the chatroom in studio, the chat system in Karaoke and Chat system etc. in line game.Web page chat system is that user is directly carried out with good friend by the page in browser The system of instant messaging.
Fig. 1 is the method flow diagram of message delet method provided by one embodiment of the present invention.The present embodiment is with the message Delet method is applied to illustrate in the browser of Web page chat system.This method includes:
Step 101, every the number of the message of first time interval statistics current cache, first time interval is greater than adjacent Average time interval between two message;
Step 102, whether the number for detecting the message of current cache is greater than first threshold;
Step 103, if the number of the message of current cache is greater than first threshold, according to receiving time to current cache A part of message in message is deleted;
Step 104, if the number of the message of current cache is less than first threshold, the message of current cache is not deleted It removes.
In conclusion message delet method provided in this embodiment, by counting current cache every first time interval Message number, first time interval be greater than adjacent two message between average time interval;Detection current cache disappears Whether the number of breath is greater than first threshold;If the number of the message of current cache is greater than first threshold, according to receiving time pair A part of message in the message of current cache is deleted;When the frequency for generating message between multiple users is higher, browsing Device can continually be in detecting state, cause the serious consumption of cpu resource, in some instances it may even be possible to the problem of leading to browser crash; The message in interval deletion current cache at predetermined time intervals is reached, has reduced what cpu resource during message is deleted consumed Effect.
Fig. 2 is the method flow diagram for the message delet method that another embodiment of the present invention provides.The present embodiment is disappeared with this Breath delet method is applied to illustrate in the browser of Web page chat system.This method includes:
Step 201, the generation frequency of the message in nearest second time interval is calculated every the second time interval;
When user is when carrying out instant messaging using Web page chat system and good friend, this end subscriber can be to peer user Send message, this end subscriber can also receive peer user transmission message, this end subscriber send message and receive message when Message can be all generated in the browser of this end subscriber.The message deposit that browser sends and receives this end subscriber is in message container In, storage has all message in browser current cache in the message container.
Browser counts the sum that message is generated in second time interval every the second time interval, when according to second Between the duration that is spaced and the sum for generating message calculate every average time for generating a piece of news in second time interval, The frequency that message is generated in second time interval is calculated according to the average time for generating a piece of news.
Such as:In second time interval, there are many user for participating in Web page chat, so in the time interval It is very high in the frequency that Web chat interface generates message;In another second time interval, due to participating in Web page chat User is fewer, so just very low in the frequency of Web chat interface generation message in the time interval.Step 202, detection generates Whether frequency is more than second threshold;
The production that after the generation frequency of message, will be calculated in nearest second time interval is calculated in browser Raw frequency is compared with preset second threshold, detects size relation between the two.
Step 203, if generating frequency is more than second threshold, the message of current cache is counted every first time interval Number;
When the generation frequency of the message in nearest second time interval is more than second threshold, browser is according to first Time interval counts the number of the message of current cache in each first time interval.
The setting means of first time interval may include two kinds:
First, browser presets first time interval, counts and works as in each preset first time interval The number of the message of preceding caching;
Second, browser is according to the generation set of frequency first time interval of message in the second time interval.Browser root According to the generation frequency of message in the second time interval, the average time interval between adjacent two message is calculated, it will at the first time The duration at interval is set greater than the duration of the average time interval between adjacent two message.
Such as:First time interval is 60 seconds, and the second time interval is 10 minutes, in nearest one message in 10 minutes Generating frequency is more than second threshold, then number of the browser in every message for requiring statistics current cache after 60 seconds.
First time interval is greater than the average time interval between adjacent two message.
Average time interval between adjacent two message be by the second time interval generate message number and The average time interval that relationship between time is calculated.
Step 204, if generating frequency is no more than second threshold, when generating message every time, disappearing for current cache is counted The number of breath;
When the generation frequency of the message in nearest second time interval is no more than second threshold, browser is each The number of the message of current cache is all counted when generating message.
Such as:Second time interval is 10 minutes, is no more than second in the generation frequency of nearest one message in 10 minutes Threshold value, then browser all counts the number of the message of current cache when this end subscriber or peer user generate message, that is, When generating new message every time, all the number of the message of current cache is counted.
Step 205, whether the number for detecting the message of current cache is greater than first threshold;
Browser detects the number and the first threshold of the message of current cache after the number for the message for counting on current cache Size relation between value.
Step 206, if the number of the message of current cache is greater than first threshold, according to receiving time to current cache A part of message in message is deleted.
When the number of the message of current cache is greater than first threshold, the message of current cache is arranged in one by browser Array, the array are arranged according to the sequencing of the receiving time of message, according to receiving time disappearing current cache A part of message for meeting deletion condition in breath is deleted.
Such as:First time interval is 60 seconds, and the second time interval is 10 minutes, and first threshold 100, Xiao Ming is utilizing When Web page chat system carries out instant messaging with good friend, merely very happy, therefore, in nearest one message in 10 minutes Generation frequency it is also very high, so browser the number that the message of current cache is counted on after 60 seconds be 120, then it is clear The message of current cache being ranked up by device of looking at according to the successive of receiving time, is deleted to 10 message for being arranged in front It removes.If Xiao Ming is with good friend, merely discovery has a thing to need to handle after a period of time, therefore, with good friend nearest one 10 current The generation frequency of message becomes very low in minute, so browser counts the message of current cache when generating message every time, it is false The number that the message of current cache is counted on when being scheduled on primary generation message is 115, then browser presses the message of current cache According to being successively ranked up for receiving time, 15 message for being arranged in front are deleted.
Optionally, the number of a part of message of deletion is the number of the message of current cache and the difference of first threshold;
Optionally, the number of a part of message of deletion is a preset positive integer.
In the present embodiment, the number of a part of message of deletion is not especially limited.
Step 207, if the number of the message of current cache is less than first threshold, the message of current cache is not deleted It removes.
In conclusion message delet method provided in this embodiment, by counting current cache every first time interval Message number, first time interval be greater than adjacent two message between average time interval;Detection current cache disappears Whether the number of breath is greater than first threshold;If the number of the message of current cache is greater than first threshold, according to receiving time pair A part of message in the message of current cache is deleted;When the frequency for generating message between multiple users is higher, browsing Device can continually be in detecting state, cause the serious consumption of cpu resource, in some instances it may even be possible to the problem of leading to browser crash; The message in interval deletion current cache at predetermined time intervals is reached, has reduced what cpu resource during message is deleted consumed Effect.
According to the frequency that message in the second time interval generates, the number for counting the message of current cache is judged, for not Same message generates frequency, realizes the switching between the method for the number of the message of two kinds of statistics current caches, reduces CPU The effect that resource seriously consumes caused by frequently detecting because of browser.
Message delet method provided by Fig. 1 and Fig. 2 embodiment is all directly to delete the message of current cache, is made It, can be by the message of current cache using DOM (the Document Object in Web page for another achievable mode Model, DOM Document Object Model) mode of node stores, then disappeared according to receiving time to a part in the message of current cache Breath delete and can also be achieved by the steps of, as shown in Figure 3.
Step 208, document fragment is created;
Document fragment is a technical term in javascript operation, is mainly used for the processing to DOM node, It can all make the page that one-shot change occur each operation of DOM node in javascript operation, document fragment is similar to A transient document in javascript operation, multiple DOM nodes can be put into document fragment, to multiple DOM nodes It is disposably operated, the performance of DOM node operation can be improved.
Step 209, the section of DOM corresponding to message to be deleted is selected from the message of current cache according to receiving time Point;
The message of current cache is arranged in an array by browser, the array according to message receiving time it is successive suitable What sequence was arranged, according to the message arranged in array obtain each message corresponding to DOM node, selected according to receiving time Meet DOM node corresponding to a part of message of deletion condition in the message of current cache.
Optionally, the number of DOM node corresponding to a part of message is the number and first threshold of the message of current cache Difference;
Optionally, the number of DOM node corresponding to a part of message is a preset positive integer.
In the present embodiment, the number of DOM node corresponding to a part of message is not especially limited.
It optionally, can be by DOM corresponding to the message after selecting DOM node corresponding to message to be deleted Node is hidden the content for showing the message.
Step 210, DOM node is added to document fragment;
DOM node corresponding to the message to be deleted selected is added in document fragment by browser.
Step 211, document fragment is deleted.
Browser deletes the document fragment for carrying DOM node corresponding to message to be deleted, accordingly, deletes Message in addition to meeting deletion condition.
In conclusion message delet method provided in this embodiment, by counting current cache every first time interval Message number, first time interval be greater than adjacent two message between average time interval;Detection current cache disappears Whether the number of breath is greater than first threshold;If the number of the message of current cache is greater than first threshold, according to receiving time pair A part of message in the message of current cache is deleted;When the frequency for generating message between multiple users is higher, browsing Device can continually be in detecting state, cause the serious consumption of cpu resource, in some instances it may even be possible to the problem of leading to browser crash; The message in interval deletion current cache at predetermined time intervals is reached, has reduced what cpu resource during message is deleted consumed Effect.
According to the frequency that message in the second time interval generates, the number for counting the message of current cache is judged, for not Same message generates frequency, realizes the switching between the method for the number of the message of two kinds of statistics current caches, reduces CPU The effect that resource seriously consumes caused by frequently detecting because of browser.
When deleting message to be deleted, DOM node corresponding to message is deleted using document fragment, Save the resource overhead of browser.
Fig. 4 is the structural block diagram that message provided by one embodiment of the present invention deletes device.The message deletes device can To pass through all or part of software, hardware or both being implemented in combination with as browser in Web page chat system. The message deletes device:
First statistical module 410, for the number of the message every first time interval statistics current cache, at the first time Interval is greater than the average time interval between adjacent two message.
Number detection module 420, for detecting whether the number of message of current cache is greater than first threshold.
Message deletion module 430, when the number for the message in current cache is greater than first threshold, according to receiving time A part of message in the message of current cache is deleted.
In conclusion message provided in this embodiment deletes device, by counting current cache every first time interval Message number, first time interval be greater than adjacent two message between average time interval;Detection current cache disappears Whether the number of breath is greater than first threshold;If the number of the message of current cache is greater than first threshold, according to receiving time pair A part of message in the message of current cache is deleted;When the frequency for generating message between multiple users is higher, browsing Device can continually be in detecting state, cause the serious consumption of cpu resource, in some instances it may even be possible to the problem of leading to browser crash; The message in interval deletion current cache at predetermined time intervals is reached, has reduced what cpu resource during message is deleted consumed Effect.
Fig. 5 is the structural block diagram that the message that another embodiment of the present invention provides deletes device.The message deletes device The whole of software, hardware or both being implemented in combination with as Web page chat system kind browser or one can be passed through Point.The message deletes device:
Frequency computing module 510, for calculating the message in nearest second time interval every the second time interval Generation frequency.
Frequency detection module 520 generates whether frequency is more than second threshold for detecting.
First statistical module 530, for counting current every first time interval when generating frequency more than second threshold The number of the message of caching.
Second statistical module 540 is used for when generating frequency no more than second threshold, when generating message every time, is counted The number of the message of current cache.
Number detection module 550, for detecting whether the number of message of current cache is greater than first threshold.
Message deletion module 560, when the number for the message in current cache is greater than first threshold, according to receiving time A part of message in the message of current cache is deleted.
In conclusion message provided in this embodiment deletes device, by counting current cache every first time interval Message number, first time interval be greater than adjacent two message between average time interval;Detection current cache disappears Whether the number of breath is greater than first threshold;If the number of the message of current cache is greater than first threshold, according to receiving time pair A part of message in the message of current cache is deleted;When the frequency for generating message between multiple users is higher, browsing Device can continually be in detecting state, cause the serious consumption of cpu resource, in some instances it may even be possible to the problem of leading to browser crash; The message in interval deletion current cache at predetermined time intervals is reached, has reduced what cpu resource during message is deleted consumed Effect.
According to the frequency that message in the second time interval generates, the number for counting the message of current cache is judged, for not Same message generates frequency, realizes the switching between the method for the number of the message of two kinds of statistics current caches, reduces CPU The effect that resource seriously consumes caused by frequently detecting because of browser.
It is all directly to delete the message of current cache that message provided by Fig. 4 and Fig. 5 embodiment, which deletes device, is made For another achievable mode, the message of current cache can be stored by the way of the DOM node in Web page, then As shown in Figure 6A, which, which deletes device, to include:
Frequency computing module 510, for calculating the message in nearest second time interval every the second time interval Generation frequency;
Frequency detection module 520 generates whether frequency is more than second threshold for detecting.
First statistical module 530, for counting current every first time interval when generating frequency more than second threshold The number of the message of caching.
Second statistical module 540 is used for when generating frequency no more than second threshold, when generating message every time, is counted The number of the message of current cache.
Number detection module 550, for detecting whether the number of message of current cache is greater than first threshold.
Message deletion module 560, when the number for the message in current cache is greater than first threshold, according to receiving time A part of message in the message of current cache is deleted.
Optionally, message deletion module 560 may include:
Document creation submodule 561, for creating document fragment.
Node selects submodule 562, for selecting to be deleted disappear from the message of current cache according to receiving time The corresponding DOM node of breath.
Node adds submodule 563, for DOM node to be added to document fragment.
Document deletes submodule 564, for deleting document fragment.
Optionally, node selects submodule 562, may include, as shown in Figure 6B:
Node arrangement units 565, for DOM node corresponding to the message by current cache according to the successive of receiving time It is arranged.
Selecting unit 566 is arranged, is arranged in DOM node corresponding to the message to be deleted of top N, N for selecting For positive integer.
In conclusion message provided in this embodiment deletes device, by counting current cache every first time interval Message number, first time interval be greater than adjacent two message between average time interval;Detection current cache disappears Whether the number of breath is greater than first threshold;If the number of the message of current cache is greater than first threshold, according to receiving time pair A part of message in the message of current cache is deleted;When the frequency for generating message between multiple users is higher, browsing Device can continually be in detecting state, cause the serious consumption of cpu resource, in some instances it may even be possible to the problem of leading to browser crash; The message in interval deletion current cache at predetermined time intervals is reached, has reduced what cpu resource during message is deleted consumed Effect.
According to the frequency that message in the second time interval generates, the number for counting the message of current cache is judged, for not Same message generates frequency, realizes the switching between the method for the number of the message of two kinds of statistics current caches, reduces CPU The effect that resource seriously consumes caused by frequently detecting because of browser.
When deleting message to be deleted, DOM node corresponding to message is deleted using document fragment, Save the resource overhead of browser.
It should be noted that:The device that message provided by the above embodiment is deleted is when deleting message, only with above-mentioned each function Can module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different functions Module is completed, i.e., the internal structure of Web page chat system is divided into different functional modules, described above complete to complete Portion or partial function.In addition, the embodiment of the method that the device that message provided by the above embodiment is deleted is deleted with message belongs to Same design, specific implementation process are detailed in embodiment of the method, and which is not described herein again.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (8)

1. a kind of message delet method, which is characterized in that the method includes:
The generation frequency of the message of current cache in nearest one second time interval is calculated every the second time interval;
Detect whether the generation frequency is more than second threshold;
If the generation frequency is more than the second threshold, the number of the message of current cache is counted every first time interval, The first time interval is greater than the average time interval between adjacent two message;
Whether the number for detecting the message of the current cache is greater than first threshold;
If the number of the message of the current cache is greater than the first threshold, according to receiving time to the current cache A part of message in message is deleted.
2. the method according to claim 1, wherein whether the detection generation frequency is more than second threshold Later, further include:
If the generation frequency, which is no more than the second threshold, counts the current cache when generating the message every time Message number;
Whether the number for detecting the message of the current cache is greater than first threshold;
If the number of the message of the current cache is greater than the first threshold, according to receiving time to the current cache A part of message in message is deleted.
3. method according to any one of claims 1 to 2, which is characterized in that the message is using the document pair in Web page As model DOM node is stored;
It is described that a part of message in the message of the current cache is deleted according to receiving time, including:
Create document fragment;
The section of DOM corresponding to the message to be deleted is selected from the message of the current cache according to the receiving time Point;
The DOM node is added to the document fragment;
Delete the document fragment.
4. according to the method described in claim 3, it is characterized in that, it is described according to the receiving time from the current cache DOM node corresponding to the message to be deleted is selected in message, including:
By successively the arranging according to receiving time of DOM node corresponding to the message of the current cache;
It selects and is arranged in DOM node corresponding to the message to be deleted of top N, N is positive integer.
5. a kind of message deletes device, which is characterized in that described device includes:
Frequency computing module, for calculating the current cache in nearest one second time interval every the second time interval Message generation frequency;
Whether frequency detection module is more than second threshold for detecting the generation frequency;
First statistical module, for working as every first time interval statistics when the generation frequency is more than the second threshold The number of the message of preceding caching, the first time interval are greater than the average time interval between adjacent two message;
Number detection module, for detecting whether the number of message of the current cache is greater than first threshold;
Message deletion module, when the number for the message in the current cache is greater than the first threshold, when according to receiving Between a part of message in the message of the current cache is deleted.
6. device according to claim 5, which is characterized in that described device further includes:
Second statistical module is used for when the generation frequency is no more than the second threshold, when generating the message every time, Count the number of the message of the current cache;
The number detection module, for detecting whether the number of message of the current cache is greater than first threshold;
The message deletion module, when the number for the message in the current cache is greater than the first threshold, according to connecing A part of message in the message of the current cache is deleted between time receiving.
7. according to any device of claim 5 to 6, which is characterized in that the message is using the document pair in Web page As model DOM node is stored;
The message deletion module, including:
Document creation submodule, for creating document fragment;
Node selects submodule, for selecting institute to be deleted from the message of the current cache according to the receiving time State DOM node corresponding to message;
Node adds submodule, for the DOM node to be added to the document fragment;
Document deletes submodule, for deleting the document fragment.
8. device according to claim 7, which is characterized in that the node selects submodule, including:
Node arrangement units, for DOM node corresponding to the message of the current cache is laggard according to the elder generation of receiving time Row arrangement;
Selecting unit is arranged, is arranged in DOM node corresponding to the message to be deleted of top N for selecting, N is positive Integer.
CN201510641251.2A 2015-09-29 2015-09-29 Message delet method and device Active CN105354088B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510641251.2A CN105354088B (en) 2015-09-29 2015-09-29 Message delet method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510641251.2A CN105354088B (en) 2015-09-29 2015-09-29 Message delet method and device

Publications (2)

Publication Number Publication Date
CN105354088A CN105354088A (en) 2016-02-24
CN105354088B true CN105354088B (en) 2018-11-27

Family

ID=55330062

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510641251.2A Active CN105354088B (en) 2015-09-29 2015-09-29 Message delet method and device

Country Status (1)

Country Link
CN (1) CN105354088B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107220344B (en) * 2017-05-27 2019-12-06 Oppo广东移动通信有限公司 Document processing method and related product

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103577348A (en) * 2013-10-09 2014-02-12 广东欧珀移动通信有限公司 Method and mobile device for automatically counting application cache size and reminding user
CN103699595A (en) * 2013-12-11 2014-04-02 小米科技有限责任公司 Method and device for webpage caching of terminal browser and terminal
CN104808952A (en) * 2015-05-05 2015-07-29 百度在线网络技术(北京)有限公司 Data caching method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102375862B (en) * 2010-08-26 2013-03-27 腾讯科技(深圳)有限公司 Large-data-volume message management method and device
US9571591B2 (en) * 2011-12-28 2017-02-14 Dynatrace Llc Method and system for tracing end-to-end transaction which accounts for content update requests

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103577348A (en) * 2013-10-09 2014-02-12 广东欧珀移动通信有限公司 Method and mobile device for automatically counting application cache size and reminding user
CN103699595A (en) * 2013-12-11 2014-04-02 小米科技有限责任公司 Method and device for webpage caching of terminal browser and terminal
CN104808952A (en) * 2015-05-05 2015-07-29 百度在线网络技术(北京)有限公司 Data caching method and device

Also Published As

Publication number Publication date
CN105354088A (en) 2016-02-24

Similar Documents

Publication Publication Date Title
CN104991850B (en) The heartbeat packet control method and device of a kind of application program
US10004059B2 (en) Service advertisement message transmission method and device
CN107483976A (en) Live management-control method, device and electronic equipment
CN110505709B (en) Method and device for quickly deactivating mobile network and mobile terminal
CN107959616A (en) Method, apparatus, computer installation and the storage medium of message forwarding
CN109561404A (en) A kind of method and system of short message push priority adjustment
CN106162365B (en) Any active ues collection maintaining method and system based on time wheel disc and barrage behavior
CN105354088B (en) Message delet method and device
CN113392041A (en) Application cache cleaning method, device, equipment and storage medium
CN105939379A (en) Real-time monitoring and early warning system and real-time monitoring and early warning method based on internet data
CN111737027A (en) Lookup processing method, system, terminal and storage medium of distributed storage system
CN112311597A (en) Message pushing method and device
CN113821421B (en) Method, system, device and storage medium for collecting server performance data
CN104168174A (en) Method and apparatus for information transmission
CN104813640B (en) A kind of Sink node method for routing and node device
Quaglia et al. Grain sensitive event scheduling in time warp parallel discrete event simulation
CN103312822A (en) Push-based SNS protocol optimization method
Zhuge et al. Preferential walk: towards efficient and scalable search in unstructured peer-to-peer networks
Khan et al. Popularity-aware content caching for distributed wireless helper nodes
CN105323320A (en) Content distribution method and device
Shen et al. A probability based subnet selection method for hot event detection in sina weibo microblogging
Abbas et al. Delay bounded spray and wait in delay tolerant networks
CN110046040A (en) Distributed task scheduling processing method and system and storage medium
Lee A deadlock detection mechanism for true fully adaptive routing in regular wormhole networks
CN104580113B (en) A kind of method and device of processing external request

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 510660 Guangzhou City, Guangzhou, Guangdong, Whampoa Avenue, No. 315, self - made 1-17

Applicant after: Guangzhou KuGou Networks Co., Ltd.

Address before: 510000 B1, building, No. 16, rhyme Road, Guangzhou, Guangdong, China 13F

Applicant before: Guangzhou KuGou Networks Co., Ltd.

GR01 Patent grant
GR01 Patent grant