CN110704174A - Memory release method and device, electronic equipment and storage medium - Google Patents

Memory release method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110704174A
CN110704174A CN201810744045.8A CN201810744045A CN110704174A CN 110704174 A CN110704174 A CN 110704174A CN 201810744045 A CN201810744045 A CN 201810744045A CN 110704174 A CN110704174 A CN 110704174A
Authority
CN
China
Prior art keywords
service data
area
information
log
received
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810744045.8A
Other languages
Chinese (zh)
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.)
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Communications Ltd Research Institute
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 China Mobile Communications Group Co Ltd, China Mobile Communications Ltd Research Institute filed Critical China Mobile Communications Group Co Ltd
Priority to CN201810744045.8A priority Critical patent/CN110704174A/en
Publication of CN110704174A publication Critical patent/CN110704174A/en
Pending legal-status Critical Current

Links

Images

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/5016Allocation 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 the resource being the memory
    • 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

Abstract

The invention relates to the technical field of wireless communication, and provides a memory release method, a device, electronic equipment and a storage medium, aiming at solving the problems of error deletion of service data and resource waste caused by untimely memory release during memory release in the prior art; according to a preset time length, first service data received in the time length is transferred from a receiving area to a buffer area, and first log information and transfer time corresponding to the transferred first service data are recorded, wherein the first log information comprises first storage position information of the transferred first service data in the buffer area; determining target first service data with the caching duration reaching a first set threshold according to the unloading time, and judging whether the first storage position corresponding to the target first service data in the buffer area stores the service data or not; and if so, deleting the service data stored in the first storage position.

Description

Memory release method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of wireless communications technologies, and in particular, to a method and an apparatus for releasing a memory, an electronic device, and a storage medium.
Background
The back-end system performs network communication based on HTTP/HTTPs, and requires higher real-time performance of service data transmission between the mobile terminal and the back-end system when the management and control of the mobile terminal are realized. Because a large amount of calculation work such as service data exchange, service data query and service data storage exists in the management and control process, the management and control scale becomes larger and larger as the connection number of the mobile terminals becomes larger and larger, the related services become more and more complex, network congestion is easily caused, and the performance of a back-end system of the back-end system is sharply reduced.
Therefore, in the prior art, the service data is usually stored in the memory to alleviate performance degradation of the back-end system, and meanwhile, in order to avoid partial functional effects of the back-end system caused by the fact that the service data stored in the memory reaches the threshold, the service data in the memory is released again.
However, the commonly used memory release methods in the prior art are also very different, and the more commonly used methods include the following two methods:
memory release method based on cache time
That is, after delaying a period of time from the time point of memory service data updating, the service data in the period of time is released.
Pointer rule-based memory release method
The service data in the memory is arranged into an FIFO queue according to the FIFO rule, then the service data pointer compiled according to the preset check rule is used for checking whether the service data which is not accessed by any service exists in the FIFO queue, if so, the part of the service data is released.
In the first method, the delay time is statically specified, and if the delay time is too short, when the delay time arrives, if the service data to be released is accessed, the service data is deleted by mistake, and the access of the service data is influenced; if the delay time is too long, the release is not timely, so that the amount of the idle memory provided by the back-end system is reduced, and the waste of memory resources is caused.
In the second method, the check rule of the service data pointer to the FIFO queue is rigid, and if the service type is increased and the check rule of the pointer does not relate to a newly added type, the service data is deleted by mistake because the newly added type cannot be identified, thereby affecting the service data access; if the service types are reduced and the pointers still follow the original service types to perform service data verification, the verification efficiency is reduced, the release is not timely, the number of idle memories provided by the back-end system is reduced, and the waste of memory resources is caused.
Therefore, how to solve the problems that the service data access is affected due to the mistaken deletion of the service data and the resource waste is caused when the memory release is not timely in the memory release method in the prior art is a problem worth paying attention.
Disclosure of Invention
The invention discloses a memory release method, a memory release device, electronic equipment and a storage medium, which are used for solving the problems that service data access is influenced due to mistaken deletion of service data when memory release is carried out and memory resources are wasted when the memory release is not in time in the prior art.
To achieve the above object, according to another aspect of the present invention, there is provided a memory release method, where the memory includes a receiving area and a buffer area, the method includes:
storing the received service data in the receiving area;
according to a preset time length, first service data received in the time length are transferred from the receiving area to the buffer area, and corresponding first log information and transfer time are recorded for the transferred first service data, wherein the first log information comprises first storage position information of each transferred first service data in the buffer area;
determining target first service data with the caching duration reaching a first set threshold according to the unloading moment, and judging whether the first storage position corresponding to the target first service data in the buffer area stores the service data or not; and if so, deleting the service data stored in the first storage position.
As can be seen from the above description, in the present invention, the memory is divided into the receiving area and the buffer area, where the receiving area is used to store the received service data, and the service data stored in the receiving area is batch-transferred to the buffer area according to the preset time length, so as to release the memory in the receiving area. At this time, the log system records log information and unloading time corresponding to the unloaded first service data according to the unloaded first service data, wherein the log information comprises first storage position information of the first service data in the buffer area. When the service data stored in the buffer area is accessed again by the user, the service data is transferred to the receiving area again, so that when the caching duration of the first service data in the buffer area reaches a first set threshold value, if the service data is stored in the corresponding first storage position in the buffer area, the service data is the service data which is not accessed again by the user, and therefore the service data can be deleted from the buffer area, and the memory in the buffer area is released. Therefore, in the invention, the memory of the receiving area can be released in time by transferring the service data in the receiving area, and the service data after transferring is deleted after the buffer area stores the cache duration of the first set threshold value, so that the user can conveniently access the service data in the buffer area again before the memory is completely released, thereby ensuring that the memory can be fully released and avoiding the problem that the service data access is influenced due to the mistaken deletion of the service data.
Specifically, after the received service data is stored in the receiving area, the method further includes:
second log information corresponding to each service data record stored in the receiving area, wherein the second log information comprises the time information of each received service data and second storage position information in the receiving area;
the unloading the first service data received in the time length from the receiving area to the buffer area comprises:
determining first service data received within the time length and a target storage position of the first service data in the receiving area according to the received time information of each piece of service data included in the second log information and second storage position information in the receiving area;
copying the first service data to the buffer area for storage;
and deleting the corresponding service data stored in the receiving area from the target storage position according to the first service data stored in the buffer area.
As can be seen from the above, the service data stored in the receiving area also has the corresponding second log information recorded therein, and the second log information includes the time information at which each piece of service data is received and the second storage location information in the receiving area, so that the first service data and the target storage location of the first service data in the receiving area can be determined according to the time information at which each piece of service data is received and the second storage location information in the receiving area. When the first service data is transferred from the receiving area to the buffer area, the first service data is copied to the buffer area, and then the corresponding service data stored in the receiving area is deleted from the target storage position, so that the problem that the service data is unavailable due to the fact that the service data in the receiving area is deleted by mistake in the transferring process can be avoided to a certain extent.
Specifically, the log information further includes first identification information of a home service of each piece of service data and second identification information of the visited device, the first log information further includes time information at which each piece of first service data is received, and the deleting, according to the first service data stored in the buffer, the corresponding service data stored in the receiving area includes:
according to the time information of each piece of first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the first log information, and the time information of the corresponding first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the second log information, the first service data copied to the buffer area is identified, and according to the first service data copied to the buffer area, the corresponding service data stored in the receiving area is deleted from the target storage position.
When the corresponding service data stored in the receiving area is deleted from the target storage position, the first service data copied to the buffer area is identified by comparing the time information of the received service data, the first identification information of the service and the second identification information of the accessed device, which are included in the first log information and the second log information, and the corresponding service data stored in the receiving area is deleted from the target storage position according to the first service data copied to the buffer area, so that the service data deleted in the receiving area can be ensured to be the service data successfully transferred to the buffer area, and the problem that the service data is unavailable due to the mistaken deletion of the service data can be further avoided, and the user experience is improved.
Specifically, the method further comprises:
according to the time information of each piece of first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the first log information, and the time information of the corresponding first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the second log information, the first service data which is not copied to the buffer area is identified, the user is informed of the first service data which is not copied to the buffer area, and the user manually copies the first service data which is not copied to the buffer area for storage.
Since some service data may be lost or cannot be copied due to a backend system or the service data being accessed in the copying process, it is necessary to identify the first service data that is not copied to the buffer by comparing the received time information of the service data, the first identification information of the service, and the second identification information of the accessed device, which are included in the first log information and the second log information, and notify the user to manually copy the first service data that is not copied to the buffer for storage. Therefore, in the invention, by carrying out manual auditing treatment on the abnormal service data which fails to be transferred and stored, the safety risk of the service data caused by over-automation can be effectively reduced, so that the integrity of the service data is ensured.
Specifically, before deleting the service data stored in the first storage location, the method further includes:
and copying the service data stored in the first storage position to a local disk for storage, and performing subsequent operation after the local disk stores the service data.
That is to say, in the present invention, before deleting the service data that is not re-accessed by the user, the part of the service data is first transferred to the local disk, so as to count the access of the user and use the statistics for subsequent data analysis.
Specifically, the local disk includes a compression area and a archive area, and the copying the service data stored in the first storage location to the local disk includes:
copying the service data stored in the first storage position to a compression area of a local disk for storage;
after the service data stored in the first storage location is copied to a compressed area of a local disk for storage, the method further includes:
and compressing the second service data of which the copying time length reaches a second set threshold value according to the copying time of each piece of service data copied to the local disk, copying the compressed second service data to the filing area, deleting the second service data in the compression area, and deleting the second service data in the filing area when the filing time length of the second service data in the filing area reaches a third set threshold value.
In the invention, the local disk is divided into the compression area and the filing area, so that the service data copied into the local disk can be compressed in the compression area, and the occupied space in the local disk can be reduced. The compressed business data is filed and stored through the filing area, so that the business data accessed by the user can be counted conveniently in the later period, and data analysis is performed. The service data in the compression area and the filing area are deleted, so that the local disk can be released.
According to another aspect of the present invention, there is also provided an electronic device, a memory of which includes a receiving area and a buffer area, the electronic device including: a processor, a memory, and a transceiver;
the transceiver is used for receiving service data under the control of the processor;
the processor is used for reading the program in the memory and executing the following processes: storing the received service data in the receiving area; according to a preset time length, first service data received in the time length are transferred from the receiving area to the buffer area, and corresponding first log information and transfer time are recorded for the transferred first service data, wherein the first log information comprises first storage position information of each transferred first service data in the buffer area; determining target first service data with the caching duration reaching a first set threshold according to the unloading moment, and judging whether the first storage position corresponding to the target first service data in the buffer area stores the service data or not; and if so, deleting the service data stored in the first storage position.
Specifically, the processor is further configured to record, after the received service data is stored in the receiving area, corresponding second log information for each piece of service data stored in the receiving area, where the second log information includes time information at which each piece of service data is received and second storage location information in the receiving area; the unloading the first service data received in the time length from the receiving area to the buffer area comprises: determining first service data received within the time length and a target storage position of the first service data in the receiving area according to the received time information of each piece of service data included in the second log information and second storage position information in the receiving area; copying the first service data to the buffer area for storage; and deleting the corresponding service data stored in the receiving area from the target storage position according to the first service data stored in the buffer area.
Specifically, the log information further includes first identification information of each service data attribution service and second identification information of the visited device, the first log information further includes time information of each piece of first service data being received, the processor specifically identifies, according to the time information of each piece of first service data being received, the first identification information of the service and the second identification information of the visited device included in the first log information, and the time information of the corresponding first service data being received, the first identification information of the service and the second identification information of the visited device included in the second log information, the first service data copied to the buffer, and deletes, according to the first service data copied to the buffer, the corresponding service data stored in the receiving area from the target storage location.
Specifically, the processor is further configured to identify, according to time information of receiving each piece of first service data, first identification information of a service, and second identification information of the accessed device, which are included in the first log information, and time information of receiving the corresponding piece of first service data, first identification information of a service, and second identification information of the accessed device, which are included in the second log information, the first service data that is not copied to the buffer is identified, and notify the user of the first service data that is not copied to the buffer, so that the user manually copies the first service data that is not copied to the buffer for storage.
Specifically, the processor is further configured to copy the service data stored in the first storage location to a local disk storage before deleting the service data stored in the first storage location, and perform subsequent operations after the local disk stores the service data.
Specifically, the local disk of the electronic device includes a compressed area and an archive area, and the processor is specifically configured to copy the service data stored in the first storage location to the compressed area of the local disk for storage; after the service data stored in the first storage location is copied to a compression area of a local disk for storage, according to the copying time of each piece of service data copied to the local disk, compressing second service data with the copying time length reaching a second set threshold value, copying the compressed second service data to the filing area, deleting the second service data in the compression area, and deleting the second service data in the filing area when the filing time length of the second service data in the filing area reaches a third set threshold value.
According to another aspect of the present invention, there is also provided a memory releasing apparatus, the memory including a receiving area and a buffer area, the apparatus including:
the receiving module is used for storing the received service data in the receiving area;
the unloading module is used for unloading the first service data received within the time length from the receiving area to the buffer area according to the preset time length, and recording corresponding first log information and unloading time aiming at the unloaded first service data, wherein the first log information comprises first storage position information of each unloaded first service data in the buffer area;
the release module is used for determining target first service data with the caching duration reaching a first set threshold according to the unloading moment and judging whether the first storage position corresponding to the target first service data in the buffer area stores the service data or not; and if so, deleting the service data stored in the first storage position.
According to another aspect of the present invention, there is also provided an electronic apparatus, including: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
the memory stores a computer program, and when the program is executed by the processor, the program causes the processor to execute the steps of the memory release method.
According to another aspect of the present invention, there is also provided a computer-readable storage medium storing a computer program executable by an electronic device, wherein the program, when executed on the electronic device, causes the electronic device to execute the steps of the above memory release method.
The invention has the following beneficial effects:
the invention provides a memory release method, a memory release device, electronic equipment and a storage medium, wherein the method comprises the following steps: storing the received service data in the receiving area; according to a preset time length, first service data received in the time length are transferred from the receiving area to the buffer area, and corresponding first log information and transfer time are recorded for the transferred first service data, wherein the first log information comprises first storage position information of each transferred first service data in the buffer area; determining target first service data with the caching duration reaching a first set threshold according to the unloading moment, and judging whether the first storage position corresponding to the target first service data in the buffer area stores the service data or not; and if so, deleting the service data stored in the first storage position. Therefore, in the memory release method provided by the invention, the memory of the receiving area can be released in time by transferring the service data in the receiving area, and in addition, the transferred service data is deleted after the buffer area stores the cache duration of the first set threshold value, so that the user can conveniently access the service data in the buffer area again before the memory is completely released, and the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a memory release method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a log system generating a receiving log table provided in the embodiment of the present invention;
fig. 3 is a schematic diagram of a journal system generating a dump journal table according to an embodiment of the present invention;
fig. 4 is a schematic diagram of deleting a memory in a receiving area according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a log system generating a packed log table according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a delete buffer memory according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating an archive log table generated by the log system in an embodiment of the present invention;
FIG. 8 is a diagram illustrating a process of transferring a log system record from a compressed area to an archive area according to an embodiment of the present invention;
FIG. 9 is a diagram illustrating deletion of a storage in a filing area according to an embodiment of the present invention;
fig. 10 is an electronic device provided in an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a memory release device according to an embodiment of the present invention;
fig. 12 is an electronic device provided in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The first embodiment is as follows:
the existing memory resource release technologies have two types, one is a time-based memory delay release method, and the other is to release the memory resources by sequencing the service data in the memory according to the FIFO rule. Because the delay time in the first scheme is statically specified, if the delay time is too short, when the delay time arrives, if the service data to be released is accessed, the service data is deleted by mistake, and the access of the service data is influenced; if the delay time is too long, the release is not timely, so that the amount of the idle memory provided by the back-end system is reduced, and the waste of memory resources is caused. In the second scheme, the check rule of the service data pointer to the FIFO queue is rigid, if the service type is increased and the check rule of the pointer does not relate to a newly added type, the service data can be deleted by mistake due to the fact that the newly added type cannot be identified, and service data access is influenced; if the service types are reduced and the pointers still follow the original service types to perform service data verification, the verification efficiency is reduced, the release is not timely, the number of idle memories provided by the back-end system is reduced, and the waste of memory resources is caused. Therefore, the memory release methods in the prior art all have the problems that service data access is affected due to the mistaken deletion of the service data, and resources are wasted due to the untimely memory release.
To overcome the foregoing technical problem, an embodiment of the present invention provides a memory release method, where in the embodiment of the present invention, a memory includes a receiving area and a buffer area, as shown in fig. 1, the method includes the following steps:
s101: and storing the received service data in the receiving area.
In the embodiment of the invention, after the back-end system receives the service data, the service data is directly stored in the memory of the receiving area, and then the receiving behavior of each receiving instance is recorded through the bottom log system, namely log information corresponding to each service data is recorded.
Therefore, after storing the received service data in the receiving area, the method further includes:
and recording second log information corresponding to each piece of service data stored in the receiving area, wherein the second log information comprises the time information of the received each piece of service data and second storage position information in the receiving area.
Specifically, in the embodiment of the present invention, the log information corresponding to each piece of service data may be stored in the same log table according to the sequence of the receiving time, that is, the log information corresponding to each piece of service data may exist in the form of a log table. Therefore, in the embodiment of the present invention, the second log information corresponding to each piece of service data may be a receiving log table corresponding to each piece of service data generated by the log system when each piece of service data is received. It is to be understood that, in the embodiment of the present invention, a form of storing the second log information is not limited to only one form of the log table, as long as the corresponding second log information can be recorded, and therefore, in the embodiment of the present invention, a storage form of the second log information is not particularly limited.
Step S102: and according to a preset time length, transferring the first service data received in the time length from the receiving area to the buffer area, and recording corresponding first log information and transfer time aiming at the transferred first service data, wherein the first log information comprises first storage position information of each piece of transferred first service data in the buffer area.
Since the received service data are all stored in the receiving area, in order to release the memory of the receiving area, the back-end system can transfer the first service data received within the time length from the receiving area to the buffer area in batches according to the preset time length. The batch unloading is to reduce the business data exchange work of the back-end system.
For convenience of describing the above unloading process, in the embodiment of the present invention, the preset time length is 1 hour, for example, so that the back-end system automatically unloads the first service data received in each hour from the receiving area to the buffer area. For example, when the time is 2 o 'clock, the first transferred service data is the service data received between 1 o' clock and 2 o 'clock, and similarly, when the time is 3 o' clock, the first transferred service data is the service data received between 2 o 'clock and 3 o' clock. Therefore, the back-end system can automatically store the service data received within 1 hour.
Since the log system records the first log information corresponding to each piece of first service data for the unloading behavior of each unloading instance, after the first service data is unloaded from the receiving area to the buffer area, the log system also generates an unloading log table corresponding to the first log information of each piece of unloaded first service data, and the unloading log table records the first storage location information of each piece of unloaded first service data in the buffer area.
For example, when the time is 2 o ' clock, the backend system may transfer the first service data received between 1 o ' clock and 2 o ' clock from the receiving area to the buffer area, and if the corresponding storage location of the transferred first service data in the buffer area is 1 to 800, the log system may record the specific storage location of each first service data in the buffer area in the transfer log table.
Specifically, in the embodiment of the present invention, when the log system generates the receiving log and the unloading log table, the process is as follows:
that is, as shown in fig. 2, the logging system includes a report storage unit and a logging unit, the report storage unit is used for recording the receiving behavior and the unloading behavior of the service data, and the logging unit is used for generating a log table corresponding to the report storage unit.
Therefore, when the service data is received, the report storage unit automatically generates a corresponding storage report file according to the received service data, and the log recording unit records the receiving behavior of each receiving instance according to the storage report file, that is, generates a receiving log table corresponding to the log information of each service data.
In the embodiment of the present invention, when the receiving Log table is generated, the receiving Log table is automatically divided in units of minutes, that is, a Log table corresponding to the service data received in the minute is output every minute, and is recorded as Log _ a. When the first service data received within the set time length is transferred, the process of transferring the first service data received within the set time length is as shown in fig. 3, that is, the Log system splices the Log _ a output every minute and generates a receiving Log table Log _ a' corresponding to the first service data. When unloading is carried out based on Log _ A', the report storage unit generates an unloading report according to the unloading behavior at this time, and the Log recording unit generates a corresponding unloading Log table, namely Log _ B, according to the unloading report.
Step S103: determining target first service data with the caching duration reaching a first set threshold according to the unloading moment, and judging whether the first storage position corresponding to the target first service data in the buffer area stores the service data or not; and if so, deleting the service data stored in the first storage position.
In the embodiment of the present invention, by setting the cache duration to reach the first set threshold, before the memory in the buffer is completely released, the user can conveniently revisit the first service data which is transferred to the buffer within the cache duration by the user. Since the receiving area and the buffer area are both located in the memory of the back-end system, when the first service data transferred into the buffer area is accessed again by the user, the first service data will return to the receiving area again. Therefore, when the memory of the buffer area is released, only whether the service data is stored in the corresponding first storage position in the buffer area needs to be judged.
That is, if the corresponding first storage location in the buffer does not store the service data, it indicates that the service data is the service data accessed again by the user, that is, the active data; if the corresponding first storage location in the buffer stores the service data, it indicates that the service data is service data that is not accessed again by the user, so that the service data can be deleted from the buffer to release the memory of the buffer.
It should be noted that, in the embodiment of the present invention, the first setting threshold of the cache duration may be set according to an actual requirement of a user, which is not limited in a unified manner, so that the memory release method provided in the embodiment of the present invention has general versatility.
Therefore, in the embodiment of the invention, the memory is divided into the receiving area and the buffer area, the accessed service data can be stored in the receiving area for a short time, and the memory in the receiving area can be released in time after the service data in the receiving area is transferred to the buffer area, so that the resource waste is avoided. After the service data is transferred to the buffer area, the buffer area can buffer the service data for a long time, so that when the user needs to access the service data again, the service data can be directly obtained from the buffer area, and the service data can be effectively prevented from being deleted by mistake and influencing the service data access. Therefore, the memory release method provided by the embodiment of the invention can ensure that the memory is fully released, and can also avoid the problem that the service data access is influenced due to the mistaken deletion of the service data.
Example two:
on the basis of the foregoing embodiment, in the embodiment of the present invention, the unloading, from the receiving area to the buffer area, the first service data received within the first set time length includes:
the unloading the first service data received in the time length from the receiving area to the buffer area comprises:
determining first service data received within the time length and a target storage position of the first service data in the receiving area according to the received time information of each piece of service data included in the second log information and second storage position information in the receiving area;
copying the first service data to the buffer area for storage;
and deleting the corresponding service data stored in the receiving area from the target storage position according to the first service data stored in the buffer area.
Since the second log information corresponding to each piece of service data is a receiving log table corresponding to each piece of service data generated by the log system when each piece of service data is received, the receiving log table records the time information of each piece of service data received and the storage position of each piece of service data in the receiving area, and when the first service data to be transferred is determined, the determination can be made according to the time information of each piece of service data received and the storage position of each piece of service data in the receiving area recorded in the receiving log table.
That is, if the first service data to be transferred is service data received between point 1 and point 2, and the service data received within the time length is stored in the storage location corresponding to the receiving area as 200 and 400, the service data stored between 200 and 400 is the first service data to be transferred.
When the first service data is transferred, the first service data is transferred from the receiving area to the buffer area, and then the corresponding service data stored between 200 and 400 in the receiving area is deleted according to the copied first service data stored in the buffer area.
Therefore, in the embodiment of the present invention, when the first service data received within the preset time length is transferred, the first service data is copied, and then the corresponding service data stored in the receiving area is deleted from the target storage location according to the copied first service data stored in the buffer area, so as to avoid the problem that the service data is unavailable due to the mistaken deletion of the service data in the receiving area or the loss of the service data during the transfer process.
Example three:
since the service ID corresponding to each piece of service data can be determined by identifying the interface accessed by each piece of service data, and each piece of service data also carries the device ID of the accessed device, on the basis of the above embodiment, in the embodiment of the present invention, the log information further includes the first identification information of the service to which each piece of service data belongs and the second identification information of the accessed device.
That is, regardless of the receiving log table or the unloading log table, the service ID corresponding to each piece of service data and the device ID of the accessed device are recorded.
It should be noted that the first log information further includes time information of receiving each piece of the first service data, that is, the dump log table further records time information of receiving each piece of the dumped first service data. Specifically, the time information of each piece of traffic data received recorded by the reception log table and the dump log table may be a time stamp of each piece of traffic data received.
As can be seen from the above, when the first service data received within the preset time length is allowed to be stored, the first service data needs to be copied and then deleted. However, due to a system reason or the service data being accessed, some service data may be lost or cannot be copied, so to further ensure that no service data is deleted by mistake or lost during the unloading process, on the basis of the above embodiment, in an embodiment of the present invention, the deleting, according to the first service data stored in the buffer, the corresponding service data stored in the receiving area includes:
according to the time information of each piece of first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the first log information, and the time information of the corresponding first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the second log information, the first service data copied to the buffer area is identified, and according to the first service data copied to the buffer area, the corresponding service data stored in the receiving area is deleted from the target storage position.
That is, as shown in fig. 4, the Log system further includes a Log comparison module, which compares the received Log table Log _ a 'and the Log dump table Log _ B generated in the first embodiment, because the Log _ a' and the Log _ B both record the timestamp of receiving each piece of service data, the service ID, and the device ID of the accessed device, the Log comparison unit may compare each Log in the Log _ a 'and the Log _ B based on the timestamp and the storage location information, and then compare the keyword in each Log, that is, the service ID, and the device ID of the accessed device, to determine whether the Log _ a' and the Log _ B are consistent, that is, determine whether Diff (Log _ B, Log _ a ') is empty, if the Log _ B' is empty, the Log _ a 'is consistent with the Log _ B, and indicate that all the service data corresponding to the Log _ a' is dumped into the Log buffer, and adds a success flag for Log _ B. At this time, the report storage unit releases the memory occupied by all the first service data recorded in the Log _ a'.
And if the Log _ B ' is not empty, the Log _ a ' and the Log _ B are inconsistent, which indicates that some service data are lost in the unloading process, at this time, the service data successfully copied to the buffer area can be identified according to the comparison result of each Log in the Log _ a ' and the Log _ B, and the corresponding service data in the receiving area can be deleted according to the service data successfully copied to the buffer area, so as to ensure that the deleted service data in the receiving area are all the service data successfully unloaded to the buffer area, thereby further avoiding the problem that the service data are unavailable due to the mistaken deletion of the service data, and improving the user experience.
Example four:
on the basis of the above embodiment, in an embodiment of the present invention, the method further includes:
according to the time information of each piece of first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the first log information, and the time information of the corresponding first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the second log information, the first service data which is not copied to the buffer area is identified, the user is informed of the first service data which is not copied to the buffer area, and the user manually copies the first service data which is not copied to the buffer area for storage.
That is to say, when the Log comparison module compares the received Log table Log _ a 'and the dump Log table Log _ B generated in the first embodiment, if the Log _ B' is not empty, the Log _ a 'is not consistent with the Log _ B, which indicates that some service data are lost during the dump process, at this time, the report storage unit generates a manual dump report based on the Log _ B', stores the manual dump report in the manual dump folder, and notifies the user of polling at regular time, so that the user manually copies the Log information recorded in the manual dump file into the buffer area.
Because a second storage position of the received service data in the receiving area is also recorded in the receiving Log table Log _ a 'and the transferring Log table Log _ B, a manual transferring report is generated based on the Log _ B', and a second storage position of the service data which is not successfully copied into the buffer area is correspondingly recorded in the receiving area.
Example five:
to facilitate statistics according to the access records of the user and use the statistics for subsequent data analysis, on the basis of the above embodiment, in an embodiment of the present invention, before deleting the service data stored in the first storage location, the method further includes:
and copying the service data stored in the first storage position to a local disk for storage, and performing subsequent operation after the local disk stores the service data.
That is, suppose that the target first service data that needs to be deleted is the service data stored between 200-. Before deleting the target first service data, the target first service data is first transferred from the buffer area to the local disk, and then the corresponding service data stored in the buffer area between 200 and 400 is deleted according to the first service data which is copied and stored to the local disk.
Therefore, in the embodiment of the present invention, before deleting the service data that is not accessed by the user, the target first service data is copied, and then the corresponding service data stored in the buffer area is deleted according to the first service data that has been copied and stored in the local disk, so that the problem of inaccurate data statistics caused by mistaken deletion or loss of the service data in the buffer area during the deletion process can be avoided.
In this embodiment of the present invention, the local disk includes a compression area and a archive area, and thus copying the service data stored in the first storage location to the local disk includes:
and copying the service data stored in the first storage position to a compression area of the local disk for storage.
Specifically, after the service data stored in the first storage location is copied to a compressed area of the local disk for storage, the method further includes:
and compressing the second service data of which the copying time length reaches a second set threshold value according to the copying time of each piece of service data copied to the local disk, copying the compressed second service data to the filing area, deleting the second service data in the compression area, and deleting the second service data in the filing area when the filing time length of the second service data in the filing area reaches a third set threshold value.
That is to say, the deleted service data in the buffer area will be copied to the compression area of the local disk first, and the compression area will perform packet compression on the second service data whose copy duration reaches the second set threshold.
The process of packing and compressing the copied service data in the compression area is as shown in fig. 5, that is, the report storing unit records this packing, and the Log recording unit generates a packed Log table Log _ C after the packing is completed, where the Log _ C records a timestamp of each piece of service data received, a service ID, and an equipment ID of the accessed equipment.
Specifically, in order to ensure the accuracy of the service data statistics, it is necessary to ensure that the service data before and after the packing compression is the same, so as shown in fig. 6, the Log comparison unit compares the Log table Log _ B generated in the above embodiment with the Log table Log _ C generated in the above embodiment to determine whether all the service data corresponding to the Log _ C is successfully packed. It should be noted that, at this time, all the service data corresponding to the Log _ B is successfully transferred.
Since the Log _ B and the Log _ C both record a timestamp, a service ID, and an equipment ID of the accessed equipment, where each piece of service data is received, the Log comparison unit may compare each Log in the Log _ B and the Log _ C based on the timestamp, and then compare the keyword in each Log, that is, the service ID, with the equipment ID of the accessed equipment, to determine whether the Log _ B is consistent with the Log _ C, that is, when determining that Diff (Log _ B, Log _ C) ═ Log _ C ', whether the Log _ C ' is empty, and if the Log _ C ' is empty, the Log _ B is consistent with the Log _ C, which indicates that all pieces of service data corresponding to the Log _ B are successfully packed. At this time, the service data in the buffer area is deleted, and a success flag is added to Log _ C.
And if the Log _ C ' is not empty, the Log _ B is inconsistent with the Log _ C, which indicates that some service data are lost in the process of transferring from the buffer area to the compression area of the local cache, or due to a system reason, the corresponding service data in the Log _ C ' are the service data which are not successfully packaged and identified, at this time, the report storage unit generates and stores a package omission report according to the Log _ C ', and stores the report in a manual transfer folder for notifying a user to perform regular inspection, so that the user manually packs and compresses the omitted service data according to Log information recorded in the package omission report. And simultaneously, the report storage unit releases a memory occupied by all the first service data recorded in the Log _ B, and generates a zip file list to be archived, and at the moment, the Log recording unit generates a Log table Log _ D according to the zip files successfully packaged, wherein the Log _ D can take the day as a unit, and a new Log _ D is recorded every day.
Because the log information recorded in the package omission report also comprises the storage position of the service data which is not successfully packaged in the packaging area, when the service data packaging process is abnormal, the position of the abnormal service data which is failed in packaging can be positioned according to the position information recorded in the package omission report, and then the abnormal service data is audited manually, so that the safety risk of the service data caused by over-automation is further effectively reduced.
Specifically, when a zip file after being packed and compressed is transferred to an archive area, as shown in fig. 7, the report storage unit records the transfer, the report archive unit of the archive area archives the zip file according to the service ID or the device ID of the accessed device, and the Log recording unit generates a Log table Log _ E after the archive is completed, where the Log _ E also takes day as a unit and records a new Log _ E every day.
Specifically, in order to ensure the accuracy of the business data statistics, it is necessary to ensure that the business data before and after archiving are the same, and therefore, as shown in fig. 8, the Log comparison unit may compare the Log _ D with the packed Log table Log _ E based on the foregoing description to determine whether all the business data corresponding to the Log _ E is successfully archived.
Because the Log _ D and the Log _ E both record a timestamp, a service ID, and an equipment ID of the accessed equipment, the Log comparison unit may compare the Log _ D and each Log in the Log _ E based on the timestamp, and then compare the Log _ E 'with the equipment ID of the accessed equipment based on a keyword in each Log, that is, the service ID, to determine whether the Log _ D is consistent with the Log _ E, that is, when determining that Diff (Log _ D, Log _ E) ═ Log _ E', whether the Log _ E 'is empty, if the Log _ E' is empty, the Log _ D is consistent with the Log _ E, which indicates that all the service data corresponding to the Log _ E are successfully filed, and adds a flag to the Log _ E.
If the Log _ E 'is not empty, the Log _ D is inconsistent with the Log _ E, which indicates that the business data corresponding to the Log _ E is not completely archived successfully, and at this time, the Log recording unit records an archive omission report according to the Log _ E', and stores the archive omission report in a manual archive folder, so as to notify the user of regular inspection, so that the user can manually archive the omitted business data according to Log information recorded in the archive omission report.
Because the log information recorded in the archiving omission report also comprises the storage position of the service data which is not successfully packaged in the packaging area, when the service data is abnormal in the archiving process, the position of the abnormal service data which is unsuccessfully archived can be positioned according to the position information recorded in the archiving omission report, and then the abnormal service data is audited manually, so that the safety risk of the service data caused by over-automation is further effectively reduced.
Specifically, in the embodiment of the present invention, the third set threshold corresponding to the archive duration in the archive region is 3 months, that is, the service data in the archive region needs to be deleted until 3 months are stored, so that the user manually processes the abnormal service data within the period of time.
Since the deleted business data is the daily business data when the business data in the archive area is deleted, as shown in fig. 9, that is, the Log comparison unit needs to determine whether all the Log _ B, Log _ C, Log _ D corresponding to the current business data to be deleted in the day are successfully marked in the previous comparison process, if so, it indicates that all the business data are archived, if one Log table is not successfully marked, it needs to determine whether the current business data to be deleted in the day still have business data which are not manually transferred or manually packaged or manually archived, at this time, the report storage unit will inquire the manual transfer report in the transfer unsuccessful folder, or the packaging omission report in the packaging unsuccessful folder or the archiving omission report in the archiving unsuccessful folder, so as to locate the position when the abnormal business data is abnormal, then, the abnormal business data is deleted after being audited manually.
Therefore, in the embodiment of the present invention, by setting the memory as the receiving area and the buffer area, setting the local disk as the compression area and the archive area, and iterating the service data check layers in each area during the unloading process, the problem of unavailability of service data caused after the service data in the system memory is released due to a misoperation can be effectively avoided. In addition, when abnormal business data processing occurs, logs of abnormal business data which are failed to be transferred and stored are stored in the corresponding file folder, the abnormal business data which are abnormal can be positioned, and then the abnormal business data are audited manually, so that the safety risk of the business data caused by excessive automation can be effectively reduced.
It can be seen from the above that, when the check of the service data in each region is iterated layer by layer, the service ID is mainly compared with the device ID of the accessed device, and certainly, in practical application, the comparison may also be performed for other keywords, and in combination with the memory use characteristics of the current service of the user system, real-time memory allocation and recovery are performed, so that the problems of complicated check and inflexible check when the memory is released based on the FIFO rule sorting in the prior art are effectively avoided.
Example six:
according to another aspect of the present invention, there is also provided an electronic device, as shown in fig. 10, a memory of the electronic device includes a receiving area and a buffer area, the electronic device includes: a processor 1001, a memory 1002, and a transceiver 1003;
in fig. 10, the bus architecture may include any number of interconnected buses and bridges, with one or more processors, represented by the processor 1001, and various circuits, represented by the memory 1002, being linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. The transceiver 1003 may be a number of elements including a transmitter and a receiver, providing a means for communicating with various other apparatus over a transmission medium. The processor 1001 is responsible for managing a bus architecture and general processes, and the memory 1002 may store service data used by the processor 1001 in performing operations.
Alternatively, the processor 1001 may be a CPU (central processing unit), an ASIC (Application specific integrated Circuit), an FPGA (Field Programmable Gate Array), or a CPLD (Complex Programmable Logic Device).
The transceiver 1003 is configured to receive service data under the control of the processor 1001;
the processor 1001 is configured to read the program in the memory 1002, and execute the following processes: storing the received service data in the receiving area; according to a preset time length, first service data received in the time length are transferred from the receiving area to the buffer area, and corresponding first log information and transfer time are recorded for the transferred first service data, wherein the first log information comprises first storage position information of each transferred first service data in the buffer area; determining target first service data with the caching duration reaching a first set threshold according to the unloading moment, and judging whether the first storage position corresponding to the target first service data in the buffer area stores the service data or not; and if so, deleting the service data stored in the first storage position.
Specifically, the processor 1001 is further configured to record, for each piece of service data stored in the receiving area, corresponding second log information after storing the received service data in the receiving area, where the second log information includes time information at which each piece of service data is received and second storage location information in the receiving area; the unloading the first service data received in the time length from the receiving area to the buffer area comprises: determining first service data received within the time length and a target storage position of the first service data in the receiving area according to the received time information of each piece of service data included in the second log information and second storage position information in the receiving area; copying the first service data to the buffer area for storage; and deleting the corresponding service data stored in the receiving area from the target storage position according to the first service data stored in the buffer area.
Specifically, the log information further includes first identification information of a service to which each piece of service data belongs and second identification information of the visited device, the first log information further includes time information at which each piece of first service data is received, and the processor 1001 is specifically configured to identify, according to the time information at which each piece of first service data is received, the first identification information of the service, and the second identification information of the visited device, included in the first log information, and the time information at which the corresponding piece of first service data is received, the first identification information of the service, and the second identification information of the visited device, included in the second log information, the first service data copied to the buffer is identified, and according to the first service data copied to the buffer, the corresponding piece of service data stored in the receiving area is deleted from the target storage location.
Specifically, the processor 1001 is further configured to identify, according to the time information of receiving each piece of first service data, the first identification information of the service, and the second identification information of the accessed device, which are included in the first log information, and the time information of receiving the corresponding piece of first service data, the first identification information of the service, and the second identification information of the accessed device, which are included in the second log information, the first service data that is not copied to the buffer is identified, and the user is notified of the first service data that is not copied to the buffer, so that the user manually copies the first service data that is not copied to the buffer for storage.
Specifically, the processor 1001 is further configured to copy the service data stored in the first storage location to a local disk storage before deleting the service data stored in the first storage location, and perform subsequent operations after the local disk stores the service data.
Specifically, the local disk of the electronic device includes a compressed area and an archive area, and the processor 1001 is specifically configured to copy the service data stored in the first storage location to the compressed area of the local disk for storage; after the service data stored in the first storage location is copied to a compression area of a local disk for storage, according to the copying time of each piece of service data copied to the local disk, compressing second service data with the copying time length reaching a second set threshold value, copying the compressed second service data to the filing area, deleting the second service data in the compression area, and deleting the second service data in the filing area when the filing time length of the second service data in the filing area reaches a third set threshold value.
Example seven:
according to another aspect of the present invention, there is also provided a memory releasing apparatus, where the memory includes a receiving area and a buffer area, as shown in fig. 11, the apparatus includes:
a receiving module 1101, configured to store the received service data in the receiving area;
a dump module 1102, configured to dump, according to a preset time length, first service data received within the time length from the receiving area to the buffer area, and record, for the dumped first service data, corresponding first log information and a dump time, where the first log information includes first storage location information of each piece of dumped first service data in the buffer area;
a releasing module 1103, configured to determine, according to the unloading time, target first service data whose cache duration reaches a first set threshold, and determine whether service data is stored in a first storage location corresponding to the target first service data in the buffer area; and if so, deleting the service data stored in the first storage position.
Specifically, the apparatus further comprises:
a log generating module 1104, configured to record, for each piece of service data stored in the receiving area, second log information corresponding to the received service data, where the second log information includes time information of the received service data and second storage location information in the receiving area;
the unloading module 1102 is specifically configured to:
determining first service data received within the time length and a target storage position of the first service data in the receiving area according to the received time information of each piece of service data included in the second log information and second storage position information in the receiving area;
copying the first service data to the buffer area for storage;
and deleting the corresponding service data stored in the receiving area from the target storage position according to the first service data stored in the buffer area.
Specifically, the log information further includes first identification information of a service to which each piece of service data belongs and second identification information of the visited device, where the first log information further includes time information at which each piece of first service data is received, and the dump module 1102 is specifically configured to identify, according to the time information at which each piece of first service data is received, the first identification information of the service, and the second identification information of the visited device, included in the first log information, and the time information at which the corresponding piece of first service data is received, the first identification information of the service, and the second identification information of the visited device, included in the second log information, the first service data copied to the buffer is identified, and according to the first service data copied to the buffer, the corresponding piece of service data stored in the receiving area is deleted from the target storage location.
Specifically, the apparatus further comprises:
a notifying module 1105, configured to identify the first service data that is not copied to the buffer according to the time information of receiving each piece of first service data, the first identification information of the service, and the second identification information of the accessed device, which are included in the first log information, and the time information of receiving the corresponding piece of first service data, the first identification information of the service, and the second identification information of the accessed device, which are included in the second log information, and notify the user of the first service data that is not copied to the buffer, so that the user manually copies the first service data that is not copied to the buffer for storage.
Specifically, the apparatus further comprises:
the copy module 1106 is configured to copy the service data stored in the first storage location to a local disk for storage before deleting the service data stored in the first storage location, and perform subsequent operations after the local disk stores the service data.
Specifically, the copying module 1106 is specifically configured to copy the service data stored in the first storage location to a compressed area of a local disk for storage.
Specifically, the apparatus further comprises:
a deleting module 1107, configured to, after the service data stored in the first storage location is copied to a compression area of a local disk for storage, compress, according to the copy time at which each piece of service data is copied to the local disk, second service data whose copy time reaches a second set threshold, delete, after the compressed second service data is copied to the filing area, the second service data in the compression area, and delete, when the filing time of the second service data in the filing area reaches a third set threshold, the second service data in the filing area.
Example eight:
according to another aspect of the present invention, there is also provided an electronic apparatus, as shown in fig. 12, including: the system comprises a processor 1201, a communication interface 1202, a memory 1203 and a communication bus 1204, wherein the processor 1201, the communication interface 1202 and the memory 1203 are communicated with each other through the communication bus 1204;
the memory 1203 stores therein a computer program which, when executed by the processor 1201, causes the processor 1201 to perform the steps of the above memory release method:
storing the received service data in the receiving area;
according to a preset time length, first service data received in the time length are transferred from the receiving area to the buffer area, and corresponding first log information and transfer time are recorded for the transferred first service data, wherein the first log information comprises first storage position information of each transferred first service data in the buffer area;
determining target first service data with the caching duration reaching a first set threshold according to the unloading moment, and judging whether the first storage position corresponding to the target first service data in the buffer area stores the service data or not; and if so, deleting the service data stored in the first storage position.
Specifically, after the received service data is stored in the receiving area, the method further includes:
second log information corresponding to each service data record stored in the receiving area, wherein the second log information comprises the time information of each received service data and second storage position information in the receiving area;
the unloading the first service data received in the time length from the receiving area to the buffer area comprises:
determining first service data received within the time length and a target storage position of the first service data in the receiving area according to the received time information of each piece of service data included in the second log information and second storage position information in the receiving area;
copying the first service data to the buffer area for storage;
and deleting the corresponding service data stored in the receiving area from the target storage position according to the first service data stored in the buffer area.
Specifically, the log information further includes first identification information of a home service of each piece of service data and second identification information of the visited device, the first log information further includes time information at which each piece of first service data is received, and the deleting, according to the first service data stored in the buffer, the corresponding service data stored in the receiving area includes:
according to the time information of each piece of first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the first log information, and the time information of the corresponding first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the second log information, the first service data copied to the buffer area is identified, and according to the first service data copied to the buffer area, the corresponding service data stored in the receiving area is deleted from the target storage position.
Specifically, the method further comprises:
according to the time information of each piece of first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the first log information, and the time information of the corresponding first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the second log information, the first service data which is not copied to the buffer area is identified, the user is informed of the first service data which is not copied to the buffer area, and the user manually copies the first service data which is not copied to the buffer area for storage.
Specifically, before deleting the service data stored in the first storage location, the method further includes:
and copying the service data stored in the first storage position to a local disk for storage, and performing subsequent operation after the local disk stores the service data.
Specifically, the local disk includes a compression area and a archive area, and the copying the service data stored in the first storage location to the local disk includes:
copying the service data stored in the first storage position to a compression area of a local disk for storage;
after the service data stored in the first storage location is copied to a compressed area of a local disk for storage, the method further includes:
and compressing the second service data of which the copying time length reaches a second set threshold value according to the copying time of each piece of service data copied to the local disk, copying the compressed second service data to the filing area, deleting the second service data in the compression area, and deleting the second service data in the filing area when the filing time length of the second service data in the filing area reaches a third set threshold value.
The communication bus 1204 mentioned in the electronic devices in the above embodiments may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
A communication interface 1202 for communication between the electronic device and other devices.
The Memory 1203 may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The processor 1201 may be a general-purpose processor, and includes a central processing unit, a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
Example nine:
according to another aspect of the present invention, there is also provided a computer-readable storage medium storing a computer program executable by an electronic device, the program, when executed on the electronic device, causing the electronic device to perform the steps of the above memory release method:
storing the received service data in the receiving area;
according to a preset time length, first service data received in the time length are transferred from the receiving area to the buffer area, and corresponding first log information and transfer time are recorded for the transferred first service data, wherein the first log information comprises first storage position information of each transferred first service data in the buffer area;
determining target first service data with the caching duration reaching a first set threshold according to the unloading moment, and judging whether the first storage position corresponding to the target first service data in the buffer area stores the service data or not; and if so, deleting the service data stored in the first storage position.
Specifically, after the received service data is stored in the receiving area, the method further includes:
second log information corresponding to each service data record stored in the receiving area, wherein the second log information comprises the time information of each received service data and second storage position information in the receiving area;
the unloading the first service data received in the time length from the receiving area to the buffer area comprises:
determining first service data received within the time length and a target storage position of the first service data in the receiving area according to the received time information of each piece of service data included in the second log information and second storage position information in the receiving area;
copying the first service data to the buffer area for storage;
and deleting the corresponding service data stored in the receiving area from the target storage position according to the first service data stored in the buffer area.
Specifically, the log information further includes first identification information of a home service of each piece of service data and second identification information of the visited device, the first log information further includes time information at which each piece of first service data is received, and the deleting, according to the first service data stored in the buffer, the corresponding service data stored in the receiving area includes:
according to the time information of each piece of first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the first log information, and the time information of the corresponding first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the second log information, the first service data copied to the buffer area is identified, and according to the first service data copied to the buffer area, the corresponding service data stored in the receiving area is deleted from the target storage position.
Specifically, the method further comprises:
according to the time information of each piece of first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the first log information, and the time information of the corresponding first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the second log information, the first service data which is not copied to the buffer area is identified, the user is informed of the first service data which is not copied to the buffer area, and the user manually copies the first service data which is not copied to the buffer area for storage.
Specifically, before deleting the service data stored in the first storage location, the method further includes:
and copying the service data stored in the first storage position to a local disk for storage, and performing subsequent operation after the local disk stores the service data.
Specifically, the local disk includes a compression area and a archive area, and the copying the service data stored in the first storage location to the local disk includes:
copying the service data stored in the first storage position to a compression area of a local disk for storage;
after the service data stored in the first storage location is copied to a compressed area of a local disk for storage, the method further includes:
and compressing the second service data of which the copying time length reaches a second set threshold value according to the copying time of each piece of service data copied to the local disk, copying the compressed second service data to the filing area, deleting the second service data in the compression area, and deleting the second service data in the filing area when the filing time length of the second service data in the filing area reaches a third set threshold value.
The computer readable storage medium in the above embodiments may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic memory such as floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc., optical memory such as CDs, DVDs, BDs, HVDs, etc., and semiconductor memory such as ROMs, EPROMs, EEPROMs, non-volatile memory (NAND FLASH), Solid State Disks (SSDs), etc.
For the backend system/device embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to some descriptions of the method embodiment for relevant points.
It is to be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or operation from another entity or operation without necessarily requiring or implying any actual such relationship or order between such entities or operations.
It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, a backend system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely application embodiment, or an embodiment combining application and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (backend systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable business data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable business data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable business data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable business data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (15)

1. A method for releasing a memory, wherein the memory comprises a receiving area and a buffer area, the method comprising:
storing the received service data in the receiving area;
according to a preset time length, first service data received in the time length are transferred from the receiving area to the buffer area, and corresponding first log information and transfer time are recorded for the transferred first service data, wherein the first log information comprises first storage position information of each transferred first service data in the buffer area;
determining target first service data with the caching duration reaching a first set threshold according to the unloading moment, and judging whether the first storage position corresponding to the target first service data in the buffer area stores the service data or not; and if so, deleting the service data stored in the first storage position.
2. The method of claim 1, wherein after storing the received traffic data in the receiving area, the method further comprises:
second log information corresponding to each service data record stored in the receiving area, wherein the second log information comprises the time information of each received service data and second storage position information in the receiving area;
the unloading the first service data received in the time length from the receiving area to the buffer area comprises:
determining first service data received within the time length and a target storage position of the first service data in the receiving area according to the received time information of each piece of service data included in the second log information and second storage position information in the receiving area;
copying the first service data to the buffer area for storage;
and deleting the corresponding service data stored in the receiving area from the target storage position according to the first service data stored in the buffer area.
3. The method of claim 2, wherein the log information further includes first identification information of a home service of each piece of service data and second identification information of the visited device, the first log information further includes time information at which each piece of first service data is received, and the deleting of the corresponding service data stored in the receiving area based on the first service data stored in the buffer area includes:
according to the time information of each piece of first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the first log information, and the time information of the corresponding first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the second log information, the first service data copied to the buffer area is identified, and according to the first service data copied to the buffer area, the corresponding service data stored in the receiving area is deleted from the target storage position.
4. The method of claim 3, wherein the method further comprises:
according to the time information of each piece of first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the first log information, and the time information of the corresponding first service data received, the first identification information of the service and the second identification information of the accessed device which are included in the second log information, the first service data which is not copied to the buffer area is identified, the user is informed of the first service data which is not copied to the buffer area, and the user manually copies the first service data which is not copied to the buffer area for storage.
5. The method of claim 1, wherein before deleting the service data stored in the first storage location, the method further comprises:
and copying the service data stored in the first storage position to a local disk for storage, and performing subsequent operation after the local disk stores the service data.
6. The method of claim 5, wherein the local disk comprises a compression area and a archive area, and wherein copying the service data stored in the first storage location to the local disk storage comprises:
copying the service data stored in the first storage position to a compression area of a local disk for storage;
after the service data stored in the first storage location is copied to a compressed area of a local disk for storage, the method further includes:
and compressing the second service data of which the copying time length reaches a second set threshold value according to the copying time of each piece of service data copied to the local disk, copying the compressed second service data to the filing area, deleting the second service data in the compression area, and deleting the second service data in the filing area when the filing time length of the second service data in the filing area reaches a third set threshold value.
7. An electronic device, wherein a memory of the electronic device includes a receiving area and a buffer area, the electronic device comprising: a processor, a memory, and a transceiver;
the transceiver is used for receiving service data under the control of the processor;
the processor is used for reading the program in the memory and executing the following processes: storing the received service data in the receiving area; according to a preset time length, first service data received in the time length are transferred from the receiving area to the buffer area, and corresponding first log information and transfer time are recorded for the transferred first service data, wherein the first log information comprises first storage position information of each transferred first service data in the buffer area; determining target first service data with the caching duration reaching a first set threshold according to the unloading moment, and judging whether the first storage position corresponding to the target first service data in the buffer area stores the service data or not; and if so, deleting the service data stored in the first storage position.
8. The electronic device of claim 7, wherein the processor is further configured to record, for each piece of service data stored in the receiving area, corresponding second log information after storing the received service data in the receiving area, where the second log information includes time information at which each piece of service data is received and second storage location information in the receiving area; the unloading the first service data received in the time length from the receiving area to the buffer area comprises: determining first service data received within the time length and a target storage position of the first service data in the receiving area according to the received time information of each piece of service data included in the second log information and second storage position information in the receiving area; copying the first service data to the buffer area for storage; and deleting the corresponding service data stored in the receiving area from the target storage position according to the first service data stored in the buffer area.
9. The electronic device of claim 8, wherein the log information further includes first identification information of a home service and second identification information of the visited device for each piece of service data, the first log information further includes time information at which each piece of first service data is received, and the processor is specifically configured to, based on the time information at which each piece of first service data included in the first log information is received, first identification information of a service, and second identification information of an accessed device, and the time information that the corresponding first service data is received, the first identification information of the service and the second identification information of the accessed device, which are included in the second log information, identify the first service data copied to the buffer, and deleting the corresponding service data stored in the receiving area from the target storage position according to the first service data copied to the buffer area.
10. The electronic device of claim 9, wherein the processor is further configured to identify the first service data that is not copied to the buffer according to the time information of the reception of each piece of first service data, the first identification information of the service, and the second identification information of the accessed device included in the first log information, and the time information of the reception of the corresponding piece of first service data, the first identification information of the service, and the second identification information of the accessed device included in the second log information, and notify the user of the first service data that is not copied to the buffer, so that the user manually copies the first service data that is not copied to the buffer for storage.
11. The electronic device of claim 8, wherein the processor is further configured to copy the service data stored in the first storage location to a local disk storage before deleting the service data stored in the first storage location, and perform a subsequent operation after the local disk stores the service data.
12. The electronic device according to claim 11, wherein the local disk of the electronic device includes a compressed area and an archive area, and the processor is specifically configured to copy the service data stored in the first storage location to the compressed area of the local disk for storage; after the service data stored in the first storage location is copied to a compression area of a local disk for storage, according to the copying time of each piece of service data copied to the local disk, compressing second service data with the copying time length reaching a second set threshold value, copying the compressed second service data to the filing area, deleting the second service data in the compression area, and deleting the second service data in the filing area when the filing time length of the second service data in the filing area reaches a third set threshold value.
13. A memory release apparatus, wherein the memory includes a receiving area and a buffer area, the apparatus comprising:
the receiving module is used for storing the received service data in the receiving area;
the unloading module is used for unloading the first service data received within the time length from the receiving area to the buffer area according to the preset time length, and recording corresponding first log information and unloading time aiming at the unloaded first service data, wherein the first log information comprises first storage position information of each unloaded first service data in the buffer area;
the release module is used for determining target first service data with the caching duration reaching a first set threshold according to the unloading moment and judging whether the first storage position corresponding to the target first service data in the buffer area stores the service data or not; and if so, deleting the service data stored in the first storage position.
14. An electronic device, characterized in that the electronic device comprises: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
the memory has stored therein a computer program which, when executed by the processor, causes the processor to carry out the steps of the method of any one of claims 1-6.
15. A computer-readable storage medium, characterized in that it stores a computer program executable by an electronic device, which program, when run on the electronic device, causes the electronic device to carry out the steps of the method according to any one of claims 1-6.
CN201810744045.8A 2018-07-09 2018-07-09 Memory release method and device, electronic equipment and storage medium Pending CN110704174A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810744045.8A CN110704174A (en) 2018-07-09 2018-07-09 Memory release method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810744045.8A CN110704174A (en) 2018-07-09 2018-07-09 Memory release method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110704174A true CN110704174A (en) 2020-01-17

Family

ID=69192199

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810744045.8A Pending CN110704174A (en) 2018-07-09 2018-07-09 Memory release method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110704174A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113079152A (en) * 2021-03-26 2021-07-06 山东英信计算机技术有限公司 Data transmission method, device and medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060236055A1 (en) * 2005-04-13 2006-10-19 Hitachi, Ltd. Storage system, data migration managing system, and data migration managing method
CN101751307A (en) * 2008-12-12 2010-06-23 比兹肯解决方法有限公司 Data storage system, method as well as data storage and backup system
CN103019956A (en) * 2012-10-23 2013-04-03 北京奇虎科技有限公司 Method and device for operating cache data
CN103516590A (en) * 2012-06-30 2014-01-15 北京神州泰岳软件股份有限公司 Method and device for logging in instant messaging platform
CN104090987A (en) * 2014-07-28 2014-10-08 华中科技大学 Historical data storage and indexing method
CN107402819A (en) * 2017-08-04 2017-11-28 郑州云海信息技术有限公司 The management method and system of a kind of client-cache
CN107632795A (en) * 2017-10-25 2018-01-26 奇酷互联网络科技(深圳)有限公司 Method, equipment, mobile terminal and the computer-readable storage medium of mobile data
CN107977462A (en) * 2017-12-21 2018-05-01 泰康保险集团股份有限公司 Data migration method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060236055A1 (en) * 2005-04-13 2006-10-19 Hitachi, Ltd. Storage system, data migration managing system, and data migration managing method
CN101751307A (en) * 2008-12-12 2010-06-23 比兹肯解决方法有限公司 Data storage system, method as well as data storage and backup system
CN103516590A (en) * 2012-06-30 2014-01-15 北京神州泰岳软件股份有限公司 Method and device for logging in instant messaging platform
CN103019956A (en) * 2012-10-23 2013-04-03 北京奇虎科技有限公司 Method and device for operating cache data
CN104090987A (en) * 2014-07-28 2014-10-08 华中科技大学 Historical data storage and indexing method
CN107402819A (en) * 2017-08-04 2017-11-28 郑州云海信息技术有限公司 The management method and system of a kind of client-cache
CN107632795A (en) * 2017-10-25 2018-01-26 奇酷互联网络科技(深圳)有限公司 Method, equipment, mobile terminal and the computer-readable storage medium of mobile data
CN107977462A (en) * 2017-12-21 2018-05-01 泰康保险集团股份有限公司 Data migration method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113079152A (en) * 2021-03-26 2021-07-06 山东英信计算机技术有限公司 Data transmission method, device and medium
CN113079152B (en) * 2021-03-26 2023-01-24 山东英信计算机技术有限公司 Data transmission method, device and medium

Similar Documents

Publication Publication Date Title
EP3678015B1 (en) Metadata query method and device
CN111061752B (en) Data processing method and device and electronic equipment
CN111651595A (en) Abnormal log processing method and device
CN112381649A (en) Transaction consensus method, device and equipment based on block chain
CN109558145B (en) Installation package volume optimization method and device for android application
CN107368330B (en) Client patch repair method, device and system
CN110069217B (en) Data storage method and device
CN110704174A (en) Memory release method and device, electronic equipment and storage medium
CN110298677B (en) Cloud computing resource charging method and device, electronic equipment and storage medium
CN113448491A (en) Data migration for storage systems
CN114817860B (en) Data statistical method and device, solid state disk and medium
CN114415970B (en) Disk fault processing method and device of distributed storage system and server
CN114218303B (en) Transaction data processing system, processing method, medium and equipment
CN115438020A (en) Database resource scheduling method, device, equipment and medium
CN112650613B (en) Error information processing method and device, electronic equipment and storage medium
CN114896641A (en) Data verification method and device, electronic equipment and computer readable storage medium
CN113535470A (en) Configuration backup method and device, electronic equipment and storage medium
CN113469825A (en) Data processing method and device, electronic equipment and computer readable medium
CN111831211A (en) Data transmission method, device, equipment and storage medium
CN112667425B (en) Method and device for processing port oscillation
CN112530139B (en) Monitoring system, method, device, collector and storage medium
CN116132204B (en) Data processing method, device, electronic equipment and readable storage medium
CN113554498B (en) Processing method and device for user account request
CN114900531B (en) Data synchronization method, device and system
US20210382645A1 (en) File processing method, computer device and readable storage medium

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200117