Data management method, device, server and storage medium
By dividing data management objects into sets and using clustering algorithms to attribute objects with similar amounts of data, the problem of performance degradation caused by too many partitions in the data warehouse is solved and the processing efficiency of the data warehouse is improved.
Patent Information
- Application Number
- CN202110327438.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-26
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-03-26
AI Technical Summary
In a data warehouse, when there are a large number of objects, allocating independent storage partitions for each object results in too many partitions, generates a large number of distributed tasks and small files, and reduces the performance of the data warehouse.
By dividing multiple data management objects into data management object collections, and allocating storage partitions to each collection, a clustering algorithm is used to attribute objects with similar data volumes to the same collection, reducing the number of partitions and the number of distributed tasks.
It reduces the number of partitions in the data warehouse and the number of small files generated, improves the performance of the data warehouse, and avoids performance degradation caused by too many partitions.
Smart Images

Figure CN113515520B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of operation and maintenance, and specifically to a data management method, device, server and storage medium. Background Art
[0002] When using the data table in the data warehouse to store multiple objects, such as data of multiple apps, in order to avoid scanning the entire data table when querying data and improve query speed, the data table needs to be partitioned during the process of managing the object data.
[0003] At present, the commonly used method is: take objects as units, allocate respective storage partitions for each object, store the object data in the object storage partition, generate corresponding distributed tasks for storing data through the data warehouse tool Hive, so as to store the object data in the corresponding partition, and generate corresponding distributed tasks for querying data, so as to query the corresponding data from the corresponding partition.
[0004] However, when there are many objects, allocating a storage partition for each object will result in a large number of partitions. Since any data storage process or data query process for any partition requires the data warehouse tool Hive to generate corresponding distributed tasks, and each distributed task will generate a certain number of small files during execution, a large number of partitions will result in too many distributed tasks and too many small files. Processing small files will take up too many resources, which will eventually reduce the performance of the data warehouse. Summary of the invention
[0005] In order to overcome the problems existing in the related art, the present disclosure provides a data management method, device, server and storage medium, so as to at least solve the problems in the related art that a large number of partitions leads to an excessive number of distributed tasks, an excessive number of small files, and reduced performance of the data warehouse. The technical solution of the present disclosure is as follows:
[0006] According to a first aspect of an embodiment of the present disclosure, there is provided a data management method, including:
[0007] receiving a data storage request, the data storage request comprising: a first name field of a first data management object among one or more data management objects, and data of the first data management object;
[0008] Determine, according to the first name field, a second name field in the name field of the data management object set that matches the first name field;
[0009] Determine a target partition field corresponding to the second name field according to the correspondence between the name field and the partition field of the data management object set;
[0010] The data of the first data management object is stored in the storage partition identified by the target partition field.
[0011] In some embodiments, before receiving the data storage request, the method further includes:
[0012] Based on data volume information of each of the one or more data management objects, dividing the one or more data management objects into one or more data management object sets;
[0013] Generate a name field for each data management object set, wherein for each data management object set, the name field of each data management object in the data management object set has an associated relationship with the name field of the data management object set;
[0014] Allocating a storage partition for each data management object set, and generating a partition field for the storage partition of each data management object set;
[0015] For each data management object set, a correspondence between the name field of the data management object set and the partition field of the storage partition of the data management object set is generated.
[0016] In some embodiments, dividing the one or more data management objects into one or more data management object sets based on the data volume information of each of the one or more data management objects includes:
[0017] Clustering the data volume information of the one or more data management objects using a preset clustering algorithm to obtain one or more clustering results;
[0018] For each clustering result in the one or more clustering results, the data management object to which each piece of data volume information in the clustering result belongs is divided into the same data management object set.
[0019] In some embodiments, the method further comprises:
[0020] receiving a data query request, the data query request comprising: a second name field of a second data management object;
[0021] Execute a data query operation, the data query operation comprising: determining a third name field in the name field of a data management object set that matches the second name field based on the second name field of the second data management object; determining a partition field corresponding to the third name field based on the correspondence between the name field and the partition field of the data management object set; and searching for data of the second data management object from a storage partition identified by the partition field corresponding to the third name field.
[0022] In some embodiments, the data storage operation is performed by a first custom data warehouse tool function, and the data storage operation includes: determining, based on the first name field, a second name field in the name field of a data management object set that matches the first name field; determining, based on the correspondence between the name field and the partition field of the data management object set, a target partition field corresponding to the second name field; storing the data of the first data management object in the storage partition identified by the target partition field, and the data query operation is performed by a second custom data warehouse tool function
[0023] According to a second aspect of an embodiment of the present disclosure, there is provided a data management device, including:
[0024] A receiving module is configured to receive a data storage request, wherein the data storage request includes: a first name field of a first data management object among one or more data management objects, and data of the first data management object;
[0025] A first determining module is configured to determine, based on the first name field, a second name field in the name field of the data management object set that matches the first name field;
[0026] A second determination module is configured to determine a target partition field corresponding to the second name field according to a correspondence between the name field and the partition field of the data management object set;
[0027] A storage module is configured to store the data of the first data management object in the storage partition identified by the target partition field.
[0028] In some embodiments, the apparatus further comprises:
[0029] The preprocessing module is configured to, before receiving a data storage request, divide the one or more data management objects into multiple data management object sets based on the data volume information of each data management object in the one or more data management objects; generate a name field for each data management object set, wherein, for each data management object set, the name field of each data management object in the data management object set has an associated relationship with the name field of the data management object set; allocate storage partitions for each data management object set, and generate partition fields for the storage partitions of each data management object set; for each data management object set, generate a correspondence between the name field of the data management object set and the partition fields of the storage partitions of the data management object set.
[0030] In some embodiments, the preprocessing module is further configured to use a preset clustering algorithm to cluster the data volume information of the one or more data management objects to obtain one or more clustering results; for each of the one or more clustering results, the data management objects to which each data volume information in the clustering results belongs are divided into the same data management object set.
[0031] In some embodiments, the apparatus further comprises:
[0032] A data query module is configured to receive a data query request, the data query request including: a second name field of a second data management object; perform a data query operation, the data query operation including: determining a third name field in a name field of a data management object set that matches the second name field based on the second name field of the second data management object; determining a partition field corresponding to the third name field based on a correspondence between the name field and the partition field of the data management object set; and searching for data of the second data management object from a storage partition identified by the partition field corresponding to the third name field.
[0033] In some embodiments, the data storage operation is performed by a first custom data warehouse tool function, and the data storage operation includes: determining, based on the first name field, a second name field in the name field of a data management object set that matches the first name field; determining, based on the correspondence between the name field and the partition field of the data management object set, a target partition field corresponding to the second name field; storing the data of the first data management object in the storage partition identified by the target partition field, and the data query operation is performed by a second custom data warehouse tool function.
[0034] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0035] The data of any first data management object belonging to the same data management set are all stored in the storage partition of the data management object set. Compared with allocating storage partitions to each object on an object basis, storing the object's data in the object's storage partition can reduce the number of partitions in the data table, thereby reducing the number of distributed tasks generated in the process of managing the data of the data management object, reducing the number of small files generated, and avoiding the situation where the performance of the data warehouse is ultimately reduced due to too many partitions. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0037] Figure 1 It is a schematic diagram of an architecture of an application scenario of a data management method provided by the present disclosure;
[0038] Figure 2 is a flow chart of an embodiment of a data management method according to an exemplary embodiment;
[0039] Figure 3 is a flow chart of another embodiment of a data management method according to an exemplary embodiment;
[0040] Figure 4 It is a schematic diagram of the effect of dividing the interval between the minimum data volume and the maximum data volume into multiple sub-intervals;
[0041] Figure 5 is a structural block diagram of a data management device according to an exemplary embodiment;
[0042] Figure 6 The figure is a structural block diagram of a server according to an exemplary embodiment. DETAILED DESCRIPTION
[0043] 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.
[0044] 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.
[0045] Figure 1 It is a schematic diagram of the architecture of an application scenario of a data management method provided by the present disclosure.
[0046] exist Figure 1 In the figure, there are shown a device generating data of data management object 1, a device generating data of data management object 2, ... a device generating data of data management object N. The device generating data of data management object 1 can send a data storage request including the name field of data management object 1 and the generated data of data management object 1 to the server, the device generating data of data management object 2 can send a data storage request including the name field of data management object 2 and the generated data of data management object 2 to the server, and the device generating data of data management object N can send a data storage request including the name field of data management object N and the generated data of data management object N to the server.
[0047] The server determines the storage partition in the data table in the data warehouse according to the name field of the corresponding data management object in the received data storage request, and stores the data of the data management object in the received data storage request in the determined storage partition.
[0048] exist Figure 1 Only one server in the server cluster for data management is exemplarily shown in FIG. Each server in the server cluster for data management receives a storage request for a corresponding data management object sent by a corresponding device, and stores the data of the corresponding data management object in a corresponding storage partition.
[0049] Figure 2 FIG. 2 is a flow chart of an embodiment of a data management method according to an exemplary embodiment. The method can be executed by a server, and the method at least includes the following steps 201-204.
[0050] Step 201: Receive a data storage request.
[0051] In the present disclosure, the data management object may be an application such as an APP (Application). The data storage request includes: a first name field of a first data management object among one or more data management objects, and data of the first data management object.
[0052] Step 202: Determine, according to the first name field of the first data management object, a second name field in the name field of the data management object set that matches the first name field.
[0053] In the present application, each data management object set has a name field. For each data management object set, the name field of the data management object set and the name field of each data management object in the data management object set can be preset, and the name field of each data management object in the data management object set is associated with the name field of the data management object set. Thus, for each data management object set, the name field of each data management object in the data management object set is associated with the name field of the data management object set.
[0054] In the present disclosure, for the name field of a data management object and the name field of a data management object set, if the name field of the data management object and the name field of the data management object set have an association relationship, then it can be considered that the name field of the data management object and the name field of the data management object set match.
[0055] In the present disclosure, after receiving a data storage request, a second name field in the name field of a data management object set that matches the first name field can be determined based on the first name field. Since the first name field of the first data management object has an association relationship with the name field of the data management object set to which the first data management object belongs, the first name field of the first data management object matches the name field of the data management object set to which the first data management object belongs. The second name field in the name field of the determined data management object set that matches the first name field is actually the name field of the data management object set to which the first data management object belongs.
[0056] Step 203: Determine the target partition field corresponding to the second name field according to the correspondence between the name field and the partition field of the data management object set.
[0057] In the present disclosure, each data management object set has a storage partition. For each data management object set, the data of each data management object in the data management object set is stored in the storage partition of the data management object set.
[0058] In the present disclosure, in the correspondence between the name field and the partition field of the data management object set, for each data management object set, the name field of the data management object set corresponds to the partition field of the storage partition of the data management object set. When determining the target partition field corresponding to the second name field based on the correspondence between the name field and the partition field of the data management object set, the partition field corresponding to the second name field in the correspondence between the name field and the partition field of the data management object set can be determined as the target partition field corresponding to the second name field.
[0059] Step 204: Store the data of the first data management object in the storage partition identified by the target partition field.
[0060] In the present disclosure, after determining the target partition field corresponding to the second name field based on the correspondence between the name field and the partition field of the data management object set, a distributed task for writing data to the corresponding partitions in the data table can be generated by using the function provided by the data warehouse tool Hive for writing data to the corresponding partitions in the data table, and the data of the first data management object can be written to the storage partition identified by the target partition field corresponding to the second name field, so as to store the data of the first data management object in the storage partition identified by the target partition field corresponding to the second name field.
[0061] In the present disclosure, the data of any first data management object belonging to the same data management set are all stored in the storage partition of the data management object set. Compared with allocating storage partitions to each data management object on a data management object basis, storing the data of the data management object in the storage partition of the data management object can reduce the number of partitions in the data table of the data warehouse, thereby reducing the number of distributed tasks generated in the process of managing the data of the data management object, reducing the number of small files generated, and avoiding the situation where the performance of the data warehouse is ultimately reduced due to too many partitions.
[0062] Figure 3 FIG. 1 is a flow chart of another embodiment of a data management method according to an exemplary embodiment. The method can be executed by a server, and the method at least includes the following steps 301-305.
[0063] Step 301, based on the data volume information of each data management object, divide one or more data management objects into one or more data management object sets; generate a correspondence between the name field of the data management object set and the partition field of the storage partition of the data management object set.
[0064] In the present disclosure, one or more data management objects can be divided into one or more data management object sets based on the data volume information of each of the one or more data management objects; a name field for each data management object set is generated, wherein, for each data management object set, the name field of each data management object in the data management object set has an associated relationship with the name field of the data management object set; a storage partition is allocated to each data management object set, and a partition field of the storage partition of each data management object set is generated; for each data management object set, a correspondence between the name field of the data management object set and the partition field of the storage partition of the data management object set is generated.
[0065] In the present disclosure, the data volume information of the data management object may be the data volume of the data of the data management object generated within a preset time period. The data volume of the data generated by each of the one or more data management objects within the same preset time period may be determined, thereby determining the data volume information of each of the one or more data management objects.
[0066] In the present disclosure, based on the data volume information of each of the one or more data management objects, the implementation method of dividing one or more data management objects into one or more data management object sets is as follows: for each data management object whose data volume is greater than or equal to the data volume threshold, the data management object whose data volume is greater than or equal to the data volume threshold is assigned to a data management object set, and the data management object set to which the data management object whose data volume is greater than or equal to the data volume threshold is assigned includes the data management object whose data volume is greater than or equal to the data volume threshold; all data management objects whose data volume is less than the data volume threshold are assigned to the same operation object set. It should be understood that for each data management object whose quantity is greater than or equal to the data volume threshold, it has a corresponding data management object set, for example: one data management object corresponds to one data management object set.
[0067] For example, it is necessary to store data of 200 applications, such as data of an application named A1, data of an application named A2, ..., data of an application named A200, in one data table in a data warehouse.
[0068] Assuming that the data volume of an application named A1, the data volume of an application named A2 ... the data volume of an application named A19 are all greater than or equal to the data volume threshold, then each of the applications named A1, the application named A2 ... the application named A19 is respectively assigned to a data management object set.
[0069] The data management object set to which the application named A1 belongs only includes the application named A1. The name field of the data management object set to which the application named A1 belongs may be A1.
[0070] The data management object set to which the application named A2 belongs only includes the application named A2. The name field of the data management object set to which the application named A2 belongs can be A2, and so on.
[0071] Assuming that the data volume of the application named A20, the data volume of the application named A21 ... the application named A200 are all less than the data volume threshold, then the application named A20, the application named A21 ... the application named A200 are all attributed to the same data management object set, and the name field of the same data management object set can be COMMON.
[0072] In certain embodiments of the present disclosure, based on the data volume information of one or more data management objects, one or more data management objects are divided into one or more data management object sets in the following manner: first, according to the data volume information of each data management object, the maximum value of the data volume information and the minimum value of the data volume information are determined. The maximum value of the data volume is the maximum value in the data volume information of the data management object. The minimum value of the data volume is the minimum value in the data volume information of the data management object. The interval between the minimum value of the data volume and the maximum value of the data volume can be divided into multiple sub-intervals. In one example, the interval ranges of each sub-interval are the same. In another example, the interval ranges of each sub-interval may also be different. In other examples, some sub-intervals have the same interval range, and some sub-intervals have different interval ranges, which are not particularly limited in the present disclosure. In the embodiments of the present disclosure, data management objects whose data volume information is in the same sub-interval can be assigned to the same data management object set. Thus, one or more data management objects are divided into one or more data management object sets.
[0073] Please refer to Figure 4 , which shows a schematic diagram of the effect of dividing the interval between the minimum data volume and the maximum data volume into multiple sub-intervals.
[0074] exist Figure 4 , showing subinterval 1, subinterval 2, ... subinterval N. The interval range of each subinterval is the same. The number of subintervals is exemplary, and the number of subintervals can be preset. All data management objects with data volume information values in subinterval 1 are assigned to data management object set 1, all data management objects with data volume information values in subinterval 2 are assigned to data management object set 2, and so on, thereby dividing one or more data management objects into one or more data management object sets.
[0075] In the present disclosure, all data management objects are divided based on the data volume information of each data management object to obtain one or more data management object sets, and multiple data management objects with similar data volume information can be assigned to the same data management object set. At the same time, a correspondence between the name field of the data management object set and the partition field of the storage partition of the data management object set is generated, so that multiple data management objects with similar data volume information in the same data management object set have a corresponding relationship with the storage partition of the same data management object set, and the data of multiple data management objects with similar data volume information in the same data management object set can be stored in the same storage partition, thereby eliminating the need to separately allocate a storage partition for each of the multiple data management objects with similar data volume information, reducing the number of storage partitions in the data table of the data warehouse, and avoiding the situation where the performance of the data warehouse is reduced due to too many storage partitions. At the same time, since the data of multiple data management objects with similar data volume information in the same data management object set are stored in the same storage partition, the data volume of each data management object in the same storage partition is balanced.
[0076] In certain embodiments of the present disclosure, based on the data volume information of each data management object in the one or more data management objects, dividing one or more data management objects into multiple data management object sets includes: clustering the data volume information of one or more data management objects using a preset clustering algorithm to obtain one or more clustering results; for each of the one or more clustering results, dividing the data management objects to which each data volume information in the clustering result belongs into the same data management object set.
[0077] In the present disclosure, the preset clustering algorithm may be a community clustering algorithm, K-means, etc. The preset clustering algorithm may be used to cluster the data volume information of one or more data management objects to obtain one or more clustering results. The data management objects to which each piece of data volume information in the same clustering result belongs belong to the same data management object set.
[0078] By clustering the data volume information of one or more data management objects through a preset clustering algorithm, similar data volume information can be quickly aggregated into corresponding clustering results. The data management objects to which each piece of data volume information in the same clustering result belongs can form a data management object set. Therefore, by clustering the data volume information of one or more data management objects through a preset clustering algorithm, one or more data management object sets can be quickly obtained. The speed of obtaining one or more data management object sets through the preset clustering algorithm is fast.
[0079] In the present disclosure, after one or more data management objects are divided into multiple data management object sets based on the data volume information of each of the one or more data management objects, a name field of each data management object set can be generated. For example, the name fields of the data management objects in the data management object set can be spliced to obtain the name field of the data management object set. For another example, a default name field can be selected as the name field of the data management object set. For another example, an integer value sequence can be generated, each integer value in the integer value sequence is different, and the number of integer values included in the integer value sequence is equal to the number of data management object sets. The integer values in the integer value sequence have an order from small to large, the first integer value in the integer value sequence is a preset minimum value, and the difference between two adjacent integer values is a preset difference value, such as 1. When generating the integer value sequence, the preset minimum value is added to the preset difference value to obtain the second integer value, and the second integer value is added to the preset difference value to obtain the third integer value, and so on. An integer value in an integer value sequence is assigned to each data management object set. The integer value assigned to each data management object set is different. For each data management object set, a preset string can be concatenated with the integer value assigned to the data management object set to obtain a name field of the data management object set. For each data management object set, the name field of each data management object in the data management object set has an association relationship with the name field of the data management object set. For example, the name fields of multiple data management objects belonging to a data management object set are A20, A21, and A22, respectively. The name field of the data management object set is obtained by concatenating the name fields of the multiple data management objects. The name field of the data management object set is A20A21A22. The name field of each data management object in the data management object set is part of the name field of the data management object set. The name field of each data management object in the data management object set has an association relationship with the name field of the data management object set. After generating the name field of each data management object set, a storage partition can be assigned to each data management object set, and a partition field of the storage partition of each data management object set is generated. For example, a part of the name field of the data management object set can be intercepted as the partition field of the storage partition of the data management object set, or a random number can be generated as the partition field of the storage partition of the data management object set. For each data management object set, a corresponding relationship between the name field of the data management object set and the partition field of the storage partition of the data management object set is generated.
[0080] Step 302: Receive a data storage request.
[0081] For implementation details of step 302 in this embodiment, refer to step 201 in the above embodiment.
[0082] Step 303: Determine, according to the first name field of the first data management object, a second name field in the name field of the data management object set that matches the first name field.
[0083] For implementation details of step 303 in this embodiment, refer to step 202 in the above embodiment.
[0084] Step 304: Determine the target partition field corresponding to the second name field according to the correspondence between the name field and the partition field of the data management object set.
[0085] For implementation details of step 304 in this embodiment, refer to step 203 in the above embodiment.
[0086] Step 305: Store the data of the first data management object in the storage partition identified by the target partition field.
[0087] For implementation details of step 305 in this embodiment, refer to step 204 in the above embodiment.
[0088] In certain embodiments of the present disclosure, a data query request is received, the data query request including: a second name field of a second data management object; a data query operation is performed, the data query operation including: determining, based on the second name field of the second data management object, a third name field in the name field of a data management object set that matches the second name field; determining, based on the correspondence between the name field of the data management object set and the partition field, a partition field corresponding to the third name field; and searching for data of the second data management object from a storage partition identified by the partition field corresponding to the third name field.
[0089] When it is necessary to query the data of a data management object, the data management object can be referred to as a second data management object. After receiving a data query request, a data query operation can be performed. In the process of performing the data query operation, the third name field in the name field of the data management object set that matches the second name field can be first determined according to the second name field of the second data management object. The second name field of the second data management object has an association relationship with the name field of the data management object set to which the second data management object belongs, and the second name field of the second data management object matches the name field of the data management object set to which the second data management object belongs. Therefore, the third name field is actually the name field of the data management object set to which the second data management object belongs. After determining the third name field in the name field of the data management object set that matches the second name field, the partition field corresponding to the third name field can be determined based on the correspondence between the name field of the data management object set and the partition field. Finally, the function provided by the data warehouse tool Hive for querying the data in the corresponding partition in the data table can be used to generate a distributed task for querying the data in the corresponding partition in the data table, and the data of the second data management object can be found from the storage partition identified by the partition field corresponding to the third name field in the data table.
[0090] For any data management object, when the corresponding storage partition stores the data of the data management object, if it is necessary to find the data of the data management object, the storage partition storing the data of the data management object can be determined through a query operation to find the data of the data management object. When it is necessary to find the data of a data management object, the device sending the data query request provides the name field of the data management object. Since the storage partition stores data management objects that match the name field of the same data management object set, the data query request includes the name field of the data management object. The data set of the data management object can be found from the data table of the data warehouse through a query operation, and the overhead of finding the data of the data management object is low.
[0091] In certain embodiments of the present disclosure, the data storage operation is performed by a first custom data warehouse tool function, and the data storage operation includes: determining, based on the first name field, a second name field in the name field of the data management object set that matches the first name field; determining, based on the correspondence between the name field of the data management object set and the partition field, a target partition field corresponding to the second name field; storing the data of the first data management object in the storage partition identified by the target partition field, and the data query operation is performed by a second custom data warehouse tool function.
[0092] In the present disclosure, the types of the first custom data warehouse tool function and the second custom data warehouse tool function may be UDF (User-Defined Function) used when managing data tables in a data warehouse through the data warehouse tool Hive.
[0093] The code of the data storage operation can be pre-encapsulated in the first custom data warehouse tool function, and when the data storage operation needs to be performed, the first custom data warehouse tool function is called to perform the data storage operation. The code of the data query operation can be encapsulated in the second custom data warehouse tool function, and when the data query operation needs to be performed, the second custom data warehouse tool function is called to perform the data query operation.
[0094] In the present disclosure, the code of data storage operation is encapsulated in a first custom data warehouse tool function, and the code of data query operation is encapsulated in a second custom data warehouse tool function, so that any program that manages the data warehouse can call the first custom data warehouse tool function to perform data storage operation and store the data of the corresponding data management object in the corresponding storage partition. In the case that the code of data storage operation changes due to business needs, it is sufficient to modify the code of the first custom data warehouse tool function without modifying the relevant code of any program that manages the data warehouse, and the overhead of modifying the code is low. Compared with the code of the program that manages the data warehouse directly including the code of data storage operation, it can avoid the situation that the relevant code of each program that manages the data warehouse needs to be modified when the code of data storage operation changes. Any program that manages the data warehouse can call the second custom data warehouse tool function to perform data query operation and find out the data of the corresponding data management object. When the code of data query operations changes due to business needs, it is only necessary to modify the code of the second custom data warehouse tool function without modifying the relevant code of any program that manages the data warehouse. The overhead of modifying the code is low, and compared with the code of the program that manages the data warehouse directly including the code of data query operations, it can avoid the need to modify the relevant code of each program that manages the data warehouse when the code of the data query operation changes.
[0095] Figure 5 is a structural block diagram of a data management device according to an exemplary embodiment. Figure 5 The data management device includes: a receiving module 501, a first determining module 502, a second determining module 503, and a storage module 504.
[0096] The receiving module 501 is configured to receive a data storage request, the data storage request including: a first name field of a first data management object among one or more data management objects, and data of the first data management object;
[0097] The first determining module 502 is configured to determine, according to the first name field, a second name field in the name field of the data management object set that matches the first name field;
[0098] The second determination module 503 is configured to determine the target partition field corresponding to the second name field according to the correspondence between the name field and the partition field of the data management object set;
[0099] The storage module 504 is configured to store the data of the first data management object in the storage partition identified by the target partition field.
[0100] In some embodiments, the apparatus further comprises:
[0101] The preprocessing module is configured to, before receiving a data storage request, divide the one or more data management objects into multiple data management object sets based on the data volume information of each data management object in the one or more data management objects; generate a name field for each data management object set, wherein, for each data management object set, the name field of each data management object in the data management object set has an associated relationship with the name field of the data management object set; allocate storage partitions for each data management object set, and generate partition fields for the storage partitions of each data management object set; for each data management object set, generate a correspondence between the name field of the data management object set and the partition fields of the storage partitions of the data management object set.
[0102] In some embodiments, the preprocessing module is further configured to use a preset clustering algorithm to cluster the data volume information of the one or more data management objects to obtain one or more clustering results; for each of the one or more clustering results, the data management objects to which each data volume information in the clustering results belongs are combined into a data management object set.
[0103] In some embodiments, the apparatus further comprises:
[0104] The data query module is configured to receive a data query request, wherein the data query request includes: a second name field of a second data management object;
[0105] Execute a data query operation, the data query operation comprising: determining a third name field in the name field of a data management object set that matches the second name field based on the second name field of the second data management object; determining a partition field corresponding to the third name field based on the correspondence between the name field and the partition field of the data management object set; and searching for data of the second data management object from a storage partition identified by the partition field corresponding to the third name field.
[0106] In some embodiments, the data storage operation is performed by a first custom data warehouse tool function, and the data storage operation includes: determining, based on the first name field, a second name field in the name field of a data management object set that matches the first name field; determining, based on the correspondence between the name field and the partition field of the data management object set, a target partition field corresponding to the second name field; storing the data of the first data management object in the storage partition identified by the target partition field, and the data query operation is performed by a second custom data warehouse tool function.
[0107] Figure 6 is a structural block diagram of a server according to an exemplary embodiment. Figure 6 The server includes a processing component 622, which further includes one or more processors, and a memory resource represented by a memory 632 for storing instructions, such as applications, that can be executed by the processing component 622. The application stored in the memory 632 can include one or more modules, each corresponding to a set of instructions. In addition, the processing component 622 is configured to execute instructions to perform the above method.
[0108] The server may also include a power supply component 626 configured to perform power management of the server, a wired or wireless network interface 650 configured to connect the server to a network, and an input / output (I / O) interface 658. The server may operate based on an operating system stored in the memory 632, such as Windows Server™, MacOS X™, Unix™, Linux™, FreeBSD™, or the like.
[0109] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, and the instructions can be executed by a processor of a server to complete the above data management method. Optionally, 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.
[0110] In an exemplary embodiment, the present application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the above-mentioned data management method is implemented.
[0111] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0112] It should be understood that the present invention is not limited to the exact construction that has 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 invention is limited only by the appended claims.
Claims
1. A data management method, characterized in that: The method comprises: receiving a data storage request, the data storage request comprising: a first name field of a first data management object among one or more data management objects, and data of the first data management object; Determine, according to the first name field, a second name field in the name field of the data management object set that matches the first name field; Determine a target partition field corresponding to the second name field according to the correspondence between the name field and the partition field of the data management object set; storing the data of the first data management object in the storage partition identified by the target partition field; Before receiving the data storage request, the method further includes: Based on data volume information of each of the one or more data management objects, dividing the one or more data management objects into one or more data management object sets; Generate a name field for each data management object set; Allocating a storage partition for each data management object set, and generating a partition field for the storage partition of each data management object set; For each data management object set, generating a correspondence between a name field of the data management object set and a partition field of a storage partition of the data management object set; The method further comprises: receiving a data query request, the data query request comprising: a second name field of a second data management object; Execute a data query operation, the data query operation comprising: determining a third name field in the name field of a data management object set that matches the second name field based on the second name field of the second data management object; determining a partition field corresponding to the third name field based on the correspondence between the name field and the partition field of the data management object set; and searching for data of the second data management object from a storage partition identified by the partition field corresponding to the third name field.
2. The method according to claim 1, characterized in that The dividing the one or more data management objects into one or more data management object sets based on the data volume information of each data management object in the one or more data management objects includes: Clustering the data volume information of the one or more data management objects using a preset clustering algorithm to obtain one or more clustering results; For each clustering result in the one or more clustering results, the data management object to which each piece of data volume information in the clustering result belongs is divided into the same data management object set.
3. The method according to claim 1, characterized in that The data storage operation is performed by a first custom data warehouse tool function, and the data storage operation includes: determining, based on the first name field, a second name field in the name field of a data management object set that matches the first name field; determining, based on the correspondence between the name field and the partition field of the data management object set, a target partition field corresponding to the second name field; storing the data of the first data management object in the storage partition identified by the target partition field, and the data query operation is performed by a second custom data warehouse tool function.
4. A data management device, characterized in that: The device comprises: A receiving module is configured to receive a data storage request, wherein the data storage request includes: a first name field of a first data management object among one or more data management objects, and data of the first data management object; A first determining module is configured to determine, based on the first name field, a second name field in the name field of the data management object set that matches the first name field; A second determination module is configured to determine a target partition field corresponding to the second name field according to a correspondence between the name field and the partition field of the data management object set; A storage module, configured to store the data of the first data management object in the storage partition identified by the target partition field; The device also includes: The preprocessing module is configured to, before receiving a data storage request, divide the one or more data management objects into one or more data management object sets based on the data volume information of each of the one or more data management objects; generate a name field for each data management object set; allocate a storage partition for each data management object set, and generate a partition field for the storage partition of each data management object set; for each data management object set, generate a corresponding relationship between the name field of the data management object set and the partition field of the storage partition of the data management object set; The device also includes: A data query module is configured to receive a data query request, the data query request including: a second name field of a second data management object; perform a data query operation, the data query operation including: determining a third name field in a name field of a data management object set that matches the second name field based on the second name field of the second data management object; determining a partition field corresponding to the third name field based on a correspondence between the name field and the partition field of the data management object set; and searching for data of the second data management object from a storage partition identified by the partition field corresponding to the third name field.
5. The device according to claim 4, characterized in that The preprocessing module is further configured to cluster the data volume information of the one or more data management objects using a preset clustering algorithm to obtain one or more clustering results; For each clustering result in the one or more clustering results, the data management object to which each piece of data volume information in the clustering result belongs is divided into the same data management object set.
6. The device according to claim 4, characterized in that The data storage operation is performed by a first custom data warehouse tool function, and the data storage operation includes: determining, based on the first name field, a second name field in the name field of a data management object set that matches the first name field; determining, based on the correspondence between the name field and the partition field of the data management object set, a target partition field corresponding to the second name field; storing the data of the first data management object in the storage partition identified by the target partition field, and the data query operation is performed by a second custom data warehouse tool function.
7. A server, 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 data management method according to any one of claims 1 to 3. 8 . A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor of a server, the server is enabled to execute the data management method according to any one of claims 1 to 3.
