CN116860183B - Data storage method, electronic equipment and storage medium - Google Patents

Data storage method, electronic equipment and storage medium Download PDF

Info

Publication number
CN116860183B
CN116860183B CN202311128546.0A CN202311128546A CN116860183B CN 116860183 B CN116860183 B CN 116860183B CN 202311128546 A CN202311128546 A CN 202311128546A CN 116860183 B CN116860183 B CN 116860183B
Authority
CN
China
Prior art keywords
historical data
target
data compression
hard disk
storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311128546.0A
Other languages
Chinese (zh)
Other versions
CN116860183A (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.)
Beijing Antiy Network Technology Co Ltd
Original Assignee
Beijing Antiy Network 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 Beijing Antiy Network Technology Co Ltd filed Critical Beijing Antiy Network Technology Co Ltd
Priority to CN202311128546.0A priority Critical patent/CN116860183B/en
Publication of CN116860183A publication Critical patent/CN116860183A/en
Application granted granted Critical
Publication of CN116860183B publication Critical patent/CN116860183B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2474Sequence data queries, e.g. querying versioned data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC
    • 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

Abstract

The invention provides a data storage method, electronic equipment and a storage medium, and relates to the field of data storage, wherein the method comprises the following steps: acquiring a first historical data compression packet list set in a target time period; compressing the packet list A according to the first historical data corresponding to the mth operating system m The total size of all first historical data compression packets and the capacity of a single mechanical hard disk are determined, and the corresponding identification of each mechanical hard disk is determined to obtain A m A corresponding set of mechanical hard disk identifiers; according to A m Dividing the mechanical hard disk corresponding to each mechanical hard disk identifier into f (m) storage areas by the size of each first historical data compression packet to obtain A m A corresponding set of storage area lists; will A m The j-th first historical data compressed packet A in the data packet m,j Dividing the data into h (m) sub first historical data compression packets, and storing each sub first historical data compression packet in a corresponding storage area; the efficiency of acquiring the target historical data is improved.

Description

Data storage method, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data storage, and in particular, to a data storage method, an electronic device, and a storage medium.
Background
With the rapid development of internet technology, the position of a server in the internet is more and more important, and the server is used as core hardware equipment in the internet and bears most of data storage and data processing tasks in the internet; currently, in order to enable full-flow data of a server to have traceability, the server generally compresses the full-flow data within a preset time period to generate a data packet and stores the data packet; after the method is adopted to store the full flow data, when the required target historical data is searched in the later period, a data compression packet containing the target historical data is required to be acquired firstly, then the whole compression packet is decompressed, and then the target historical data is inquired from the decompressed data; however, this storage method may result in less efficient querying of the target history data when the amount of data within the data compression packet is large.
Disclosure of Invention
Aiming at the technical problems, the application adopts the following technical scheme:
according to a first aspect of the present application there is provided a data storage method comprising the steps of:
s100, acquiring a first historical data compression packet list set A= (A) in a target time period 1 ,A 2 ,…,A m ,…,A n ) M=1, 2, …, n; wherein A is m The method comprises the steps that a first historical data compressed packet list corresponding to an mth operating system is used, and n is the number of the first historical data compressed packet list; a is that m =(A m,1 ,A m,2 ,…,A m,j ,…,A m,f(m) ),j=1,2,…,f(m);A m,j Is A m The j-th first historical data compressed packet, f (m) is A m The number of first historical data compression packets; a is that m,j The target attribute of each first historical data in the database is the same, A m,j Target attribute and A of any first historical data m Any one of the other first historical data compression packets has different target attributes; SA (SA) m,r >SA m,r+1 ,r=1,2,…,f(m)-1;SA m,r According to A m,r Query priorities obtained by the corresponding target attributes; the target attribute is a file attribute of the first historical data;
s200, according to A m The total size of all first historical data compression packets and the capacity of a single mechanical hard disk are determined to be A m Corresponding to each mechanical hard disk mark to obtain A m Corresponding mechanical hard disk identification set Y m =(Y m,1 ,Y m,2 ,…,Y m,p ,…,Y m,h(m) ) P=1, 2, …, h (m); wherein Y is m,p Is A m The corresponding p-th mechanical hard disk mark, h (m) is A m The number of corresponding mechanical hard disk identifiers;
s300 according to A m The size of each first historical data compression packet will be Y m,1 、Y m,2 、…、Y m,p 、…、Y m,h(m) The corresponding mechanical hard disk is divided into f (m) storage areas, and each storage area corresponds to a storage area identifier to obtain A m Corresponding storage area identification set Q m =(Q m,1 ,Q m,2 ,…,Q m,j ,…,Q m,f(m) ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein Q is m,j Is A m,j A corresponding storage area identifier; q (Q) m,r The read-write speed of the corresponding storage area is larger than Q m,r+1 The read-write speed of the corresponding storage area; a is that m,j The same storage area identifier is corresponding to each mechanical hard disk;
s400, A m,j Dividing into h (m) sub-first historical data compression packets to obtain A m,j Corresponding sub first historical data compressed packet set TA m,j =(TA m,j,1 ,TA m,j,2 ,…,TA m,j,p ,…,TA m,j,h(m) ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein TA m,j,p For TA m,j The p < th > sub-first historical data compression packet;
s500, TA m,j,p Q stored in the p-th mechanical hard disk m,j Corresponding storage areas.
Optionally, step S300 includes the steps of:
s310, according to A m Acquiring a target data size list w= (W m,1 ,W m,2 ,…,W m,j ,…,W m,f(m) ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein W is m,j Is A m,j A corresponding target data size; w (W) m,j =WA m,j /h(m);WA m,j Is A m,j Data size of (2);
s320, according to W, slave A m The outermost side of the corresponding magnetic disk of each mechanical hard disk gradually divides the magnetic disk of each mechanical hard disk into f (m) target storage areas;
s330, obtaining the storage area identification of each target storage area to obtain A m Corresponding storage area identification set Q m =(Q m,1 ,Q m,2 ,…,Q m,j ,…,Q m,f(m) ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein Q is m,j Includes Q m,j Start memory address and end memory address of corresponding memory region, and Q m,j Corresponding storage The storage space of the region is not smaller than W m,j
Alternatively, SA m,r The method comprises the following steps of:
s110, obtaining A m,r Corresponding target attributes;
s111 according to A m,r The corresponding target attribute obtains SA from a preset query priority mapping table m,r The method comprises the steps of carrying out a first treatment on the surface of the The query priority mapping table comprises a plurality of rows, and each row corresponds to one target attribute and the query priority corresponding to the target attribute.
Optionally, the target attribute is determined by:
s120, acquiring a plurality of second historical data received in a preset historical time period, and determining a candidate attribute list set U= (U) 1 ,U 2 ,…,U x ,…,U y ),x=1,2,…,y;U x An xth candidate attribute list; each candidate attribute list comprises a plurality of candidate attributes; each second history data is in U x Has a unique corresponding candidate attribute;
s130, grouping all the second historical data according to U to obtain a second historical data set list set TU= (TU) 1 ,TU 2 ,…,TU x ,…,TU y ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein TU is x According to U x A second historical data group list obtained for all second historical data groups; TU (TU) x =(TU x,1 ,TU x,2 ,…,TU x,d ,…,TU x,c(x) ),d=1,2,…,c(x);TU x,d For TU x The d second historical data group in the database, c (x) is TU x The number of inner second historical data sets;
s140, compressing each second historical data set in each second historical data set list in the TU to obtain a second historical data compressed packet list set QTU = (QTU) corresponding to the TU 1 ,QTU 2 ,…,QTU x ,…,QTU y ) The method comprises the steps of carrying out a first treatment on the surface of the Therein, QTU x For TU x A corresponding second historical data compression packet list;
s150, obtaining second historical data corresponding to each candidate attribute list in the UThe read-write time length is obtained to obtain a read-write time length set TS= (TS) corresponding to U 1 ,TS 2 ,…,TS x ,…,TS y ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein TS x To QTU x Each second historical data compression packet in the storage area is stored in a preset fixed storage area, and the time length for the second historical data samples with the preset number is read from the fixed storage area;
s160, the shortest second history data read-write time T min Candidate attributes in the corresponding candidate attribute list are used as target attributes; t (T) min MIN (TS), MIN () is a preset minimum function.
Optionally, step S150 includes the steps of:
s151, obtaining a storage duration set T corresponding to each candidate attribute list 1 =(T 1,1 ,T 1,2 ,…,T 1,x ,…,T 1,y ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein T is 1,x To QTU x Each second historical data compression packet in the storage space is stored in a preset fixed storage space for a period of time;
s152, obtaining a reading time length set T corresponding to each candidate attribute list 2 =(T 2,1 ,T 2,2 ,…,T 2,x ,…,T 2,y ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein T is 2,x To store QTU x Reading the time length of a preset number of second historical data samples in the fixed storage space of each second historical data compression packet;
s153 according to T 1,x And T 2,x Determining TS x To obtain TS.
Alternatively, TS x1 ×T 1,x2 ×T 2,x ;η 1 For a preset first weight, eta 2 For a preset second weight, eta 12 =1,η 1 <η 2
Alternatively, η1 is in the range of 0.3 to 0.4.
Alternatively, TA m,j The sizes of the first historical data compression packets of any two sub-first historical data compression packets are equal.
According to another aspect of the present application, there is also provided a non-transitory computer readable storage medium having stored therein at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by a processor to implement the data storage method described above.
According to another aspect of the present application, there is also provided an electronic device comprising a processor and the above-described non-transitory computer-readable storage medium.
The application has at least the following beneficial effects:
according to the data storage method, the acquired first historical data compression packet list set corresponds to a target time period, each first historical data compression packet in the first historical data compression packet list set corresponds to an operating system type, and the target attribute of each first historical data is the same; therefore, all the first historical data in the target time period are classified according to the type of the operating system, then the first historical data are classified according to the target attribute of the first historical data, and when the target historical data are inquired in the later period, the information of the first historical data compression packet containing the target historical data can be rapidly determined according to the time, the type of the operating system and the attribute corresponding to the target historical data to be inquired, so that the efficiency of acquiring the target historical data is improved.
Further, the invention sorts the first historical data compression packets according to the query priority of the first historical data compression packets; meanwhile, according to the total size of the first historical data compression packets corresponding to each operating system type, the number of the mechanical hard disks is determined, so that all the first historical data compression packets can be stored in the mechanical hard disks; the first historical data compression package with the high query priority is divided into a plurality of sub first historical data compression packages, and each sub first historical data compression package is stored in a storage area with high read-write speed of each mechanical hard disk, so that the first historical data compression package with the high query priority can be read out in the shortest time when being read later, and the reading efficiency of the first historical data compression package is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a data storage method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a storage relationship between a sub-first historical data compressed package and a mechanical hard disk storage area according to an embodiment of the present invention;
FIG. 3 is an application scenario diagram of a data storage method according to an embodiment of the present invention;
fig. 4 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
It is noted that various aspects of the embodiments are described below within the scope of the following claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms and that any specific structure and/or function described herein is merely illustrative. Based on the present disclosure, one skilled in the art will appreciate that one aspect described herein may be implemented independently of any other aspect, and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. In addition, such apparatus may be implemented and/or such methods practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
A data storage method will be described with reference to the flowchart of the data storage method described in fig. 1.
The data storage method comprises the following steps:
s100, acquiring a first historical data compression packet list set A= (A) in a target time period 1 ,A 2 ,…,A m ,…,A n ) M=1, 2, …, n; wherein A is m The method comprises the steps that a first historical data compressed packet list corresponding to an mth operating system is used, and n is the number of the first historical data compressed packet list; a is that m =(A m,1 ,A m,2 ,…,A m,j ,…,A m,f(m) ),j=1,2,…,f(m);A m,j Is A m The j-th first historical data compressed packet, f (m) is A m The number of first historical data compression packets; a is that m,j The target attribute of each first historical data in the database is the same, A m,j Target attribute and A of any first historical data m Any one of the other first historical data compression packets has different target attributes; SA (SA) m,r >SA m,r+1 ,r=1,2,…,f(m)-1;SA m,r According to A m,r Query priorities obtained by the corresponding target attributes; the target attribute is a file attribute of the first historical data.
In this embodiment, for all the first historical data received in the target time period, first, according to the type of the operating system corresponding to each first historical data, all the first historical data are grouped, for example, the first historical data corresponding to the Windows operating system are grouped into a group, and the first historical data corresponding to the Android operating system is grouped into a group; each history data also has a plurality of attributes, so that each first history data corresponding to the same operating system can be grouped again according to the target attribute, for example, the target attribute is a file type, the file type comprises a doc file, a PPT file, a DLL file, an exe file and the like, the doc file and the PPT file belong to the same file type, and the DLL file and the exe file belong to the same file type; therefore, each first historical data corresponding to each operating system can be divided into a plurality of groups; compressing each group of first history data corresponding to each operating system to obtain a plurality of first history numbers According to the compressed packets, sequencing each first historical data compressed packet according to the order of the query priority of the first historical data in the first historical data compressed packet at the same time, so as to obtain A m Thereby obtaining A; when the target historical data is queried in the later period, the information of the first historical data compression packet containing the target historical data can be rapidly determined according to the time, the operating system type and the attribute corresponding to the target historical data to be queried, so that the efficiency of acquiring the target historical data is improved.
S200, according to A m The total size of all first historical data compression packets and the capacity of a single mechanical hard disk are determined to be A m Corresponding to each mechanical hard disk mark to obtain A m Corresponding mechanical hard disk identification set Y m =(Y m,1 ,Y m,2 ,…,Y m,p ,…,Y m,h(m) ) P=1, 2, …, h (m); wherein Y is m,p Is A m The corresponding p-th mechanical hard disk mark, h (m) is A m The number of corresponding mechanical hard disk identifications.
In this embodiment, for all the first historical data compression packets in the target time period, the number of hard disks required is selected in units of an operating system; can obtain A m The size of each first historical data compression packet is obtained to obtain A m The total size WA of all first historical data compression packets in the network m The capacity W' of a single mechanical hard disk can be directly obtained, so that the number h (m) = ⌈ WA of mechanical hard disk identifications can be obtained m W' ⌉, wherein ⌈ ⌉ is a preset rounding-up function; and then determine A m Corresponding to each mechanical hard disk mark to obtain A m Corresponding mechanical hard disk identification set Y m The method comprises the steps of carrying out a first treatment on the surface of the It can be understood that, since the number of the first historical data compression packets corresponding to each operating system is different in this embodiment, h (m) does not refer to a specific function or a function result value, but refers to a value that may be different according to the specific value of m, for example, when m=1, h (m) =5; when m=2, h (m) =8; when m=3, h (m) =8.
In this embodiment, according to the first calendar corresponding to each operating system typeThe total size of the history data compression packets is determined, and the number of the mechanical hard disks is determined, so that all first history data compression packets can be stored in the mechanical hard disks, and the total capacity of the selected mechanical hard disks is prevented from being smaller than WA m This results in the occurrence of an inability to fully store each first historical data compression packet.
S300 according to A m The size of each first historical data compression packet will be Y m,1 、Y m,2 、…、Y m,p 、…、Y m,h(m) The corresponding mechanical hard disk is divided into f (m) storage areas, and each storage area corresponds to a storage area identifier to obtain A m Corresponding storage area identification set Q m =(Q m,1 ,Q m,2 ,…,Q m,j ,…,Q m,f(m) ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein Q is m,j Is A m,j A corresponding storage area identifier; q (Q) m,r The read-write speed of the corresponding storage area is larger than Q m,r+1 The read-write speed of the corresponding storage area; a is that m,j And each mechanical hard disk corresponds to the same storage area identifier.
In this embodiment, A is determined m After the corresponding h (m) mechanical hard disks, A is needed to be added m Storing each first historical data compression packet in h (m) mechanical hard disks, wherein the read-write speeds of different storage areas are different for the mechanical hard disks, and the read-write speed of the storage area outside the magnetic disk of the mechanical hard disk is greater than that of the storage area inside the magnetic disk; based on this characteristic of the mechanical hard disk, A can be determined m Each corresponding mechanical hard disk is divided into f (m) storage areas, and the storage areas of each mechanical hard disk are divided in the same mode; therefore, the first historical data compression packet with higher query priority can be stored in the storage area with higher read-write speed of each mechanical hard disk, so that the efficiency of acquiring the later target historical data is improved.
It is noted that A m,j The storage area identifiers on each mechanical hard disk are the same storage area identifier, and the storage area identifier records A m,j The initial storage position and the final storage position of the storage area on the magnetic disk of each mechanical hard disk are acquired at the later stage m,j When the method is used, only one storage area identifier is needed to be acquired, the corresponding sub first historical data compression packet can be acquired from f (m) mechanical hard disks, and the data acquisition efficiency is improved.
S400, A m,j Dividing into h (m) sub-first historical data compression packets to obtain A m,j Corresponding sub first historical data compressed packet set TA m,j =(TA m,j,1 ,TA m,j,2 ,…,TA m,j,p ,…,TA m,j,h(m) ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein TA m,j,p For TA m,j The p-th sub-first historical data compressed packet in (a).
In this embodiment, A m Corresponding to h (m) mechanical hard disks, A needs to be carried out m,j Stored in h (m) mechanical hard disks, A is needed to be stored in the hard disk m,j Dividing the first historical data compression packet into h (m) sub-first historical data compression packets; thus, A is acquired at a later stage m,j In the time, A can be obtained from h (m) mechanical hard disks in parallel m,j And when the target historical data compression packet is acquired, the corresponding first historical data compression packet of each sub-can be acquired in the same mode, so that the efficiency of acquiring the target historical data is improved.
S500, TA m,j,p Q stored in the p-th mechanical hard disk m,j Corresponding storage areas.
In this embodiment, referring to FIG. 2, A m,j Dividing into h (m) sub first historical data compression packets to obtain TA m,j ,TA m,j Each sub first historical data compression packet in the database is correspondingly provided with a storage area on h (m) mechanical hard disks, and TA is carried out m,j,p Q stored in the p-th mechanical hard disk m,j In the corresponding storage area, namely finish A m Is stored in the first historical data compression package.
According to the data storage method of the embodiment, the acquired first historical data compression packet list set corresponds to a target time period, each first historical data compression packet in the first historical data compression packet list set corresponds to an operating system type, and the target attribute of each first historical data is the same; therefore, all the first historical data in the target time period are classified according to the type of the operating system, then the first historical data are classified according to the target attribute of the first historical data, and when the target historical data are inquired in the later period, the information of the first historical data compression packet containing the target historical data can be rapidly determined according to the time, the type of the operating system and the attribute corresponding to the target historical data to be inquired, so that the efficiency of acquiring the target historical data is improved.
Further, the invention sorts the first historical data compression packets according to the query priority of the first historical data compression packets; meanwhile, according to the total size of the first historical data compression packets corresponding to each operating system type, the number of the mechanical hard disks is determined, so that all the first historical data compression packets can be stored in the mechanical hard disks; the first historical data compression package with the high query priority is divided into a plurality of sub first historical data compression packages, and each sub first historical data compression package is stored in a storage area with high read-write speed of each mechanical hard disk, so that the first historical data compression package with the high query priority can be read out in the shortest time when being read later, and the reading efficiency of the first historical data compression package is improved.
Optionally, the step S300 includes the steps of:
s310, according to A m Acquiring a target data size list w= (W m,1 ,W m,2 ,…,W m,j ,…,W m,f(m) ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein W is m,j Is A m,j A corresponding target data size; w (W) m,j =WA m,j /h(m);WA m,j Is A m,j Is a data size of (a) a data size of (b).
In this example, A m,j Is equally divided into W m,j The h (m) sub first historical data compression packets are correspondingly stored in the h (m) mechanical hard disks in the follow-up mode, so that storage is balanced, and when corresponding first historical data are acquired in the later period, the acquiring duration of each corresponding mechanical hard disk can be balanced.
S320, according to W, slave A m The outermost side of the corresponding magnetic disk of each mechanical hard disk gradually divides the magnetic disk of each mechanical hard disk into f (m) target storage areas.
It can be understood that for a mechanical hard disk, the read-write speed of the outer storage area is greater than that of the inner storage area, A m The first historical data compression packets are ordered according to the corresponding priority, namely the priority of the first historical data compression packets arranged at the earlier position is higher than that of the first historical data compression packets arranged at the later position; at A m In (A) m,1 Is highest for A m,1 When dividing the storage area of the mechanical hard disk, firstly, according to A m,1 From the outermost side of each mechanical hard disk, a size W is defined m,1 From A m The outermost side of the corresponding magnetic disk of each mechanical hard disk gradually divides the magnetic disk of each mechanical hard disk into f (m) target storage areas; therefore, the first historical data compression packet with higher query priority can be ensured to be stored in a storage area with higher read-write speed of each mechanical hard disk, the storage speed of the first historical data compression packet is improved, and meanwhile, the acquisition speed of the later first historical data compression packet can also be improved.
S330, obtaining the storage area identification of each target storage area to obtain A m Corresponding storage area identification set Q m =(Q m,1 ,Q m,2 ,…,Q m,j ,…,Q m,f(m) ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein Q is m,j Includes Q m,j Start memory address and end memory address of corresponding memory region, and Q m,j The storage space of the corresponding storage area is not smaller than W m,j
In step S320, for any mechanical hard disk, each memory area is divided into a memory area identifier, where the memory area identifier includes a start memory address and a stop memory address of the corresponding memory area, and the memory area identifier corresponding to each first historical data compression packet is obtained to obtain a m Corresponding storage area identification set Q m
Alternatively, SA m,r The method comprises the following steps of:
s110, obtaining A m,r Corresponding target attributes.
S111 according to A m,r The corresponding target attribute obtains SA from a preset query priority mapping table m,r The method comprises the steps of carrying out a first treatment on the surface of the The query priority mapping table comprises a plurality of rows, and each row corresponds to one target attribute and the query priority corresponding to the target attribute.
In this embodiment, a query priority mapping table is preset, in which a query priority corresponding to each target attribute is recorded, and SA can be obtained through the query priority mapping table m,r
It will be appreciated that A m,r Corresponding priority is A m,r The higher the queried frequency, the higher the importance of the first historical data compression packet.
Alternatively, TA m,j The sizes of the first historical data compression packets of any two sub-first historical data compression packets are equal.
In this example, A m,j Averagely dividing the data into h (m) sub-historical data compression packets so that A stored in each of the h (m) mechanical hard disks m,j The size of the sub first historical data compression packet is the same, and A is acquired in the later stage m,j In the process, A is obtained from each mechanical hard disk m,j The time of the sub-first historical data compression packets is the same, thereby achieving the balance of obtaining A from each mechanical hard disk m,j The effect of the time of the sub-first historical data compression packet, at the same time, also causes acquisition A m,j The time is shortest, and the acquisition efficiency is highest.
In an exemplary embodiment, the target attribute is determined by:
s120, acquiring a plurality of second historical data received in a preset historical time period, and determining a candidate attribute list set U= (U) 1 ,U 2 ,…,U x ,…,U y ),x=1,2,…,y;U x An xth candidate attribute list; each candidate attribute list comprises a plurality of candidate attributes; each second history data is in U x Has a unique corresponding candidate attribute.
In this embodiment, the second history data corresponds to a plurality of candidate attribute lists, for example, a file type list, a file size list, and the like; y candidate attribute lists corresponding to the second historical data can be obtained; it will be appreciated that all second historical data received during the preset historical period exists as a sample of statistical analysis, the number of which is large, and the statistical analysis of the read-write speed is performed with different candidate attribute lists in the subsequent steps.
S130, grouping all the second historical data according to U to obtain a second historical data set list set TU= (TU) 1 ,TU 2 ,…,TU x ,…,TU y ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein TU is x According to U x A second historical data group list obtained for all second historical data groups; TU (TU) x =(TU x,1 ,TU x,2 ,…,TU x,d ,…,TU x,c(x) ),d=1,2,…,c(x);TU x,d For TU x The d second historical data group in the database, c (x) is TU x The number of second historical data sets.
In this embodiment, all the second historical data are grouped according to different candidate attribute lists in U, so as to obtain a grouping result corresponding to each candidate attribute list; for example, the grouping is performed according to a file type list and the grouping is performed according to a file size list, and the number of groupings obtained by the grouping and the second history data within each group are different in large probability.
S140, compressing each second historical data set in each second historical data set list in the TU to obtain a second historical data compressed packet list set QTU = (QTU) corresponding to the TU 1 ,QTU 2 ,…,QTU x ,…,QTU y ) The method comprises the steps of carrying out a first treatment on the surface of the Therein, QTU x For TU x And a corresponding second historical data compression packet list.
In this embodiment, after all the second historical data are grouped according to each candidate attribute list, each second historical data set needs to be compressed, so that the condition of statistical analysis can be ensured to be the same as the condition of actual storage and reading, and the accuracy of statistical analysis is further improved.
S150, obtaining each candidate genus in the UThe second historical data read-write time length corresponding to the property list is obtained to obtain a read-write time length set TS= (TS) corresponding to U 1 ,TS 2 ,…,TS x ,…,TS y ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein TS x To QTU x Each second historical data compression packet in the storage area is stored in a preset fixed storage area, and the time length for the preset number of second historical data samples is read from the fixed storage area.
In this embodiment, after obtaining a plurality of second historical data compression packets corresponding to each candidate attribute list in U, it is not determined with which candidate attribute list to group and compress the plurality of second historical data compression packets obtained at this time, and the duration used when storing and reading the data samples is the shortest; based on this, in this embodiment, each second historical data compression packet corresponding to each candidate attribute list is respectively acquired and stored in a preset fixed storage area, and a duration used by a preset number of second historical data samples is read from the fixed storage area, so as to obtain a TS.
As another embodiment, the second historical data may be first grouped according to the operating system, and then grouped according to each candidate attribute list in the U, so as to ensure that the condition of statistical analysis is the same as the condition of actual storage and reading, thereby improving the accuracy of statistical analysis.
S160, the shortest second history data read-write time T min Candidate attributes in the corresponding candidate attribute list are used as target attributes; t (T) min MIN (TS), MIN () is a preset minimum function.
It can be understood that, the minimum value in the TS indicates that after all the second historical data are grouped by the corresponding candidate attribute list, the corresponding second historical data has the shortest read-write duration and the highest read-write efficiency; then, taking the candidate attribute in the candidate attribute list as a target attribute; for example, if the determined candidate attribute list is a file type list, then the candidate attribute in the file type list is used as a target attribute, and when the subsequently acquired historical data is grouped, the acquired historical data is grouped by the candidate attribute in the file type list.
In this embodiment, by the method, it can be determined which candidate attribute in the candidate attribute list is used as the target attribute to group the acquired historical data, so that the storage and reading efficiencies of the historical data are the highest, and the acquisition efficiency of the later target historical data is further improved.
Optionally, step S150 includes the steps of:
S151, obtaining a storage duration set T corresponding to each candidate attribute list 1 =(T 1,1 ,T 1,2 ,…,T 1,x ,…,T 1,y ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein T is 1,x To QU x Each second historical data compression packet in the storage space is stored in a preset fixed storage space for a period of time.
S152, obtaining a reading time length set T corresponding to each candidate attribute list 2 =(T 2,1 ,T 2,2 ,…,T 2,x ,…,T 2,y ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein T is 2,x To store QU x And reading the time length of the preset number of second historical data samples in the fixed storage space of each second historical data compression packet.
S153 according to T 1,x And T 2,x Determining TS x To obtain TS.
In this embodiment, the time length of storing the history data may affect the efficiency of processing the history data, so the time length of reading and writing the second history data in this embodiment includes the time length of storing the second history data and the time length of reading the second history data samples of a preset number, thereby determining the time length of reading and writing the second history data more reasonably, and also reflecting the processing efficiency of the history data from two dimensions.
Alternatively, TS x1 ×T 1,x2 ×T 2,x ;η 1 For a preset first weight, eta 2 For a preset second weight, eta 12 =1,η 1 <η 2
In this embodiment, the history data is stored only once, and the history data is obtainedThe number of times is plural, and therefore, the present embodiment sets T 2,x Is greater than T 1,x For example, η1 has a value in the range of 0.3 to 0.4; therefore, the read-write time length of the determined second historical data is more accurate.
Alternatively, T 1,x The method comprises the following steps of:
s410, obtaining ls=1; LS is a preset first variable.
S420, acquiring QW to be used x The time length T for each second historical data compression packet in the same preset storage space LS
S430, if LS < LS0, ls=ls+1, and execute step S420; to obtain T 1,x =1/LS0×∑ LS0 LS=1 T LS The method comprises the steps of carrying out a first treatment on the surface of the LS0 is a preset first execution time.
In this embodiment, each second historical data compression packet corresponding to the LS attribute is stored in the same preset storage space LS0 times, and then the average value of the time length used each time is taken as T 1,x Can avoid T caused by error in storing some historical data compressed package 1,x Determining the occurrence of error by accident, thereby improving T 1,x Accuracy of the determination.
Alternatively, T 2,x The method comprises the following steps of:
s510, acquiring ln=1; wherein LN is a preset second variable.
S520, determining the QW stored therein x The duration T for acquiring the preset number of data samples in the preset storage space of each corresponding second historical data compression packet LN
S530, if LN < LN0, ln=ln+1, and executing step S520; to obtain T 2,x =1/LN0×∑ LN0 LN=1 T LN The method comprises the steps of carrying out a first treatment on the surface of the LN0 is a preset second execution count.
In this embodiment, a predetermined number of data samples LN0 times are obtained from a predetermined storage space storing each second historical data compression packet corresponding to the LS-th attribute, and then the average value of the time lengths used each time is taken as T 2,x Can avoid acquiring preset value at a certain timeErrors in the number of data samples cause T 2,x Determining the occurrence of error by accident, thereby improving T 2,x Accuracy of the determination.
After the data is stored by the above method, in order to enable a user to quickly query and acquire the stored data, in an exemplary embodiment of the present application, the data may be queried and acquired by the following method.
Specifically, the method comprises the following steps:
s600, responding to target historical data query operation of a user, and acquiring a target historical data query command SQ= (TG, SG, MG); the method comprises the steps of determining a target history data, wherein TG is a time point or a time period corresponding to the target history data, SG is an operating system type identifier corresponding to the target history data, and MG is a target attribute corresponding to the target history data.
In this embodiment, when a user queries the target historical data, a query instruction is input first, where the query instruction includes a time or a time period corresponding to the target historical data, for example, the time for generating the target historical data is 2023, 1 month, 1 day, and 12 points; the query instruction also contains an operating system type corresponding to the target historical data, for example, the operating system corresponding to the target historical data is a Windows operating system; the query instruction also comprises a target attribute corresponding to the target history data, wherein the target attribute is a file attribute; and acquiring the query instruction input by the user to obtain SQ.
S610, obtaining all query indexes to obtain a query index set ST= (ST) 1 ,ST 2 ,…,ST a ,…,ST b ) A=1, 2, …, b; wherein ST is a A is the a query index, b is the number of query indexes; each inquiry index comprises three levels of a tree structure, wherein the first level comprises time window information corresponding to historical data, the second level comprises a plurality of operating system type identifiers belonging to the same time window information, and the third level comprises a plurality of historical data compression packet information corresponding to each operating system type identifier; each of the history data compression packet information includes a target attribute of the history data in the history data compression packet and storage location information of the history data compression packet。
In this embodiment, a plurality of query indexes are stored on the server, each historical time period, that is, a historical time window, corresponds to one query index, and each query index records information of all historical data in the corresponding historical time period, for example, in units of days, the historical data in each day corresponds to one query index; each history data corresponds to not only the generated time point but also an operating system, so that the history data generated in the history time period corresponding to the query index corresponds to a plurality of operating system types and is used as a second level of the query index; the third level comprises a plurality of historical data compression packet information corresponding to each operating system type, the historical data compression packet is obtained by compressing a plurality of historical data, and the historical data compression packet information comprises attributes corresponding to each historical data in the historical data compression packet; the attribute of the history data may be understood as a file type or a file size of the history data, etc.; the storage position information of the historical data compression packet records the start and stop position information of the corresponding historical data compression packet stored on the mechanical hard disk; therefore, through the query index, the historical data can be divided by taking the historical time period as a unit, and the historical data in each historical time period is divided into the same query index, so that the target query index to which the target historical data belongs can be rapidly positioned when the historical data is acquired later, and the acquisition efficiency of the target historical data is improved.
S620, traversing the first level of each query index in the ST according to the TG to determine a plurality of target query indexes; the time window corresponding to the time window information of the first level of each target query index coincides with the TG.
In this embodiment, a historical time period is recorded in the first level of each query index, and if the historical time period coincides with the TG, the query index corresponding to the historical time period is determined to be a target query index; it should be noted that, if TG input by the user is a time point, the target query index is one; if the TG input by the user is a time period, the target query index may be one or a plurality of target query indexes; therefore, the target query index containing the target historical data information can be rapidly determined according to the time point or the time period corresponding to the target historical data input by the user, and in the subsequent query step, the target query index is only needed to be processed, so that the resource occupation is greatly reduced, and the acquisition efficiency of the target historical data is improved.
S630, traversing the second level of each target query index according to the SG so as to determine a plurality of target operating system type identifiers in all the target query indexes; wherein each target operating system type identifier is the same as the SG.
In this embodiment, after determining the target query index, determining the type of the target operating system at the second level of the target query index according to the SG; it should be noted that, if the corresponding operating system type of the target historical data input by the user is one, determining a target operating system type which is the same as the operating system type input by the user at the second level of the target query index; if the corresponding operating system types of the target historical data input by the user are multiple, determining multiple target operating system types which are the same as each operating system type input by the user one by one in a second level of the target query index; the historical data information of the operating system types which do not correspond to the target historical data can be completely eliminated without traversing the historical data information contained in all the operating system types in the target query index, so that the resource occupation is further reduced, and the acquisition efficiency of the target historical data is improved.
S640, traversing each historical data compression packet information corresponding to each target operating system type identifier according to the MG to obtain a plurality of target historical data compression packet information; each historical data compression packet information comprises a storage start address and a storage end address of the corresponding historical data compression packet.
In this embodiment, the third level corresponding to each operating system type includes a plurality of pieces of history data compression packet information, and the history data compression packet information including the history data compression packet information in the third level and having the same target attribute as the MG is determined as the target history data compression packet information, so as to determine the information of the target history data compression packet.
S650, determining a target hard disk identification list corresponding to each target historical data compression packet according to the time window information and the operating system type identification corresponding to each target historical data compression packet.
In this embodiment, a mechanical hard disk identifier mapping table is preset, and a target mechanical hard disk identifier list corresponding to each target operating system type is recorded in the mechanical hard disk identifier mapping table, so that a target hard disk identifier list corresponding to each target historical data compression packet can be determined in the mechanical hard disk identifier mapping table according to time window information and an operating system type identifier corresponding to each target historical data compression packet information.
S660, according to the storage start address and the storage end address of the historical data compression packet corresponding to each target historical data compression packet information, each target historical data compression packet is obtained from the target mechanical hard disk corresponding to each target hard disk identifier in the target hard disk identifier list.
In this embodiment, the type of the corresponding target operating system can be determined according to the information of each target historical data compression packet, a corresponding target mechanical hard disk identification list is further obtained, then, according to the storage start address and the storage end address of the historical data compression packet corresponding to the information of each target historical data compression packet, a plurality of sub-target historical data compression packets corresponding to each target historical data compression packet are obtained from the corresponding storage area of the mechanical hard disk corresponding to each target mechanical hard disk identification in the target mechanical hard disk identification list, and the sub-target historical data compression packets corresponding to each target historical data compression packet are integrated to obtain each target historical data compression packet corresponding to SQ.
According to the data acquisition method of the embodiment, firstly, according to the time or the time period corresponding to the target historical data in the target historical data query instruction input by a user and the time window of the first-level record of each query index, determining a target query index from a plurality of query indexes; the query indexes which do not accord with the time or the time period corresponding to the target historical data can be completely eliminated, the information of the target historical data is only queried in the target query indexes, and all historical data information does not need to be traversed, so that the occupation of resources is greatly reduced, and the acquisition efficiency of the target historical data is improved.
Further, determining a target operating system type from a second level of the target query index according to the operating system type corresponding to the target historical data in the target historical data query instruction; determining storage position information of a target historical data compression packet in a third level corresponding to a target operating system type in a target query index according to attributes corresponding to target historical data in a target historical data query instruction, so as to acquire a corresponding target historical data compression packet; the historical data information which does not accord with the type of the operating system corresponding to the target historical data can be completely eliminated, and the target historical data information and the storage position information of the target historical data compression packet are only inquired in the historical data information contained in the target operating system, so that the corresponding target historical data compression packet is obtained; the historical data information contained in all the operating system types in the target query index does not need to be traversed, so that the resource occupation is further reduced, and the acquisition efficiency of target historical data is improved.
Furthermore, the storage area identifier of each historical data compression packet on each corresponding hard disk is the same storage area identifier, so that the storage amount of the storage area identifier can be reduced, and meanwhile, when the historical data compression packet is acquired, only one storage area identifier is required to be acquired, so that the corresponding historical data compression packet can be acquired from each mechanical hard disk corresponding to the historical data compression packet, the acquisition amount of the storage area identifier is reduced, and the historical data acquisition efficiency is further improved.
Optionally, step S630 includes the steps of:
s631, obtaining initial first vectors GP= (GP) corresponding to the n1 target query indexes 1 ,GP 2 ,…,GP m1 ,…,GP n1 ) M1=1, 2, …, n1; wherein GP is m1 For the first target operating system hit identification corresponding to the m1 st target query index in the GP, each first target operation in the GPThe initial state of the system hit indicator is the first state.
In this embodiment, corresponding first target operating system hit identifiers are respectively established for the obtained n1 target indexes, where the first target operating system hit identifiers are used to characterize whether the operating system type identical to that of the SG exists in the corresponding target indexes; the first state may be represented by a number, for example, a number 0 for the first state and a number 1 for the second state.
S632, traversing the second level of each target query index according to the SG.
S633, if the same OS type as SG exists in the multiple OS types corresponding to the second level of the m1 st target query index, GP is determined m1 Is changed to a second state; otherwise, the GP is maintained m1 The state of (2) is a first state; to obtain target first vector GP ' = (GP ') corresponding to n1 target query indexes ' 1 ,GP’ 2 ,…,GP’ m1 ,…,GP’ n1 ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein GP' m1 And identifying the hit of the second target operating system corresponding to the m1 st target query index in the GP'.
In this embodiment, according to SG in SQ input by the user, traversing the second hierarchy of n1 target query indexes to obtain a first vector GP'; according to the method, the target query index with the target operating system type can be determined through the hit identification state of each second target operating system in the GP', and the target query index with the target operating system type is not required to be acquired, so that the resource occupation is reduced, and the execution efficiency is improved.
S634, each second target operating system hit identifier in the GP' with the second state is obtained to obtain a middle target operating system hit identifier list WGP= (WGP) 1 ,WGP 2 ,…,WGP m2 ,…,WGP n2 ) M2=1, 2, …, n2; wherein WGP m2 For the m2 nd intermediate target operating system hit identifier in the WGP, n2 is the number of intermediate target operating system hit identifiers in the WGP.
In this embodiment, the second target operating system hit identifier with the GP 'internal state being the second state indicates that the corresponding operating system type is the operating system type required by the user, and each second target operating system hit identifier with the GP' internal state being the second state can be obtained to obtain the WGP.
S635, determining the type of the operating system corresponding to each intermediate target operating system hit identifier in the WGP as the target operating system type, so as to obtain n2 target operating system types.
In this embodiment, in some special scenarios, the query instruction input by the user may not include the target attribute corresponding to the target historical data, that is, the user needs all the historical data corresponding to the target operating system; aiming at the situation, the steps in the embodiment can acquire all the target operating system types meeting the needs of the user, and all the historical data compression packets corresponding to each target operating system type are acquired from the corresponding mechanical hard disk, so that the mode of acquiring the historical data by the user is more flexible.
Optionally, step S640 includes the steps of:
s641, according to the MG, traversing each second target operating system hit mark corresponding to the second state in the GP'.
S642, if the same historical data compression packet information as MG exists in the target attribute corresponding to the plurality of historical data compression packet information corresponding to the third level corresponding to the m1 st target operating system type, the GP 'is maintained' m1 The state of (2) is a second state; otherwise, GP 'is to' m1 Is changed to a first state; to obtain target second vectors LGP ' = (LGP ') corresponding to the n1 target query indexes ' 1 ,LGP’ 2 ,…,LGP’ m1 ,…,LGP’ n1 ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein LGP' m1 And compressing the packet information hit identification for the target historical data corresponding to the m1 target query index.
In this embodiment, according to MG in SQ input by the user, traversing a third hierarchy corresponding to n2 target operating system types to obtain a target second vector LGP'; according to the method, the target operating system with the target historical data compression packet information can be determined through the state of each historical data compression packet information hit mark in the LGP', when the target historical data compression packet information is acquired subsequently, the target operating system with the target historical data compression packet information only needs to be traversed, and the historical data compression packet information corresponding to all operating system types does not need to be traversed, so that the efficiency of acquiring the historical data is improved.
S643, obtaining each target historical data compression packet information hit identifier with the second state in the LGP 'to obtain a middle target historical data compression packet information hit identifier list WGP' = (WGP '' 1 ,WGP’ 2 ,…,WGP’ m3 ,…,WGP’ n3 ) M3=1, 2, …, n3; wherein WGP' m3 For the m3 th intermediate target historical data compression packet information hit identifier in the WGP ', n3 is the number of intermediate target historical data compression packet information hit identifiers in the WGP'.
S644, determining the historical data compression packet information corresponding to each middle target historical data compression packet information hit identifier in the WGP' as target historical data compression packet information so as to obtain n3 target historical data compression packet information.
It should be noted that, each target historical data compressed packet information includes a storage area location and a target attribute of the corresponding target historical data compressed packet, and the corresponding target operating system type can be determined according to the target query index where the target operating system type is located.
Optionally, step S650 includes the steps of:
s651, acquiring a preset mechanical hard disk identification mapping table; the mechanical hard disk identification mapping table comprises b rows, and the b rows respectively correspond to time window information of each query index; each row includes a list of hard disk identifications corresponding to each operating system of the second hierarchy of corresponding query indexes.
In this embodiment, a mechanical hard disk identifier mapping table is preset, where the mechanical hard disk identifier mapping table includes b rows, that is, corresponding to b query indexes, and the preset time window information of each row is the same as the time window information of the corresponding query index; meanwhile, each row comprises a hard disk identification list corresponding to each operating system type corresponding to the corresponding query index, and a plurality of mechanical hard disk identifications are recorded in each hard disk identification list.
S652, traversing the time window information of the query index corresponding to each row of the mechanical hard disk identification mapping table according to the time window information corresponding to each target historical data compression packet information so as to obtain a plurality of candidate query indexes.
In this embodiment, a row where each target historical data compressed packet information is located in the mechanical hard disk identifier mapping table can be determined according to time window information corresponding to each target historical data compressed packet information, and then a query index corresponding to each row is obtained to obtain a plurality of target query indexes.
S653, determining a plurality of target operating system type identifiers from a plurality of operating system type identifiers corresponding to the second level of the plurality of candidate query indexes according to the operating system type identifiers corresponding to each target historical data compression packet information.
S654, obtaining a target hard disk identifier list corresponding to each target operating system type identifier to obtain a target hard disk identifier list set Ht= (HT) 1, HT 2 ,…,HT m2 ,…,HT n2 ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein HT is a kind of m2 A target hard disk identification list corresponding to the m2 target operating system type identification; HT (HT) m2 =(HT m2,1, HT m2,2 ,…,HT m2,v ,…,HT m2,u(m2) ) V=1, 2, …, u (m 2); wherein HT is a kind of m2,v And u (m 2) is the number of mechanical hard disk identifiers in the target hard disk identifier list corresponding to the m 2-th target operating system type identifier.
In this embodiment, a target hard disk identifier list corresponding to each target operating system type identifier is recorded in a preset mechanical hard disk identifier mapping table, and a hard disk address stored in a historical data compression packet corresponding to each target operating system can be determined through the target hard disk identifier list corresponding to each target operating system type identifier.
Optionally, step S660 includes the steps of:
S661,obtaining a storage area identifier of a historical data compressed packet corresponding to each target historical data compressed packet information to obtain a target historical data storage area identifier list KT= (KT) 1 ,KT 2 ,…,KT m3 ,…,KT n3 ) M3=1, 2, …, n3; wherein KT m3 The storage area identification of the historical data compression packet corresponding to the m3 th target historical data compression packet information is given, and n3 is the number of the target historical data compression packet information; KT (Kappy- m3 =(KT m3,1 ,KT m3,2 ),KT m3,1 A storage start address KT of a historical data compressed packet corresponding to the m3 rd target historical data compressed packet information m3,2 And storing the termination address of the historical data compression packet corresponding to the m3 th target historical data compression packet information.
It can be understood that in this embodiment, the storage areas of the history data compression packets corresponding to any one of the target history data compression packet information on the corresponding mechanical hard disks are identified as the same; therefore, when the target historical data compression packet is acquired, the corresponding sub-target historical data compression packet can be acquired from each mechanical hard disk corresponding to the target historical data compression packet only by acquiring one storage area identifier, the acquisition amount of the storage area identifier is reduced, and the historical data acquisition efficiency is further improved.
S662, obtaining a target hard disk identifier list HT corresponding to a target operating system corresponding to the m3 rd target historical data compressed packet information from HT m0 The method comprises the steps of carrying out a first treatment on the surface of the Wherein, the value of m0 is an integer between 1 and n 2.
S663 acquisition of HT m0 KT on each mechanical hard disk corresponding to each mechanical hard disk identifier in the memory m3,1 To KT m3,2 The sub-target historical data compression packets stored in the storage unit are used for obtaining a plurality of sub-target historical data compression packets corresponding to the m < 3 > target historical data compression packet.
S664, integrating the plurality of sub-target historical data compression packets corresponding to the m3 target historical data compression packet to obtain the m3 target historical data compression packet.
In the present embodiment, the HT is used in parallel m0 Each machine corresponding to each mechanical hard disk identifier in the machineThe mechanical hard disk acquires each sub first historical data compression packet corresponding to the m3 th target historical data compression packet, so that the time for acquiring each sub first historical data compression packet is the same, the effect of balancing the time for acquiring each sub first historical data compression packet from each mechanical hard disk is achieved, meanwhile, the time for acquiring the m3 rd target historical data compression packet is shortest, and the acquisition efficiency is highest.
It should be noted that, a person skilled in the art may integrate each sub-target historical data compression packet by using an existing data compression packet integration method according to actual requirements to obtain a target historical data compression packet, which is not described herein.
Furthermore, although the steps of the methods in the present disclosure are depicted in a particular order in the drawings, this does not require or imply that the steps must be performed in that particular order or that all illustrated steps be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
Embodiments of the present invention also provide a non-transitory computer readable storage medium that may be disposed in an electronic device to store at least one instruction or at least one program for implementing one of the methods embodiments, the at least one instruction or the at least one program being loaded and executed by the processor to implement the methods provided by the embodiments described above.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. Referring to FIG. 3, the program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
Referring to fig. 4, an embodiment of the present application also provides an electronic device including a processor and the aforementioned non-transitory computer-readable storage medium.
An electronic device according to this embodiment of the application. The electronic device is merely an example, and should not impose any limitations on the functionality and scope of use of embodiments of the present application.
The electronic device is in the form of a general purpose computing device. Components of an electronic device may include, but are not limited to: the at least one processor, the at least one memory, and a bus connecting the various system components, including the memory and the processor.
Wherein the memory stores program code that is executable by the processor to cause the processor to perform steps according to various exemplary embodiments of the application described in the "exemplary methods" section of this specification.
The storage may include readable media in the form of volatile storage, such as Random Access Memory (RAM) and/or cache memory, and may further include Read Only Memory (ROM).
The storage may also include a program/utility having a set (at least one) of program modules including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
The bus may be one or more of several types of bus structures including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.
The electronic device may also communicate with one or more external devices (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device, and/or with any device (e.g., router, modem, etc.) that enables the electronic device to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface. And, the electronic device may also communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through a network adapter. The network adapter communicates with other modules of the electronic device via a bus. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with an electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Embodiments of the present invention also provide a computer program product comprising program code for causing an electronic device to carry out the steps of the method according to the various exemplary embodiments of the invention as described in the specification, when said program product is run on the electronic device.
While certain specific embodiments of the invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the invention. Those skilled in the art will also appreciate that many modifications may be made to the embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.

Claims (10)

1. A method of data storage, the method comprising the steps of:
s100, acquiring a first historical data compression packet list set A= (A) in a target time period 1 ,A 2 ,…,A m ,…,A n ) M=1, 2, …, n; wherein A is m The first historical data compression packet list corresponding to the mth operating system is provided, and n is the first historical numberThe number of compressed packet lists; a is that m =(A m,1 ,A m,2 ,…,A m,j ,…,A m,f(m) ),j=1,2,…,f(m);A m,j Is A m The j-th first historical data compressed packet, f (m) is A m The number of first historical data compression packets; a is that m,j The target attribute of each first historical data in the database is the same, A m,j Target attribute and A of any first historical data m Any one of the other first historical data compression packets has different target attributes; SA (SA) m,r >SA m,r+1 ,r=1,2,…,f(m)-1;SA m,r According to A m,r Query priorities obtained by the corresponding target attributes; the target attribute is a file attribute of the first historical data;
s200, according to A m The total size of all first historical data compression packets and the capacity of a single mechanical hard disk are determined to be A m Corresponding to each mechanical hard disk mark to obtain A m Corresponding mechanical hard disk identification set Y m =(Y m,1 ,Y m,2 ,…,Y m,p ,…,Y m,h(m) ) P=1, 2, …, h (m); wherein Y is m,p Is A m The corresponding p-th mechanical hard disk mark, h (m) is A m The number of corresponding mechanical hard disk identifiers;
S300 according to A m The size of each first historical data compression packet will be Y m,1 、Y m,2 、…、Y m,p 、…、Y m,h(m) The corresponding mechanical hard disk is divided into f (m) storage areas on average, and each storage area corresponds to one storage area identifier to obtain A m Corresponding storage area identification set Q m =(Q m,1 ,Q m,2 ,…,Q m,j ,…,Q m,f(m) ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein Q is m,j Is A m,j A corresponding storage area identifier; q (Q) m,r The read-write speed of the corresponding storage area is larger than Q m,r+1 The read-write speed of the corresponding storage area; a is that m,j The same storage area identifier is corresponding to each mechanical hard disk;
s400, A m,j Dividing into h (m) sub-first historical data compression packets to obtain A m,j Corresponding sub first historical data compressed packet set TA m,j =(TA m,j,1 ,TA m,j,2 ,…,TA m,j,p ,…,TA m,j,h(m) ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein TA m,j,p For TA m,j The p < th > sub-first historical data compression packet;
s500, TA m,j,p Q stored in the p-th mechanical hard disk m,j Corresponding storage areas.
2. The data storage method according to claim 1, wherein step S300 includes the steps of:
s310, according to A m Acquiring a target data size list w= (W m,1 ,W m,2 ,…,W m,j ,…,W m,f(m) ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein W is m,j Is A m,j A corresponding target data size; w (W) m,j =WA m,j /h(m);WA m,j Is A m,j Data size of (2);
s320, according to W, slave A m The outermost side of the corresponding magnetic disk of each mechanical hard disk gradually divides the magnetic disk of each mechanical hard disk into f (m) target storage areas;
S330, obtaining the storage area identification of each target storage area to obtain A m Corresponding storage area identification set Q m =(Q m,1 ,Q m,2 ,…,Q m,j ,…,Q m,f(m) ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein Q is m,j Includes Q m,j Start memory address and end memory address of corresponding memory region, and Q m,j The storage space of the corresponding storage area is not smaller than W m,j
3. The data storage method of claim 1, wherein SA m,r The method comprises the following steps of:
s110, obtaining A m,r Corresponding target attributes;
s111 according to A m,r The corresponding target attribute obtains SA from a preset query priority mapping table m,r The method comprises the steps of carrying out a first treatment on the surface of the Wherein the query priority mapping table comprises a plurality of rows, each row corresponding to a target genusSex and query priority corresponding to the target attribute.
4. The data storage method of claim 1, wherein the target attribute is determined by:
s120, acquiring a plurality of second historical data received in a preset historical time period, and determining a candidate attribute list set U= (U) 1 ,U 2 ,…,U x ,…,U y ),x=1,2,…,y;U x An xth candidate attribute list; each candidate attribute list comprises a plurality of candidate attributes; each second history data is in U x Has a unique corresponding candidate attribute;
s130, grouping all the second historical data according to U to obtain a second historical data set list set TU= (TU) 1 ,TU 2 ,…,TU x ,…,TU y ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein TU is x According to U x A second historical data group list obtained for all second historical data groups; TU (TU) x =(TU x,1 ,TU x,2 ,…,TU x,d ,…,TU x,c(x) ),d=1,2,…,c(x);TU x,d For TU x The d second historical data group in the database, c (x) is TU x The number of inner second historical data sets;
s140, compressing each second historical data set in each second historical data set list in the TU to obtain a second historical data compressed packet list set QTU = (QTU) corresponding to the TU 1 ,QTU 2 ,…,QTU x ,…,QTU y ) The method comprises the steps of carrying out a first treatment on the surface of the Therein, QTU x For TU x A corresponding second historical data compression packet list;
s150, obtaining the second historical data read-write time length corresponding to each candidate attribute list in the U to obtain a read-write time length set TS= (TS) corresponding to the U 1 ,TS 2 ,…,TS x ,…,TS y ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein TS x To QTU x Each second historical data compression packet in the storage area is stored in a preset fixed storage area, and the time length for the second historical data samples with the preset number is read from the fixed storage area;
s160, the shortest second history data read-write time T min Candidate attributes in the corresponding candidate attribute list are used as target attributes; t (T) min MIN (TS), MIN () is a preset minimum function.
5. The data storage method of claim 4, wherein step S150 comprises the steps of:
s151, obtaining a storage duration set T corresponding to each candidate attribute list 1 =(T 1,1 ,T 1,2 ,…,T 1,x ,…,T 1,y ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein T is 1,x To QTU x Each second historical data compression packet in the storage space is stored in a preset fixed storage space for a period of time;
s152, obtaining a reading time length set T corresponding to each candidate attribute list 2 =(T 2,1 ,T 2,2 ,…,T 2,x ,…,T 2,y ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein T is 2,x To store QTU x Reading the time length of a preset number of second historical data samples in the fixed storage space of each second historical data compression packet;
s153 according to T 1,x And T 2,x Determining TS x To obtain TS.
6. The data storage method of claim 5, wherein TS x1 ×T 1,x2 ×T 2,x ;η 1 For a preset first weight, eta 2 For a preset second weight, eta 12 =1,η 1 <η 2
7. The data storage method of claim 6, wherein η1 is in the range of 0.3 to 0.4.
8. The data storage method of claim 1, wherein TA m,j The sizes of the first historical data compression packets of any two sub-first historical data compression packets are equal.
9. A non-transitory computer readable storage medium having stored therein at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the data storage method of any one of claims 1-8.
10. An electronic device comprising a processor and the non-transitory computer readable storage medium of claim 9.
CN202311128546.0A 2023-09-04 2023-09-04 Data storage method, electronic equipment and storage medium Active CN116860183B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311128546.0A CN116860183B (en) 2023-09-04 2023-09-04 Data storage method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311128546.0A CN116860183B (en) 2023-09-04 2023-09-04 Data storage method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116860183A CN116860183A (en) 2023-10-10
CN116860183B true CN116860183B (en) 2023-12-01

Family

ID=88230774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311128546.0A Active CN116860183B (en) 2023-09-04 2023-09-04 Data storage method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116860183B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104281528A (en) * 2013-07-09 2015-01-14 浙江大华技术股份有限公司 Data storage method and device
CN108492339A (en) * 2018-03-28 2018-09-04 腾讯科技(深圳)有限公司 Obtain method, apparatus, electronic equipment and the storage medium of resource compressed package
CN114356867A (en) * 2021-12-29 2022-04-15 珠海豹好玩科技有限公司 Method and device for opening compressed package file, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11281691B2 (en) * 2015-12-07 2022-03-22 International Business Machines Corporation Data replication based on compression ratio history

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104281528A (en) * 2013-07-09 2015-01-14 浙江大华技术股份有限公司 Data storage method and device
CN108492339A (en) * 2018-03-28 2018-09-04 腾讯科技(深圳)有限公司 Obtain method, apparatus, electronic equipment and the storage medium of resource compressed package
CN114356867A (en) * 2021-12-29 2022-04-15 珠海豹好玩科技有限公司 Method and device for opening compressed package file, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN116860183A (en) 2023-10-10

Similar Documents

Publication Publication Date Title
US20190253489A1 (en) Command process load balancing system
GB2508503A (en) Batch evaluation of remote method calls to an object oriented database
EP3356951B1 (en) Managing a database of patterns used to identify subsequences in logs
CN110569218B (en) Offline modification method and device for EXT file system and storage medium
CN110825953B (en) Data query method, device and equipment
US11210290B2 (en) Automated optimization of number-of-frequent-value database statistics
CN116860183B (en) Data storage method, electronic equipment and storage medium
US11144538B2 (en) Predictive database index modification
US11966356B2 (en) Efficient usage of one-sided RDMA for linear probing
JP2004326480A (en) Distributed parallel analysis method of mass data
US11645283B2 (en) Predictive query processing
US11847121B2 (en) Compound predicate query statement transformation
CN116860761B (en) Data acquisition method, electronic equipment and storage medium
US11720554B2 (en) Iterative query expansion for document discovery
US20210390125A1 (en) Sensitive Data Evaluation
CN116348868A (en) Metadata indexing for information management
US20200134071A1 (en) Performance for query execution
CN112328630A (en) Data query method, device, equipment and storage medium
CN112416699A (en) Index data collection method and system
CN110750569A (en) Data extraction method, device, equipment and storage medium
US20230214394A1 (en) Data search method and apparatus, electronic device and storage medium
US11630849B2 (en) Optimizing insight generation in heterogeneous datasets
CN110457122B (en) Task processing method, task processing device and computer system
CN111291040B (en) Data processing method, device, equipment and medium
US11379669B2 (en) Identifying ambiguity in semantic resources

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