CN108133033A - A kind of method, apparatus and computer equipment for data storage - Google Patents
A kind of method, apparatus and computer equipment for data storage Download PDFInfo
- Publication number
- CN108133033A CN108133033A CN201810015937.4A CN201810015937A CN108133033A CN 108133033 A CN108133033 A CN 108133033A CN 201810015937 A CN201810015937 A CN 201810015937A CN 108133033 A CN108133033 A CN 108133033A
- Authority
- CN
- China
- Prior art keywords
- character string
- data
- method name
- coding schedule
- name
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2291—User-Defined Types; Storage management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
- G06F16/90335—Query processing
- G06F16/90344—Query processing by using string matching techniques
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/40—Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
An embodiment of the present invention provides a kind of method, apparatus and computer equipment for data storage, apply in platform is broadcast live, the method includes:More parts of performance sampled datas are obtained, the performance sampled data includes:A variety of method names and corresponding operation data;String encoding is carried out using each method name as different basic elements, generates coding schedule;Each corresponding character string of the method title in every part of performance sampled data and each corresponding operation data of the method title are stored into database respectively;In this way, it is that will carry out string encoding using each method name as different basic elements when being encoded;And character string is readable data, even if after data are stored, data are still readable;Therefore user, can be according to corresponding string search to corresponding method name when carrying out information retrieval, then gets the performance sampled data of party's legitimate name.
Description
Technical field
The invention belongs to network operation technical field more particularly to a kind of method, apparatus and calculating for data storage
Machine equipment.
Background technology
After xhprof is used to carry out performance sampling, need by sampled data storage in database with it is to be retrieved and point
Analysis.
Performance sampled data is a very big array, and common processing method is laggard first with conventional compact compression algorithm
Row storage, but after carrying out compression storage to performance data, data lose readability, can not carry out information retrieval to it.
Invention content
In view of the problems of the existing technology, an embodiment of the present invention provides a kind of method, apparatus for data storage
And computer equipment, after solving in the prior art to store performance sampled data, it can not be retrieved, be searched
The technical issues of.
The present invention provides a kind of method for data storage, applies in platform is broadcast live, the method includes:
More parts of performance sampled datas are obtained, the performance sampled data includes:A variety of method names and corresponding operation number
According to;
Each the method name is referred to as different basic elements and carries out string encoding, generates coding schedule;
Based on the coding schedule, respectively by each corresponding word of the method title in every part of performance sampled data
Symbol string and each corresponding operation data of the method title are stored into database.
Described to carry out string encoding using each method name as different basic elements in said program, generation is compiled
Code table, including:
When the coding schedule is unshared coding schedule, each method name in the more parts of performance sampled datas is counted respectively
The quantity of title;
A unique character string is distributed for each method name in every part of performance sampled data;
By each method name described in every part of performance sampled data kind, the quantity of each method name and corresponding
Character string is stored respectively into corresponding first mapping table, first mapping table be unshared coding schedule, the corresponding word
Symbol string is preset.
Described to carry out string encoding using each method name as different basic elements in said program, generation is compiled
Code table, including:
When the coding schedule is shared coding schedule, arbitrary a performance sampling in the more parts of performance sampled datas is counted
The quantity of each method name in data;
A unique character string is distributed for each method name;
Each described method name, the quantity of each method name and corresponding character string are stored to preset
In second mapping table, second mapping table is shared coding schedule, and the corresponding character string is preset.
In said program, based on the coding schedule, the corresponding character string of each described method name is stored to database
In, including:
The corresponding character string of each method name is searched from the coding schedule;
According to each the method title one character string sequence of corresponding text string generation;
In the character string sequence, separator is provided between different character strings.
In said program, the operation data includes:The run time of each the method title, number of run, operation
Memory and central processing unit (CPU, Central Processing Unit) utilization rate of occupancy.
The present invention also provides a kind of device for data storage, described device includes:
Acquiring unit, for obtaining more parts of performance sampled datas, the performance sampled data includes:A variety of method names and
Corresponding operation data;
Coding unit carries out string encoding for each the method name to be referred to as different basic elements;
Storage unit, for respectively by the character string of each the method title in every part of performance sampled data and
The corresponding compressed operation data of each the method title is stored into database.
In said program, the coding unit is specifically used for:
When the coding schedule is shared coding schedule, arbitrary a performance sampling in the more parts of performance sampled datas is counted
The quantity of method name is planted in data;
A unique character string is distributed for each method name;
Each described method name, the quantity of each method name and corresponding character string are stored to preset
In second mapping table, second mapping table is shared coding schedule, and the corresponding character string is preset.
In said program, the storage unit is specifically used for:
The corresponding character string of each method name is searched from the coding schedule;
According to each the method title one character string sequence of corresponding text string generation;
In the character string sequence, separator is provided between different character strings.
The present invention also provides a kind of computer readable storage mediums, are stored thereon with computer program, which is handled
Device is able to carry out any of the above-described method when performing.
The present invention also provides it is a kind of for data storage computer equipment, including:
At least one processor;And
At least one processor being connect with the processor communication, wherein,
The memory is stored with the program instruction that can be performed by the processor, and the processor calls described program to refer to
Order is able to carry out such as any of the above-described method.
An embodiment of the present invention provides a kind of method, apparatus and computer equipment for data storage, apply and are being broadcast live
In platform, the method includes:More parts of performance sampled datas are obtained, the performance sampled data includes:A variety of method names and
Corresponding operation data;String encoding is carried out using each method name as different basic elements, by each the method
The corresponding character string of title and the corresponding compressed operation data of each the method title are stored into database;In this way,
It is that will carry out string encoding using each method name as different basic elements when being encoded;And character string is readable
Data, even if after data are stored, data are still readable;Therefore user, can be according to corresponding when carrying out information retrieval
String search to corresponding method name, then get the performance sampled data of party's legitimate name.
Description of the drawings
Fig. 1 is the method flow schematic diagram for data storage that the embodiment of the present invention one provides;
Fig. 2 is the apparatus structure schematic diagram provided by Embodiment 2 of the present invention for data storage;
Fig. 3 is the computer equipment overall structure diagram for data storage that the embodiment of the present invention three provides.
Specific embodiment
After being used to solve in the prior art to store performance sampled data, it can not be retrieved, be searched
The technical issues of, the present invention provides a kind of method, apparatus and computer equipment for data storage, apply in live streaming platform
In, the method includes:More parts of performance sampled datas are obtained, the performance sampled data includes:A variety of method names and correspondence
Operation data;String encoding is carried out using each method name as different basic elements, by each the method title
Corresponding character string and the corresponding compressed operation data of each the method title are stored into database.
Technical scheme of the present invention is described in further detail below by drawings and the specific embodiments.
Embodiment one
The present embodiment provides a kind of methods for data storage, apply in platform is broadcast live, as shown in Figure 1, the side
Method includes:
S110, obtains more parts of performance sampled datas, and the performance sampled data includes:A variety of method names and corresponding fortune
Row data;
It needs to get performance sampled data in this step, the performance sampled data includes more parts, every part of performance
Sampled data all includes a variety of method names and corresponding operation data.Than if desired for getting user's name, then corresponding
Method name is exactly username or userID;The run time of the operation data including each method name, number of run,
Run the memory occupied and CPU usage etc..
S111 carries out string encoding using each method name as different basic elements, generates coding schedule;
Here it is possible to it is carried out for each method name in every part of performance sampled data respectively as different basic elements
String encoding generates multiple unshared coding schedules.
Specifically, the quantity of each method name in the more parts of performance sampled datas is counted respectively;It is adopted for every part of performance
Each method name in sample data distributes a unique character string;By each method name described in every part of performance sampled data kind
Claim, the quantity of each method name and corresponding character string are stored respectively into corresponding first mapping table, described the
One mapping table is unshared coding schedule, and the corresponding character string is preset.
For example, it is as shown in table 1 for first mapping table of certain part of performance sampled data generation, it is adopted for other performances
First mapping table of sample data is realized after the same method.Wherein, the character string can be from 26 upper and lower case letters
In determine.
Table 1
Method name | Occurrence number | Character code |
A | 243 | f |
B | 173 | d |
C | 99 | e |
It should be noted that the performance sampled data of different numbers include identical method name when, identical method
Title is required for identical character string.
Further, because when sampling, no matter sampling how many times for same application program, method name it is total
Number is fixed, each method name is also much the same in the frequency that replicate sampling data occur, it is contemplated that performance hits
According to particularity, this step, can also be first when each method name is carried out string encoding as different basic element
Method name based on arbitrary a performance sampled data is encoded, and a shared coding schedule is generated, to save memory space.
Here, using Huffman encoding method in the present embodiment.
Specifically, each method name in arbitrary a performance sampled data is counted in the more parts of performance sampled datas
Quantity;A unique character string is distributed for each method name;By described each method name, each method name
Quantity and corresponding character string are stored into preset second mapping table, and second mapping table is as shown in table 1.Wherein, institute
Stating character string can also determine from 26 upper and lower case letters.
Table 2
Second mapping table is a shared coding schedule, then by the storage of shared coding schedule in the database, so only
A shared coding schedule need to be stored, saves memory space.Also, because character string is readable data, even if after data are stored,
Data are still readable;Therefore user, can be according to corresponding string search to corresponding side when carrying out information retrieval
Legitimate name, then get the performance sampled data of party's legitimate name.
If in addition, wanting to further improve encoding rate, the shared coding schedule can include multiple, each shared coding schedule
There are one unique marks, and in this case, every part of performance sampled data can select corresponding shared coding according to the mark specified
Table.
S112, it is respectively that each the method title in every part of performance sampled data is corresponding based on the coding schedule
Character string and each corresponding operation data of the method title are stored into database.
In this step, when needing to store more parts of performance sampled datas of same application program, every part of performance is first obtained
A variety of method names of sampled data inquire each side from the shared coding schedule or from corresponding unshared coding schedule
The corresponding character string of legitimate name, then according to each method name one character string sequence of corresponding text string generation;Described
In character string sequence, separator is added between different character strings, to facilitate accurate retrieval.Here, the corresponding character
String is preset.
Such as when being searched with unshared coding schedule, the method name that certain part of performance sampled data includes is A and B;
In first part of performance sampled data, the corresponding operation datas of method A are 1, and the corresponding operation datas of method B are B;So character string
Sequence is:
Method A->F, method B->d;f,d;1,3;
Such as when being searched with shared coding schedule, the method name that certain part of performance sampled data includes is A and B;The
In a performance sampled data, the corresponding operation datas of method A are 1, and the corresponding operation datas of method B are B;So character string sequence
It is classified as:f,d;1,3;
Similarly, if it is desired to when being stored to 1000 parts of performance sampled datas, distinguish according to above-mentioned same method
Generation.Here, each operation data has corresponding offset or extraction mark;The offset can be that the time is inclined
It moves, serial number deviates or address offset.
Finally the corresponding character string of the method title is compressed, by the corresponding operation number of each the method title
According to being compressed, compressed character string and corresponding operation data are stored into database.
It can certainly be respectively by each corresponding character string of the method title in every part of performance sampled data
And each corresponding operation data of the method title is serialized, and generates character string sequence;By the character string sequence into
Row compression, obtains compression result, the compression result is stored into database.
Here, it is differed because method name generally comprises several to dozens of characters, if directly being carried out with single character
During compression, the space occupied is bigger, but using method name as basic element carry out string encoding after, generally also just include 1
A to arrive several characters, the space occupied is with regard to smaller in this way in compression.
For example by taking the performance sampled data of certain request of direct broadcasting room as an example, occur 476 method names in total, occur altogether
1788 times, average each method name occurs 3.8 times.The weighted average length of method name is 28.6 characters.If it does not examine
Consider method name occurrence number, then the average length of this 457 method names is 31.4 characters.Character string after serializing
In, the character of method name occupies the 58.0% of overall content.
After the above-mentioned progress Huffman encoding to method name, a method name can be with average 8.0 bit come table
Show.In contrast, if stored with character style, each character is required for 1 byte (1 byte=8bit) in method name.
After also meaning that coding, the occupied space of method name only have before 1/28.6th.
When using shared coding schedule, since coding schedule is shared, do not need to be additional in compression result
Coding schedule used in storage (space of storage reference can be ignored).The each method name being so encoded averagely saves
27.6 character lengths are saved, save 96.5% space in other words.Overall content is accounted in view of the character content of method name
58%, it is exactly 56% to be multiplied by 96.5%.I.e. theoretically, can be before conventional compression method by this programme, it will be to be compressed interior
Hold the size of diminution 56%, also just reduce memory space in this way.
It should be noted that remaining 42% operation data is according to conventional compress mode compression, storage.
When needing to retrieve performance sampled data, can be looked into coding schedule (shared coding schedule or unshared coding schedule)
The corresponding string encoding of goal approach title is found, then finds the corresponding total operation data of the string encoding, so
Object run data are extracted from total operation data according to the offset address of object run data or extraction mark afterwards.
Embodiment two
Corresponding to embodiment one, the present embodiment also provides a kind of device for data storage, as shown in Fig. 2, the dress
Put including:Acquiring unit 21, coding unit 22 and storage unit 23;Wherein,
Acquiring unit 21 is for obtaining performance sampled data, and the performance sampled data includes more parts, every part of performance
Sampled data all includes a variety of method names and corresponding operation data.Than if desired for getting user's name, then corresponding
Method name is exactly username or userID;The run time of the operation data including each method name, number of run,
Run the memory occupied and CPU usage etc..
Here it is possible to it is carried out for each method name in every part of performance sampled data respectively as different basic elements
String encoding generates multiple unshared coding schedules.
Specifically, the quantity of each method name in the more parts of performance sampled datas is counted respectively;It is adopted for every part of performance
Each method name in sample data distributes a unique character string;By each method name described in every part of performance sampled data kind
Claim, the quantity of each method name and corresponding character string are stored respectively into corresponding first mapping table, described the
One mapping table is unshared coding schedule, and the corresponding character string is preset.
For example, it is as shown in table 1 for first mapping table of certain part of performance sampled data generation, it is adopted for other performances
First mapping table of sample data is realized after the same method.Wherein, the character string can be from 26 upper and lower case letters
In determine.
Table 1
Method name | Occurrence number | Character code |
A | 243 | f |
B | 173 | d |
C | 99 | e |
It should be noted that the performance sampled data of different numbers include identical method name when, identical method
Title is required for identical character string.
Further, because when sampling, no matter sampling how many times for same application program, method name it is total
Number is fixed, each method name is also much the same in the frequency that replicate sampling data occur, it is contemplated that performance hits
According to particularity, coding unit 22 also may be used when each method name is carried out string encoding as different basic element
It is encoded with the method name first based on arbitrary a performance sampled data, here, using Huffman in the present embodiment
Coding method.
Specifically, coding unit 22 counts each in arbitrary portion performance sampled data in the more parts of performance sampled datas
The quantity of method name;A unique character string is distributed for each method name;Will each described method name, it is described each
The quantity of method name and corresponding character string are stored into preset second mapping table, second mapping table such as 2 institute of table
Show.Wherein, the character string can be determined from 26 upper and lower case letters.
Table 2
Method name | Occurrence number | Character code |
A | 240 | f |
B | 170 | d |
C | 100 | e |
Second mapping table is a shared coding schedule, then by the storage of shared coding schedule in the database, so only
A shared coding schedule need to be stored and also save memory space.Also, because character string is readable data, even if data are stored
Afterwards, data are still readable;Therefore user, can be according to corresponding string search to corresponding when carrying out information retrieval
Method name, then get the performance sampled data of party's legitimate name.
If in addition, wanting to further improve encoding rate, the shared coding schedule can include multiple, each shared coding schedule
There are one unique marks, and in this case, every part of performance sampled data can select corresponding shared coding according to preset mark
Table.
After coding schedule generates, storage unit 23 is used for the character string of each the method title and each described side
The corresponding compressed operation data of legitimate name is stored into database.
Specifically, it when needing to store more parts of performance sampled datas of same application program, first obtains every part of performance and adopts
A variety of method names of sample data inquire each method from the shared coding schedule or from corresponding unshared coding schedule
The corresponding character string of title, then according to each method name one character string sequence of corresponding text string generation;In the word
It accords in string sequence, separator is added between different character strings, to facilitate accurate retrieval.Here, the corresponding character string
It is preset.
Such as when being searched with unshared coding schedule, the method name that certain part of performance sampled data includes is A and B;
In first part of performance sampled data, the corresponding operation datas of method A are 1, and the corresponding operation datas of method B are B;So character string
Sequence is:
Method A->F, method B->d;f,d;1,3;
Such as when being searched with shared coding schedule, the method name that certain part of performance sampled data includes is A and B;The
In a performance sampled data, the corresponding operation datas of method A are 1, and the corresponding operation datas of method B are B;So character string sequence
It is classified as:f,d;1,3;
Similarly, if it is desired to when being stored to 1000 parts of performance sampled datas, distinguish according to above-mentioned same method
Generation.Here, each operation data has corresponding offset or extraction mark;The offset can be that the time is inclined
It moves, serial number deviates or address offset.
Finally each corresponding character string of the method title in every part of performance sampled data is compressed, by each
The corresponding operation data of the method title is compressed, and compressed character string and corresponding operation data are stored to data
In library.
It can certainly be respectively by each corresponding character string of the method title in every part of performance sampled data
And each corresponding operation data of the method title is serialized, formation sequence character string;By the character string sequence
It is compressed, obtains compression result, the compression result is stored into database.
Here, it is differed because method name generally comprises several to dozens of characters, if directly being carried out with single character
During compression, the space occupied is bigger, but using method name as basic element carry out string encoding after, generally also just include 1
A to arrive several characters, the space occupied is with regard to smaller in this way in compression.
For example by taking the performance sampled data of certain request of direct broadcasting room as an example, occur 476 method names in total, occur altogether
1788 times, average each method name occurs 3.8 times.The weighted average length of method name is 28.6 characters.If it does not examine
Consider method name occurrence number, then the average length of this 457 method names is 31.4 characters.Character string after serializing
In, the character of method name occupies the 58.0% of overall content.
After the above-mentioned progress Huffman encoding to method name, a method name can be with average 8.0 bit come table
Show.In contrast, if stored with character style, each character is required for 1 byte (1 byte=8bit) in method name.
After also meaning that coding, the occupied space of method name only have before 1/28.6th.
When using shared coding schedule, since coding schedule is shared, do not need to be additional in compression result
Coding schedule used in storage (space of storage reference can be ignored).The each method name being so encoded averagely saves
27.6 character lengths are saved, save 96.5% space in other words.Overall content is accounted in view of the character content of method name
58%, it is exactly 56% to be multiplied by 96.5%.I.e. theoretically, can be before conventional compression method by this programme, it will be to be compressed interior
Hold the size of diminution 56%, also just reduce memory space in this way.
It should be noted that remaining 42% operation data is compressed according to conventional compress mode.
When needing to retrieve performance sampled data, can be looked into coding schedule (shared coding schedule or unshared coding schedule)
The corresponding string encoding of goal approach title is found, then finds the corresponding total operation data of the string encoding, so
Object run data are extracted from total operation data according to the offset address of object run data or extraction mark afterwards.
Embodiment three
The present embodiment also provides a kind of computer equipment for data storage, as shown in figure 3, the computer equipment packet
It includes:Radio frequency (Radio Frequency, RF) circuit 310, memory 320, input unit 330, display unit 340, voicefrequency circuit
350th, the components such as WiFi module 360, processor 370 and power supply 380.It will be understood by those skilled in the art that it is shown in Fig. 3
Computer equipment structure do not form restriction to computer equipment, can include than illustrate more or fewer components or
Person combines certain components or different components arrangement.
Each component parts of computer equipment is specifically introduced with reference to Fig. 3:
RF circuits 310 can be used for sending and receiving for signal, particularly, after the downlink information of base station is received, to processing
Device 370 is handled.In general, RF circuits 310 include but not limited at least one amplifier, transceiver, coupler, low noise amplification
Device (Low Noise Amplifier, LNA), duplexer etc..
Memory 320 can be used for storage software program and module, and processor 370 is stored in memory 320 by operation
Software program and module, so as to perform the various function application of computer equipment and data processing.Memory 320 can be led
To include storing program area and storage data field, wherein, storing program area can storage program area, needed at least one function
Application program etc.;Storage data field can be stored uses created data etc. according to computer equipment.In addition, memory 320
Can include high-speed random access memory, can also include nonvolatile memory, a for example, at least disk memory,
Flush memory device or other volatile solid-state parts.
Input unit 330 can be used for receiving the number inputted or character information and generation and the user of computer equipment
Setting and function control it is related key signals input.Specifically, input unit 330 may include keyboard 331 and other inputs
Equipment 332.Keyboard 331 collects the input operation of user on it, and drives corresponding connection according to preset formula
Device.Keyboard 331 gives processor 370 again after collecting output information.In addition to keyboard 331, input unit 330 can also include
Other input equipments 332.Specifically, other input equipments 332 can include but is not limited to touch panel, function key (such as sound
Measure control button, switch key etc.), it is trace ball, mouse, one or more in operating lever etc..
Display unit 340 can be used for display by information input by user or be supplied to the information and computer equipment of user
Various menus.Display unit 340 may include display panel 341, optionally, liquid crystal display (Liquid may be used
Crystal Display, LCD), the forms such as Organic Light Emitting Diode (Organic Light-Emitting Diode, OLED)
Display panel 341 is configured.Further, keyboard 331 can cover display panel 341, when keyboard 331 detect it is on it or attached
After near touch operation, processor 370 is sent to determine the type of touch event, is followed by subsequent processing device 370 according to incoming event
Type corresponding visual output is provided on display panel 341.Although keyboard 331 and display panel 341 are conducts in figure 3
Two independent components realize the input of computer equipment and input function, but in some embodiments it is possible to by keyboard
331 is integrated with display panel 341 and that realizes computer equipment output and input function.
Voicefrequency circuit 350, loud speaker 351, microphone 352 can provide the audio interface between user and computer equipment.
The transformed electric signal of the audio data received can be transferred to loud speaker 351, is converted by loud speaker 351 by voicefrequency circuit 350
It is exported for voice signal;
WiFi belongs to short range wireless transmission technology, and computer equipment can help user to receive and dispatch by WiFi module 360
Email, browsing webpage and access streaming video etc., it has provided wireless broadband internet to the user and has accessed.Although Fig. 3
Show WiFi module 360, but it is understood that, and must be configured into for computer equipment is not belonging to, it completely can root
It is omitted in the range for the essence for not changing invention according to needs.
Processor 370 is the control centre of computer equipment, utilizes various interfaces and the entire computer equipment of connection
Various pieces, by run or perform the software program being stored in memory 320 and/or module and call be stored in
Data in memory 320 perform the various functions of computer equipment and processing data, whole so as to be carried out to computer equipment
Monitoring.Optionally, processor 370 may include one or more processing units;Preferably, processor 370 can be integrated using processing
Device, wherein, the main processing operation system of application processor, user interface and application program etc..
Computer equipment further includes the power supply 380 (such as power supply adaptor) powered to all parts, it is preferred that power supply can
With logically contiguous by power-supply management system and processor 370.
The advantageous effect that the method, apparatus provided in an embodiment of the present invention for being used to store data and computer equipment can be brought
At least:
An embodiment of the present invention provides a kind of method, apparatus and computer equipment for data storage, apply and are being broadcast live
In platform, the method includes:More parts of performance sampled datas are obtained, the performance sampled data includes:A variety of method names and
Corresponding operation data;String encoding is carried out using each method name as different basic elements, generates coding schedule;It is based on
The coding schedule, respectively by each corresponding character string of the method title in every part of performance sampled data and each institute
The corresponding operation data of method name is stated to store into database;In this way, it is that each method name will be referred to as when being encoded
String encoding is carried out for different basic elements;And character string is readable data, even if after data are stored, data are still
Readable;Therefore user, can be according to corresponding string search to corresponding method name when carrying out information retrieval, then obtains
Get the performance sampled data of party's legitimate name;And when using shared coding schedule, due to only needing generation one altogether
It enjoys coding schedule and storage can be realized, reduce content that needs store so as to reduce the memory space of occupancy;Also, due to this
Case is encoded method name as a basic element, when being compressed to method name, due to the data of compression
It reduces, so as to also improve compression ratio.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein.
Various general-purpose systems can also be used together with teaching based on this.As described above, required by constructing this kind of system
Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that it can utilize various
Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair
Bright preferred forms.
In the specification provided in this place, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention
Example can be put into practice without these specific details.In some instances, well known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of each inventive aspect,
Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor
Shield the present invention claims the more features of feature than being expressly recited in each claim.More precisely, as following
Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim is in itself
Separate embodiments all as the present invention.
Those skilled in the art, which are appreciated that, to carry out adaptively the module in the equipment in embodiment
Change and they are arranged in one or more equipment different from the embodiment.It can be the module or list in embodiment
Member or component be combined into a module or unit or component and can be divided into addition multiple submodule or subelement or
Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it may be used any
Combination is disclosed to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so to appoint
Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification is (including adjoint power
Profit requirement, abstract and attached drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation
It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments in this include institute in other embodiments
Including certain features rather than other feature, but the combination of the feature of different embodiment means in the scope of the present invention
Within and form different embodiments.For example, in the following claims, embodiment claimed it is arbitrary it
One mode can use in any combination.
The all parts embodiment of the present invention can be with hardware realization or to be run on one or more processor
Software module realize or realized with combination thereof.It will be understood by those of skill in the art that it can use in practice
Microprocessor or digital signal processor (DSP, Digital Signal Processing) are implemented to realize according to the present invention
The gateway of example, proxy server, some or all components in system some or all functions.It is of the invention acceptable real
It is now for performing some or all equipment of method as described herein or program of device (for example, computer journey
Sequence and computer program product).It is such realize the present invention program can be stored on computer readable storage medium or
There can be the form of one or more signal.Such signal can be downloaded from internet website and obtain or carry
It provides on body signal or is provided in the form of any other.It should be noted that above-described embodiment the present invention will be described and
It does not limit the invention, and those skilled in the art can set without departing from the scope of the appended claims
Count out alternative embodiment.In the claims, any reference mark between bracket should not be configured to claim
Limitation.Word "comprising" does not exclude the presence of element or step not listed in the claims.Word before element
"a" or "an" does not exclude the presence of multiple such elements.The present invention can be by means of including the hardware of several different elements
And it is realized by means of properly programmed computer.If in the unit claim for listing equipment for drying, in these devices
Several can be embodied by same hardware branch.The use of word first, second, and third does not indicate that
Any sequence.These words can be construed to title.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the scope of the present invention, it is all
All any modification, equivalent and improvement made within the spirit and principles in the present invention etc. should be included in the protection of the present invention
Within the scope of.
Claims (10)
1. a kind of method for data storage is characterized in that, applies in platform is broadcast live, the method includes:
More parts of performance sampled datas are obtained, the performance sampled data includes:A variety of method names and corresponding operation data;
Each the method name is referred to as different basic elements and carries out string encoding, generates coding schedule;
Based on the coding schedule, respectively by each corresponding character string of the method title in every part of performance sampled data
And each corresponding operation data of the method title is stored into database.
2. the method as described in claim 1, which is characterized in that it is described using each method name as different basic elements into
Line character string encoding generates coding schedule, including:
When the coding schedule is unshared coding schedule, each method name in the more parts of performance sampled datas is counted respectively
Quantity;
A unique character string is distributed for each method name in every part of performance sampled data;
By each method name, the quantity of each method name and corresponding character described in every part of performance sampled data kind
String stored respectively into corresponding first mapping table, first mapping table be unshared coding schedule, the corresponding character string
It is preset.
3. the method as described in claim 1, which is characterized in that it is described using each method name as different basic elements into
Line character string encoding generates coding schedule, including:
When the coding schedule is shared coding schedule, arbitrary a performance sampled data in the more parts of performance sampled datas is counted
In each method name quantity;
A unique character string is distributed for each method name;
Each described method name, the quantity of each method name and corresponding character string are stored to preset second
In mapping table, second mapping table is shared coding schedule, and the corresponding character string is preset.
4. the method as described in claim 1, which is characterized in that based on the coding schedule, each described method name is corresponded to
Character string store into database, including:
The corresponding character string of each method name is searched from the coding schedule;
According to each the method title one character string sequence of corresponding text string generation;
In the character string sequence, separator is provided between different character strings.
5. the method as described in claim 1, which is characterized in that the operation data includes:The fortune of each the method title
The memory and central processor CPU utilization rate that row time, number of run, operation occupy.
6. a kind of device for data storage, which is characterized in that described device includes:
Acquiring unit, for obtaining more parts of performance sampled datas, the performance sampled data includes:A variety of method names and correspondence
Operation data;
Coding unit carries out string encoding for each the method name to be referred to as different basic elements;
Storage unit, for respectively by the character string of each the method title in every part of performance sampled data and each
The corresponding compressed operation data of the method title is stored into database.
7. device as claimed in claim 6, which is characterized in that the coding unit is specifically used for:
When the coding schedule is shared coding schedule, arbitrary a performance sampled data in the more parts of performance sampled datas is counted
The quantity of middle kind of method name;
A unique character string is distributed for each method name;
Each described method name, the quantity of each method name and corresponding character string are stored to preset second
In mapping table, second mapping table is shared coding schedule, and the corresponding character string is preset.
8. device as claimed in claim 6, which is characterized in that the storage unit is specifically used for:
The corresponding character string of each method name is searched from the coding schedule;
According to each the method title one character string sequence of corresponding text string generation;
In the character string sequence, separator is provided between different character strings.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor
The method as described in claim 1 to 5 is any is able to carry out during row.
10. a kind of computer equipment for data storage, which is characterized in that including:
At least one processor;And
At least one processor being connect with the processor communication, wherein,
The memory is stored with the program instruction that can be performed by the processor, and the processor calls described program instruction energy
Enough methods performed as described in claim 1 to 5 is any.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810015937.4A CN108133033B (en) | 2018-01-08 | 2018-01-08 | Method and device for data storage and computer equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810015937.4A CN108133033B (en) | 2018-01-08 | 2018-01-08 | Method and device for data storage and computer equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108133033A true CN108133033A (en) | 2018-06-08 |
CN108133033B CN108133033B (en) | 2020-06-12 |
Family
ID=62399542
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810015937.4A Active CN108133033B (en) | 2018-01-08 | 2018-01-08 | Method and device for data storage and computer equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108133033B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103379136A (en) * | 2012-04-17 | 2013-10-30 | 中国移动通信集团公司 | Compression method and decompression method of log acquisition data, compression apparatus and decompression apparatus of log acquisition data |
CN104408100A (en) * | 2014-11-19 | 2015-03-11 | 北京融海恒信咨询有限公司 | Compression method for structured web log |
CN105893337A (en) * | 2015-01-04 | 2016-08-24 | 伊姆西公司 | Method and equipment for text compression and decompression |
-
2018
- 2018-01-08 CN CN201810015937.4A patent/CN108133033B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103379136A (en) * | 2012-04-17 | 2013-10-30 | 中国移动通信集团公司 | Compression method and decompression method of log acquisition data, compression apparatus and decompression apparatus of log acquisition data |
CN104408100A (en) * | 2014-11-19 | 2015-03-11 | 北京融海恒信咨询有限公司 | Compression method for structured web log |
CN105893337A (en) * | 2015-01-04 | 2016-08-24 | 伊姆西公司 | Method and equipment for text compression and decompression |
Also Published As
Publication number | Publication date |
---|---|
CN108133033B (en) | 2020-06-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104159159B (en) | Based on the exchange method of video, terminal, server and system | |
CN107562835A (en) | File search method, device, mobile terminal and computer-readable recording medium | |
CN107770596A (en) | A kind of special efficacy synchronous method, device and mobile terminal | |
CN104066009B (en) | program identification method, device, terminal, server and system | |
CN108322780B (en) | Prediction method of platform user behavior, storage medium and terminal | |
CN107480123A (en) | A kind of recognition methods, device and the computer equipment of rubbish barrage | |
CN104159136B (en) | The acquisition methods of interactive information, terminal, server and system | |
CN107609916A (en) | A kind of method, apparatus and computer equipment of advertisement information | |
DE602004028661D1 (en) | TRAFFIC MONITORING SYSTEM FOR A MOBILE RADIO NETWORK FOR TRAFFIC ANALYSIS WITH A HIERARCHICAL APPROACH | |
RU2008109840A (en) | ESTABLISHING CONFORMITY BETWEEN THE UNIFIED RESOURCE ID AND THE IDENTIFIER FOR THE SERVICE GUIDE | |
CN106970816B (en) | Software upgrading processing method and device and audio playing equipment | |
CN105979379A (en) | Method and device for playing trial listening content | |
CN108123945A (en) | Distribution method, system and the intelligent terminal of random data | |
CN107391587A (en) | Link is shared and access method, server, terminal and computer-readable storage medium | |
CN108184148B (en) | A kind of method, apparatus and computer equipment of user for identification | |
CN109525647A (en) | Message pushes badge value control method, electronic device and storage medium | |
CN108256017A (en) | A kind of method, apparatus and computer equipment for data storage | |
CN107577712B (en) | A kind of method, apparatus and computer equipment of loading page | |
CN107479985A (en) | The method, apparatus and computer equipment of a kind of remote procedure call | |
CN103607377A (en) | Method, device and system for information sharing | |
CN109995743A (en) | A kind of processing method and terminal of multimedia file | |
CN101727505B (en) | Efficient data processing method and device | |
CN107948753B (en) | A kind of recommended method, device and computer equipment | |
CN105047185A (en) | Method, device and system for obtaining audio frequency of accompaniment | |
CN114022196A (en) | Advertisement putting method, device, electronic device and 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 |