CN109828862A - A kind of method and apparatus playing back log - Google Patents

A kind of method and apparatus playing back log Download PDF

Info

Publication number
CN109828862A
CN109828862A CN201711180655.1A CN201711180655A CN109828862A CN 109828862 A CN109828862 A CN 109828862A CN 201711180655 A CN201711180655 A CN 201711180655A CN 109828862 A CN109828862 A CN 109828862A
Authority
CN
China
Prior art keywords
log
metadata
data segment
collection
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201711180655.1A
Other languages
Chinese (zh)
Other versions
CN109828862B (en
Inventor
王万振
叶小杰
韩明瑞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Huawei Technology Co Ltd
Original Assignee
Chengdu Huawei Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Huawei Technology Co Ltd filed Critical Chengdu Huawei Technology Co Ltd
Priority to CN201711180655.1A priority Critical patent/CN109828862B/en
Publication of CN109828862A publication Critical patent/CN109828862A/en
Application granted granted Critical
Publication of CN109828862B publication Critical patent/CN109828862B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

This application provides a kind of method and apparatus for playing back log, this method comprises: determining the first data segment to be played back, first data segment includes N number of log, each log includes metadata and data in N number of log, position of the metadata and data of each log on first data segment is adjacent in N number of log, and N is positive integer;Determine collection of metadata, which includes the metadata of each log in N number of log;According to the collection of metadata, the metadata of each log in N number of log is played back.The method of the embodiment of the present application, write log it is unaffected in the case where, by determine collection of metadata, facilitate shorten log playback time delay.

Description

A kind of method and apparatus playing back log
Technical field
This application involves the communications fields, and more particularly, to a kind of method and apparatus for playing back log.
Background technique
The unexpected power down of server where data restarts suddenly or directly closes database, is accessing the meeting of database When words can stop (shutdown abort) suddenly, so that data are not done after server restarting or media failure Method is normally restored, and log at this time just sends and gone up use, is played back by using log, data be restored to server failure that A moment, to ensure data consistency.And playback duration decision systems start the time worked normally.
In current techniques, data and metadata in log issue at the same time ensure write performance in the case of, when playback one by one Storage medium playback of data is read, playback time delay is will lead in this way and increases with the increase of data segment (segment) length, return Put overlong time will lead to system for a long time can not work normally.
Summary of the invention
The application provide it is a kind of play back log method, write log it is unaffected in the case where, pass through determine metadata Set facilitates the playback time delay for shortening log.
In a first aspect, a kind of method for playing back log is provided, this method comprises: determine the first data segment to be played back, First data segment includes N number of log, and each log includes metadata and data, each day in N number of log in N number of log Position of the metadata and data of will on first data segment is adjacent, and N is positive integer;Determine collection of metadata, the metadata Set includes the metadata of each log in N number of log;According to the collection of metadata, to each log in N number of log Metadata is played back.
The embodiment of the present application playback log method, write log it is unaffected in the case where, pass through determine metadata Set facilitates the playback time delay for shortening log.
With reference to first aspect, in certain possible implementations of first aspect, which includes this yuan of number According to set.
The embodiment of the present application playback log method, write log it is unaffected in the case where, pass through determine notebook data Collection of metadata in section facilitates the playback time delay for shortening log.
With reference to first aspect, in certain possible implementations of first aspect, the determination collection of metadata, comprising: The collection of metadata is obtained from the second data segment, second data segment is different from first data segment.
The embodiment of the present application playback log method, write log it is unaffected in the case where, by determine another Collection of metadata in data segment facilitates the playback time delay for shortening log.
It with reference to first aspect,, should before the determination collection of metadata in certain possible implementations of first aspect Method further include: when the log write for determining first data segment is full, which is written into first data segment.
The method of the playback log of the embodiment of the present application helps to contract by increasing collection of metadata in notebook data section The playback time delay of short log.
It with reference to first aspect,, should before the determination collection of metadata in certain possible implementations of first aspect Method further include: when the log write for determining first data segment is full, which is written into second data segment.
The method of the playback log of the embodiment of the present application is helped by increasing collection of metadata in another data segment In the playback time delay for shortening log.
With reference to first aspect, in certain possible implementations of first aspect, the collection of metadata is in first number According to the tail portion of section.The method of the playback log of the embodiment of the present application has by increasing collection of metadata in the tail portion of notebook data section Help shorten the playback time delay of log.
With reference to first aspect, in certain possible implementations of first aspect, this is according to the collection of metadata, to this The metadata of each log is played back in N number of log, comprising: is played back to the metadata of each log in N number of log; According to the metadata that the playback obtains, the location information of first data segment is determined;According to the location information of first data segment, Determine first data segment.
Second aspect, provide it is a kind of play back log device, which includes: first processing module, for determine to First data segment of playback, which includes N number of log, and each log includes metadata and data in N number of log, Position of the metadata and data of each log on first data segment is adjacent in N number of log, and N is positive integer;At second Module is managed, for determining collection of metadata, which includes the metadata of each log in N number of log;At third Module is managed, for being played back to the metadata of each log in N number of log according to the collection of metadata.
In conjunction with second aspect, in certain possible implementations of second aspect, which includes this yuan of number According to set.
In conjunction with second aspect, in certain possible implementations of second aspect, which is specifically used for: The collection of metadata is obtained from the second data segment, second data segment is different from first data segment.
In conjunction with second aspect, in certain possible implementations of second aspect, the device further include: fourth process mould Block, for when the log write for determining first data segment is full, which to be written first data segment.
In conjunction with second aspect, in certain possible implementations of second aspect, the device further include: the 5th processing mould Block, for when the log write for determining first data segment is full, which to be written second data segment.
In conjunction with second aspect, in certain possible implementations of second aspect, the collection of metadata is in first number According to the tail portion of section.
In conjunction with second aspect, in certain possible implementations of second aspect, which is specifically used for: The metadata of each log in N number of log is played back;According to the metadata that the playback obtains, first data segment is determined Location information;According to the location information of first data segment, first data segment is determined.
The third aspect provides a kind of device for playing back log, which includes memory and processor, which uses In store instruction;The processor is used to call the instruction in the memory, to execute above-mentioned first aspect and first aspect Method described in any possible implementation.
Fourth aspect provides a kind of computer readable storage medium, including instruction, when run on a computer, So that computer mechanism executes the method in first aspect or first aspect any one possible implementation.
5th aspect, provides a kind of computer program product, the computer program product includes: computer program generation Code, when the computer program code is run by computer, so that the computer executes above-mentioned first aspect or first party Method in any possible implementation in face.
Detailed description of the invention
Fig. 1 is a kind of schematic diagram of data segment structure of the embodiment of the present application.
Fig. 2 is the schematic flow chart of the method for the playback log of the embodiment of the present application.
Fig. 3 is a kind of another schematic diagram of data segment structure of the embodiment of the present application.
Fig. 4 is a kind of another schematic diagram of data segment structure of the embodiment of the present application.
Fig. 5 is another schematic flow chart of the method for the playback log of the embodiment of the present application.
Fig. 6 is the schematic block diagram of the device of the playback log of the embodiment of the present application.
Fig. 7 is another schematic block diagram of the device of the playback log of the embodiment of the present application.
Specific embodiment
Below in conjunction with attached drawing, the technical solution in the application is described.
The embodiment of the present application is suitable for the scene of all nonvolatile memory logs playback, including but not limited to stores System, terminal device etc..
Terminal device in the embodiment of the present application can refer to user equipment, access terminal, subscriber unit, subscriber station, movement It stands, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless telecom equipment, user agent or user Device.Terminal device can also be cellular phone, wireless phone, session initiation protocol (Session Initiation Protocol, SIP) phone, wireless local loop (Wireless Local Loop, WLL) stand, personal digital assistant (Personal Digital Assistant, PDA), the handheld device with wireless communication function calculate equipment or are connected to Other processing equipments of radio modem, mobile unit, wearable device, terminal device in the following 5G network or not Carry out the terminal device etc. in the Public Land Mobile Network network (Public Land Mobile Network, PLMN) of evolution, The embodiment of the present application does not limit this.
Fig. 1 is a kind of schematic diagram of data segment structure of the embodiment of the present application, as shown in Figure 1, in writing logging process, number It is issued according to metadata by system, when carrying out log playback, log is played back one by one together.Log storage format be Foremost data segment (Segment) head successively stores log (Log), it should be appreciated that each log includes the data of log (LogData) and metadata (LogMeta).
Fig. 2 shows the schematic flow charts according to the method 100 of the playback log of the embodiment of the present application, as shown in Figure 1, This method 100 can be executed by processor, and this method 100 includes:
S110 determines the first data segment to be played back, which includes N number of log, each day in N number of log Will includes metadata and data, position phase of the metadata and data of each log on first data segment in N number of log Neighbour, N are positive integer;
It should be understood that first data segment can be the data segment in Fig. 1.
It should also be understood that the metadata and data of each log can be by writing the storage system of data while being handed down to processing Some log of first data segment, the position of the metadata and data is written in the metadata and data by device, the processor Position in first log is adjacent.
S120 determines collection of metadata, which includes the metadata of each log in N number of log.
Optionally, which includes the collection of metadata.
Optionally, before the determination collection of metadata, this method 100 further include:
When the log write for determining first data segment is full, which is written into first data segment.
Specifically, first data segment includes the collection of metadata, when the processor determines the day of first data segment When will has write full, which is written to the reserved location of first data segment, it can be by determining the metadata set The reserved location of conjunction, so that it is determined that the collection of metadata on the reserved location.
Optionally, the collection of metadata is in the tail portion of first data segment.
It should be understood that the collection of metadata can in the tail portion of the first data segment, can also the first data segment other What position, the application are not limited to this.
Fig. 3 shows the schematic diagram of another data segment structure according to the embodiment of the present application, as shown in figure 3, each Data segment, which ends up, reserves the space collection of metadata (Meta Blocks), and the collection of metadata is all for storing notebook data section Metadata, the collection of metadata can issue nonvolatile memory together with the last item log.
It should be understood that the size of the collection of metadata can size, the size of data segment header, max log according to data segment Size and the size of log metadata header be calculated, can also there are other to obtain, the application is not limited to this.
It should also be understood that as long as the collection of metadata in data segment structural schematic diagram shown in Fig. 3 is in the position quickly read Setting can be with, however it is not limited to the tail portion of the data segment.
Optionally, the determination collection of metadata, comprising:
The collection of metadata is obtained from the second data segment, second data segment is different from first data segment.
Optionally it is determined that before collection of metadata, this method 100 further include:
When the log write for determining first data segment is full, which is written into second data segment.
Specifically, second data segment includes the collection of metadata, when processor determines that first data segment has been write Second data segment can be written in the metadata of first data segment by Man Shi.
It should be understood that before second data segment is written in the collection of metadata, can initially set up the first data segment and Index relative between second data segment can be by N number of log in first data segment when the log write of the first data segment is full Metadata corresponding second data segment is written.
It should also be understood that the collection of metadata can be in any position of second data segment.
Fig. 4 shows the schematic diagram of data segment structure in one according to the embodiment of the present application, as shown in figure 4, system exists M data segment (Segment) is reserved when initialization, which is used to store metadata, some data segments (in addition to Other data segments outside the M data segment) when writing full, issue notebook data section metadata set be bonded in the M data segment one A data segment, when playback, read corresponding collection of metadata information, carry out the metadata information reduction of data segment.
For example, be used to write log, respectively data segment 1, data segment 2 and data segment 3 there are 3 data segments when initialization, 1 data segment (data segment 4) has also been reserved for storing all metadata of data segment 1, data segment 2 and data segment 3, has worked as number When writing full according to some data segment in section 1, data segment 2 and data segment 3, the metadata of notebook data section is issued to data segment by system 4, the corresponding metadata information of data segment 4 is read when playback, carries out the metadata information reduction of data segment.
It should be understood that as long as the collection of metadata in data segment structural schematic diagram shown in Fig. 4 is in the position quickly read It can be with, however it is not limited to be stored in individual data segment.
S130 rebuilds the metadata of each log in N number of log according to the collection of metadata.
Specifically, processor is when carrying out log playback, it is first determined need to carry out the first data segment of log playback, First data segment includes N number of log, and each log includes metadata and data, each day in N number of log in N number of log The metadata and data of will are issued simultaneously by system, and N is positive integer, according to first data segment, determine collection of metadata, this yuan Data acquisition system includes the metadata of each log in N number of log, for example, as shown in figure 3, the metadata set of first data segment Conjunction can be in the tail portion of first data segment;In another example as shown in figure 4, the metadata of first data segment can be at another In data segment.The processor can rebuild the metadata of each log in N number of log according to the collection of metadata.
Optionally, this plays back the metadata of each log in N number of log according to the collection of metadata, comprising:
The metadata of each log in N number of log is played back;
According to the metadata that the playback obtains, the location information of first data segment is determined;
According to the location information of first data segment, first data segment is determined.
Specifically, the location information that the metadata in the collection of metadata includes first data segment (is also possible that Other information), the metadata of each log in N number of log is played back, data pair in first data segment can be obtained Should be in the location information in storage dish, when user needs to obtain the data of first data segment, it can be according to first data Location information in the corresponding storage dish of section, obtains corresponding data.
It should be understood that the location information in the corresponding storage dish of the first data segment can be some administrative unit in storage dish Position, the data being stored in the administrative unit in first data segment.
The embodiment of the present application playback log method, write log it is unaffected in the case where, pass through determine metadata Set facilitates the playback time delay for shortening log.
Fig. 5 shows the schematic flow chart of the method 200 of the playback log according to the embodiment of the present application, as shown in figure 5, This method 200 can be executed by processor, and this method 200 includes:
S210, fault recovery, starting log plays back when restarting or when node rises main;
S220 is obtained all to playback of data segment identification (SegmentID) set;
S230 obtains the smallest data segment identification not played back (for example, not playing back most from the data segment logo collection Small data segment identification corresponds to Segment1, i.e. data segment 1);
S240 judges that the release of data segment 1 exists, and then playback terminates if it does not exist;If it exists, then the day of data segment 1 is carried out Will playback;
S250 judges whether data segment 1 has expired and (had been written into collection of metadata), carries out S260 if full and reads the data The collection of metadata of section 1 carries out metadata playback, carries out S280 if discontented and plays back log one by one.
It should be understood that for data segment structure shown in Fig. 3, it can be determined that whether the data segment 1 is written with collection of metadata, For data segment structure shown in Fig. 4, it can be determined that whether the second data segment (different from data segment 1) is written with metadata set It closes.
S260 reads the reserved collection of metadata position acquisition metadata of the data segment 1;
S270 rebuilds the metadata information of the data segment 1;
S280 reads log one by one, obtains metadata and carries out metadata reconstruction;
S290, log playback terminate.
The embodiment of the present application playback log method, write log time delay it is unaffected in the case where, playback log When by determine collection of metadata, facilitate shorten log playback time delay.
It is detailed to describe the method for the playback log according to the embodiment of the present application above in conjunction with Fig. 1 to Fig. 5, it ties below Fig. 6 and Fig. 7 is closed, the device of the playback log according to the embodiment of the present application is described in detail.
Fig. 6 shows the schematic block diagram of the device 300 of the playback log according to the embodiment of the present application, as shown in fig. 6, should Device 300 includes:
First processing module 310, for determining the first data segment to be played back, which includes N number of log, should Each log includes metadata and data in N number of log, and the metadata and data of each log are in first number in N number of log Adjacent according to the position in section, N is positive integer;
Second processing module 320, for determining collection of metadata, which includes each day in N number of log The metadata of will;
Third processing module 330, for according to the collection of metadata, to the metadata of each log in N number of log into Row playback.
Optionally, which includes the collection of metadata.
Optionally, which is specifically used for:
The collection of metadata is obtained from the second data segment, second data segment is different from first data segment.
Optionally, the device 300 further include:
Fourth processing module, for when the log write for determining first data segment is full, collection of metadata write-in to be somebody's turn to do First data segment.
Optionally, the device 300 further include:
5th processing module, for when the log write for determining first data segment is full, collection of metadata write-in to be somebody's turn to do Second data segment.
Optionally, the collection of metadata is in the tail portion of first data segment.
Optionally, which is specifically used for:
The metadata of each log in N number of log is played back;
According to the metadata that the playback obtains, the location information of first data segment is determined;
According to the location information of first data segment, first data segment is determined.
The embodiment of the present application playback log device, write log it is unaffected in the case where, pass through determine metadata Set facilitates the playback time delay for shortening log.
Fig. 7 shows the schematic block diagram of the device 400 of the playback log according to the embodiment of the present application, the device 400 packet It includes:
Memory 410, for storing instruction;
Processor 420, for calling the instruction in the memory 410, in the correlation method to carry out the embodiment of the present application Operation.
The embodiment of the present application also provides a kind of computer program product, in the device applied to playback log, the meter Calculation machine program product includes series of instructions, when described instruction is run, so that described device can be executed corresponding to upper State the operation of the device of method.
In the embodiment of the present application, it should be noted that the above-mentioned embodiment of the method for the embodiment of the present application can be applied to processor In, or realized by processor.Processor may be a kind of IC chip, the processing capacity with signal.It was realizing Cheng Zhong, each step of above method embodiment can pass through the integrated logic circuit of the hardware in processor or software form Instruction is completed.Above-mentioned processor can be general processor, digital signal processor (Digital Signal Processor, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing At programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, discrete Door or transistor logic, discrete hardware components.It may be implemented or execute the disclosed each side in the embodiment of the present application Method, step and logic diagram.General processor can be microprocessor or the processor is also possible to any conventional processing Device etc..The step of method in conjunction with disclosed in the embodiment of the present application, can be embodied directly in hardware decoding processor and execute completion, Or in decoding processor hardware and software module combination execute completion.Software module can be located at random access memory, dodge It deposits, read-only memory, this fields such as programmable read only memory or electrically erasable programmable memory, register are mature to deposit In storage media.The storage medium is located at memory, and processor reads the information in memory, completes the above method in conjunction with its hardware The step of.
It is appreciated that the memory in the embodiment of the present application can be volatile memory or nonvolatile memory, or It may include both volatile and non-volatile memories.Wherein, nonvolatile memory can be read-only memory (Read- Only Memory, ROM), programmable read only memory (Programmable ROM, PROM), the read-only storage of erasable programmable Device (Erasable PROM, EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM) or Flash memory.Volatile memory can be random access memory (Random Access Memory, RAM), be used as external high Speed caching.By exemplary but be not restricted explanation, the RAM of many forms is available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), Synchronous Dynamic Random Access Memory (Synchronous DRAM, SDRAM), double data speed synchronous dynamic RAM (Double Data Rate SDRAM, DDR SDRAM), enhanced Synchronous Dynamic Random Access Memory (Enhanced SDRAM, ESDRAM), synchronized links Dynamic random access memory (Synchlink DRAM, SLDRAM) and direct rambus random access memory (Direct Rambus RAM, DR RAM).It should be noted that the memory of system and method described herein be intended to include but be not limited to these and The memory of any other suitable type.
It should be understood that " one embodiment " or " embodiment " that specification is mentioned in the whole text mean it is related with embodiment A particular feature, structure, or characteristic includes in one or more embodiments of the application.Therefore, occur everywhere in the whole instruction " in one embodiment " or " in one embodiment " not necessarily refer to identical embodiment.In addition, these specific features, Structure or characteristic can combine in any suitable manner in one or more embodiments.It should be understood that in the various realities of the application It applies in example, magnitude of the sequence numbers of the above procedures are not meant that the order of the execution order, the execution sequence Ying Yiqi of each process Function and internal logic determine that the implementation process without coping with the embodiment of the present application constitutes any restriction.
In addition, the terms " system " and " network " are often used interchangeably herein.The terms " and/ Or ", only a kind of incidence relation for describing affiliated partner, indicates may exist three kinds of relationships, for example, A and/or B, it can be with table Show: individualism A exists simultaneously A and B, these three situations of individualism B.In addition, character "/" herein, typicallys represent front and back Affiliated partner is a kind of relationship of "or".
It should be understood that in the embodiment of the present application, " B corresponding with A " indicates that B is associated with A, B can be determined according to A.But It should also be understood that determining that B is not meant to determine B only according to A according to A, B can also be determined according to A and/or other information.
In above-described embodiment, it can be realized wholly or partly by software, hardware, firmware or any combination thereof. When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program produces Product may include one or more computer instructions.When loading on computers and executing the computer program instructions, all Or it partly generates according to process or function described in the embodiment of the present application.The computer can be general purpose computer, dedicated Computer, computer network or other programmable devices.The computer instruction can store in computer-readable storage medium In matter, or from a computer readable storage medium to the transmission of another computer readable storage medium, for example, the calculating Machine instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center Word user (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or Data center is transmitted.The computer readable storage medium can be any usable medium that computer can access or It is comprising data storage devices such as one or more usable mediums integrated server, data centers.The usable medium can be with It is magnetic medium (for example, floppy disk, hard disk, disk), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disk Solid State Disk (SSD)) etc..
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed Scope of the present application.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed systems, devices and methods, it can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of device or unit It closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) execute each embodiment the method for the application all or part of the steps. And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), arbitrary access are deposited The various media that can store program code such as reservoir (Random Access Memory, RAM), magnetic or disk.
The above, the only specific embodiment of the application, but the protection scope of the application is not limited thereto, it is any Those familiar with the art within the technical scope of the present application, can easily think of the change or the replacement, and should all contain Lid is within the scope of protection of this application.Therefore, the protection scope of the application should be based on the protection scope of the described claims.

Claims (16)

1. a kind of method for playing back log characterized by comprising
Determine the first data segment to be played back, first data segment includes N number of log, each log packet in N number of log Metadata and data are included, position phase of the metadata and data of each log on first data segment in N number of log Neighbour, N are positive integer;
Determine that collection of metadata, the collection of metadata include the metadata of each log in N number of log;
According to the collection of metadata, the metadata of each log in N number of log is played back.
2. the method according to claim 1, wherein first data segment includes the collection of metadata.
3. the method according to claim 1, wherein the determining collection of metadata, comprising:
The collection of metadata is obtained from the second data segment, second data segment is different from first data segment.
4. according to the method described in claim 2, it is characterized in that, the method is also wrapped before the determining collection of metadata It includes:
When the log write for determining first data segment is full, first data segment is written into the collection of metadata.
5. according to the method described in claim 3, it is characterized in that, the method is also wrapped before the determining collection of metadata It includes:
When the log write for determining first data segment is full, second data segment is written into the collection of metadata.
6. method according to claim 2 or 4, which is characterized in that the collection of metadata is in first data segment Tail portion.
7. method according to any one of claim 1 to 6, which is characterized in that it is described according to the collection of metadata, it is right The metadata of each log is played back in N number of log, comprising:
The metadata of each log in N number of log is played back;
According to the metadata for playing back and obtaining, the location information of first data segment is determined;
According to the location information of first data segment, first data segment is determined.
8. a kind of device for playing back log characterized by comprising
First processing module, for determining the first data segment to be played back, first data segment includes N number of log, described N number of Each log includes metadata and data in log, and the metadata and data of each log are described first in N number of log Position on data segment is adjacent, and N is positive integer;
Second processing module, for determining that collection of metadata, the collection of metadata include each log in N number of log Metadata;
Third processing module, for being returned to the metadata of each log in N number of log according to the collection of metadata It puts.
9. device according to claim 8, which is characterized in that first data segment includes the collection of metadata.
10. device according to claim 8, which is characterized in that the Second processing module is specifically used for:
The collection of metadata is obtained from the second data segment, second data segment is different from first data segment.
11. device according to claim 9, which is characterized in that described device further include:
Fourth processing module, for when the log write for determining first data segment is full, institute to be written in the collection of metadata State the first data segment.
12. device according to claim 10, which is characterized in that described device further include:
5th processing module, for when the log write for determining first data segment is full, institute to be written in the collection of metadata State the second data segment.
13. the device according to claim 9 or 11, which is characterized in that the collection of metadata is in first data segment Tail portion.
14. the device according to any one of claim 8 to 13, which is characterized in that the third processing module is specifically used In:
The metadata of each log in N number of log is played back;
According to the metadata for playing back and obtaining, the location information of first data segment is determined;
According to the location information of first data segment, first data segment is determined.
15. a kind of device for playing back log characterized by comprising
Memory, for storing instruction;
Processor executes method described in any one of the claims 1-7 for calling the instruction in the memory.
16. a kind of computer readable storage medium, which is characterized in that including instruction, when run on a computer, make to succeed in one's scheme Calculation machine executes method described in any one of the claims 1-7.
CN201711180655.1A 2017-11-23 2017-11-23 Method and device for replaying log Active CN109828862B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711180655.1A CN109828862B (en) 2017-11-23 2017-11-23 Method and device for replaying log

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711180655.1A CN109828862B (en) 2017-11-23 2017-11-23 Method and device for replaying log

Publications (2)

Publication Number Publication Date
CN109828862A true CN109828862A (en) 2019-05-31
CN109828862B CN109828862B (en) 2023-08-22

Family

ID=66858438

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711180655.1A Active CN109828862B (en) 2017-11-23 2017-11-23 Method and device for replaying log

Country Status (1)

Country Link
CN (1) CN109828862B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102375853A (en) * 2010-08-24 2012-03-14 中国移动通信集团公司 Distributed database system, method for building index therein and query method
CN103077222A (en) * 2012-12-31 2013-05-01 中国科学院计算技术研究所 Method and system for ensuring consistence of distributed metadata in cluster file system
CN103516549A (en) * 2013-09-27 2014-01-15 浪潮电子信息产业股份有限公司 File system metadata log mechanism based on shared object storage
CN103902479A (en) * 2014-03-27 2014-07-02 浪潮电子信息产业股份有限公司 Quick reconstruction mechanism for metadata cache on basis of metadata log
CN104050268A (en) * 2014-06-23 2014-09-17 西北工业大学 Continuous data protection and recovery method with log space adjustable online
CN104301360A (en) * 2013-07-19 2015-01-21 阿里巴巴集团控股有限公司 Method, log server and system for recording log data
CN105138284A (en) * 2015-08-11 2015-12-09 上海交通大学 Virtual machine disk mirror image synchronization operation optimization system and method
CN105574104A (en) * 2015-12-11 2016-05-11 上海爱数信息技术股份有限公司 LogStructure storage system based on ObjectStore and data writing method thereof
CN105956090A (en) * 2016-04-27 2016-09-21 中国科学技术大学 I/O self-adaption-based file system log mode
CN106294866A (en) * 2016-08-23 2017-01-04 北京奇虎科技有限公司 A kind of log processing method and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102375853A (en) * 2010-08-24 2012-03-14 中国移动通信集团公司 Distributed database system, method for building index therein and query method
CN103077222A (en) * 2012-12-31 2013-05-01 中国科学院计算技术研究所 Method and system for ensuring consistence of distributed metadata in cluster file system
CN104301360A (en) * 2013-07-19 2015-01-21 阿里巴巴集团控股有限公司 Method, log server and system for recording log data
CN103516549A (en) * 2013-09-27 2014-01-15 浪潮电子信息产业股份有限公司 File system metadata log mechanism based on shared object storage
CN103902479A (en) * 2014-03-27 2014-07-02 浪潮电子信息产业股份有限公司 Quick reconstruction mechanism for metadata cache on basis of metadata log
CN104050268A (en) * 2014-06-23 2014-09-17 西北工业大学 Continuous data protection and recovery method with log space adjustable online
CN105138284A (en) * 2015-08-11 2015-12-09 上海交通大学 Virtual machine disk mirror image synchronization operation optimization system and method
CN105574104A (en) * 2015-12-11 2016-05-11 上海爱数信息技术股份有限公司 LogStructure storage system based on ObjectStore and data writing method thereof
CN105956090A (en) * 2016-04-27 2016-09-21 中国科学技术大学 I/O self-adaption-based file system log mode
CN106294866A (en) * 2016-08-23 2017-01-04 北京奇虎科技有限公司 A kind of log processing method and device

Also Published As

Publication number Publication date
CN109828862B (en) 2023-08-22

Similar Documents

Publication Publication Date Title
CN107911249B (en) Method, device and equipment for sending command line of network equipment
CN104834713A (en) Method and system for storing and transmitting image data of terminal equipment
CN109218352A (en) The common recognition confirmation method and device of Transaction Information in a kind of block chain network
CN103995855A (en) Method and device for storing data
CN104462225A (en) Data reading method, device and system
CN105187733A (en) Video processing method, device and terminal
CN111966632B (en) Streaming data storage method, reading method, equipment and readable storage medium
CN104853081A (en) Breakpoint filming method, device and mobile terminal
CN107613369A (en) Video broadcasting method, device and electronic equipment based on GStreamer frameworks
CN101763433B (en) Data storage system and method
CN111984557A (en) Data processing method, device and system
CN112954244A (en) Method, device and equipment for realizing storage of monitoring video and storage medium
WO2022089313A1 (en) Communication processing method and apparatus, storage medium, chip and related device
CN107850932B (en) Apparatus and method for saving and restoring data in a processor to save power
CN106354718B (en) File management method and device of user identification module
CN110109865A (en) A kind of date storage method, device, equipment and readable storage medium storing program for executing
CN106453663B (en) Improved storage expansion method and device based on cloud service
CN104796967B (en) Wireless network data restoring method and device
CN117473011A (en) Data synchronization method, device and hybrid cache system
CN109828862A (en) A kind of method and apparatus playing back log
CN107670276A (en) Game application control method and equipment
CN108345434B (en) Data writing method and device, computer equipment and readable storage medium
CN106462421B (en) Telecommunication device and method for updating software in a telecommunication device
CN102932960A (en) Exchange system and exchange method for electronic business cards
CN111352769A (en) Method for restoring database, restoring server and computer 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
GR01 Patent grant
GR01 Patent grant