Quick preview method and system based on mysql database

By analyzing the binary data of Mysql database files, a quick preview of the Mysql database is achieved, solving the problem that the existing technology cannot quickly preview the database, and achieving a fast and convenient database preview effect.

CN119938767APending Publication Date: 2025-05-06XIAMEN MEIYABAIKE INFORMATION SECURITY RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411729731.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

The existing technology cannot quickly preview Mysql databases, and lacks direct fast preview technology.

Method used

By analyzing the binary data of the database file, initializing the offset address, locate the table structure information, reading the ibd file information, looping through the data per page, obtaining non-empty records, combining the table structure information and table record information, and achieving a quick preview of the database table data.

Benefits of technology

There is no need to run database services, no dependency on log files and transactions to be enabled, which enables fast and convenient preview of the Mysql database and allows comprehensive database table data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938767A_ABST
    Figure CN119938767A_ABST
Patent Text Reader

Abstract

The invention discloses a quick previewing method and system based on a mysql database. The method comprises the steps that an offset address is initialized, and a head mark of an frm file is confirmed; reading a table structure field number and a table structure field data starting position according to the offset address; analyzing a table structure field name set and table structure type set information; reading the information of the ibd file, obtaining the page number and the page deviation position of the ibd file, cyclically analyzing the data of each page, reading the data at the preset position in the data page, reading the data with the preset mark, and cyclically obtaining non-empty records to obtain all record numbers; and circularly reading the record number, obtaining the field number and the field offset position of each record according to the record head information, responding to the fact that the field number in the table structure is the same as the field number in the record information, calculating and combining according to the field number and the field offset position to obtain complete table record information, and combining to obtain database table data information. According to the method and the device, Mysql database previewing can be quickly and conveniently realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of databases, in particular to a fast preview method and system based on MySQL database. Background Art

[0002] MySQL is an open source, easy-to-use and high-performance relational database, suitable for high-concurrency and large-data-volume applications, with good security and cross-platform support. MySQL is an open source project that users can download, use and modify freely. It performs well in large amounts of data, especially in read operations, and is suitable for high-concurrency application scenarios. MySQL has good cross-platform capabilities and can run on multiple operating systems, including Windows, Linux and macOS. It has good compatibility and provides a variety of security features, such as user rights management, SSL encryption, data encryption, etc., to ensure data security. MySQL has rich functions and scalability, supports advanced functions such as transactions, stored procedures, triggers, views, etc., to meet complex application requirements.

[0003] Currently, MySQL database is widely used in the market, but there is no technology to quickly preview the database directly, so it is impossible to quickly preview the MySQL database. Summary of the invention

[0004] In order to solve the above technical problems existing in the prior art, the present invention proposes a quick preview method and system based on MySQL database to solve the above technical problems.

[0005] According to a first aspect of the present invention, a fast preview method based on MySQL database is proposed, comprising:

[0006] S1: Initialize the offset address and confirm the header mark of the frm file;

[0007] S2: Locate the table structure information position, and read the number of table structure fields and the starting position of table structure field data according to the offset address;

[0008] S3: Parse the table structure information, and parse out the table structure field name set and table structure type set information according to the number of table structure fields and the starting position of the table structure field data;

[0009] S4: Read the ibd file information, obtain the page number and page offset position of the ibd file, parse each page of data in a loop according to the page number and page offset position of the ibd file, read the data at a predetermined position in the data page, read the data with a predetermined mark, and loop to obtain non-empty records to obtain the number of all records;

[0010] S5: Read the number of records in a loop, obtain the number of fields and the field offset position of each record according to the record header information, in response to the number of fields in the table structure being the same as the number of fields in the record information, calculate and combine the number of fields and the field offset position to obtain the complete table record information, and combine the table structure information and the table record information to obtain the database table data information.

[0011] In some specific embodiments, S1 specifically includes: setting the offset address Offset=0, reading the first 2 bytes of data of the frm file and determining whether it is the frm file header flag 0XFE01.

[0012] In some specific embodiments, in S2, 2 bytes of data are read from the offset address Offset+258 as the table structure field number, and 2 bytes of data are read from the offset address Offset+260 as the start position of the table structure field data.

[0013] In some specific embodiments, data is read at a predetermined position in the data page in S4, and reading data with a predetermined mark specifically includes: setting the offset position Offset = page offset position + 24, reading two-byte data values, if it is a data page, reading 7 bytes of data from the offset position Offset = page offset position + 99, and judging whether it is an "infimum" mark, if so, continuing to read 8 bytes of data from the offset position Offset = page offset position + 112, and judging whether it is a "supremum" mark, if so, setting the offset position Offset = current offset position + 4, and looping out of the offset position Offset to obtain the next non-empty record, if the number of records is empty, the acquisition is completed, and the number of all records Records is obtained.

[0014] In some specific embodiments, the structure of the frm file includes file header information, table name, character set information, storage engine information, table field information, table index information, as well as file creation time, file modification time, and user table comment information; the structure of the ibd file includes file header information, table name, character set information, storage engine information, row format information, table data information, table index information, as well as file creation time, file modification time, number of data pages, and file size.

[0015] In some specific embodiments, the ibd file includes several data pages, and the structure of the data page includes page header information, row directory, data row and page footer information.

[0016] According to a second aspect of the present invention, a computer-readable storage medium is provided, on which one or more computer programs are stored. When the one or more computer programs are executed by a computer processor, the above method is implemented.

[0017] According to a third aspect of the present invention, a quick preview system based on MySQL database is proposed, comprising:

[0018] Initialization unit, configured to initialize the offset address and confirm the header mark of the frm file;

[0019] A positioning table structure information location unit is configured to locate the table structure information location and read the number of table structure fields and the start position of table structure field data according to the offset address;

[0020] A table structure information parsing unit is configured to parse the table structure information, and parse out the table structure field name set and the table structure type set information according to the number of table structure fields and the start position of the table structure field data;

[0021] A record acquisition unit is configured to read ibd file information, obtain the page number and page offset position of the ibd file, cyclically parse each page of data according to the page number and page offset position of the ibd file, read data at a predetermined position in the data page, read data with a predetermined mark, and cyclically obtain non-empty records to obtain all the record numbers;

[0022] A database table data information acquisition unit is configured to cyclically read the number of records, obtain the number of fields and the field offset position of each record according to the record header information, and in response to the number of fields in the table structure being the same as the number of fields in the record information, calculate and combine the number of fields and the field offset position to obtain complete table record information, and combine the table structure information and the table record information to obtain the database table data information.

[0023] In some specific embodiments, the initialization unit is specifically configured to: set the offset address Offset=0, read the first 2 bytes of data of the frm file and determine whether it is the frm file header flag 0XFE01.

[0024] In some specific embodiments, in the positioning table structure information location unit, 2 bytes of data are read from the offset address Offset+258 as the table structure field number, and 2 bytes of data are read from the offset address Offset+260 as the starting position of the table structure field data.

[0025] In some specific embodiments, the record acquisition unit reads data at a predetermined position in the data page, and reading the data with a predetermined mark specifically includes: setting the offset position Offset = page offset position + 24, reading two-byte data values, if it is a data page, reading 7 bytes of data from the offset position Offset = page offset position + 99, and judging whether it is an "infimum" mark, if so, continuing to read 8 bytes of data from the offset position Offset = page offset position + 112, and judging whether it is a "supremum" mark, if so, setting the offset position Offset = current offset position + 4, and looping out of the offset position Offset to obtain the next non-empty record, if the number of records is empty, the acquisition is completed, and all the record numbers Records are obtained.

[0026] In some specific embodiments, the structure of the frm file includes file header information, table name, character set information, storage engine information, table field information, table index information, as well as file creation time, file modification time, and user table comment information; the structure of the ibd file includes file header information, table name, character set information, storage engine information, row format information, table data information, table index information, as well as file creation time, file modification time, number of data pages, and file size; the ibd file includes several data pages, and the structure of the data page includes page header information, row directory, data row, and page footer information.

[0027] The present invention studies the storage logic at the bottom of the Mysql database file and conducts a large number of experiments, and proposes a fast preview method and system based on the MySQL database. The method realizes direct preview by parsing the binary data of the data file, does not need to run the database service, does not rely on the functions such as log files and whether the transaction is opened, and realizes the Mysql database preview quickly and conveniently. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and together with the description are used to explain the principles of the present invention. Other embodiments and many expected advantages of the embodiments will be readily appreciated as they become better understood by reference to the following detailed description. Other features, objects and advantages of the present application will become more apparent by reading the detailed description of the non-limiting embodiments made with reference to the following drawings:

[0029] Figure 1 This is a flowchart of a method for quickly previewing a MySQL database according to an embodiment of the present application;

[0030] Figure 2 It is a structural diagram of an ibd file of a specific embodiment of the present application;

[0031] Figure 3 This is a schematic diagram of the structure of an frm file of a specific embodiment of the present application;

[0032] Figure 4 is a structural diagram of a data page of a specific embodiment of the present application;

[0033] Figure 5 It is a flowchart of a method for quick preview based on MySQL database according to a specific embodiment of the present application;

[0034] Figure 6a-6b It is a schematic diagram of the experimental effect of a specific embodiment of the present application;

[0035] Figure 7 This is a quick preview system architecture diagram based on MySQL database in one embodiment of the present application;

[0036] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application. DETAILED DESCRIPTION

[0037] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0038] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0039] Figure 1 The flowchart of the method for quick preview based on MySQL database according to an embodiment of the present application is shown. Figure 1 As shown, the method comprises the following steps:

[0040] S1: Initialize the offset address and confirm the header mark of the frm file. Specifically, set the offset address Offset=0, read the first 2 bytes of the frm file and determine whether it is the frm file header mark 0XFE01.

[0041] S2: Locate the table structure information position, and read the table structure field number and the table structure field data start position according to the offset address. Specifically, read 2 bytes of data from the offset address Offset+258 as the table structure field number, and read 2 bytes of data from the offset address Offset+260 as the table structure field data start position.

[0042] S3: Parse the table structure information, and parse out the table structure field name set and table structure type set information according to the number of table structure fields and the starting position of the table structure field data.

[0043] S4: Read the ibd file information, obtain the page number and page offset position of the ibd file, parse each page of data in a loop according to the page number and page offset position of the ibd file, read the data at a predetermined position in the data page, read the data with a predetermined mark, and loop to obtain non-empty records to obtain the number of all records.

[0044] In a specific embodiment, the offset position Offset is set to page offset position + 24, and two bytes of data value are read. If it is a data page, 7 bytes of data are read from the offset position Offset = page offset position + 99 to determine whether it is an "infimum" flag. If so, 8 bytes of data are read from the offset position Offset = page offset position + 112 to determine whether it is a "supremum" flag. If so, the offset position Offset is set to current offset position + 4, and the next non-empty record is obtained from the offset position Offset out of the loop. If the number of records is empty, the acquisition is completed and all the record numbers Records are obtained.

[0045] S5: Read the number of records in a loop, obtain the number of fields and the field offset position of each record according to the record header information, in response to the number of fields in the table structure being the same as the number of fields in the record information, calculate and combine the number of fields and the field offset position to obtain the complete table record information, and combine the table structure information and the table record information to obtain the database table data information.

[0046] Figure 2 A schematic diagram showing the structure of an ibd file of a specific embodiment of the present application is shown in FIG. Figure 2 As shown, the structure of the ibd file includes file header information, table name, character set information, storage engine information, row format information, table data information, table index information, as well as file creation time, file modification time, number of data pages, and file size.

[0047] Figure 3 A schematic diagram of the structure of the frm file of a specific embodiment of the present application is shown as follows: Figure 3 As shown, the structure of the frm file includes file header information, table name, character set information, storage engine information, table field information, table index information, as well as file creation time, file modification time, and user table comment information.

[0048] Figure 4 A schematic diagram of the structure of a data page of a specific embodiment of the present application is shown as follows: Figure 4As shown in the figure, the Mysqlibd file consists of several data pages. The data page is the smallest unit of the Mysql database. The size of the data page is 16K by default. The structure of the data page includes page header information, row directory, data row and page footer information. The page header information includes page type, page number, page size, number of rows, etc. Row directory: mainly stores the offset of each row in the data page, allowing fast location of row data. Data row: mainly stores the row data actually, each row includes the values ​​of multiple fields. Page footer information: includes checksum data to ensure data integrity and consistency.

[0049] Continue to refer Figure 5 , Figure 5 It is a flowchart of a method for quickly previewing a MySQL database according to a specific embodiment of the present application. Figure 5 As shown, the quick preview process specifically includes:

[0050] Step 1. Set the offset address Offset = 0; read the 2 bytes of data in the frm file header and determine whether it is the frm file header flag (0XFE01). If so, jump to step #2; if not, jump to step #2.

[0051] Step 2, set the offset address Offset to the location where the table structure information is stored, read 2 bytes of data from the Offset+258 position as the table structure field number (Fields), read 2 bytes of data from the Offset+260 position as the table structure field data start position (StartPos), and jump to step #3;

[0052] Step 3: According to the number of table structure fields Fields, parse all table structure field name sets (Names) and table structure type sets (Types) information from the StartPos position in a loop to obtain complete table structure information (TableFrm), and jump to step #4;

[0053] Step 4, set the offset address Offset = 0; read the ibd file data, with the page size of 16KB as the minimum unit variable ibd file, get all the pages (pages) and each page offset position (pageoffset) in the ibd file; jump to step #5;

[0054] Step 5: Loop through the data of each page from the page offset position (pageoffset) according to all the pages (pages), set the offset position Offset = pageoffset + 24, read two bytes of data value from the Offset position, and determine whether it is a data page (0x45BF). If yes, jump to step #6; if not, jump to step #5;

[0055] Step 6, read 7 bytes of data from Offset = pageoffset + 99, and determine whether it is the "infimum" flag; if so, jump to step #7; if not, jump to step #5;

[0056] Step 7, read 8 bytes of data from Offset = pageoffset + 112, and determine whether it is the "supremum" flag; if so, jump to step #8; if not, jump to step #5;

[0057] Step 8, set the offset position Offset = Offset + 4, loop out from Offset to get the next non-empty record, if the number of records is empty, the acquisition is completed, and all the records are obtained. Jump to step #8;

[0058] Step 9, loop through the number of records (Records), get each record (Record), calculate the number of fields (Columns) in each record and the offset position (RecordPos) of each field according to the header information of the record (Record), and jump to step #10;

[0059] Step 10: Determine whether the number of fields in the table structure is equal to the number of fields in the record information. If they are equal, jump to step #11; if they are not equal, jump to step #9;

[0060] Step 11. According to the number of fields in the record (Columns) and the offset position of each field (RecordPos), calculate the field value corresponding to each field, and combine all field values ​​into a complete record. Jump to step #12;

[0061] Step 12: Combine the table structure information and all the table record information together to obtain a complete database table data information, and then jump to step #13;

[0062] Step 13, end.

[0063] Figure 6a-6b A schematic diagram of the experimental effect of a specific embodiment of the present application is shown. Figure 6a As shown, the original data includes the test.ibd file and the test.frm file. The above method is used to implement Figure 6b This method does not require the support of any database engine, and can directly preview the database file quickly, which can obtain the database table data very conveniently and comprehensively.

[0064] Figure 7 The architecture diagram of a quick preview system based on MySQL database of an embodiment of the present application is shown, as shown in 7, the system includes an initialization unit 701, a table structure information parsing unit 702, a table structure information parsing unit 703, a record acquisition unit 704 and a database table data information acquisition unit 705. Among them, the initialization unit 701 is configured to initialize the offset address and confirm the header mark of the frm file; the table structure information location positioning unit 702 is configured to locate the table structure information location, and read the table structure field number and the table structure field data start position according to the offset address; the table structure information parsing unit 703 is configured to parse the table structure information, and parse the table structure field name set and the table structure type set information according to the table structure field number and the table structure field data start position; the record acquisition unit 704 is configured to read the ibd file information, obtain the page number and page offset position of the ibd file, cyclically parse each page of data according to the page number and page offset position of the ibd file, read the data at a predetermined position in the data page, read the data with a predetermined mark, and cyclically obtain non-empty records to obtain all the record numbers; the database table data information acquisition unit 705 is configured to cyclically read the record number, obtain the field number and field offset position of each record according to the record header information, in response to the number of fields in the table structure being the same as the number of fields in the record information, calculate and combine the complete table record information according to the field number and the field offset position, and combine the table structure information and the table record information to obtain the database table data information.

[0065] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0066] like Figure 8 As shown, the computer system includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0067] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.

[0068] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above functions defined in the method of the present application are executed. It should be noted that the computer-readable storage medium of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wireline, optical cable, RF, etc., or any suitable combination of the foregoing.

[0069] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0070] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0071] The modules involved in the embodiments of the present application may be implemented by software or hardware.

[0072] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: initializes the offset address and confirms the header mark of the frm file; locates the position of the table structure information, and reads the number of table structure fields and the starting position of the table structure field data according to the offset address; parses the table structure information, and parses the table structure field name set and the table structure type set information according to the number of table structure fields and the starting position of the table structure field data; reads the ibd file information, obtains the page number and page offset position of the ibd file, parses each page of data according to the page number and page offset position of the ibd file in a loop, reads data at a predetermined position in the data page, reads data with a predetermined mark, and cyclically obtains non-empty records to obtain the number of all records; cyclically reads the number of records, obtains the number of fields and the field offset position of each record according to the record header information, and in response to the number of fields in the table structure being the same as the number of fields in the record information, calculates and combines the complete table record information according to the number of fields and the field offset position, and combines the table structure information and the table record information to obtain the database table data information.

[0073] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.

Claims

1. A fast preview method based on MySQL database, characterized in that: include: S1: Initialize the offset address and confirm the header mark of the frm file; S2: Locate the table structure information position, and read the number of table structure fields and the starting position of table structure field data according to the offset address; S3: parsing the table structure information, and obtaining table structure field name set and table structure type set information according to the number of table structure fields and the starting position of the table structure field data; S4: Read the ibd file information, obtain the page number and page offset position of the ibd file, cyclically parse each page of data according to the page number and page offset position of the ibd file, read data at a predetermined position in the data page, read data with a predetermined mark, and cyclically obtain non-empty records to obtain the number of all records; S5: Loop through the number of records, obtain the number of fields and the field offset position of each record according to the record header information, and in response to the number of fields in the table structure being the same as the number of fields in the record information, calculate and combine the number of fields and the field offset position to obtain complete table record information, and combine the table structure information and the table record information to obtain database table data information.

2. The method for quick preview based on MySQL database according to claim 1, characterized in that: The S1 specifically includes: setting the offset address Offset=0, reading the header 2 bytes of the frm file and determining whether it is the frm file header flag 0XFE01.

3. The method for quick preview based on MySQL database according to claim 1, characterized in that: In S2, 2 bytes of data are read from the offset address Offset+258 as the number of fields in the table structure, and 2 bytes of data are read from the offset address Offset+260 as the starting position of the field data in the table structure.

4. The method for quick preview based on MySQL database according to claim 1, characterized in that: In the S4, data is read at a predetermined position in the data page, and reading the data with a predetermined mark specifically includes: setting the offset position Offset = the page offset position + 24, reading two-byte data values, if it is a data page, reading 7 bytes of data from the offset position Offset = the page offset position + 99, and judging whether it is an "infimum" mark, if so, continuing to read 8 bytes of data from the offset position Offset = the page offset position + 112, and judging whether it is a "supremum" mark, if so, setting the offset position Offset = the current offset position + 4, and looping out of the offset position Offset to obtain the next non-empty record, if the number of records is empty, the acquisition is completed, and all the record numbers Records are obtained.

5. The method for quick preview based on MySQL database according to claim 1, characterized in that: The structure of the frm file includes file header information, table name, character set information, storage engine information, table field information, table index information, as well as file creation time, file modification time, and user table comment information; The structure of the ibd file includes file header information, table name, character set information, storage engine information, row format information, table data information, table index information, as well as file creation time, file modification time, number of data pages, and file size.

6. The method for quick preview based on MySQL database according to claim 5, characterized in that: The ibd file includes several data pages, and the structure of the data page includes page header information, row directory, data row and page footer information.

7. A computer-readable storage medium having one or more computer programs stored thereon, characterized in that: When the one or more computer programs are executed by a computer processor, the method according to any one of claims 1 to 6 is implemented.

8. A quick preview system based on MySQL database, characterized in that: include: Initialization unit, configured to initialize the offset address and confirm the header mark of the frm file; A table structure information location unit is configured to locate the table structure information location and read the table structure field number and the table structure field data start position according to the offset address; A table structure information parsing unit configured to parse the table structure information, and parse out table structure field name set and table structure type set information according to the number of table structure fields and the start position of the table structure field data; A record acquisition unit is configured to read ibd file information, obtain the page number and page offset position of the ibd file, cyclically parse each page of data according to the page number and page offset position of the ibd file, read data at a predetermined position in the data page, read data with a predetermined mark, and cyclically acquire non-empty records to obtain all the record numbers; A database table data information acquisition unit is configured to cyclically read the number of records, obtain the number of fields and the field offset position of each record according to the record header information, and in response to the number of fields in the table structure being the same as the number of fields in the record information, calculate and combine the number of fields and the field offset position to obtain complete table record information, and combine the table structure information and the table record information to obtain database table data information.

9. The MySQL database-based quick preview system according to claim 8, characterized in that: The initialization unit is specifically configured to: set the offset address Offset=0, read the header 2 bytes of the frm file and determine whether it is the frm file header flag 0XFE01.

10. The MySQL database-based quick preview system according to claim 8, characterized in that: In the positioning table structure information location unit, 2 bytes of data are read from the offset address Offset+258 as the table structure field number, and 2 bytes of data are read from the offset address Offset+260 as the starting position of the table structure field data.

11. The MySQL database-based quick preview system according to claim 8, characterized in that: The record acquisition unit reads data at a predetermined position in the data page, and reading the data with a predetermined mark specifically includes: setting the offset position Offset = the page offset position + 24, reading two-byte data values, if it is a data page, reading 7 bytes of data from the offset position Offset = the page offset position + 99, and judging whether it is an "infimum" mark, if so, continuing to read 8 bytes of data from the offset position Offset = the page offset position + 112, and judging whether it is a "supremum" mark, if so, setting the offset position Offset = the current offset position + 4, and looping out of the offset position Offset to obtain the next non-empty record, if the number of records is empty, the acquisition is completed, and all the record numbers Records are obtained.

12. The MySQL database-based quick preview system according to claim 8, characterized in that: The structure of the frm file includes file header information, table name, character set information, storage engine information, table field information, table index information, as well as file creation time, file modification time, and user table comment information; The structure of the ibd file includes file header information, table name, character set information, storage engine information, row format information, table data information, table index information, as well as file creation time, file modification time, number of data pages, and file size; the ibd file includes several data pages, and the structure of the data page includes page header information, row directory, data row, and page footer information.