Data page compression method and device, equipment and storage medium
By merging data pages and processing differential data in the database system, the problem of low compression efficiency in the prior art is solved, and more efficient data storage is achieved.
Patent Information
- Application Number
- CN202510398535.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-01
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-04-01
AI Technical Summary
The prior art is less efficient when compressing data pages in database systems because the compression algorithm is directly used to compress each data page, and the data characteristics in the data pages are not fully utilized.
By identifying the data compression instructions of the target database, the data page to be compressed is determined, and the data page is merged according to the data characteristics of the data page to obtain the candidate data page, and then the data page difference data set is determined, the candidate data page and the difference data set are merged to obtain the target data page.
Through data page merging and differential data storage, the efficiency of data page compression is improved and storage space requirements are reduced.
Smart Images

Figure CN119917475A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to the field of data compression technology, and specifically to a data page compression method, device, equipment, and storage medium. Background Art
[0002] Currently, in database systems, compressing data before storing it on storage media can both save storage media costs and improve database performance.
[0003] In the existing methods, various compression algorithms (such as Huffman coding) are generally directly used to compress each data page in the database. Although this saves the storage space of the database, due to the different data characteristics in the data pages, directly using the compression algorithm to compress each data page can easily lead to low efficiency in data page compression. Summary of the invention
[0004] The present application provides a data page compression method, apparatus, device and storage medium to improve the efficiency of data page compression.
[0005] According to one aspect of the present application, a data page compression method is provided, the method comprising:
[0006] In case of identifying a data compression instruction of the target database, determining at least one data page to be compressed according to the data compression instruction;
[0007] Merging data pages of the at least one data page to be compressed according to data characteristics of the at least one data page to be compressed to obtain a candidate data page; the data characteristics include at least one attribute name and a data value corresponding to the attribute name;
[0008] Determine a data page difference data set according to the at least one data page to be compressed and the candidate data page;
[0009] The candidate data page and the data page difference data set are merged to obtain a target data page.
[0010] According to another aspect of the present application, a data page compression device is provided, the device comprising:
[0011] A data page determination module, configured to determine at least one data page to be compressed according to the data compression instruction when a data compression instruction of a target database is identified;
[0012] a data page merging module, configured to merge the at least one data page to be compressed according to data characteristics of the at least one data page to be compressed, so as to obtain a candidate data page; the data characteristics include at least one attribute name and a data value corresponding to the attribute name;
[0013] a difference data determination module, configured to determine a data page difference data set according to the at least one data page to be compressed and the candidate data page;
[0014] The data merging module is used to merge the candidate data page and the data page difference data set to obtain a target data page.
[0015] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:
[0016] one or more processors;
[0017] A memory for storing one or more programs;
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the data page compression methods provided in the embodiments of the present application.
[0019] According to another aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, any one of the data page compression methods provided in the embodiments of the present application is implemented.
[0020] According to another aspect of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the computer program implements any one of the data page compression methods provided in the embodiments of the present application.
[0021] The present application determines at least one data page to be compressed according to the data compression instruction when the data compression instruction of the target database is identified; merges the data pages of at least one data page to be compressed according to the data characteristics of the at least one data page to be compressed to obtain a candidate data page; the data characteristics include at least one attribute name and the data value corresponding to the attribute name; determines a data page difference data set according to at least one data page to be compressed and the candidate data page; merges the candidate data page and the data page difference data set to obtain a target data page. The above technical solution can complete data compression only by merging data pages and storing difference data, which helps to improve the efficiency of data page compression. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a flow chart of a data page compression method provided according to Embodiment 1 of the present application;
[0023] Figure 2 is a flow chart of a data page compression method provided according to Embodiment 2 of the present application;
[0024] Figure 3 is a structural schematic diagram of a data page compression device provided according to Embodiment 3 of the present application;
[0025] Figure 4 It is a structural schematic diagram of an electronic device that implements the data page compression method of an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] In addition, it should be noted that in the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of relevant data such as data compression instructions and data pages to be compressed are in compliance with the relevant laws and regulations and do not violate public order and good morals.
[0029] Embodiment 1
[0030] Figure 1 This is a flow chart of a data page compression method provided according to the first embodiment of the present application. This embodiment is applicable to the case of compressing the data pages of a database, and can be executed by a data page compression device. The data page compression device can be implemented in the form of hardware and / or software. The data page compression device can be configured in a computer device, such as a server. Figure 1 As shown, the method includes:
[0031] S110 . When a data compression instruction of a target database is identified, determine at least one data page to be compressed according to the data compression instruction.
[0032] In this embodiment, the target database refers to a database system or example storing data. When data compression is performed, the data in the target database is usually processed. The data compression instruction refers to an instruction to compress the data in the target database; these instructions may include a compression range, a compression method, a compression granularity, etc. The data page to be compressed refers to a data page that needs to be compressed. Each data page may include multiple records, and each record has multiple attributes.
[0033] Exemplarily, when a data compression instruction of a target database is identified and before a target compression algorithm is used to compress a data page to be compressed, at least one data item to be compressed is determined according to the data compression instruction, and pre-compression processing is performed on at least one data item to be compressed to improve the compression efficiency of the subsequent use of the compression algorithm.
[0034] S120. Merge data pages of at least one data page to be compressed according to data characteristics of at least one data page to be compressed to obtain candidate data pages; the data characteristics include at least one attribute name and a data value corresponding to the attribute name.
[0035] In this embodiment, data characteristics refer to some attributes or features used to describe the data content; here, data characteristics include at least one attribute name and the data value corresponding to the attribute name; the combination of attribute name and data value is used to characterize the data content stored in each data page; these characteristics are used to determine how to perform data compression and optimize the data page merging process. Data page merging refers to the process of merging multiple data pages to be compressed into a candidate data page during the compression process; this is usually to improve storage efficiency or reduce space waste during data compression. Candidate data page refers to the candidate data page generated after the data page merging operation; it is a new data page that contains the data content of multiple merged data pages; during the compression process, this candidate data page will be used for further processing. Attribute name refers to the field or column name in the data page, which is used to identify the type of data. Data value refers to the data value under the attribute name, which is the specific data content.
[0036] Exemplarily, according to data characteristics of at least one data page to be compressed, identical records in at least one data page to be compressed are merged, or identical data structures in multiple pages are reorganized, so as to merge at least one data page to be compressed into a candidate data page.
[0037] In an optional implementation, after obtaining the candidate data page, the parameter length of at least one data page to be compressed can be summed to obtain the candidate parameter length; the current parameter length of the candidate data page is determined, and the current parameter length is compared with the candidate parameter length to obtain a parameter length comparison result; if the parameter length comparison result does not meet the parameter length condition, the data page compression is stopped and an abnormal alarm is fed back.
[0038] In this embodiment, the parameter length of the data page to be compressed refers to the total length of all parameters in the data page; during the data page compression process, each data page to be compressed contains multiple parameters (such as records, fields, etc.); the parameter length refers to the length of each parameter (or data field), usually in bytes. The candidate parameter length refers to the result of summing up all parameter lengths in each data page to be compressed; this is to calculate whether the total parameter size of the data page meets expectations during the compression process. The current parameter length of the candidate data page refers to the current total length of the parameters contained in the candidate data page after the data merging and compression operations; this is an immediate calculation result, reflecting the size of the data in the current candidate data page. The parameter length comparison result refers to the result obtained by comparing the current parameter length of the candidate data page with the candidate parameter length; the purpose of this comparison is to check whether the merged data page meets the expected size or length requirements. The parameter length condition refers to the standard or requirement that needs to be met when performing parameter length comparison; the condition can be that the current parameter length is less than the candidate parameter length. An abnormal alarm is an alarm issued by the system when the parameter length comparison result during the data page compression process does not meet the expected conditions. This alarm notifies the user or system administrator that a problem has occurred during the data compression process and that appropriate measures need to be taken to resolve it.
[0039] Exemplarily, if the current parameter length is less than the candidate parameter length, the parameter length comparison result satisfies the parameter length condition and data page compression continues; if the current parameter length is greater than or equal to the candidate parameter length, the parameter length comparison result does not satisfy the parameter length condition, data page compression is stopped, and an abnormal alarm is fed back.
[0040] S130: Determine a data page difference data set according to at least one data page to be compressed and a candidate data page.
[0041] In this embodiment, the data page difference data set refers to the difference between the data page to be compressed and the candidate data page; the difference data set records the different contents between the two, which may be caused by the difference or update of data during the merging process; this part of data is used to construct the final target data page.
[0042] Exemplarily, after the data pages are merged, a comparison difference process may be performed on the data, that is, a difference between at least one data page to be compressed and the candidate data page is calculated to determine a data page difference data set.
[0043] S140: Merge the candidate data page and the data page difference data set to obtain a target data page.
[0044] In this embodiment, the target data page refers to the final data page after compression processing, which contains the data content after data page merging and differential data set processing; ultimately, the target data page is the result of the compression process and is used to store streamlined or optimized data.
[0045] In an optional implementation, after obtaining the target data page, the data characteristics of the target data page may be determined, and a target compression algorithm may be determined from candidate compression algorithms based on the data characteristics of the target data page; and the target data page may be compressed using the target compression algorithm.
[0046] In this embodiment, the data characteristics of the target data page refer to some attributes or features used to describe the data content. The candidate compression algorithm is a pre-configured related algorithm that can be used for database data compression; the algorithm can be Huffman coding, JPEG (Joint Photographic Experts Group) compression algorithm, etc. The target compression algorithm refers to an algorithm that can be used to compress the target data page.
[0047] Exemplarily, if the target data page is text data, Huffman coding may be used for data compression; if the target data page is image data, JPEG compression algorithm may be used for data compression.
[0048] It can be understood that when the data compression instruction of the target database is identified, the conventional data compression operation generally directly selects the corresponding compression algorithm to compress the data page to be compressed, while the present application merges and performs difference processing on the data pages to perform an initial compression on the data pages first, so as to improve the efficiency of the compression algorithm when secondary compression is required later.
[0049] The embodiment of the present application determines at least one data page to be compressed according to the data compression instruction when the data compression instruction of the target database is identified; merges the data pages of at least one data page to be compressed according to the data characteristics of the at least one data page to be compressed to obtain a candidate data page; the data characteristics include at least one attribute name and the data value corresponding to the attribute name; determines a data page difference data set according to at least one data page to be compressed and the candidate data page; merges the candidate data page and the data page difference data set to obtain the target data page. The above technical solution can complete data compression only by merging data pages and storing difference data, which helps to improve the efficiency of data page compression.
[0050] Embodiment 2
[0051] Figure 2This is a flow chart of a data page compression method provided in accordance with the second embodiment of the present application. Based on the technical solutions of the above embodiments, this embodiment refines "merging data pages of at least one data page to be compressed according to the data characteristics of at least one data page to be compressed to obtain candidate data pages" into "analyzing attribute name similarity of at least one data page to be compressed to determine candidate duplicate attribute names of at least one data page to be compressed; merging data pages of at least one data page to be compressed according to the candidate duplicate attribute names to obtain candidate data pages". It should be noted that for the parts not described in detail in the embodiments of the present application, please refer to the relevant statements of other embodiments. Figure 2 As shown, the method includes:
[0052] S210: When a data compression instruction of a target database is identified, determine at least one data page to be compressed according to the data compression instruction.
[0053] S220: Perform attribute name similarity analysis on at least one data page to be compressed to determine candidate duplicate attribute names of at least one data page to be compressed.
[0054] In this embodiment, attribute name similarity analysis refers to analyzing the attribute names between the data pages to be compressed to determine which attribute names may be similar in semantics or form; similarity analysis is usually performed by comparing the text content of the attribute names. Candidate duplicate attribute names refer to attribute names that are identified in the attribute name similarity analysis and may represent the same or similar data; these candidate attribute names may be merged or replaced during the data compression process to reduce redundancy and improve compression efficiency.
[0055] Exemplarily, the attribute names between at least one data page to be compressed are compared to screen out repeated attribute names as candidate repeated attribute names of at least one data page to be compressed.
[0056] It should be noted that the candidate repeated attribute name refers to the attribute name that is repeated in each data page to be compressed.
[0057] S230 . According to the candidate repeated attribute name, merge data pages for at least one data page to be compressed to obtain a candidate data page.
[0058] Optionally, perform data value similarity analysis on data values corresponding to candidate repeated attribute names in at least one data page to be compressed to obtain target repeated attribute names and data values corresponding to the target repeated attribute names; merge data pages on at least one data page to be compressed in sequence to obtain intermediate data pages; and delete redundant data in the intermediate data pages based on the target repeated attribute names and the data values corresponding to the target repeated attribute names to obtain candidate data pages.
[0059] In this embodiment, data value similarity analysis refers to comparing the attribute values corresponding to the candidate repeated attribute names to check whether these attribute values are similar or identical between different data pages; the purpose is to further determine which data values are redundant or mergeable by identifying the similarity of attribute values. The target repeated attribute names refer to those repeated attribute names obtained through data value similarity analysis; that is, the data values corresponding to these attribute names are similar or identical between multiple data pages, and thus can be used as the basis for compression and merging. The data values corresponding to the target repeated attribute names refer to the data values associated with the target repeated attribute names; these data values are repeated or similar in different data pages, and thus can be merged or optimized to reduce data storage space. The intermediate data page refers to the temporary data page after the merging step, which contains the merged data of each data page to be compressed, but it may still contain redundant data and needs further processing. Redundant data deletion refers to removing those repeated, redundant or unnecessary data in the intermediate data page; in this step, the data value similarity analysis provides a basis for identifying which data values are redundant and deleting them.
[0060] S240: Determine a data page difference data set according to at least one data page to be compressed and a candidate data page.
[0061] Optionally, for each data page to be compressed, a similarity analysis is performed between the data page to be compressed and a candidate data page to obtain data page difference data between the data page to be compressed and the candidate data page; after the similarity analysis is completed after identifying at least one data page to be compressed, the data page difference data of at least one data page to be compressed is summarized to obtain a data page difference data set.
[0062] In this embodiment, the similarity analysis here refers to comparing the contents of the data page to be compressed with the candidate data page to find the similar parts between them; the goal of this analysis is to identify the difference data between the two data pages, so as to provide a basis for subsequent data compression, merging and optimization. The data page difference data refers to the different parts between the data page to be compressed and the candidate data page during the similarity analysis process; these difference data reflect the different contents between the two data pages, which may be different attribute values, records, or completely different data structures; by analyzing these difference data, it can be determined which contents are unique.
[0063] Exemplarily, the data content of each data page to be compressed is compared with the data content of the candidate data pages to filter out the data page difference data between each data page to be compressed and the candidate data pages, and the data page difference data are integrated according to the order of the data pages to be compressed, and the corresponding identifiers of the data page difference data and the data pages to be compressed are marked to obtain a data page difference data set.
[0064] S250: Merge the candidate data page and the data page difference data set to obtain a target data page.
[0065] In one optional implementation scheme, after obtaining the target data page, if the data of a data page to be compressed is to be restored, the data page difference data of the data page to be compressed is determined from the data page difference data set in the target data page; the data page difference data corresponding to the data page to be compressed is removed from the merged data of each data page to be compressed stored in the target data page to obtain the restored data of the data page to be compressed.
[0066] It should be noted that the merged data refers to the data corresponding to the candidate data page.
[0067] The embodiment of the present application determines at least one data page to be compressed according to the data compression instruction when the data compression instruction of the target database is identified; performs attribute name similarity analysis on at least one data page to be compressed to determine candidate duplicate attribute names of at least one data page to be compressed; performs data page merging on at least one data page to be compressed according to the candidate duplicate attribute names to obtain candidate data pages; determines a data page difference data set based on at least one data page to be compressed and the candidate data pages; merges the candidate data pages and the data page difference data set to obtain the target data page. The above technical scheme realizes the merging of data pages by screening out the target duplicate attribute names and the data values corresponding to the target duplicate attribute names between the data pages to be compressed, and based on this, realizes the merging of data pages, which can effectively improve the reliability of data page merging while ensuring compression efficiency.
[0068] Embodiment 3
[0069] Figure 3 This is a schematic diagram of the structure of a data page compression device provided according to the third embodiment of the present application, which can be applied to compressing data pages of a database. The data page compression device can be implemented in the form of hardware and / or software, and the data page compression device can be configured in a computer device, such as a server. Figure 3 As shown, the device comprises:
[0070] A data page determination module 310 is used to determine at least one data page to be compressed according to the data compression instruction when a data compression instruction of a target database is identified;
[0071] The data page merging module 320 is used to merge the data pages of at least one data page to be compressed according to the data characteristics of at least one data page to be compressed to obtain a candidate data page; the data characteristics include at least one attribute name and a data value corresponding to the attribute name;
[0072] The difference data determination module 330 is used to determine a data page difference data set according to at least one data page to be compressed and a candidate data page;
[0073] The data merging module 340 is used to merge the candidate data page and the data page difference data set to obtain a target data page.
[0074] The embodiment of the present application determines at least one data page to be compressed according to the data compression instruction when the data compression instruction of the target database is identified; merges the data pages of at least one data page to be compressed according to the data characteristics of the at least one data page to be compressed to obtain a candidate data page; the data characteristics include at least one attribute name and the data value corresponding to the attribute name; determines a data page difference data set according to at least one data page to be compressed and the candidate data page; merges the candidate data page and the data page difference data set to obtain the target data page. The above technical solution can complete data compression only by merging data pages and storing difference data, which helps to improve the efficiency of data page compression.
[0075] Optionally, the data page merging module 320 includes:
[0076] An attribute name analysis unit, used to perform attribute name similarity analysis on at least one data page to be compressed, and determine candidate duplicate attribute names of at least one data page to be compressed;
[0077] The data page merging unit is used to merge data pages for at least one data page to be compressed according to the candidate repeated attribute name to obtain a candidate data page.
[0078] Optional, data page merging unit, specifically used for:
[0079] Performing data value similarity analysis on data values corresponding to the candidate repeated attribute name in at least one data page to be compressed to obtain a target repeated attribute name and the data value corresponding to the target repeated attribute name;
[0080] Merging data pages on at least one data page to be compressed in order to obtain an intermediate data page;
[0081] Based on the target repeated attribute name and the data value corresponding to the target repeated attribute name, the redundant data in the intermediate data page is deleted to obtain the candidate data page.
[0082] Optionally, the data page merging module 320 further includes a parameter length checking unit; the parameter length checking unit is used to:
[0083] After obtaining the candidate data page, summing the parameter lengths of at least one data page to be compressed to obtain the candidate parameter length;
[0084] Determine the current parameter length of the candidate data page, and compare the current parameter length with the candidate parameter length to obtain a parameter length comparison result;
[0085] When the parameter length comparison result does not meet the parameter length condition, the data page compression is stopped and an abnormal alarm is fed back.
[0086] Optionally, the difference data determination module 330 is specifically configured to:
[0087] For each data page to be compressed, similarity analysis is performed between the data page to be compressed and the candidate data page to obtain data page difference data between the data page to be compressed and the candidate data page;
[0088] After the similarity analysis of at least one data page to be compressed is completed, data page difference data of at least one data page to be compressed is summarized to obtain a data page difference data set.
[0089] Optionally, the device further includes a data page compression module; the data page compression module is used to:
[0090] Determine data characteristics of a target data page, and determine a target compression algorithm from candidate compression algorithms based on the data characteristics of the target data page;
[0091] Use the target compression algorithm to compress the target data page.
[0092] The data page compression device provided in the embodiment of the present application can execute the data page compression method provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects for executing each data page compression method.
[0093] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.
[0094] Embodiment 4
[0095] Figure 4 4 is a schematic diagram of the structure of an electronic device 410 that implements the data page compression method of an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0096] like Figure 4As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In RAM413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, ROM412 and RAM413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.
[0097] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0098] The processor 411 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 411 performs the various methods and processes described above, such as a data page compression method.
[0099] In some embodiments, the data page compression method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the data page compression method described above may be performed. Alternatively, in other embodiments, the processor 411 may be configured as the data page compression method in any other appropriate manner (e.g., by means of firmware).
[0100] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0101] Computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data page compression device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0102] In the context of the present application, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.
[0103] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0104] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0105] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0106] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of this application can be achieved, and this document is not limited here.
[0107] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A data page compression method, characterized in that: include: In case of identifying a data compression instruction of the target database, determining at least one data page to be compressed according to the data compression instruction; Merging data pages of the at least one data page to be compressed according to data characteristics of the at least one data page to be compressed to obtain a candidate data page; the data characteristics include at least one attribute name and a data value corresponding to the attribute name; Determine a data page difference data set according to the at least one data page to be compressed and the candidate data page; The candidate data page and the data page difference data set are merged to obtain a target data page.
2. The method according to claim 1, characterized in that The step of merging data pages of the at least one data page to be compressed according to the data characteristics of the at least one data page to be compressed to obtain a candidate data page includes: Performing attribute name similarity analysis on the at least one data page to be compressed to determine candidate repeated attribute names of the at least one data page to be compressed; According to the candidate repeated attribute name, data pages are merged for the at least one data page to be compressed to obtain a candidate data page.
3. The method according to claim 2, characterized in that The step of merging the at least one data page to be compressed according to the candidate repeated attribute name to obtain a candidate data page includes: Performing data value similarity analysis on the data values corresponding to the candidate repeated attribute name in the at least one data page to be compressed to obtain a target repeated attribute name and the data value corresponding to the target repeated attribute name; Merging data pages on the at least one data page to be compressed in order to obtain an intermediate data page; Based on the target repeated attribute name and the data value corresponding to the target repeated attribute name, redundant data in the intermediate data page is deleted to obtain a candidate data page.
4. The method according to claim 1, characterized in that: After obtaining the candidate data page, the method further includes: summing the parameter lengths of the at least one data page to be compressed to obtain a candidate parameter length; Determine the current parameter length of the candidate data page, and compare the current parameter length with the candidate parameter length to obtain a parameter length comparison result; When the parameter length comparison result does not meet the parameter length condition, the data page compression is stopped and an abnormal alarm is fed back.
5. The method according to claim 1, characterized in that The step of determining a data page difference data set according to the at least one data page to be compressed and the candidate data page comprises: For each data page to be compressed, performing similarity analysis between the data page to be compressed and the candidate data page to obtain data page difference data between the data page to be compressed and the candidate data page; After the similarity analysis of the at least one data page to be compressed is completed, the data page difference data of the at least one data page to be compressed is summarized to obtain a data page difference data set.
6. The method according to claim 1, characterized in that After obtaining the target data page, the method further includes: Determining data characteristics of the target data page, and determining a target compression algorithm from candidate compression algorithms according to the data characteristics of the target data page; The target data page is compressed using the target compression algorithm.
7. A data page compression device, characterized in that: include: A data page determination module, configured to determine at least one data page to be compressed according to the data compression instruction when a data compression instruction of a target database is identified; a data page merging module, configured to merge the at least one data page to be compressed according to data characteristics of the at least one data page to be compressed, so as to obtain a candidate data page; the data characteristics include at least one attribute name and a data value corresponding to the attribute name; a difference data determination module, configured to determine a data page difference data set according to the at least one data page to be compressed and the candidate data page; The data merging module is used to merge the candidate data page and the data page difference data set to obtain a target data page.
8. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the data page compression method as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the data page compression method as described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the data page compression method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Data compression method and device, equipment and medium
CN116204135A
Method, device and equipment for compressing data
CN116248128A
Rapid data file merging method and system for time sequence database
CN116561120A
Data processing method, chip, storage medium and computer program product
CN119376652A
Valid data merging method, memory controller and memory storage apparatus
US20170115925A1