Data processing method, device and equipment and computer storage medium
By merging data between the first-level and second-level storage spaces of the LevelDB database, the problem of redundant write operations during the database merging process is solved, and the system throughput and data processing efficiency are improved.
Patent Information
- Application Number
- CN202410776262.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-08-23
AI Technical Summary
LevelDB database generates redundant read and write operations when merging data files, resulting in reduced system throughput and low data processing efficiency.
By merging data between the first-level storage space and the second-level storage space of the database disk, the number of files to be merged is reduced, redundant write operations are reduced, and system throughput is improved.
By merging data files, redundant write operations are reduced, the efficiency of the system in processing data is improved, and the system throughput is improved.
Smart Images

Figure CN118535100A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a method, device, equipment, computer storage medium and computer program product for data processing. Background Art
[0002] With the development of information technology, the amount of business data that enterprises need to process is gradually increasing. In order to meet the needs of accessing and storing massive data, enterprises usually use non-relational databases such as LevelDB databases to store data.
[0003] However, when the LevelDB database merges data files on disk, it generates redundant read and write operations, which consumes bandwidth and causes latency issues, reduces system throughput, and causes the system to process data inefficiently. Summary of the invention
[0004] The embodiments of the present disclosure provide a data processing method, apparatus, device, computer storage medium, and computer program product, which can improve the efficiency of system data processing.
[0005] In a first aspect, an embodiment of the present disclosure provides a method for data processing, the method comprising:
[0006] Get the data to be stored in the database memory;
[0007] Writing the data to be stored into the first component of the first-level storage space of the database disk;
[0008] When the data stored in the first component is greater than the first threshold, detecting the storage data size of the second component in the first-level storage space to obtain a detection result;
[0009] When the detection result indicates that the storage data of the second component is empty, the data stored in the first component is written into the second-level storage space of the database disk and merged with the data in the second-level storage space to obtain merged data.
[0010] In an achievable implementation, the data to be stored includes first data, and obtaining the data to be stored in the database memory includes:
[0011] The first data in the database memory is obtained, wherein the first data cannot be changed.
[0012] In an achievable implementation, before writing the data stored in the first component into the second-level storage space of the database disk and merging the data with the data in the second-level storage space to obtain the merged data, the method further includes:
[0013] When the data stored in the first component is greater than the first threshold, writing the data to be stored into the first component is stopped.
[0014] In an achievable implementation, after writing the data stored in the first component to the second-level storage space of the database disk and merging it with the data in the second-level storage space to obtain the merged data, the method further includes:
[0015] Detecting the size of data stored in the first component to obtain a target detection result;
[0016] When the target detection result indicates that the storage data of the first component is empty, writing the data to be stored into the second component;
[0017] When the data stored in the second component is greater than the second threshold, the data stored in the second component is written into the second-level storage space and merged with the data in the second-level storage space to obtain merged target data.
[0018] In an achievable implementation, before writing the data stored in the second component into the second-level storage space and merging the data with the data in the second-level storage space to obtain the merged target data, the method further includes:
[0019] When the data stored in the second component is greater than the second threshold, writing the data to be stored into the second component is stopped.
[0020] In an achievable implementation, before writing the data to be stored into the first component in the first-level storage space of the database disk, the method further includes:
[0021] Get target parameters;
[0022] The target parameter is used to determine the number of files in the first component or the second component to be merged.
[0023] In a second aspect, an embodiment of the present disclosure provides a data processing device, the device comprising:
[0024] The acquisition module is used to obtain the data to be stored in the database memory;
[0025] A writing module, used for writing the data to be stored into the first component of the first-level storage space of the database disk;
[0026] A detection module, configured to detect the storage data size of the second component in the first-level storage space when the data stored in the first component is greater than a first threshold, and obtain a detection result;
[0027] The writing module is also used to write the data stored in the first component to the second-level storage space of the database disk and merge it with the data in the second-level storage space to obtain merged data when the detection result indicates that the storage data of the second component is empty.
[0028] In a third aspect, an embodiment of the present disclosure provides a data processing device, the device comprising a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement a data processing method as described in any one of the first aspects.
[0029] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, a method for data processing as described in any one of the first aspects is implemented.
[0030] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which implements the data processing method as described in any one of the first aspects when the computer program is executed by a processor.
[0031] The data processing method, apparatus, device, computer storage medium and computer program product provided by the embodiments of the present disclosure obtain data to be stored in the database memory; write the data to be stored into the first component in the first-level storage space of the database disk; when the data stored in the first component is greater than a first threshold, detect the storage data size of the second component in the first-level storage space to obtain a detection result; when the detection result indicates that the storage data of the second component is empty, write the data stored in the first component into the second-level storage space of the database disk, and merge it with the data in the second-level storage space to obtain the merged data. The embodiments of the present disclosure can reduce the number of files to be merged by merging the data in the first component in the first-level storage space with the data in the second-level storage space, thereby reducing redundant write operations, thereby improving the throughput of the system and further improving the efficiency of the system in processing data. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the following is a brief introduction to the drawings required for use in the embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0033] Figure 1 is a flowchart of a data processing method provided by an embodiment of the present disclosure;
[0034] Figure 2 is a flowchart of a method for obtaining first data provided by an embodiment of the present disclosure;
[0035] Figure 3 is a flow chart of a method for stopping writing data to be stored provided by an embodiment of the present disclosure;
[0036] Figure 4 is a flowchart of a method for writing data to be stored into a second component provided by an embodiment of the present disclosure;
[0037] Figure 5 is a structural diagram of a data processing device provided by an embodiment of the present disclosure;
[0038] Figure 6 It is a structural diagram of a data processing device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0039] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present invention, rather than to limit the present invention. For those skilled in the art, the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention.
[0040] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0041] It should be noted that the acquisition, storage, use and processing of data in the embodiments of the present application are in compliance with the relevant provisions of national laws and regulations.
[0042] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0043] Before describing the technical solutions provided by the embodiments of the present disclosure, in order to facilitate understanding of the embodiments of the present disclosure, the present disclosure specifically describes the problems existing in the related technologies:
[0044] With the development of the information age, enterprises need to process more and more business data. How to store and improve the speed of reading and writing these massive data, reduce delays and respond in time are problems that enterprises need to solve urgently. In order to meet the access and storage needs of massive data and make the storage system highly scalable, reliable and economical, NoSQL (non-relational) databases are developing rapidly and receiving more and more attention. As a representative of non-relational databases, LevelDB database is also widely used in enterprises.
[0045] When processing massive amounts of data, the LevelDB database needs to perform frequent compaction operations to improve processing efficiency and organize data. However, during the merging process, redundant write operations will occur, causing system performance fluctuations, and causing write amplification and latency issues in the system.
[0046] Specifically, the LevelDB database reduces the number of SSTable files on the disk through background merge operations to improve read performance, while cleaning up expired data to improve space utilization, but this also brings about the problem of write amplification. Write amplification refers to the ratio of the size of data actually written to the disk to the size of data required to be written by the program. Write amplification in the LevelDB database can be expressed as the efficiency of a merge operation. The expression of the efficiency of the merge operation is shown in Formula 1:
[0047]
[0048] Among them, WA represents the efficiency of the merge operation, k represents the ratio of the storage space sizes of different levels on the disk of the LevelDB database, S represents the size of the SSTable file storing data on the disk, and N represents the total amount of data.
[0049] Furthermore, the expression of the system's write throughput is shown in Formula 2:
[0050]
[0051] Among them, ssd represents the disk, th represents the write throughput of the system, and th ssd Indicates the write throughput of the disk.
[0052] According to Formula 1 and Formula 2, when the number of data files to be merged increases, the number of redundant write operations increases, which reduces the throughput of the system.
[0053] In addition, since there are relatively many files with overlapping key ranges that need to be merged in the L0 layer of the LevelDB database, the write amplification problem caused by the merge operation triggered at the L0 layer far exceeds that of other layers. Therefore, the merge operation at the L0 layer has the greatest impact on the system throughput.
[0054] In view of the above research findings of the inventors, the embodiments of the present disclosure provide a method, apparatus, device, computer storage medium and computer program product for data processing, which can solve at least one of the above technical problems existing in the related art.
[0055] The disclosed embodiment obtains the data to be stored in the database memory, and writes the data to be stored into the first component in the first-level storage space of the database disk. When the data stored in the first component is greater than the first threshold, the storage data size of the second component in the first-level storage space is detected to obtain a detection result. When the detection result indicates that the storage data of the second component is empty, the data stored in the first component is written into the second-level storage space of the database disk, and merged with the data in the second-level storage space to obtain the merged data. By merging the data in the first component in the first-level storage space with the data in the second-level storage space, the number of files to be merged can be reduced, thereby reducing redundant write operations, improving the throughput of the system, and further improving the efficiency of the system in processing data.
[0056] The following first introduces the data processing method provided by the embodiment of the present disclosure.
[0057] Figure 1 FIG. 1 is a flow chart showing a method for data processing provided by an embodiment of the present disclosure. Figure 1 The method may include the following steps S110-S140.
[0058] S110: Acquire the data to be stored in the database memory.
[0059] The database disk obtains the data to be stored in the database memory.
[0060] In one example, the database may be a non-relational database, such as a LevelDB database.
[0061] In one embodiment, the disk of the LevelDB database obtains the data to be stored from the memory of the LevelDB database.
[0062] S120: Writing the data to be stored into the first component in the first-level storage space of the database disk.
[0063] After obtaining the data to be stored in the database memory, the database disk writes the data to be stored into the first component in the first-level storage space of the database disk. The first component represents part of the first-level storage space of the database disk. The data is stored in the disk in the form of SSTable files.
[0064] In one example, the first-level storage space of the database disk may be the L0 layer space of the LevelDB database.
[0065] S130: When the data stored in the first component is greater than the first threshold, detect the storage data size of the second component in the first-level storage space to obtain a detection result.
[0066] When the data to be stored is continuously written into the first component in the first-level storage space of the database disk, if the data stored in the first component is greater than the first threshold, the storage data size of the second component in the first-level storage space is detected to obtain a detection result. The first threshold represents the storage data capacity size threshold. The second component represents a portion of the first-level storage space of the database disk.
[0067] S140: When the detection result indicates that the storage data of the second component is empty, the data stored in the first component is written into the second-level storage space of the database disk, and merged with the data in the second-level storage space to obtain merged data.
[0068] If it is detected that the storage data of the second component is empty, the data stored in the first component in the first-level storage space of the database disk is written to the second-level storage space of the database disk, sorted and merged with the data in the second-level storage space, and the merged data is stored in the second-level storage space.
[0069] In one example, when the data to be stored is continuously written into the first component in the L0 layer of the LevelDB database, if the data stored in the first component is greater than 50% of the space capacity of the L0 layer, the storage data size of the second component is detected. If the storage data of the second component is empty, the data stored in the first component in the L0 layer and the data stored in the L1 layer are sorted and merged, and the merged data is stored in the L1 layer.
[0070] The disclosed embodiment obtains the data to be stored in the database memory, and writes the data to be stored into the first component in the first-level storage space of the database disk. When the data stored in the first component is greater than the first threshold, the storage data size of the second component in the first-level storage space is detected to obtain a detection result. When the detection result indicates that the storage data of the second component is empty, the data stored in the first component is written into the second-level storage space of the database disk, and merged with the data in the second-level storage space to obtain the merged data. By merging the data in the first component in the first-level storage space with the data in the second-level storage space, the number of files to be merged can be reduced, thereby reducing redundant write operations, improving the throughput of the system, and further improving the efficiency of the system in processing data.
[0071] In one embodiment, Figure 2 As shown, step S110 may include step S111.
[0072] S111: Acquire the first data in the database memory.
[0073] The database disk obtains the first data in the database memory from the database memory, wherein the first data cannot be changed.
[0074] In one example, a LevelDB database disk obtains an immutable memory table in a database memory, wherein data in the immutable memory table cannot be changed.
[0075] The disclosed embodiment obtains the unchangeable first data in the database memory and can effectively write the first data into the database disk.
[0076] In one embodiment, Figure 3 As shown, in step S140, when the detection result indicates that the storage data of the second component is empty, the data stored in the first component is written into the second-level storage space of the database disk and merged with the data in the second-level storage space to obtain the merged data, the method may further include step S150:
[0077] S150: When the data stored in the first component is greater than a first threshold, stop writing the data to be stored into the first component.
[0078] When the data to be stored in the database memory is continuously written to the first component in the first-level storage space of the database disk, if the data stored in the first component is greater than a first threshold, the writing of the data to be stored in the database memory to the first component is stopped.
[0079] In one example, when the data to be stored in the LevelDB database memory is continuously written to the first component of the L0 layer space of the LevelDB database disk, if the data stored in the first component is greater than 50% of the capacity of the L0 layer space, the data to be stored in the LevelDB database memory is stopped from being written to the first component.
[0080] When the data stored in the first component is greater than a first threshold, the embodiment of the present disclosure stops writing the data to be stored in the database memory to the first component, which can effectively control the size of the data stored in the first component and facilitate subsequent detection of the size of the data stored in the first component.
[0081] In one embodiment, Figure 4 As shown, in step S140, when the detection result indicates that the storage data of the second component is empty, the data stored in the first component is written to the second-level storage space of the database disk and merged with the data in the second-level storage space to obtain the merged data. The method may also include steps S210-S230.
[0082] S210: Detect the size of data stored in the first component to obtain a target detection result.
[0083] The data size of the data currently stored in the first component in the first-level storage space in the database disk is detected to obtain a target detection result.
[0084] S220: When the target detection result indicates that the storage data of the first component is empty, write the data to be stored into the second component.
[0085] If it is detected that the current storage data of the first component in the first-level storage space in the database disk is empty, the data to be stored in the database memory is written to the second component.
[0086] S230: When the data stored in the second component is greater than the second threshold, the data stored in the second component is written into the second-level storage space and merged with the data in the second-level storage space to obtain merged target data.
[0087] When the data to be stored is continuously written into the second component in the first-level storage space of the database disk, if the data stored in the second component is greater than the second threshold, the data stored in the second component in the first-level storage space of the database disk is written into the second-level storage space of the database disk, sorted and merged with the data in the second-level storage space, and the merged target data is stored in the second-level storage space. The second threshold represents the storage data capacity size threshold.
[0088] In one example, if the storage data of the first component is empty, the data to be stored in the memory of the LevelDB database is continuously written to the second component in the L0 layer of the LevelDB database. When the data stored in the second component is greater than 50% of the space capacity of the L0 layer, the data stored in the second component in the L0 layer is sorted and merged with the data stored in the L1 layer, and the merged target data is stored in the L1 layer.
[0089] The disclosed embodiment can reduce the number of files to be merged by merging the data in the second component in the first-level storage space with the data in the second-level storage space, thereby reducing unnecessary write operations, improving the system throughput and improving the system's efficiency in processing data.
[0090] In one embodiment, in step S230, when the data stored in the second component is greater than the second threshold, the data stored in the second component is written into the second-level storage space and merged with the data in the second-level storage space to obtain the merged target data. The method may also include step S240.
[0091] S240: When the data stored in the second component is greater than the second threshold, stop writing the data to be stored into the second component.
[0092] When the data to be stored in the database memory is continuously written to the second component in the first-level storage space of the database disk, if the data stored in the second component is greater than the second threshold, the writing of the data to be stored in the database memory to the second component is stopped.
[0093] In one example, when the data to be stored in the LevelDB database memory is continuously written to the second component of the L0 layer space of the LevelDB database disk, if the data stored in the second component is greater than 50% of the capacity of the L0 layer space, the data to be stored in the LevelDB database memory is stopped from being written to the second component.
[0094] When the data stored in the second component is greater than a first threshold, the embodiment of the present disclosure stops writing the data to be stored in the database memory into the second component, which can effectively control the size of the data stored in the second component and facilitate subsequent detection of the size of the data stored in the second component.
[0095] In one embodiment, before writing the data to be stored into the first component in the first-level storage space of the database disk before step S120, steps S160 and S170 are also included.
[0096] S160: Obtain target parameters.
[0097] Before writing the data to be stored into the first component of the first-level storage space of the database disk, a target parameter is obtained, wherein the target parameter represents the key value overlap rate in the SStable file to be merged.
[0098] S170: Determine the number of files involved in merging in the first component or the second component using the target parameter.
[0099] In one embodiment, the first key value range corresponding to the SSTable files in each first / second component can be determined based on all SSTable files stored in the first / second component in the first-level storage space. The second key value range corresponding to the SSTable files in each second-level storage space can be determined based on all SSTable files stored in the second-level storage space. Based on the first key value range and the second key value range, multiple overlap rates are obtained. The smallest overlap rate among the multiple overlap rates is selected as the target overlap rate, and the number of files participating in the merge in the first / second component is determined based on the target overlap rate.
[0100] In one example, the HyperLogLog algorithm may be used to calculate the key value overlap ratio.
[0101] The disclosed embodiment obtains target parameters and determines the number of files involved in merging in the first component or the second component according to the target parameters, thereby reducing the number of files that need to be merged each time a merge operation is performed on the database disk space, thereby improving the system throughput and data processing efficiency.
[0102] like Figure 5 As shown, the embodiment of the present disclosure further provides a data processing device 300, and the data processing device 300 includes:
[0103] The acquisition module 301 is used to acquire the data to be stored in the database memory;
[0104] A writing module 302, used for writing the data to be stored into the first component in the first-level storage space of the database disk;
[0105] A detection module 303 is used to detect the storage data size of the second component in the first-level storage space when the data stored in the first component is greater than the first threshold, and obtain a detection result;
[0106] The writing module 302 is also used to write the data stored in the first component to the second-level storage space of the database disk and merge it with the data in the second-level storage space to obtain merged data when the detection result indicates that the storage data of the second component is empty.
[0107] In some embodiments, the acquisition module 301 is specifically used to:
[0108] The first data in the database memory is obtained, wherein the first data cannot be changed.
[0109] In some embodiments, the writing module 302 is specifically configured to:
[0110] When the data stored in the first component is greater than the first threshold, writing the data to be stored into the first component is stopped.
[0111] In some embodiments, the detection module 303 is specifically configured to:
[0112] Detecting the size of data stored in the first component to obtain a target detection result;
[0113] When the target detection result indicates that the storage data of the first component is empty, writing the data to be stored into the second component;
[0114] When the data stored in the second component is greater than the second threshold, the data stored in the second component is written into the second-level storage space and merged with the data in the second-level storage space to obtain merged target data.
[0115] In some embodiments, the writing module 302 is specifically configured to:
[0116] When the data stored in the second component is greater than the second threshold, writing the data to be stored into the second component is stopped.
[0117] In some embodiments, the acquisition module 301 is specifically used to:
[0118] Get target parameters;
[0119] The target parameter is used to determine the number of files in the first component or the second component to be merged.
[0120] Figure 5 Each module / unit in the device shown has the function of realizing Figure 1 The functions of each step executed by the application system in the present invention can achieve the corresponding technical effects. For the sake of brevity, they will not be repeated here.
[0121] Figure 6 A schematic diagram of the hardware structure of data processing provided by an embodiment of the present disclosure is shown.
[0122] The data processing device may include a processor 401 and a memory 402 storing computer program instructions.
[0123] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0124] Memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, memory 402 may include a removable or non-removable (or fixed) medium. In appropriate cases, memory 402 may be inside or outside of an integrated gateway disaster recovery device. In a specific embodiment, memory 402 is a non-volatile solid-state memory.
[0125] The memory 402 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present disclosure.
[0126] The processor 401 implements any one of the data processing methods in the above embodiments by reading and executing computer program instructions stored in the memory 402 .
[0127] In one example, the data processing device may further include a communication interface 403 and a bus 404. Figure 6 As shown, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 404 and communicate with each other.
[0128] The communication interface 403 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0129] Bus 404 includes hardware, software or both, and couples the components of online data flow billing equipment to each other. For example, but not limitation, the bus may include Accelerated Graphics Port (AGP) or other graphics bus, Enhanced Industry Standard Architecture (EISA) bus, Front Side Bus (FSB), Hyper Transport (HT) interconnection, Industry Standard Architecture (ISA) bus, InfiniBand interconnection, Low Pin Count (LPC) bus, Memory bus, Micro Channel Architecture (MCA) bus, Peripheral Component Interconnect (PCI) bus, PCI-Express (PCI-X) bus, Serial Advanced Technology Attachment (SATA) bus, Video Electronics Standards Association Local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 404 may include one or more buses. Although the embodiment of the present invention describes and shows a specific bus, the present invention considers any suitable bus or interconnection. In addition, in conjunction with the method for data processing in the above-mentioned embodiment, the embodiment of the present application also provides a computer storage medium to realize. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the data processing methods in the above embodiments is implemented.
[0130] An embodiment of the present application also provides a computer program product, including a computer program, which implements any one of the data processing methods in the above embodiments when the computer program is executed by a processor.
[0131] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0132] The functional blocks shown in the above structural block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or communication link by a data signal carried in a carrier. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (Read-Only Memory, ROM), flash memory, erasable read-only memory (Erasable ReadOnly Memory, EROM), floppy disks, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical discs, hard disks, optical fiber media, radio frequency (Radio Frequency, RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0133] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.
[0134] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0135] The above is only a specific implementation of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system, module and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.
Claims
1. A method for data processing, characterized in that: include: Get the data to be stored in the database memory; Writing the data to be stored into a first component in a first-level storage space of a database disk; In the case where the data stored in the first component is greater than a first threshold, detecting the storage data size of the second component in the first-level storage space to obtain a detection result; When the detection result indicates that the storage data of the second component is empty, the data stored in the first component is written into the second-level storage space of the database disk and merged with the data in the second-level storage space to obtain merged data.
2. The method according to claim 1, characterized in that The data to be stored includes first data, and the step of obtaining the data to be stored in the database memory includes: The first data in the database memory is obtained, wherein the first data cannot be changed.
3. The method according to claim 1, characterized in that Before writing the data stored in the first component into the second-level storage space of the database disk and merging the data with the data in the second-level storage space to obtain the merged data, the method further includes: When the data stored in the first component is greater than a first threshold, writing the data to be stored into the first component is stopped.
4. The method according to claim 1, characterized in that: After writing the data stored in the first component into the second-level storage space of the database disk and merging the data with the data in the second-level storage space to obtain the merged data, the method further includes: Detecting the size of data stored in the first component to obtain a target detection result; When the target detection result indicates that the storage data of the first component is empty, writing the data to be stored into the second component; When the data stored in the second component is greater than a second threshold, the data stored in the second component is written into the second-level storage space and merged with the data in the second-level storage space to obtain merged target data.
5. The method according to claim 4, characterized in that Before writing the data stored in the second component into the second-level storage space and merging the data with the data in the second-level storage space to obtain the merged target data, the method further includes: When the data stored in the second component is greater than a second threshold, writing the data to be stored into the second component is stopped.
6. The method according to claim 1, characterized in that Before writing the data to be stored into the first component in the first-level storage space of the database disk, the method further includes: Get target parameters; The target parameter is used to determine the number of files in the first component or the second component to be merged.
7. A data processing device, characterized in that: The device comprises: An acquisition module, the acquisition module is used to acquire the data to be stored in the database memory; A writing module, the writing module is used to write the data to be stored into a first component in a first-level storage space of a database disk; a detection module, the detection module being used to detect the storage data size of the second component in the first-level storage space when the data stored in the first component is greater than a first threshold, and obtain a detection result; The writing module is also used to write the data stored in the first component into the second-level storage space of the database disk and merge it with the data in the second-level storage space to obtain merged data when the detection result indicates that the storage data of the second component is empty.
8. A data processing device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the data processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method for data processing according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the data processing method according to any one of claims 1 to 6.
