Metadata acquisition method and device, storage medium and computer equipment
By obtaining and processing the metadata change information of the target database, the problem of insufficient timeliness of metadata collection is solved, real-time collection and storage of metadata is realized, inconsistency between the application system and the database is avoided, and collection efficiency is improved.
Patent Information
- Application Number
- CN202410721517.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-08-30
AI Technical Summary
The insufficient timeliness of metadata collection in the existing technology leads to the problem of metadata inconsistency between the application system and the database.
By obtaining the metadata change information in the log file of the target database, writing it into the cache pool for merging, sending it to the preset message middleware, and obtaining and segmenting the message in real time in the application system, and storing it in the corresponding drop-in database.
It realizes real-time collection of metadata, avoids the problem of metadata inconsistency, and improves the efficiency of metadata collection.
Smart Images

Figure CN118568326A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a metadata collection method and device, a storage medium, and a computer device. Background Art
[0002] Metadata, also known as intermediary data or relay data, is data about data. It mainly describes the properties of data and is used to support functions such as indicating storage location, historical data, resource search, and file records.
[0003] At present, in the prior art, metadata is mainly collected by timed collection, that is, metadata is collected at a specified time. However, if the stored metadata has changed since the last metadata collection, the changed metadata information can only be obtained when the metadata is collected next time, thus, the timeliness of obtaining metadata change information cannot be guaranteed. Once the stored metadata has changed since the last metadata collection, the metadata between the application system and the database will be inconsistent. Summary of the invention
[0004] In view of this, the present application provides a metadata collection method and apparatus, a storage medium, and a computer device, the main purpose of which is to solve the problem of metadata inconsistency between the application system and the database due to the inability to guarantee the timeliness of obtaining metadata change information.
[0005] According to one aspect of the present application, a metadata collection method is provided, the method comprising:
[0006] Obtain metadata change information in the log file of the target database;
[0007] Writing the metadata change information into a cache pool, merging the data in the cache pool to obtain a target message, and sending the target message to a preset message middleware;
[0008] The application system obtains the target message in the preset message middleware in real time, and segments the target message to obtain a plurality of segmentation information;
[0009] A storage database corresponding to the segmentation information and a storage data table in the storage database are determined, and the segmentation information is stored in the storage data table in the storage database.
[0010] Optionally, the cache pool includes a first cache pool; and the step of writing the metadata change information into the cache pool and merging the data in the cache pool to obtain the target message includes:
[0011] The metadata change information is written into the first cache pool until the amount of data in the first cache pool reaches the first capacity of the first cache pool, and the data stored in the first cache pool is merged to obtain the target message.
[0012] Optionally, the cache pool includes a first cache pool; and the step of writing the metadata change information into the cache pool and merging the data in the cache pool to obtain the target message includes:
[0013] The metadata change information is written into the first cache pool until the amount of data in the first cache pool reaches the first capacity of the first cache pool, and the data stored in the first cache pool is merged to obtain the target message.
[0014] Optionally, the cache pool includes a second cache pool; and the step of writing the metadata change information into the cache pool, merging the data in the cache pool, and obtaining the target message further includes:
[0015] After the amount of data in the first cache pool reaches the first capacity of the first cache pool, new metadata change information is written into the second cache pool, until the amount of data in the second cache pool reaches the second capacity of the second cache pool, and the data stored in the second cache pool is merged to obtain the target message;
[0016] After the amount of data in the second cache pool reaches a second capacity of the second cache pool, new metadata change information is written into the first cache pool.
[0017] Optionally, storing the segmentation information in the drop-in-stock data table in the drop-in-stock database includes:
[0018] According to the storage database and the storage data table corresponding to each of the segmentation information, the segmentation information is grouped to obtain at least one segmentation information group;
[0019] For any segmentation information group, the segmentation information in the segmentation information group is merged, and the merged segmentation information is saved in the storage data table in the storage database corresponding to the segmentation information group.
[0020] Optionally, when the segmentation information groups include multiple ones, for any segmentation information group, merging the segmentation information in the segmentation information group and saving the merged segmentation information in a storage data table in the storage database corresponding to the segmentation information group includes:
[0021] Respectively obtain a processing thread corresponding to each of the segmentation information groups;
[0022] The segmentation information in each segmentation information group is merged in parallel through multiple processing threads, and the merged segmentation information is saved in a storage data table in the storage database corresponding to the segmentation information group.
[0023] Optionally, obtaining metadata change information in a log file of the target database includes:
[0024] Using a plurality of preset listeners to respectively monitor the log files in the target database corresponding to each other;
[0025] When any preset listener monitors that the corresponding log file changes, the metadata change information is obtained.
[0026] Optionally, before using a plurality of preset listeners to respectively monitor the log files in the target database corresponding to each other, the method further includes:
[0027] The multiple preset listeners are added to the application system, and when the application system is started, the multiple preset listeners are started simultaneously, wherein the number of the multiple preset listeners is consistent with the number of the target databases.
[0028] According to another aspect of the present application, a metadata collection device is provided, the device comprising:
[0029] An acquisition module is used to obtain metadata change information in the log file of the target database;
[0030] A writing module, used to write the metadata change information into a cache pool, merge the data in the cache pool to obtain a target message, and send the target message to a preset message middleware;
[0031] A segmentation module, used for the application system to obtain the target message in the preset message middleware in real time, and segment the target message to obtain a plurality of segmentation information;
[0032] The determination module is used to determine the warehouse drop database corresponding to the segmentation information and the warehouse drop data table in the warehouse drop database, and store the segmentation information in the warehouse drop data table in the warehouse drop database.
[0033] Optionally, the writing module is further used for:
[0034] The metadata change information is written into the first cache pool until the amount of data in the first cache pool reaches the first capacity of the first cache pool, and the data stored in the first cache pool is merged to obtain the target message.
[0035] Optionally, the writing module is further used for:
[0036] After the amount of data in the first cache pool reaches a first capacity of the first cache pool, new metadata change information is written into the second cache pool, until the amount of data in the second cache pool reaches a second capacity of the second cache pool, and the data stored in the second cache pool are merged to obtain the target message;
[0037] After the amount of data in the second cache pool reaches a second capacity of the second cache pool, new metadata change information is written into the first cache pool.
[0038] Optionally, the determining module is further used to:
[0039] According to the storage database and the storage data table corresponding to each of the segmentation information, the segmentation information is grouped to obtain at least one segmentation information group;
[0040] For any segmentation information group, the segmentation information in the segmentation information group is merged, and the merged segmentation information is saved in the storage data table in the storage database corresponding to the segmentation information group.
[0041] Optionally, the determining module is further used to:
[0042] Respectively obtain a processing thread corresponding to each of the segmentation information groups;
[0043] The segmentation information in each segmentation information group is merged in parallel through multiple processing threads, and the merged segmentation information is saved in a storage data table in the storage database corresponding to the segmentation information group.
[0044] Optionally, the acquisition module is further used to:
[0045] Using a plurality of preset listeners to respectively monitor the log files in the target database corresponding to each other;
[0046] When any preset listener monitors that the corresponding log file changes, the metadata change information is obtained.
[0047] Optionally, the device further comprises:
[0048] An adding module is used to add the multiple preset listeners in the application system, and when the application system is started, the multiple preset listeners are started at the same time, wherein the number of the multiple preset listeners is consistent with the number of the target databases.
[0049] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned metadata collection method is implemented.
[0050] According to another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned metadata collection method when executing the program.
[0051] By means of the above technical scheme, the present application provides a metadata collection method and device, storage medium, and computer equipment. First, metadata change information in the log file of the target database is obtained, the metadata change information is written into the cache pool, the data in the cache pool is merged to obtain the target message, and the target message is sent to the preset message middleware. Secondly, the application system obtains the target message in the preset message middleware in real time, and segments the target message to obtain multiple segmentation information. Finally, the database corresponding to the segmentation information and the database data table in the database are determined, and the segmentation information is stored in the database data table in the database. The present application merges the obtained metadata change information to obtain the target message and sends it to the preset message middleware. After sending the target message to the preset message middleware, the application system obtains the target message in the preset message middleware in real time, and segments the target message to obtain multiple segmentation information, and saves the segmentation information to the corresponding database data table in the database, thereby avoiding the problem of inconsistent metadata between the application system and the database due to the inability to ensure the timeliness of obtaining metadata change information, thereby improving the efficiency of metadata collection.
[0052] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0054] Figure 1 A schematic diagram of a process of collecting metadata provided by an embodiment of the present application is shown;
[0055] Figure 2 A schematic diagram showing a process flow of another metadata collection method provided by an embodiment of the present application is shown;
[0056] Figure 3 A schematic diagram of the structure of a metadata collection device provided in an embodiment of the present application is shown;
[0057] Figure 4 A schematic diagram of the device structure of a computer device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0058] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0059] In this embodiment, a metadata collection method is provided. Figure 1 As shown, the method includes:
[0060] Step 101: Obtain metadata change information in a log file of a target database.
[0061] Step 102: write the metadata change information into a buffer pool, merge the data in the buffer pool to obtain a target message, and send the target message to a preset message middleware.
[0062] Step 103: the application system obtains the target message in the preset message middleware in real time, and segments the target message to obtain a plurality of segmentation information.
[0063] Step 104, determining the warehouse drop database corresponding to the segmentation information and the warehouse drop data table in the warehouse drop database, and storing the segmentation information in the warehouse drop data table in the warehouse drop database.
[0064] The above-mentioned embodiment of the present application is used to collect metadata that has changed in a database in real time. By obtaining metadata change information in the log file of the target database, and writing the obtained metadata change information into the cache pool, until the amount of data in the cache pool reaches the cache pool capacity, the data in the cache pool is merged, and the target message is obtained by merging, and the target message is sent to the preset message middleware. After the target message is sent to the preset message middleware, the application system obtains the target message in the preset message middleware in real time, and divides the obtained target message to obtain multiple division information, and after determining the database corresponding to the division information and the database data table in the database, the division information is saved in the database data table in the corresponding database. By writing the metadata change information into the cache pool and merging and sending it to the preset message middleware, the problem of low efficiency of directly writing the metadata change information to the disk in the prior art is solved, thereby achieving real-time collection of metadata that has changed in the database, avoiding the problem of inconsistent metadata between the application system and the database due to the inability to ensure the timeliness of obtaining metadata change information, and improving the efficiency of metadata collection.
[0065] In this embodiment, first, when the log file of the target database changes, metadata change information is obtained from the log file of the target database, wherein the target database can be multiple or one. When there are multiple target databases, metadata change information can be obtained from the log files corresponding to each of the multiple target databases at the same time, and the obtained metadata change information is written into the cache pool until the amount of data in the cache pool reaches the cache pool capacity, and the data in the cache pool is merged, and the target message is obtained by merging, wherein the cache pool is divided into a first cache pool and a second cache pool, and the first cache pool and the second cache pool are used alternately and cyclically, and the target message is sent to the preset message middleware. Secondly, after sending the target message to the preset message middleware, the application system obtains the target message in the preset message middleware in real time, and after each target message is obtained, the obtained target message is segmented, and multiple segmentation information is obtained by segmentation. Finally, after obtaining multiple segmentation information, the database corresponding to the segmentation information and the database data table in the database are determined, and the segmentation information is saved in the database data table in the database.
[0066] It should be noted that the obtained metadata change information is written into the cache pool until the amount of data in the cache pool reaches the cache pool capacity, wherein the size of the cache pool capacity can be set according to the size of the data with the highest transmission efficiency. For example, after testing, when the data amount is 10M, the transmission efficiency is the highest, then the cache pool capacity is set to 10M.
[0067] By applying the technical solution of this embodiment, when the log file of the target database changes, the metadata change information in the log file of the target database is obtained, and the obtained metadata change information is written into the cache pool. When the amount of data in the cache pool reaches the capacity of the cache pool, the data in the cache pool is merged to obtain the target message, and the target message is sent to the preset message middleware. The application system obtains the target message in the preset message middleware in real time, and splits the obtained target message to obtain multiple split information through splitting. After obtaining multiple split information, the database corresponding to the split information and the database data table in the database are determined, and the split information is saved in the database data table in the corresponding database. In this way, the metadata that has changed in the database is collected in real time, avoiding the problem of inconsistent metadata between the application system and the database due to the inability to ensure the timeliness of obtaining metadata change information, thereby improving the efficiency of metadata collection.
[0068] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another metadata collection method is provided, such as Figure 2 As shown, the method includes:
[0069] Step 201 : adding the plurality of preset listeners to the application system, and starting the plurality of preset listeners simultaneously when starting the application system, wherein the number of the plurality of preset listeners is consistent with the number of the target databases.
[0070] In this embodiment, the number corresponding to the target databases is determined, and based on the number corresponding to the target databases, a corresponding number of preset listeners are added to the application system, and each preset listener is started at the same time when the application system is started. For example, when the number corresponding to the target databases is three, that is, three preset listeners need to be added to the application system, that is, one preset listener corresponds to one target database.
[0071] Step 202: Use a plurality of preset listeners to respectively monitor the log files in the target database corresponding to each other.
[0072] Step 203: When any preset listener detects that the corresponding log file has changed, the metadata change information is obtained.
[0073] In this embodiment, after starting multiple preset listeners, the multiple preset listeners are used to monitor the log files of the corresponding target databases respectively. When changes are detected in the log file of any target database, metadata change information is obtained from the log file of the target database. If changes are detected in the log files of multiple target databases, metadata change information can be obtained from the log files corresponding to the multiple target databases at the same time. For example, if three preset listeners in the application system all monitor changes in the log files of their corresponding target databases, metadata change information can be obtained from the log files corresponding to the three target databases at the same time.
[0074] Step 204: write the metadata change information into a cache pool, merge the data in the cache pool to obtain a target message, and send the target message to a preset message middleware.
[0075] In this embodiment, after obtaining the metadata change information, the obtained metadata change information is written into the cache pool until the amount of data in the cache pool reaches the cache pool capacity, the data in the cache pool is merged, the target message is obtained by merging, and the target message is sent to the preset message middleware.
[0076] Optionally, the buffer pool mentioned in step 204 of "writing the metadata change information into a buffer pool, merging the data in the buffer pool, and obtaining a target message" includes a first buffer pool and a second buffer pool, and the first buffer pool and the second buffer pool are used alternately and cyclically. The specific steps are as follows:
[0077] Step 204-1, writing the metadata change information into the first cache pool until the amount of data in the first cache pool reaches the first capacity of the first cache pool, merging the data stored in the first cache pool to obtain the target message.
[0078] Step 204-2: After the amount of data in the first cache pool reaches the first capacity of the first cache pool, new metadata change information is written into the second cache pool until the amount of data in the second cache pool reaches the second capacity of the second cache pool, and the data stored in the second cache pool is merged to obtain the target message.
[0079] Step 204-3: after the amount of data in the second cache pool reaches the second capacity of the second cache pool, write new metadata change information into the first cache pool.
[0080] In the above embodiment, after obtaining the metadata change information, the obtained metadata change information is written into the first cache pool in a default order until the amount of data in the first cache pool reaches the first capacity of the first cache pool. At this time, the data in the first cache pool is merged, and the target message is obtained by merging, and the obtained target message is sent to the preset message middleware. After the amount of data in the first cache pool reaches the first capacity of the first cache pool, the obtained new metadata change information is automatically written into the second cache pool until the amount of data in the second cache pool reaches the second capacity of the second cache pool. At this time, the data in the second cache pool is merged, and the target message is obtained by merging, and the obtained target message is sent to the preset message middleware. After the amount of data in the second cache pool reaches the second capacity of the second cache pool, the obtained new metadata change information is automatically written into the first cache pool.
[0081] It should be noted that after the metadata change information is obtained, the metadata change information is written into the first cache pool in a default order, wherein the default order may also be modified or adjusted according to actual conditions.
[0082] It should also be noted that after the first cache pool or the second cache pool sends the merged target message to the preset message middleware, it automatically returns to the clear state. Therefore, when the amount of data in the second cache pool reaches the second capacity of the second cache pool, the acquired new metadata is automatically written into the first cache pool.
[0083] Step 205: the application system obtains the target message in the preset message middleware in real time, and segments the target message to obtain a plurality of segmentation information.
[0084] In this embodiment, after sending the target message to the preset message middleware, the application system obtains the target message in the preset message middleware in real time, and each time a target message is obtained, the obtained target message is segmented to obtain multiple segmentation information.
[0085] Step 206, determining the storage database corresponding to the segmentation information and the storage data table in the storage database.
[0086] In this embodiment, after the acquired target message is segmented to obtain a plurality of segmentation information, the corresponding database for each segmentation information and the database data table in the database are determined, so as to subsequently group each segmentation information.
[0087] Step 207: group the segmented information according to the corresponding storage database and storage data table of each segmented information to obtain at least one segmented information group.
[0088] Step 208: for any segmentation information group, the segmentation information in the segmentation information group is merged, and the merged segmentation information is saved in the storage data table in the storage database corresponding to the segmentation information group.
[0089] In this embodiment, after determining the warehouse database and the warehouse data table in the warehouse database corresponding to each segmentation information, the segmentation information is grouped according to the warehouse database and the warehouse data table corresponding to each segmentation information. By grouping the segmentation information, at least one segmentation information group is obtained. For example, segmentation information 1, segmentation information 2, and segmentation information 3 all correspond to data table a in database A, then segmentation information 1, segmentation information 2, and segmentation information 3 are put into one segmentation information group. For any segmentation information group, the segmentation information in the segmentation information group is merged, and the merged segmentation information is saved in the warehouse data table in the warehouse database corresponding to the segmentation information group.
[0090] Step 209: respectively obtain a processing thread corresponding to each of the segmentation information groups.
[0091] Step 210: Merge the segmentation information in each segmentation information group in parallel through multiple processing threads, and save the merged segmentation information into the storage data table in the storage database corresponding to the segmentation information group.
[0092] In this embodiment, after the segmentation information is grouped, when the segmentation information group includes multiple segments, the processing threads corresponding to each segmentation information group are obtained respectively. After obtaining the processing thread corresponding to each segmentation information group, multiple processing threads are obtained. The segmentation information in each segmentation information group is merged in parallel through the multiple processing threads, and the merged segmentation information is saved in the storage data table in the storage database corresponding to the segmentation information group.
[0093] By applying the technical solution of this embodiment, multiple preset listeners are added to the application system, and the log files of the corresponding target databases are monitored by the multiple preset listeners. When any preset listener monitors that the log file of the corresponding target database has changed, metadata change information is obtained in the log file of the target database, and the metadata change information is written into the first cache pool in a default order. When the amount of data in the first cache pool reaches the first capacity of the first cache pool, the data in the first cache pool is merged, and the target message is obtained by merging, and the target message is sent to the preset message middleware. After the amount of data in the first cache pool reaches the capacity of the first cache pool, the acquired new metadata change information is automatically written into the second cache pool. When the amount of data in the second cache pool reaches the second capacity of the second cache pool, the data in the second cache pool is merged, and the target message is obtained by merging, and the target message is sent to the preset message middleware. When the amount of data in the second cache pool reaches the second capacity of the second cache pool, the data in the second cache pool is merged, and the target message is obtained by merging, and the target message is sent to the preset message middleware. After the second capacity is reached, the newly acquired metadata change information is automatically written into the first cache pool. After the target message is sent to the preset message middleware, the application system acquires the target message in the preset message middleware in real time, and each time a target message is acquired, the acquired target message is segmented, and a plurality of segmentation information are obtained by segmentation, and the database corresponding to each segmentation information and the data table in the database are determined. The segmentation information is grouped according to the database and the data table corresponding to each segmentation information, and the segmentation information in the segmentation information group is merged, and the merged segmentation information is saved in the database data table in the database corresponding to the segmentation information group. When the segmentation information group contains multiple segments, the processing threads corresponding to each segmentation information group are acquired respectively to obtain multiple processing threads, and the segmentation information in each segmentation information group is merged in parallel by multiple processing threads, and the merged segmentation information is saved in the database data table in the database corresponding to the segmentation information group. This enables real-time collection of metadata changes in the database, avoiding the problem of inconsistent metadata between the application system and the database due to the lack of timeliness in obtaining metadata change information, and improves the efficiency of metadata collection.
[0094] Further, as Figure 1 The specific implementation of the method, the embodiment of the present application provides a metadata collection device, such as Figure 3 As shown, the device comprises:
[0095] An acquisition module is used to obtain metadata change information in the log file of the target database;
[0096] A writing module, used to write the metadata change information into a cache pool, merge the data in the cache pool to obtain a target message, and send the target message to a preset message middleware;
[0097] A segmentation module, used for the application system to obtain the target message in the preset message middleware in real time, and segment the target message to obtain a plurality of segmentation information;
[0098] The determination module is used to determine the warehouse drop database corresponding to the segmentation information and the warehouse drop data table in the warehouse drop database, and store the segmentation information in the warehouse drop data table in the warehouse drop database.
[0099] Optionally, the writing module is further used for:
[0100] The metadata change information is written into the first cache pool until the amount of data in the first cache pool reaches the first capacity of the first cache pool, and the data stored in the first cache pool is merged to obtain the target message.
[0101] Optionally, the writing module is further used for:
[0102] After the amount of data in the first cache pool reaches a first capacity of the first cache pool, new metadata change information is written into the second cache pool, until the amount of data in the second cache pool reaches a second capacity of the second cache pool, and the data stored in the second cache pool are merged to obtain the target message;
[0103] After the amount of data in the second cache pool reaches a second capacity of the second cache pool, new metadata change information is written into the first cache pool.
[0104] Optionally, the determining module is further used to:
[0105] According to the storage database and the storage data table corresponding to each of the segmentation information, the segmentation information is grouped to obtain at least one segmentation information group;
[0106] For any segmentation information group, the segmentation information in the segmentation information group is merged, and the merged segmentation information is saved in the storage data table in the storage database corresponding to the segmentation information group.
[0107] Optionally, the determining module is further used to:
[0108] Respectively obtain a processing thread corresponding to each of the segmentation information groups;
[0109] The segmentation information in each segmentation information group is merged in parallel through multiple processing threads, and the merged segmentation information is saved in a storage data table in the storage database corresponding to the segmentation information group.
[0110] Optionally, the acquisition module is further used to:
[0111] Using a plurality of preset listeners to respectively monitor the log files in the target database corresponding to each other;
[0112] When any preset listener monitors that the corresponding log file changes, the metadata change information is obtained.
[0113] Optionally, the device further comprises:
[0114] An adding module is used to add the multiple preset listeners in the application system, and when the application system is started, the multiple preset listeners are started at the same time, wherein the number of the multiple preset listeners is consistent with the number of the target databases.
[0115] It should be noted that for other corresponding descriptions of the functional units involved in the metadata collection device provided in the embodiment of the present application, reference can be made to Figure 1 to Figure 2 The corresponding description in the method will not be repeated here.
[0116] The present application also provides a computer device, which may be a personal computer, a server, a network device, etc. Figure 4 As shown, the computer device includes a bus, a processor, a memory and a communication interface, and may also include an input and output interface and a display device. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store location information. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in each method embodiment are implemented.
[0117] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0118] In one embodiment, a computer-readable storage medium is provided. The computer-readable storage medium may be non-volatile or volatile, and stores a computer program thereon. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0119] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0120] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0121] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0122] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0123] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A metadata collection method, characterized in that: include: Obtain metadata change information in the log file of the target database; Writing the metadata change information into a cache pool, merging the data in the cache pool to obtain a target message, and sending the target message to a preset message middleware; The application system obtains the target message in the preset message middleware in real time, and segments the target message to obtain a plurality of segmentation information; A storage database corresponding to the segmentation information and a storage data table in the storage database are determined, and the segmentation information is stored in the storage data table in the storage database.
2. The method according to claim 1, characterized in that The cache pool includes a first cache pool; the metadata change information is written into the cache pool, and the data in the cache pool is merged to obtain a target message, including: The metadata change information is written into the first cache pool until the amount of data in the first cache pool reaches the first capacity of the first cache pool, and the data stored in the first cache pool is merged to obtain the target message.
3. The method according to claim 2, characterized in that The cache pool includes a second cache pool; the metadata change information is written into the cache pool, and the data in the cache pool is merged to obtain the target message, and further includes: After the amount of data in the first cache pool reaches a first capacity of the first cache pool, new metadata change information is written into the second cache pool, until the amount of data in the second cache pool reaches a second capacity of the second cache pool, and the data stored in the second cache pool are merged to obtain the target message; After the amount of data in the second cache pool reaches a second capacity of the second cache pool, new metadata change information is written into the first cache pool.
4. The method according to claim 1, characterized in that: The storing the segmentation information in the drop-in-stock data table in the drop-in-stock database includes: According to the storage database and the storage data table corresponding to each of the segmentation information, the segmentation information is grouped to obtain at least one segmentation information group; For any segmentation information group, the segmentation information in the segmentation information group is merged, and the merged segmentation information is saved in the storage data table in the storage database corresponding to the segmentation information group.
5. The method according to claim 4, characterized in that When the segmentation information groups include multiple ones, for any segmentation information group, merging the segmentation information in the segmentation information group and saving the merged segmentation information in the storage data table in the storage database corresponding to the segmentation information group includes: Respectively obtain a processing thread corresponding to each of the segmentation information groups; The segmentation information in each segmentation information group is merged in parallel through multiple processing threads, and the merged segmentation information is saved in a storage data table in the storage database corresponding to the segmentation information group.
6. The method according to any one of claims 1 to 5, characterized in that The step of obtaining metadata change information in a log file of a target database includes: Using a plurality of preset listeners to respectively monitor the log files in the target database corresponding to each other; When any preset listener monitors that the corresponding log file changes, the metadata change information is obtained.
7. The method according to claim 6, characterized in that Before using a plurality of preset listeners to respectively monitor the log files in the target database corresponding to each other, the method further includes: The multiple preset listeners are added to the application system, and when the application system is started, the multiple preset listeners are started simultaneously, wherein the number of the multiple preset listeners is consistent with the number of the target databases.
8. A metadata collection device, characterized in that: The device comprises: An acquisition module is used to obtain metadata change information in the log file of the target database; A writing module, used to write the metadata change information into a cache pool, merge the data in the cache pool to obtain a target message, and send the target message to a preset message middleware; A segmentation module, used for the application system to obtain the target message in the preset message middleware in real time, and segment the target message to obtain a plurality of segmentation information; The determination module is used to determine the warehouse drop database corresponding to the segmentation information and the warehouse drop data table in the warehouse drop database, and store the segmentation information in the warehouse drop data table in the warehouse drop database.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Index-based computer continuous data protection method
CN102521269A
Metadata updating method and device
CN107491558A
Business data processing method and device and computer readable storage medium
CN114328749A
Method and system for realizing network security based on full-flow asset discovery
CN115840951A
