Dimension table data processing method, device, electronic device and storage medium
By caching the data to be associated and querying dimension tables in batches when conditions are met, the problem of low computing job throughput in traditional technology is solved and the efficiency and accuracy of data processing are improved.
Patent Information
- Application Number
- CN202210018707.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-08
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-01-08
AI Technical Summary
In traditional technology, when querying data analysis in dimension tables, the RPC protocol needs to be frequently used to generate access requests, which causes the data storage end to take a lot of time to return results, reducing the throughput of computing jobs.
By obtaining and caching the data to be associated, if the cached data meets the preset batch query triggering conditions, a dimension table query request is sent, reducing the number of accesses to the dimension table storage end, and achieving batch acquisition of associated dimension table data.
It improves the throughput of computing jobs, reduces the waiting time caused by frequent access to the dimension table storage end, and achieves timely and accurate data reception.
Smart Images

Figure CN114356936B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of database technology, and in particular to a dimension table data processing method, device, electronic device and storage medium. Background Art
[0002] With the increasing development of Internet technology, the era of massive data has arrived. In the era of massive data, in order to observe data from multiple angles and multiple aspects, data can be stored in dimension tables.
[0003] In traditional technology, when querying data in a dimension table to perform data analysis on input data, it is often necessary to frequently and massively use access requests generated based on the RPC (Remote Procedure Call) protocol to request the data storage end to return the dimension table data. This results in frequent time spent waiting for the data storage end to return the results, which is not conducive to timely processing of data and reduces the throughput of computing operations.
[0004] Therefore, there is a problem of low throughput of computing operations in conventional technologies. Summary of the invention
[0005] The present disclosure provides a dimension table data processing method, device, electronic device and storage medium to at least solve the problem of low computing operation throughput in the related art. The technical solution of the present disclosure is as follows:
[0006] According to a first aspect of an embodiment of the present disclosure, a dimension table data processing method is provided, including:
[0007] Acquire and cache at least one piece of data to be associated; the data to be associated is data that needs to establish an association relationship with the dimension table;
[0008] If the cached data to be associated meets the preset batch query trigger condition, a dimension table query request is sent to the dimension table storage end; the dimension table query request includes a key value set composed of dimension table key values corresponding to each of the cached data to be associated;
[0009] receiving a dimension table set returned by the dimension table storage end in response to the dimension table query request; the dimension table set includes dimension tables matching the key values of each dimension table;
[0010] For any of the data to be associated, determining, in the dimension table set, a target dimension table that matches a dimension table key value corresponding to any of the data to be associated;
[0011] An association relationship between any of the data to be associated and the target dimension table is established to obtain an associated dimension table corresponding to each of the data to be associated.
[0012] In a possible implementation, after the step of acquiring and caching at least one piece of data to be associated, the method further includes: in response to a snapshot creation instruction for the associated dimension table, executing the step of sending a dimension table query request to a dimension table storage end, and after the step of establishing an association relationship between any of the data to be associated and the target dimension table and obtaining an associated dimension table corresponding to each of the data to be associated, executing a snapshot creation operation corresponding to the snapshot creation instruction on the associated dimension table to obtain a database snapshot of the associated dimension table at the current moment.
[0013] In a possible implementation, each of the database snapshots has a corresponding snapshot creation time, and the method further includes: in response to a data recovery request for the associated dimension table, obtaining a target database snapshot; the snapshot creation time corresponding to the target database snapshot is closest to the current time; and performing a data recovery operation according to the target database snapshot to obtain the associated dimension table after data recovery.
[0014] In one possible implementation, after the step of obtaining and caching at least one data to be associated, the method further includes: obtaining the number of cached data to be associated to obtain the amount of cached data; if the amount of cached data is greater than or equal to a preset data amount threshold, determining that the cached data to be associated meets the batch query trigger condition.
[0015] In a possible implementation, after the step of obtaining and caching at least one data to be associated, the method further includes: obtaining a batch query time point; and when the current moment reaches the batch query time point, determining that the cached data to be associated meets the batch query trigger condition.
[0016] In one possible implementation, the sending of the dimension table query request to the dimension table storage end includes: extracting the dimension table key values in each of the cached data to be associated; generating the dimension table query request according to a key value set composed of each of the dimension table key values; sending the dimension table query request to a batch query interface provided by the dimension table storage end; the batch query interface is used to respond to the dimension table query request to instruct the dimension table storage end to query and return dimension tables that match each of the dimension table key values.
[0017] In one possible implementation, the dimension table query request is generated based on a key value set composed of the key values of each dimension table, including: deduplicating the key values of each dimension table to obtain deduplicated key values; adding the deduplicated key values to the key value set; and generating a query request carrying the key value set to obtain the dimension table query request.
[0018] In a possible implementation, the acquiring and caching at least one piece of data to be associated includes: receiving the at least one piece of data to be associated as input; and caching each of the at least one piece of data to be associated in a target buffer.
[0019] According to a second aspect of an embodiment of the present disclosure, a dimension table data processing device is provided, including:
[0020] A cache unit is configured to execute acquisition and cache at least one piece of data to be associated; the data to be associated is data that needs to establish an association relationship with the dimension table;
[0021] A sending unit is configured to send a dimension table query request to a dimension table storage end if the cached data to be associated meets a preset batch query trigger condition; the dimension table query request includes a key value set consisting of dimension table key values corresponding to each of the cached data to be associated;
[0022] A receiving unit is configured to receive a dimension table set returned by the dimension table storage end in response to the dimension table query request; the dimension table set includes dimension tables matching the key values of each dimension table;
[0023] A determining unit is configured to determine, for any of the data to be associated, a target dimension table in the dimension table set that matches a dimension table key value corresponding to any of the data to be associated;
[0024] The establishing unit is configured to establish an association relationship between any of the to-be-associated data and the target dimension table, and obtain an associated dimension table corresponding to each of the to-be-associated data.
[0025] In a possible implementation, the device further includes: a snapshot creation unit, configured to execute, in response to a snapshot creation instruction for the associated dimension table, the step of sending a dimension table query request to a dimension table storage end, and after the step of establishing an association relationship between any of the to-be-associated data and the target dimension table and obtaining an associated dimension table corresponding to each of the to-be-associated data, perform a snapshot creation operation corresponding to the snapshot creation instruction on the associated dimension table to obtain a database snapshot of the associated dimension table at the current moment.
[0026] In a possible implementation, the device further includes: a data recovery unit configured to execute a data recovery request for the associated dimension table to obtain a target database snapshot; the snapshot creation time corresponding to the target database snapshot is closest to the current time; and a data recovery operation is performed according to the target database snapshot to obtain the associated dimension table after data recovery.
[0027] In one possible implementation, the device also includes: a first determination unit, configured to execute acquisition of the number of cached data to be associated, to obtain the amount of cached data; if the amount of cached data is greater than or equal to a preset data amount threshold, it is determined that the cached data to be associated meets the batch query trigger condition.
[0028] In a possible implementation, the device further includes: a second determination unit configured to execute acquisition of a batch query time point; and when the current moment reaches the batch query time point, determine that the cached data to be associated meets the batch query trigger condition.
[0029] In one possible implementation, the sending unit is specifically configured to extract dimension table key values from each of the cached data to be associated; generate the dimension table query request according to a key value set composed of each of the dimension table key values; send the dimension table query request to a batch query interface provided by the dimension table storage end; the batch query interface is used to respond to the dimension table query request to instruct the dimension table storage end to query and return a dimension table that matches each of the dimension table key values.
[0030] In one possible implementation, the sending unit is specifically configured to perform deduplication processing on each dimension table key value to obtain deduplicated key values; add the deduplicated key values to the key value set; generate a query request carrying the key value set to obtain the dimension table query request.
[0031] In a possible implementation, the cache unit is specifically configured to execute receiving the at least one piece of input data to be associated; and cache each of the at least one piece of input data to be associated in a target buffer.
[0032] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the dimension table data processing method as described in the first aspect or any possible implementation manner of the first aspect is implemented.
[0033] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the dimension table data processing method as described in the first aspect or any possible implementation manner of the first aspect is implemented.
[0034] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, the program product comprising a computer program, the computer program being stored in a readable storage medium, at least one processor of a device reading and executing the computer program from the readable storage medium, so that the device executes the dimension table data processing method described in any possible implementation manner of the first aspect.
[0035] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects: by acquiring and caching at least one piece of data to be associated that needs to establish an association relationship with the dimension table; if it is determined that the cached data to be associated meets the preset batch query trigger condition, a dimension table query request is sent to the dimension table storage end; the dimension table query request includes a key value set composed of dimension table key values corresponding to each cached data to be associated. In this way, it is possible to send dimension table query requests to the dimension table storage end in batches according to the cache status of the data to be associated; there is no need to initiate a corresponding dimension table query request to the dimension table storage end for each piece of data to be associated, which reduces the number of accesses to the dimension table storage end and alleviates the access pressure on the dimension table storage end;
[0036] At the same time, by receiving a dimension table set returned by the dimension table storage end in response to a dimension table query request; the dimension table set includes dimension tables that match the key values of each dimension table; for any data to be associated, in the dimension table set, a target dimension table that matches the dimension table key value corresponding to any data to be associated is determined, an association relationship between any data to be associated and the target dimension table is established, and an associated dimension table corresponding to each data to be associated is obtained; thereby, batch acquisition of associated dimension table data corresponding to batches of data to be associated is achieved, the number of times dimension table query requests are initiated to the dimension table storage end is reduced, and the situation in which the dimension table storage end needs to frequently spend time waiting for the result to be returned due to the need to frequently initiate dimension table query requests to the dimension table storage end is avoided, thereby achieving timely and accurate reception of dimension table data for associating with the data to be associated, and improving the throughput of computing operations.
[0037] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0039] Figure 1 The figure is a flowchart of a dimension table data processing method according to an exemplary embodiment.
[0040] Figure 2 The diagram is an interactive diagram of a dimension table data processing method according to an exemplary embodiment.
[0041] Figure 3 The figure is a block diagram of a device for processing dimension table data according to an exemplary embodiment.
[0042] Figure 4 It is a block diagram of an electronic device according to an exemplary embodiment.
[0043] Figure 5 is a block diagram of an electronic device according to another exemplary embodiment. DETAILED DESCRIPTION
[0044] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0045] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0046] It should also 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 display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0047] Figure 1 is a flowchart of a dimension table data processing method according to an exemplary embodiment. Figure 1 As shown, the dimension table data processing method is used in an electronic device and includes the following steps.
[0048] In step S110, at least one piece of data to be associated is obtained and cached.
[0049] The data to be associated is data that needs to establish an association relationship with the dimension table. In practical applications, the data to be associated may be, but is not limited to, original detailed data generated by executing business operations on the server and / or client.
[0050] Among them, the dimension table may include descriptive information of the data to be associated in different dimensions. For example, when the data to be associated is a web browsing data record of a user account, the dimension table associated with the data to be associated may include descriptive information of the web browsing data record in different dimensions, such as descriptive information of the web browsing data record in dimensions such as time dimension, region dimension, user dimension, etc. In a specific implementation, the electronic device may obtain the data to be associated and cache the data to be associated in an internal buffer. In order to facilitate the understanding of those skilled in the art, in actual applications, the electronic device may be named a dimension table association operator (MiniBatch Lookup Join) with batch query function.
[0051] For example, the electronic device may receive original detailed data generated by executing business operations through the server and / or the client, and the original detailed data may be a data record corresponding to a certain web browsing behavior of the user account, such as a specific web page corresponding to the web browsing behavior, web browsing duration corresponding to the web browsing behavior, occurrence time of the web browsing behavior, user corresponding to the web browsing behavior, region where the user corresponding to the web browsing behavior is located, etc. The electronic device caches the data record corresponding to the web browsing behavior in an internal buffer.
[0052] In step S120 , if the cached data to be associated meets the preset batch query triggering condition, a dimension table query request is sent to the dimension table storage end.
[0053] The dimension table query request includes a key value set consisting of dimension table key values corresponding to each cached data to be associated. In some embodiments, the batch query trigger condition includes at least one of the following: the amount of cached data is greater than or equal to a preset data amount threshold, and the current moment reaches a preset batch query time point.
[0054] In a specific implementation, the electronic device can determine the amount of cached data to be associated by determining the amount of cached data to be associated in the buffer, and determine whether the cached data to be associated meets the preset batch query trigger condition by determining whether the amount of cached data is greater than or equal to the preset data amount threshold, or determining whether the current moment reaches the preset batch query time point. When it is determined that the cached data to be associated has met the preset batch query trigger condition, the cached data to be associated will be treated as a batch, and the dimension table key value corresponding to each data to be associated will be determined according to the key identification information carried in each data to be associated, and the dimension table query request corresponding to the batch will be sent to the dimension table storage end according to the key value set composed of the dimension table key values.
[0055] For example, for a certain web browsing behavior of a user account, if the dimension table storage end uses the unique identification information of the dimension table data as the dimension table key value corresponding to the dimension table data, the electronic device can obtain the key identification information carried in the data to be associated, and use the key identification information as the dimension table key value corresponding to the data to be associated; for example, if the dimension table key value of the user dimension table is the user number, the electronic device obtains the user number from the data to be associated, and determines the dimension table key value corresponding to the data to be associated.
[0056] If the dimension table storage end does not use the unique identification information of the dimension table data as the dimension table key value corresponding to the dimension table data, then after the electronic device obtains the key identification information carried in the data to be associated, it can obtain the mapping relationship between the key identification information and the dimension table key value, and can determine the dimension table key value corresponding to the key identification information carried in the data to be associated, and obtain the dimension table key value corresponding to the data to be associated. In practical applications, the key identification information can be, but is not limited to, time identification information, region identification information, and user identification information; the dimension table key value can be, but is not limited to, a time dimension table key value, a region dimension table key value, and a user dimension table key value.
[0057] Step S130 , receiving a dimension table set returned by the dimension table storage end in response to the dimension table query request.
[0058] The dimension table set includes dimension tables that match the key values of each dimension table.
[0059] There may be multiple dimension table data matching one dimension table key value.
[0060] In a specific implementation, when the dimension table storage end receives a dimension table query request sent by an electronic device, it will query the dimension table matching each dimension table key value in the stored database according to the dimension table key value carried in the dimension table query request, and generate a dimension table set according to the dimension table matching each dimension table key value, and return the dimension table set to the electronic device, so that the electronic device can receive the dimension table set and obtain the dimension table matching each dimension table key value.
[0061] For example, it is known that the dimension table key value corresponding to a certain web browsing behavior data is P1, and P1 represents the user dimension table key value. The dimension table matching the dimension table key value P1 queried by the dimension table storage end may include descriptive information recording the web browsing behavior data under the user dimension; for example, the descriptive information included in the dimension table matching the dimension table key value P1 may be the user's name, gender, age, contact information, etc.
[0062] It is known that the dimension table key value corresponding to a certain web browsing behavior data is A1, and A1 represents the regional dimension table key value. The dimension table matching the dimension table key value A1 queried by the dimension table storage end may include descriptive information recording the web browsing behavior data under the regional dimension; for example, the descriptive information included in the dimension table matching the dimension table key value A1 may be provinces, cities, streets, etc.
[0063] Step S140: for any data to be associated, determine in the dimension table set a target dimension table that matches the dimension table key value corresponding to any data to be associated.
[0064] In a specific implementation, the electronic device can determine, for any cached data to be associated in the buffer, a target dimension table that matches the dimension table key value corresponding to any cached data to be associated in the received dimension table set based on a mapping relationship between the dimension table key value and the dimension table.
[0065] Step S150: Establish an association relationship between any data to be associated and the target dimension table, and obtain an associated dimension table corresponding to each data to be associated.
[0066] In a specific implementation, the dimension table association operator can establish an association relationship between the cached data to be associated and the target dimension table through the correspondence between each cached data to be associated and each dimension table key value, based on determining the target dimension table that matches the dimension table key value corresponding to any cached data to be associated, so that the associated dimension table corresponding to the cached data to be associated can be obtained, and the data to be associated and the associated dimension table with the established association relationship can be output to the user terminal where the operation user account is located, so that the operation user account can implement different business operations by analyzing the descriptive information of the data to be associated under different dimensions, for example, using the above descriptive information to implement content recommendation for the user account. Among them, since there may be multiple dimension tables matching the dimension table key value, a piece of data to be associated can have dimension table key values under different dimensions, and thus there may be multiple associated dimension table data corresponding to a piece of data to be associated.
[0067] The above-mentioned dimension table data processing method obtains and caches at least one piece of data to be associated that needs to establish an association relationship with the dimension table; if it is determined that the cached data to be associated meets the preset batch query trigger condition, a dimension table query request is sent to the dimension table storage end; the dimension table query request includes a key value set composed of dimension table key values corresponding to each cached data to be associated. In this way, it is possible to send dimension table query requests to the dimension table storage end in batches according to the cache status of the data to be associated; there is no need to initiate a corresponding dimension table query request to the dimension table storage end for each piece of data to be associated, which reduces the number of accesses to the dimension table storage end and alleviates the access pressure on the dimension table storage end;
[0068] At the same time, by receiving a dimension table set returned by the dimension table storage end in response to a dimension table query request; the dimension table set includes dimension tables that match the key values of each dimension table; for any data to be associated, in the dimension table set, a target dimension table that matches the dimension table key value corresponding to any data to be associated is determined, an association relationship between any data to be associated and the target dimension table is established, and an associated dimension table corresponding to each data to be associated is obtained; thereby, batch acquisition of associated dimension table data corresponding to batches of data to be associated is achieved, the number of times dimension table query requests are initiated to the dimension table storage end is reduced, and the situation in which the dimension table storage end needs to frequently spend time waiting for the result to be returned due to the need to frequently initiate dimension table query requests to the dimension table storage end is avoided, thereby achieving timely and accurate reception of dimension table data for associating with the data to be associated, and improving the throughput of computing operations.
[0069] In an exemplary embodiment, after the step of acquiring and caching at least one piece of data to be associated, the method further includes: in response to a snapshot creation instruction for the associated dimension table, executing a step of sending a dimension table query request to a dimension table storage end, and after the step of establishing an association relationship between any piece of data to be associated and a target dimension table and obtaining an associated dimension table corresponding to each piece of data to be associated, executing a snapshot creation operation corresponding to the snapshot creation instruction on the associated dimension table to obtain a database snapshot of the associated dimension table at the current moment.
[0070] In a specific implementation, when an electronic device receives a snapshot creation instruction for an associated dimension table, it will respond to the snapshot creation instruction and trigger a batch query in advance for all associated data cached in the current buffer, that is, calculate and determine the dimension table key values corresponding to all the data to be associated in the cache at the current moment, and generate a key value set, and send a dimension table query request containing the above key value set to the dimension table storage end according to the key value set. In this way, the dimension table returned by the dimension table storage end that matches the key values of each dimension table in the key value set can be obtained, and the associated dimension table corresponding to each data to be associated in the cache can be determined.
[0071] The electronic device executes a snapshot creation operation corresponding to the snapshot creation instruction for the associated dimension table corresponding to each data to be associated, obtains a database snapshot of the associated dimension table corresponding to each data to be associated at the current moment, and then can save the association processing result of the data to be associated at the current moment through the database snapshot, and the association processing result includes the dimension table key value corresponding to the data to be associated in the buffer, and the associated dimension table matching the dimension table key value in the dimension table storage end.
[0072] The technical solution of this embodiment executes the step of sending a dimension table query request to a dimension table storage end in response to a snapshot creation instruction for an associated dimension table, and after establishing an association relationship between any data to be associated and a target dimension table and obtaining the associated dimension table corresponding to each data to be associated, executes a snapshot creation operation corresponding to the snapshot creation instruction on the associated dimension table to obtain a database snapshot of the associated dimension table at the current moment; thus, a batch query is triggered in advance for the cached data to be associated, and then a snapshot creation operation is performed to obtain a database snapshot at the current moment; thus, before creating a database snapshot, it is ensured that all cached data to be associated in the buffer have been subjected to the dimension table association operation, and by saving the association processing results of each data to be associated at the current moment, it is convenient to restore the cached data to be associated to the state corresponding to the database snapshot creation moment after the job fails and is restarted, and obtain the association processing results corresponding to the data to be associated at the database snapshot creation moment, thereby realizing the backup of the association processing results and ensuring the reliability of the dimension table association processing for the data to be associated.
[0073] In an exemplary embodiment, each database snapshot has a corresponding snapshot creation time, and the method further includes: in response to a data recovery request for an associated dimension table, obtaining a target database snapshot; the snapshot creation time corresponding to the target database snapshot is closest to the current time; and performing a data recovery operation according to the target database snapshot to obtain an associated dimension table after data recovery.
[0074] In a specific implementation, different database snapshots have corresponding snapshot creation times. When an operation is abnormal and causes a failed restart, the electronic device will receive a data recovery request. In response to the data recovery request, the electronic device obtains a target database snapshot that was successfully created at the closest moment to the current moment, and the snapshot creation time of the target database snapshot is closest to the current moment. In some other embodiments, a quick creation time can also be freely selected to freely perform data recovery operations based on database snapshots at different creation times.
[0075] The electronic device can perform a data recovery operation according to the target data snapshot, restore the state of the electronic device to the state at the time when the target data snapshot was created, and obtain the association processing result of the data to be associated in the buffer at the time when the target data snapshot was created. The association processing result includes the dimension table key value corresponding to the data to be associated in the buffer, and the associated dimension table matching the dimension table key value in the dimension table storage end.
[0076] According to the technical solution of this embodiment, each database snapshot has a corresponding snapshot creation time, and a target database snapshot is obtained by responding to a data recovery request for an associated dimension table; the snapshot creation time corresponding to the target database snapshot is closest to the current time; a data recovery operation is performed according to the target database snapshot to obtain an associated dimension table after data recovery; in this way, when the data to be associated is still in the buffer and the step of sending a dimension table query request has not been executed, even if an abnormality occurs in the job, after the computing job fails and is restarted, the association processing result of the data to be associated in the buffer at the target data snapshot creation time can still be directly obtained through the target database snapshot, thereby avoiding the situation that the dimension table association processing of the data to be associated is repeated after the restart and the data to be associated is lost, thereby ensuring the effective processing of the data to be associated.
[0077] In an exemplary embodiment, after the step of obtaining and caching at least one data to be associated, the method further includes: obtaining the number of cached data to be associated to obtain the amount of cached data; if the amount of cached data is greater than or equal to a preset data amount threshold, determining that the cached data to be associated meets the batch query trigger condition.
[0078] The amount of cached data may be the number of cached data to be associated, or the size of cached data to be associated.
[0079] In a specific implementation, after the electronic device caches the received data to be associated, the number of cached data to be associated can be determined, and the amount of cached data can be obtained according to the number of cached data to be associated; wherein, the amount of cached data can be obtained directly according to the number of cached data to be associated, that is, the number of data items of cached data to be associated; or the data size of the cached data to be associated can be determined according to the data size of each item of cached data to be associated, so as to obtain the amount of cached data; when it is determined that the amount of cached data reaches a preset data amount threshold, it is determined that the cached data to be associated meets the batch query trigger condition, the cached data to be associated is taken as a batch, the cached data to be associated is analyzed, the dimension table key value corresponding to each cached data to be associated is determined, a key value set consisting of the dimension table key values corresponding to the cached data to be associated is obtained, and a dimension table query request including the key value set is sent to the dimension table storage end.
[0080] In actual applications, when the preset data volume threshold is the preset data number threshold, the cached data volume is the number of cached data to be associated; wherein the preset data volume threshold can be determined by weighing throughput and latency; for example, the preset data volume threshold can be 10,000. When the dimension association operator determines that the number of cached data to be associated reaches the preset data volume threshold, that is, the cached data reaches 10,000, it is determined that the cached data to be associated meets the batch query trigger condition, and the 10,000 cached data to be associated are taken as a batch, and the dimension table key values corresponding to the 10,000 cached data to be associated are analyzed and determined, thereby obtaining a key value set, and sending a dimension table query request including the key value set to the dimension table storage end.
[0081] When the preset data volume threshold is the preset data capacity threshold, the cached data volume is the data size of the cached data to be associated; wherein the preset data volume threshold may be any value, for example, the preset data volume threshold may be 1TB (Terabyte), the electronic device may obtain the amount of currently cached data to be associated, and determine the data size of the cached data to be associated according to the data size of each piece of cached data to be associated; when the data size of the cached data to be associated reaches 1TB, it is determined that the currently cached data to be associated meets the batch query trigger condition, the currently cached data to be associated is taken as a batch, the dimension table key value corresponding to the currently cached data to be associated is analyzed and determined, and a key value set is obtained, so that a dimension table query request including the key value set can be sent to the dimension table storage end.
[0082] The technical solution of this embodiment obtains the amount of cached data to be associated by acquiring the number of cached data to be associated; if the amount of cached data is greater than or equal to a preset data amount threshold, it is determined that the cached data to be associated meets the batch query trigger condition; in this way, by setting the preset data amount threshold, it is possible to determine whether the cached data to be associated meets the batch query trigger condition, thereby achieving a flexible definition of the batch query trigger condition and obtaining different batch query trigger strategies.
[0083] In an exemplary embodiment, after the step of acquiring and caching at least one data to be associated, the method further includes: acquiring a batch query time point; when the current moment reaches the batch query time point, determining whether the cached data to be associated meets the batch query trigger condition.
[0084] In some embodiments, the time interval between each two adjacent batch query time points is the same, that is, a batch query request is sent every certain period of time.
[0085] In a specific implementation, the time point when the electronic device starts to cache the data to be associated can be used as the time starting point, and a preset time interval can be set to obtain multiple time points as each batch query time point, and two adjacent batch query time points have the same preset time interval; when the current moment reaches the batch query node, it is determined that the cached data to be associated meets the batch query trigger condition, and the cached data to be associated is taken as a batch, and the batch of data to be associated is analyzed to determine the dimension table key value corresponding to each data to be associated, obtain a key value set composed of the dimension table key values, and send a dimension table query request including the key value set to the dimension table storage end.
[0086] In practical applications, the preset time interval can be determined by weighing throughput and latency. For example, the preset time interval can be 5 seconds, that is, when the electronic device starts caching the data to be associated, a batch query time point will be reached every 5 seconds, and it can be determined that the cached data to be associated meets the batch query trigger condition.
[0087] The technical solution of this embodiment is to obtain a batch query time point; when the current moment reaches the batch query time point, determine whether the cached data to be associated meets the batch query trigger condition; in this way, by setting a preset batch query time point, it can be determined whether the current moment reaches the batch query time point, so as to determine whether the cached data to be associated meets the batch query trigger condition, thereby realizing a flexible definition of the batch query trigger condition and obtaining different batch query trigger strategies.
[0088] In an exemplary embodiment, sending a dimension table query request to a dimension table storage end includes: extracting dimension table key values in each cached data to be associated; generating a dimension table query request according to a key value set composed of each dimension table key value; and sending the dimension table query request to a batch query interface provided by the dimension table storage end.
[0089] The batch query interface is used to respond to the dimension table query request and instruct the dimension table storage end to query and return the dimension table that matches the key value of each dimension table.
[0090] In one embodiment, the batch query interface is an interface of a dimension table connector corresponding to a target database in a dimension table storage end.
[0091] The dimension table connector is used to connect to the dimension table storage end and send a dimension table query instruction to the dimension table storage end.
[0092] For example, the dimension connector can be but is not limited to a Redis connector or an HBase connector. Different dimension table connectors correspond to different target databases in the dimension table storage end; for example, a Redis connector corresponds to a Redis database, and an HBase connector corresponds to an HBase database; wherein the target database stores the dimension table.
[0093] In a specific implementation, the electronic device can determine the dimension table key value corresponding to the data to be associated based on the key identification information carried in the cached data to be associated, and extract the dimension table key value in each cached data to be associated. In this way, a key value set can be formed according to each dimension table key value, and a dimension table query request including the key value set can be generated according to the key value set, and the dimension table query request can be sent to a batch query interface of the dimension table connector; wherein the dimension table connector is a dimension table connector corresponding to the target database in the dimension table storage end; the batch query interface responds to the dimension table query request, so that the dimension table connector can determine the key value set in the dimension table query request, generate a dimension table query instruction including the key value set according to the key value set, and send the dimension table query instruction to the dimension table storage end, so that the dimension table storage end can query the dimension table matching each dimension table key value in the target database corresponding to the dimension table connector, and send the dimension table matching each dimension table key value to the dimension table connector.
[0094] At the same time, the dimension table connector is also used to receive the dimension tables matching the key values of each dimension table returned by the dimension table storage end, obtain a dimension table set, and return the dimension table set to the electronic device through a batch query interface.
[0095] The technical solution of this embodiment is as follows: when sending a dimension table query request to the dimension table storage end, dimension table key values in each cached data to be associated are extracted; a dimension table query request is generated according to a key value set composed of each dimension table key value; and the dimension table query request is sent to a batch query interface provided by the dimension table storage end. In this way, a connection can be established with the dimension table storage end by calling the batch query interface, so that the associated dimension table corresponding to the data to be associated returned by the dimension table storage end can be obtained, which is conducive to data analysis of different dimensions of the data to be associated.
[0096] In an exemplary embodiment, a dimension table query request is generated based on a key value set composed of key values of each dimension table, including: deduplicating the key values of each dimension table to obtain deduplicated key values; adding the deduplicated key values to the key value set; generating a query request carrying the key value set to obtain a dimension table query request.
[0097] In a specific implementation, the electronic device can determine the dimension table key value corresponding to the cached data to be associated. Since there are multiple cached data to be associated with the same dimension table key value, it is necessary to deduplicate the repeated dimension table key values so that only one identical dimension table key value is retained, thereby obtaining the deduplicated key value, and adding the deduplicated key value to the key value set so that there are no duplicate dimension table key values in the key value set. Then, a query request carrying the key value set can be generated based on the key value set, and the query request carrying the key value set can be used as a dimension table query request.
[0098] In actual applications, since the electronic device only needs to perform one read and write state operation for the data to be associated corresponding to the same dimension table key value, the greater the repetition rate of the dimension table key value corresponding to the cached data to be associated, the lower the state access frequency of the electronic device to the cached data to be associated, thereby improving the throughput for real-time operations.
[0099] The technical solution of this embodiment is as follows: when generating a dimension table query request according to a key value set composed of key values of each dimension table, deduplication processing is performed on the key values of each dimension table to obtain deduplicated key values; the deduplicated key values are added to the key value set; a query request carrying the key value set is generated to obtain a dimension table query request; in this way, the key value set in the query request sent to the dimension table storage end does not include repeated dimension table key values, which can reduce the amount of data sent to the dimension table storage end; at the same time, when a dimension table matching the dimension table key values corresponding to each data to be associated is received, the target dimension table corresponding to the data to be associated with the same dimension table key value can be directly determined, which reduces the read and write status access to the data to be associated, thereby improving the throughput.
[0100] In an exemplary embodiment, obtaining and caching at least one piece of data to be associated includes: receiving at least one piece of input data to be associated; and caching at least one piece of data to be associated in a target buffer.
[0101] The target buffer is a buffer inside the electronic device.
[0102] In a specific implementation, when the electronic device receives at least one input data to be associated, it does not immediately process the data to be associated, but stores the data to be associated in a target buffer, that is, stores the received data to be associated in a buffer inside the electronic device to obtain cached data to be associated, until the cached data to be associated meets the preset batch query trigger condition.
[0103] The technical solution of this embodiment, when acquiring and caching at least one piece of data to be associated, receives at least one piece of input data to be associated; caches at least one piece of data to be associated in a target buffer; thus, caching of the data to be associated is achieved, and a batch of cached data to be associated can be obtained, avoiding frequent sending of dimension table query requests to the dimension table storage end for each piece of data to be associated, thereby reducing the access pressure on the dimension table storage end.
[0104] In an application embodiment, in order to facilitate understanding by those skilled in the art, Figure 2 An interactive schematic diagram of a dimension table data processing method is provided. In a specific application, a Query Hint is indicated in a SQL (Structured Query Language) query statement so that the SQL optimizer turns on the batch optimization function of the dimension table association operator, and obtains a dimension table association operator with a batch optimization function. At the same time, a data source (Mini-Batch Lookup Source) that can be queried by key values and supports batch queries is introduced, that is, it supports receiving a key value set composed of multiple dimension table key values, returns a dimension table set composed of dimension tables that match the key values of each dimension table in the key value set, and is configured in a dimension table connector. The dimension table connector supports one-by-one queries, batch queries, and one-by-one queries and batch queries. For example, the Hbase connector and the Redis connector support both one-by-one queries of the data to be associated and batch queries of the data to be associated. This embodiment is described by taking the case where the dimension table connector is a Redis connector as an example, and the data source configured by the Redis connector is the RedisMini-Batch Lookup Source.
[0105] When the dimension table association operator obtains at least one input data to be associated (for example, data 1, data 2, data 3, etc.), it will cache the data to be associated in an internal buffer (Cache), and obtain the number of data to be associated in the buffer to obtain the amount of cached data; determine whether the amount of cached data is greater than or equal to a preset data amount threshold; when it is determined that the amount of cached data is greater than or equal to the preset data amount threshold, it is determined that the cached data to be associated meets the batch query trigger condition; or, the dimension table association operator can determine whether the current moment reaches the batch query time point, and when it is determined that the current moment reaches the batch query time point, it is determined that the cached data to be associated meets the batch query trigger condition; wherein, any two adjacent batch query times have the same preset time interval.
[0106] When it is determined that the data to be associated in the buffer meets the preset batch query trigger condition, the dimension table key value corresponding to the data to be associated in the buffer can be determined, and the duplicate dimension table key values can be deduplicated to obtain the deduplicated key values, and the deduplicated key values are added to the key value set, so that there are no duplicate dimension table key values in the key value set, and a dimension table query request is generated according to the key value set; the batch query interface of the Redis connector is called, and the dimension table query request carrying the key value set is sent to the dimension table storage end.
[0107] Specifically, the dimension table association operator can send a dimension table query request to the batch query interface of the Redis connector, so that the Redis connector can respond to the dimension table query request, generate a dimension table query instruction according to the key value set and send it to the dimension table storage end; so that the dimension table storage end can query the dimension table data that matches the key values of each dimension table in the key value set in the Redis database corresponding to the Redis connector, obtain the dimension table set, and send the dimension table set to the Redis connector; so that the Redis connector can return the dimension table set to the dimension table association operator through the batch query interface; so that the dimension table association operator can determine the target dimension table that matches the dimension table key value corresponding to each data to be associated in the buffer from the dimension table set, establish an association relationship between the data to be associated and the target dimension table, obtain the associated dimension table corresponding to the data to be associated, and output the data to be associated and the associated dimension table with the established association relationship as output results (output1, output2, output3) to the user terminal where the operating user account is located.
[0108] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0109] It can be understood that the same / similar parts between the various embodiments of the above method in this specification can refer to each other, and each embodiment focuses on the differences from other embodiments. For related points, please refer to the description of other method embodiments.
[0110] Figure 3FIG. 1 is a block diagram of a dimension table data processing device according to an exemplary embodiment. Figure 3 The device includes a cache unit 310, a sending unit 320, a receiving unit 330, a determining unit 340 and an establishing unit 350.
[0111] The cache unit 310 is configured to execute acquisition and cache at least one piece of data to be associated; the data to be associated is data that needs to establish an association relationship with the dimension table.
[0112] The sending unit 320 is configured to execute, if the cached data to be associated meets the preset batch query trigger condition, sending a dimension table query request to the dimension table storage end; the dimension table query request includes a key value set consisting of dimension table key values corresponding to each of the cached data to be associated.
[0113] The receiving unit 330 is configured to receive a dimension table set returned by the dimension table storage end in response to the dimension table query request; the dimension table set includes dimension tables that match the key values of each dimension table.
[0114] The determining unit 340 is configured to determine, for any of the data to be associated, a target dimension table in the dimension table set that matches a dimension table key value corresponding to the any of the data to be associated.
[0115] The establishing unit 350 is configured to establish an association relationship between any of the to-be-associated data and the target dimension table, and obtain an associated dimension table corresponding to each of the to-be-associated data.
[0116] In an exemplary embodiment, the device further includes: a snapshot creation unit, configured to execute, in response to a snapshot creation instruction for the associated dimension table, the step of sending a dimension table query request to a dimension table storage end, and after the step of establishing an association relationship between any of the data to be associated and the target dimension table and obtaining the associated dimension table corresponding to each of the data to be associated, perform a snapshot creation operation corresponding to the snapshot creation instruction on the associated dimension table to obtain a database snapshot of the associated dimension table at the current moment.
[0117] In an exemplary embodiment, the device further includes: a data recovery unit configured to execute a data recovery request for the associated dimension table, obtain a target database snapshot; the snapshot creation time corresponding to the target database snapshot is closest to the current time; and perform a data recovery operation according to the target database snapshot to obtain the associated dimension table after data recovery.
[0118] In an exemplary embodiment, the device also includes: a first determination unit, configured to execute acquisition of the number of cached data to be associated to obtain the amount of cached data; if the amount of cached data is greater than or equal to a preset data amount threshold, it is determined that the cached data to be associated meets the batch query trigger condition.
[0119] In an exemplary embodiment, the device further includes: a second determination unit configured to execute obtaining a batch query time point; when the current moment reaches the batch query time point, determine whether the cached data to be associated meets the batch query trigger condition.
[0120] In an exemplary embodiment, the sending unit 320 is specifically configured to extract the dimension table key values in each of the cached data to be associated; generate the dimension table query request according to the key value set composed of each of the dimension table key values; send the dimension table query request to the batch query interface provided by the dimension table storage end; the batch query interface is used to respond to the dimension table query request to instruct the dimension table storage end to query and return the dimension table that matches each of the dimension table key values.
[0121] In an exemplary embodiment, the sending unit 320 is specifically configured to perform deduplication processing on each dimension table key value to obtain deduplicated key values; add the deduplicated key values to the key value set; generate a query request carrying the key value set to obtain the dimension table query request.
[0122] In an exemplary embodiment, the cache unit 310 is specifically configured to receive the at least one piece of input data to be associated; and cache each of the at least one piece of input data to be associated in a target buffer.
[0123] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0124] Figure 4 4 is a block diagram of an electronic device 400 for executing the above-mentioned dimension table data processing method according to an exemplary embodiment. For example, the electronic device 400 may be a server. Figure 4 , the electronic device 400 includes a processing component 420, which further includes one or more processors, and a memory resource represented by a memory 422 for storing instructions that can be executed by the processing component 420, such as an application. The application stored in the memory 422 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 420 is configured to execute instructions to perform the above method.
[0125] The electronic device 400 may further include a power supply component 424 configured to perform power management of the electronic device 400, a wired or wireless network interface 426 configured to connect the electronic device 400 to a network, and an input / output (I / O) interface 428. The electronic device 400 may operate based on an operating system stored in the memory 422, such as Window4 4erver, Mac O4 X, Unix, Linux, FreeB4D or the like.
[0126] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 422 including instructions, and the above instructions can be executed by a processor of the electronic device 400 to complete the above method. The storage medium can be a computer-readable storage medium, for example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0127] In an exemplary embodiment, a computer program product is further provided. The computer program product includes instructions. The instructions can be executed by a processor of the electronic device 400 to complete the above method.
[0128] Figure 5 1 is a block diagram of an electronic device 500 for executing the above-mentioned dimension table data processing method according to another exemplary embodiment. For example, the electronic device 500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0129] Reference Figure 5 , the electronic device 500 may include one or more of the following components: a processing component 502 , a memory 504 , a power component 506 , a multimedia component 508 , an audio component 510 , an input / output (I / O) interface 512 , a sensor component 514 , and a communication component 516 .
[0130] The processing component 502 generally controls the overall operation of the electronic device 500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 502 may include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.
[0131] The memory 504 is configured to store various types of data to support operations on the electronic device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phone book data, messages, pictures, videos, etc. The memory 504 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, optical disk, or graphene memory.
[0132] The power supply component 506 provides power to the various components of the electronic device 500. The power supply component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 500.
[0133] The multimedia component 508 includes a screen that provides an output interface between the electronic device 500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. When the electronic device 500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0134] The audio component 510 is configured to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC), and when the electronic device 500 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 504 or sent via the communication component 516. In some embodiments, the audio component 510 also includes a speaker for outputting an audio signal.
[0135] I / O interface 512 provides an interface between processing component 502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0136] The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the electronic device 500. For example, the sensor assembly 514 can detect the open / closed state of the electronic device 500, the relative positioning of the components, such as the display and keypad of the electronic device 500, and the sensor assembly 514 can also detect the position change of the electronic device 500 or the components of the electronic device 500, the presence or absence of contact between the user and the electronic device 500, the orientation or acceleration / deceleration of the device 500, and the temperature change of the electronic device 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 514 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0137] The communication component 516 is configured to facilitate wired or wireless communication between the electronic device 500 and other devices. The electronic device 500 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0138] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0139] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, and the above instructions can be executed by the processor 520 of the electronic device 500 to perform the above method. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0140] In an exemplary embodiment, a computer program product is further provided. The computer program product includes instructions. The instructions can be executed by the processor 520 of the electronic device 500 to complete the above method.
[0141] It should be noted that the above-mentioned devices, electronic devices, computer-readable storage media, computer program products, etc. may also include other implementation methods according to the description of the method embodiments. The specific implementation methods can refer to the description of the relevant method embodiments, which will not be described one by one here.
[0142] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0143] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A dimension table data processing method, characterized in that: include: Obtain and cache at least one piece of data to be associated; The data to be associated is data that needs to establish an association relationship with the dimension table; If the cached data to be associated meets the preset batch query trigger condition, a dimension table query request is sent to the dimension table storage end; the dimension table query request includes a key value set composed of dimension table key values corresponding to each of the cached data to be associated; Receiving a dimension table set returned by the dimension table storage end in response to the dimension table query request; the dimension table set includes dimension tables matching the key values of each dimension table; For any of the data to be associated, determining, in the dimension table set, a target dimension table that matches a dimension table key value corresponding to any of the data to be associated; An association relationship between any of the data to be associated and the target dimension table is established to obtain an associated dimension table corresponding to each of the data to be associated.
2. The dimension table data processing method according to claim 1, characterized in that: After the step of acquiring and caching at least one piece of data to be associated, the method further includes: In response to the snapshot creation instruction for the associated dimension table, the step of sending the dimension table query request to the dimension table storage end is executed, and after the step of establishing an association relationship between any of the to-be-associated data and the target dimension table and obtaining the associated dimension table corresponding to each of the to-be-associated data, a snapshot creation operation corresponding to the snapshot creation instruction is executed on the associated dimension table to obtain a database snapshot of the associated dimension table at the current moment.
3. The dimension table data processing method according to claim 2, characterized in that: Each of the database snapshots has a corresponding snapshot creation time, and the method further includes: In response to a data recovery request for the associated dimension table, a target database snapshot is acquired; the snapshot creation time corresponding to the target database snapshot is closest to the current time; A data recovery operation is performed according to the target database snapshot to obtain an associated dimension table after data recovery.
4. The dimension table data processing method according to claim 1, characterized in that: After the step of acquiring and caching at least one data to be associated, the method further includes: Obtaining the number of cached data to be associated, and obtaining the amount of cached data; If the cached data volume is greater than or equal to a preset data volume threshold, it is determined that the cached data to be associated meets the batch query triggering condition.
5. The dimension table data processing method according to claim 1, characterized in that: After the step of acquiring and caching at least one data to be associated, the method further includes: Get batch query time point; When the current time reaches the batch query time point, it is determined that the cached data to be associated meets the batch query triggering condition.
6. The dimension table data processing method according to claim 1, characterized in that: The step of sending the dimension table query request to the dimension table storage end includes: Extracting dimension table key values from each of the cached data to be associated; Generate the dimension table query request according to the key value set composed of the dimension table key values; The dimension table query request is sent to a batch query interface provided by the dimension table storage end; the batch query interface is used to respond to the dimension table query request to instruct the dimension table storage end to query and return dimension tables that match the dimension table key values.
7. The dimension table data processing method according to claim 6, characterized in that: The step of generating the dimension table query request according to the key value set composed of the key values of each dimension table includes: Deduplication processing is performed on the key values of each dimension table to obtain deduplicated key values; Adding the deduplicated key value to the key value set; A query request carrying the key value set is generated to obtain the dimension table query request.
8. The dimension table data processing method according to any one of claims 1 to 7, characterized in that: The obtaining and caching at least one piece of data to be associated includes: receiving the at least one piece of data to be associated; The at least one piece of data to be associated is cached in a target buffer.
9. A dimension table data processing device, characterized in that: include: A cache unit, configured to execute acquisition and cache at least one piece of data to be associated; The data to be associated is data that needs to establish an association relationship with the dimension table; A sending unit is configured to send a dimension table query request to a dimension table storage end if the cached data to be associated meets a preset batch query trigger condition; the dimension table query request includes a key value set consisting of dimension table key values corresponding to each of the cached data to be associated; A receiving unit is configured to receive a dimension table set returned by the dimension table storage end in response to the dimension table query request; the dimension table set includes dimension tables matching the key values of each dimension table; A determining unit is configured to determine, for any of the data to be associated, a target dimension table in the dimension table set that matches a dimension table key value corresponding to any of the data to be associated; The establishing unit is configured to establish an association relationship between any of the to-be-associated data and the target dimension table, and obtain an associated dimension table corresponding to each of the to-be-associated data.
10. The dimension table data processing device according to claim 9, characterized in that: The device further includes: a snapshot creation unit configured to execute, in response to the snapshot creation instruction for the associated dimension table, the step of sending the dimension table query request to the dimension table storage end, and after the step of establishing the association relationship between any of the to-be-associated data and the target dimension table and obtaining the associated dimension table corresponding to each of the to-be-associated data, perform a snapshot creation operation corresponding to the snapshot creation instruction on the associated dimension table to obtain a database snapshot of the associated dimension table at the current moment.
11. The dimension table data processing device according to claim 10, characterized in that: The device also includes: a data recovery unit, configured to execute a data recovery request for the associated dimension table, obtain a target database snapshot; the snapshot creation time corresponding to the target database snapshot is closest to the current time; and perform a data recovery operation according to the target database snapshot to obtain the associated dimension table after data recovery.
12. The dimension table data processing device according to claim 9, characterized in that: The device also includes: a first determination unit, configured to execute acquisition of the number of cached data to be associated to obtain the amount of cached data; if the amount of cached data is greater than or equal to a preset data amount threshold, determine that the cached data to be associated meets the batch query trigger condition.
13. The dimension table data processing device according to claim 9, characterized in that: The device further includes: a second determination unit configured to execute obtaining a batch query time point; and when the current time reaches the batch query time point, determine that the cached data to be associated meets the batch query triggering condition.
14. The dimension table data processing device according to claim 9, characterized in that: The sending unit is specifically configured to extract dimension table key values from each cached data to be associated; and generate the dimension table query request according to a key value set composed of each dimension table key value; The dimension table query request is sent to a batch query interface provided by the dimension table storage end; the batch query interface is used to respond to the dimension table query request to instruct the dimension table storage end to query and return dimension tables that match the dimension table key values.
15. The dimension table data processing device according to claim 14, characterized in that: The sending unit is specifically configured to perform deduplication processing on each dimension table key value to obtain deduplicated key values; add the deduplicated key values to the key value set; generate a query request carrying the key value set to obtain the dimension table query request.
16. The dimension table data processing device according to any one of claims 9 to 15, characterized in that: The cache unit is specifically configured to execute receiving the at least one piece of input data to be associated; and cache each of the at least one piece of input data to be associated in a target buffer.
17. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the dimension table data processing method according to any one of claims 1 to 8.
18. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the dimension table data processing method according to any one of claims 1 to 8.
19. A computer program product, comprising instructions, characterized in that: When the instruction is executed by a processor of an electronic device, the electronic device is enabled to execute the dimension table data processing method as described in any one of claims 1 to 8.
