[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN106933997B - Method for analyzing time format of Mysql database - Google Patents

Method for analyzing time format of Mysql database Download PDF

Info

Publication number
CN106933997B
CN106933997B CN201710115431.6A CN201710115431A CN106933997B CN 106933997 B CN106933997 B CN 106933997B CN 201710115431 A CN201710115431 A CN 201710115431A CN 106933997 B CN106933997 B CN 106933997B
Authority
CN
China
Prior art keywords
year
month
executing
bits
formula
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
CN201710115431.6A
Other languages
Chinese (zh)
Other versions
CN106933997A (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.)
XLY SALVATIONDATA TECHNOLOGY Inc.
Original Assignee
Sichuan Aite Yingtai Intelligent 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 Sichuan Aite Yingtai Intelligent Technology Co ltd filed Critical Sichuan Aite Yingtai Intelligent Technology Co ltd
Priority to CN201710115431.6A priority Critical patent/CN106933997B/en
Publication of CN106933997A publication Critical patent/CN106933997A/en
Application granted granted Critical
Publication of CN106933997B publication Critical patent/CN106933997B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Complex Calculations (AREA)

Abstract

The invention discloses a method for analyzing the time format of a Mysql database, which is characterized in that the bottom data is found and converted into binary data; dividing the data; converting the divided data into a decimal number; setting a base year and a base number; executing a formula to obtain N; judging whether N is greater than the base year; calculating a month field; judging whether the month is in the month domain; the executing formula calculates the year and month. The invention has the following beneficial effects: the time format of the Mysql database is analyzed completely and efficiently through a formula, and no analysis error occurs.

Description

Method for analyzing time format of Mysql database
Technical Field
The invention relates to the technical field of information security, in particular to a method for analyzing the time format of a Mysql database.
Background
MySQL is a relational database management system developed by the MySQLAB company, Sweden, and currently belongs to the product under Oracle flag. MySQL, the most popular relational database management system, is one of the best RDBMS (relational database management system) application software in terms of WEB applications.
MySQL is a relational database management system that keeps data in different tables instead of putting all the data in one large repository, which increases speed and flexibility.
The SQL language used by MySQL is the most common standardized language for accessing databases. MySQL software adopts a double-authorization policy, which is divided into a community version and a business version, and generally MySQL is selected as a website database for development of small and medium-sized websites due to the characteristics of small volume, high speed, low total ownership cost and particularly open source codes.
At present, the condition that the recovery time is messy codes or errors occurs when the MySQL data is recovered.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a method for analyzing the time format of the Mysql database.
In order to solve the above problems, the technical scheme adopted by the invention is as follows:
a method for analyzing the time format of a Mysql database comprises the following steps:
s1: finding 5 bytes of the underlying data for the date;
s2: converting into binary number;
s3: dividing the obtained product into 6 groups, wherein the 6 groups have 14 bits, 4 bits, 5 bits, 6 bits and 6 bits respectively, and correspond to years, months, days, hours, minutes and seconds respectively;
s4: converting the digits into decimal system to obtain the correct time of day, hour, minute and second, setting the number corresponding to the obtained year as Y and the number corresponding to the month as M;
s5: setting the current year as the basic year, wherein the number corresponding to the basic year is the basic number;
s6: executing the formula: the base Y-N;
s7: judging whether N is greater than the base year, and recording a judgment result;
s8: executing the formula to obtain a month field: 1+ (vinyl-N) × 3 ═ N1(ii) a 12+ (basic year-N) × 3 ═ N12(ii) a And the month field is N1To N1212 of (c);
s9: judging whether M is N or not1To N12If so, taking the number of M bits in the month domain as the month and N as the correct time of the year, and ending; if not, go to S10;
s10: judging the result of S7, and if N is less than the basic year, executing S11; if N is greater than the base year, executing S12;
s11: executing the formula M +16 ═ M; n-1 ═ N; return to execution S8;
s12: executing the formula M-16 ═ M; n +1 ═ N; return is made to execution S8.
The invention has the following beneficial effects: the time format of the Mysql database is analyzed completely and efficiently through a formula, and no analysis error occurs.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to examples.
A method for analyzing the time format of a Mysql database comprises the following steps:
s1: finding 5 bytes of the underlying data for the date;
s2: converting into binary number;
s3: dividing the obtained product into 6 groups, wherein the 6 groups have 14 bits, 4 bits, 5 bits, 6 bits and 6 bits respectively, and correspond to years, months, days, hours, minutes and seconds respectively;
s4: converting the digits into decimal system to obtain the correct time of day, hour, minute and second, setting the number corresponding to the obtained year as Y and the number corresponding to the month as M;
s5: setting the current year as the basic year, wherein the number corresponding to the basic year is the basic number;
s6: executing the formula: the base Y-N;
s7: judging whether N is greater than the base year, and recording a judgment result;
s8: executing the formula to obtain a month field: 1+ (vinyl-N) × 3 ═ N1(ii) a 12+ (basic year-N) × 3 ═ N12(ii) a And the month field is N1To N1212 of (c);
s9: judging whether M is N or not1To N12If so, taking the number of M bits in the month domain as the month and N as the correct time of the year, and ending; if not, go to S10;
s10: judging the result of S7, and if N is less than the basic year, executing S11; if N is greater than the base year, executing S12;
s11: executing the formula M +16 ═ M; n-1 ═ N; return to execution S8;
s12: executing the formula M-16 ═ M; n +1 ═ N; return is made to execution S8.
For a better understanding of the invention, the following examples are set forth;
the first embodiment is as follows: the extracted date bottom data is '999842 DAA 1'; it is converted to 2 binary 1001100110011000010000101101101010100001; converting into 10-system, with 100001-33 seconds, 101010-42 seconds, 01101-13 days, 00001-1 months, 0001-1 months, 10011001100110-9830 years;
the year is 2016, 9830-;
the year data is 9830-;
12+ (2016-; month 1 is in the month domain of 1 to 12, so the determined time is 2016 year 1, month 1, day 13, 42 minutes 33 seconds.
Example two: the bottom data of the extracted date is '999 BA 7011C'; converting into 1001100110001000000000101101101010001101 in 2 system; converting into 10-system year 9826, month 0, day 1, day 13, minute 42, second 13;
similarly, the base year is 2016, 9830-2016 is 7814, and 7814 is the base number;
9826-; 12+ (2016-;
month 0 is not between 12 and 24, so 0+16 ═ 16 is performed; 2012-1 ═ 2011;
performing 1+ (2016-; 12+ (2016-;
month 16 is in the first digit of the month fields 16 to 27, the first digit representing 1 month, so that month is 1 month;
the determination time is 42 minutes and 13 seconds at 1 month and 1 day and 13 days in 2011.
Example three: the extracted date and bottom data is '999 EE70D 2507'; converting into 1001100110011110111001110000110100100101 in 2 system; converting into 10-system year 9831, month 11, day 19, time 16, minute 52, second 37;
similarly, the base year is 2016, 9830-2016 is 7814, and 7814 is the base number;
9831-; 12+ (2016-;
month 11 is not between-2 and 9, so 11-16 ═ -5 is performed; 2017+1 ═ 2018;
performing 1+ (2016-; 12+ (2016-;
month-5 is in the first digit of the month fields-5 to 6, the first digit representing 1 month, so that the month is 1 month;
the time was determined to be 2018, 1, 19, 16, 52 minutes 37 seconds.
It will be appreciated by those of ordinary skill in the art that the examples described herein are intended to assist the reader in understanding the manner in which the invention is practiced, and it is to be understood that the scope of the invention is not limited to such specifically recited statements and examples. Those skilled in the art can make various other specific changes and combinations based on the teachings of the present invention without departing from the spirit of the invention, and these changes and combinations are within the scope of the invention.

Claims (1)

1. A method for analyzing the time format of a Mysql database is characterized by comprising the following steps:
s1: finding 5 bytes of the underlying data for the date;
s2: converting into binary number;
s3: dividing the obtained product into 6 groups, wherein the 6 groups have 14 bits, 4 bits, 5 bits, 6 bits and 6 bits respectively, and correspond to years, months, days, hours, minutes and seconds respectively;
s4: converting the digits into decimal system to obtain the correct time of day, hour, minute and second, setting the number corresponding to the obtained year as Y and the number corresponding to the month as M;
s5: setting the current year as the basic year, wherein the number corresponding to the basic year is the basic number;
s6: executing the formula: the base Y-N;
s7: judging whether N is greater than the base year, and recording a judgment result;
s8: executing the formula to obtain a month field: 1+ (vinyl-N) × 3 ═ N1(ii) a 12+ (basic year-N) × 3 ═ N12(ii) a And the month field is N1To N1212 of (c);
s9: judging whether M is N or not1To N12If so, taking the number of M bits in the month domain as the month and N as the correct time of the year, and ending; if not, go to S10;
s10: according to the judgment result of S7, if N is less than the basic year, executing S11; if N is greater than the base year, executing S12;
s11: executing the formula M +16 ═ M; n-1 ═ N; return to execution S8;
s12: executing the formula M-16 ═ M; n +1 ═ N; return is made to execution S8.
CN201710115431.6A 2017-03-01 2017-03-01 Method for analyzing time format of Mysql database Active CN106933997B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710115431.6A CN106933997B (en) 2017-03-01 2017-03-01 Method for analyzing time format of Mysql database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710115431.6A CN106933997B (en) 2017-03-01 2017-03-01 Method for analyzing time format of Mysql database

Publications (2)

Publication Number Publication Date
CN106933997A CN106933997A (en) 2017-07-07
CN106933997B true CN106933997B (en) 2020-10-30

Family

ID=59423556

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710115431.6A Active CN106933997B (en) 2017-03-01 2017-03-01 Method for analyzing time format of Mysql database

Country Status (1)

Country Link
CN (1) CN106933997B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7702698B1 (en) * 2005-03-01 2010-04-20 Yahoo! Inc. Database replication across different database platforms
CN103605775A (en) * 2013-11-28 2014-02-26 北京锐安科技有限公司 Method and device for inquiring surrounding geographical location information
JP6459669B2 (en) * 2015-03-17 2019-01-30 日本電気株式会社 Column store type database management system
CN105068790B (en) * 2015-07-13 2018-07-24 广东安居宝智能控制系统有限公司 The recording method of random time segment data and system

Also Published As

Publication number Publication date
CN106933997A (en) 2017-07-07

Similar Documents

Publication Publication Date Title
CN103514201B (en) Method and device for querying data in non-relational database
US20160259839A1 (en) Reporting and summarizing metrics in sparse relationships on an oltp database
CN104899295B (en) A kind of heterogeneous data source data relation analysis method
CN112115152B (en) Data increment updating and inquiring method and device, electronic equipment and storage medium
CN106446144A (en) Kettle-based method for extraction and statistics of data on large data platform based on kettle
CN103455722A (en) Method and system for analyzing patent value
CN112148843A (en) Text processing method and device, terminal equipment and storage medium
CN106131139A (en) The encryption of the floating data of a kind of cloud relational database and querying method
CN105354272A (en) Indicator calculating method and system based on dimension combinations
CN110609860A (en) Data ETL processing method, device, equipment and storage medium
CN104391865A (en) Method for realizing operation log recording based on trigger principle
CN102567536A (en) Key performance target analyzing method based on data statistics
CN103246753A (en) Method for generating entity metadata model according to database structure
CN106933997B (en) Method for analyzing time format of Mysql database
CN113609128B (en) Method, device, terminal equipment and storage medium for generating database entity class
CN111078774A (en) Automatic data integration method
CN103885765A (en) Method for coding XBRL (extensible business reporting language) elements
CN105574764A (en) Intellectual property evaluation system
CN107085603A (en) A kind of data processing method and device
CN117540343A (en) Data fusion method and system
CN106056458B (en) Digital oil field comprehensive application system
CN112115271B (en) Knowledge graph construction method and device
CN112650754A (en) Method for importing total data of relational database into Hive
CN106294587B (en) Thematic module drainage effect methods of exhibiting in a kind of website of Rapid Implementation
CN112528100A (en) Label strategy recommending and marking method, terminal equipment 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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210315

Address after: 641100 No.1 Hanyu Avenue, Shizhong District, Neijiang City, Sichuan Province

Patentee after: XLY SALVATIONDATA TECHNOLOGY Inc.

Address before: 641000 704, floor 7, unit 1, building 3, No. 1700, North Tianfu Avenue, high tech Zone, Chengdu, Sichuan

Patentee before: SICHUAN AITE YINGTAI INTELLIGENT TECHNOLOGY Co.,Ltd.