Data cleaning method and device, equipment, medium and product thereof
By dynamically configuring data cleaning schemes in a visual interface, the problems of high development costs and high error rates in traditional methods are solved, enabling flexible data cleaning, reducing development complexity and risk, and improving the security and efficiency of data cleaning.
Patent Information
- Application Number
- CN202311214851.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-19
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2043-09-19
AI Technical Summary
Traditional application data cleaning methods rely on the experience of developers and manually write cleaning scripts, resulting in high development costs and high error rates, and cannot effectively support system application data cleaning tasks in different business scenarios.
This paper provides a data cleaning method that displays the data table name, fields, and cleaning conditions in a visual interface, allowing users to dynamically configure the cleaning scope. It supports automatic partitioning and cleaning of data tables, reducing the operational complexity and error rate for developers.
By simplifying the interaction method, development costs are reduced, the security and efficiency of data cleaning are improved, potential risks caused by differences in developer capabilities are avoided, and flexible data cleaning is supported in different business scenarios.
Smart Images

Figure CN117194402B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of big data, and particularly relates to a data cleaning method and device, equipment, medium and product. BACKGROUND
[0002] Application data cleaning refers to cleaning historical data in an application system database, including deleting historical data or migrating historical data in a specified range to other locations for archiving.
[0003] In related technologies, a traditional application data cleaning method is mostly based on the experience of a developer to manually write a cleaning statement, and a cleaning script needs to be re-written each time a new data cleaning task is faced. However, the development threshold for manually writing a cleaning script is high, and a developer needs to be familiar with both the relevant business attributes and the technical attributes of a data table, otherwise errors are likely to occur. Therefore, manually writing a script not only consumes manpower, but also may lead to errors due to human factors, and there is a problem of high development cost and error rate. SUMMARY
[0004] Embodiments of the application provide a data cleaning method and device, equipment, medium and product, which can solve the problem of high development cost and error rate of a data cleaning solution in related technologies.
[0005] In a first aspect, embodiments of the application provide a data cleaning method, which includes: in the case that a database connection string is input in a configuration file, displaying, in a first configuration interface, a data cleaning configuration control and M data table names of M data tables corresponding to a first user identifier, wherein the database connection string carries the first user identifier; receiving, in the first configuration interface, a first selection operation of selecting a first data table name from the M data table names and a second selection operation on the data cleaning configuration control, wherein the data cleaning configuration control is used to trigger a data cleaning configuration operation on a first data table corresponding to the first data table name; in response to the first selection operation and the second selection operation, displaying N fields in the first data table and receiving a third selection operation of selecting a first field from the N fields; in response to the third selection operation, determining the first field as a cleaning basis field and dividing the first data table into data partitions based on the cleaning basis field; displaying, in a second configuration interface, data distribution of the data partitions and receiving a cleaning range configuration operation in the second configuration interface; determining a cleaning range based on the cleaning range configuration operation and determining data in the first data table located in the cleaning range as to-be-cleaned data, and cleaning the to-be-cleaned data.
[0006] In some possible implementation of the first aspect, the first field is a partition key, and the second configuration interface further includes a first input box, and the receiving the clean-up range configuration operation in the second configuration interface includes: receiving a clean-up range configuration operation of inputting a target data partition name in the first input box, the target data partition name being a data partition name of a target data partition in the data partitions; and determining the data in the first data table within the clean-up range as the data to be cleaned, including: determining the data within the target data partition as the data to be cleaned.
[0007] In some possible implementation of the first aspect, the first field is a time type field, and the second configuration interface further includes a second input box and a third input box, and the receiving the clean-up range configuration operation in the second configuration interface includes: receiving a clean-up range configuration operation of inputting a start date in the second input box and inputting an end date in the third input box; and determining the data in the first data table within the clean-up range as the data to be cleaned, including: determining the data between the start date and the end date as the data to be cleaned.
[0008] In some possible implementation of the first aspect, after determining the data in the first data table within the clean-up range as the data to be cleaned, and before cleaning the data to be cleaned, the method further includes: determining a first data amount corresponding to the first data table before the data to be cleaned is cleaned, and a second data amount corresponding to the data to be cleaned; determining a third data amount corresponding to the first data table after the data to be cleaned is cleaned, the third data amount being a difference between the first data amount and the second data amount; and displaying, in a third configuration interface, a comparison of the data amounts of the first data table before and after the data to be cleaned is cleaned, based on the first data amount and the third data amount.
[0009] In some possible implementation of the first aspect, after determining the data in the first data table within the clean-up range as the data to be cleaned, and before cleaning the data to be cleaned, the method further includes: displaying a first control and a second control in a fourth configuration interface, wherein the first control is associated with a clean-up manner of directly deleting the data to be cleaned, and the second control is associated with a clean-up manner of transferring the data to be cleaned to a historical data table; receiving a fourth selection operation of selecting a first target control from the first control and the second control; and in response to the fourth selection operation, cleaning the data to be cleaned according to the clean-up manner associated with the first target control.
[0010] In some possible implementation manners of the first aspect, the target control is the first control, and in response to the fourth selection operation, the to-be-cleaned data is cleaned according to the cleaning manner associated with the first target control, including: in response to the fourth selection operation, the third control and the fourth control are displayed on the fifth configuration interface, where the cleaning manner associated with the third control is to delete the to-be-cleaned data from the first data table, and the cleaning manner associated with the fourth control is to delete the first data table after migrating the target data to a newly created table, the target data being data in the first data table other than the to-be-cleaned data; a fifth selection operation of selecting a second target control from the third control and the fourth control is received; and in response to the fifth selection operation, the to-be-cleaned data is cleaned according to the cleaning manner associated with the second target control.
[0011] In some possible implementation manners of the first aspect, the third control and the fourth control are displayed on the fifth configuration interface, including: determining a data occupancy of the to-be-cleaned data in the first data table; in a case where the data occupancy is less than or equal to a preset occupancy threshold, the third control is highlighted; and in a case where the data occupancy is greater than the preset occupancy threshold, the fourth control is highlighted.
[0012] In the second aspect, an embodiment of the present application provides a data cleaning device, including: a display module, configured to display, in a case where a database connection string is input in a configuration file, a data cleaning configuration control and M data table names of M data tables corresponding to a first user identifier on a first configuration interface, where the database connection string carries the first user identifier; a receiving module, configured to receive, in the first configuration interface, a first selection operation of selecting a first data table name from the M data table names and a second selection operation on the data cleaning configuration control, where the data cleaning configuration control is used to trigger a data cleaning configuration operation on a first data table corresponding to the first data table name; the display module is further configured to display N fields in the first data table in response to the first selection operation and the second selection operation, and receive a third selection operation of selecting a first field from the N fields; a determination module, configured to determine, in response to the third selection operation, that the first field is a cleaning basis field, and divide the first data table into data partitions based on the cleaning basis field; the display module is configured to display, on a second configuration interface, a data distribution of the data partitions, and receive a cleaning range configuration operation on the second configuration interface; and a data cleaning module, configured to determine a cleaning range based on the cleaning range configuration operation, and determine data in the first data table located in the cleaning range as to-be-cleaned data, and clean the to-be-cleaned data.
[0013] In some possible implementation manners of the second aspect, the first field is a partition key, and the second configuration interface further includes a first input box, and the display module includes: a receiving unit, configured to receive a cleaning range configuration operation of inputting a target data partition name in the first input box, the target data partition name being a data partition name of a target data partition in each data partition; and a determination module, configured to determine data located in the target data partition as the data to be cleaned.
[0014] In some possible implementation manners of the second aspect, the first field is a time type field, and the second configuration interface further includes a second input box and a third input box, and the display module includes: a receiving unit, configured to receive a cleaning range configuration operation of inputting a start date in the second input box and inputting an end date in the third input box; and a determination module, configured to determine data located between the start date and the end date as the data to be cleaned.
[0015] In some possible implementation manners of the second aspect, the apparatus further includes a determination module, configured to, after determining that the data located in the cleaning range in the first data table as the data to be cleaned, and before cleaning the data to be cleaned, determine a first data amount corresponding to the first data table before the data to be cleaned is cleaned, and a second data amount corresponding to the data to be cleaned; and the determination module is further configured to determine a third data amount corresponding to the first data table after the data to be cleaned is cleaned, the third data amount being a difference between the first data amount and the second data amount; and the display module is further configured to display, based on the first data amount and the third data amount, a comparison of the data amounts of the first data table before and after the data to be cleaned is cleaned on the third configuration interface.
[0016] In some possible implementation manners of the second aspect, the apparatus further includes a display module, configured to, after determining that the data located in the cleaning range in the first data table as the data to be cleaned, display a first control and a second control on a fourth configuration interface, where the cleaning manner associated with the first control is to directly delete the data to be cleaned, and the cleaning manner associated with the second control is to transfer the data to be cleaned to a historical data table; and a receiving module, configured to receive a fourth selection operation of selecting a first target control from the first control and the second control; and a data cleaning module, including a data cleaning unit, configured to clean the data to be cleaned according to the cleaning manner associated with the first target control in response to the fourth selection operation.
[0017] In some possible implementation manners of the second aspect, the target control is the first control, and the data cleaning unit includes: a display subunit, configured to display, in response to a fourth selection operation, a third control and a fourth control in a fifth configuration interface, where the cleaning manner associated with the third control is to delete the data to be cleaned from the first data table, and the cleaning manner associated with the fourth control is to delete the first data table after migrating the target data to a newly created table, and the target data is data in the first data table other than the data to be cleaned; a receiving subunit, configured to receive a fifth selection operation of selecting a second target control from the third control and the fourth control; and a data cleaning subunit, configured to clean the data to be cleaned according to the cleaning manner associated with the second target control in response to the fifth selection operation.
[0018] In some possible implementation manners of the second aspect, the display subunit is specifically configured to: determine a data occupancy of the data to be cleaned in the first data table; highlight the third control when the data occupancy is less than or equal to a preset occupancy threshold; and highlight the fourth control when the data occupancy is greater than the preset occupancy threshold.
[0019] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory storing computer program instructions; and the processor implements the steps of the data cleaning method shown in any one of the embodiments of the first aspect when executing the computer program instructions.
[0020] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores computer program instructions, and the computer program instructions are executed by a processor to implement the steps of the data cleaning method shown in any one of the embodiments of the first aspect.
[0021] In a fifth aspect, an embodiment of the present application provides a computer program product, and instructions in the computer program product are executed by a processor of an electronic device to enable the electronic device to perform the steps of the data cleaning method shown in any one of the embodiments of the first aspect.
[0022] The data cleaning method, device, equipment, medium and product provided by the embodiments of the present application can be used in a scenario in which a data table under a first user name needs to be cleaned. A database connection string carrying a first user identifier is input in a configuration file, and a data cleaning configuration control and M data table names corresponding to M data tables of the first user identifier are displayed on a first configuration interface. If the user wants to clean the data of a first data table in the M data tables, the user can select a first data table name from the M data table names displayed on the first configuration interface. When a first selection operation of selecting the first data table name and a second selection operation of selecting the data cleaning configuration control are received, a data cleaning configuration operation on the first data table can be triggered. Specifically, in response to the first selection operation and the second selection operation, N fields in the first data table can be displayed, and a third selection operation of selecting a first field from the N fields can be received. Based on this, in response to the third selection operation, the first field can be determined as a cleaning basis field, and the first data table can be divided into data partitions based on the cleaning basis field. By displaying the data distribution of each data partition on a second configuration interface, the user can set the cleaning range according to the data distribution of each data partition. When the cleaning range configuration operation is received on the second configuration interface, the cleaning range can be determined based on the cleaning range configuration operation, and the data in the first data table within the cleaning range can be determined as to-be-cleaned data, so that the to-be-cleaned data can be effectively cleaned. In this way, the table name, field, cleaning condition and other elements in the data cleaning script are displayed on the visual interface in a simple and interactive manner. The user can dynamically configure the data cleaning according to the actual demand and actual situation, provide dynamic configuration of the application data cleaning scheme, flexibly support the system application data cleaning task in different business scenarios, effectively save time compared with manually writing the cleaning script, reduce the cost of the developer, and avoid the potential risks of the data cleaning script and the application system caused by the difference in the ability of the developers in the related art, reduce the error rate, and effectively improve the security of the data cleaning. BRIEF DESCRIPTION OF DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. Those skilled in the art can obtain other drawings according to these drawings without creating any creative labor.
[0024] Figure 1 is a flowchart of a data cleaning method provided by an embodiment of the present application;
[0025] Figure 2 is a flowchart of a data cleaning method provided by another embodiment of the present application;
[0026] Figure 3 is a flowchart of a data cleaning method provided by another embodiment of the present application;
[0027] Figure 4 is a flowchart of a data cleaning method provided by another embodiment of the present application;
[0028] Figure 5 is a structural diagram of a data cleaning device provided by an embodiment of the present application;
[0029] Figure 6 is a hardware structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0030] The features and exemplary embodiments of various aspects of the present application will be described below in detail, in order to make the purposes, technical solutions and advantages of the present application more clear and apparent, the present application will be further described in detail below in combination with the drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, but not to limit the present application. The present application can be implemented without some of these specific details by those skilled in the art. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application.
[0031] It should be noted that, in this paper, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the elements defined by the statement "include" do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0032] Application data cleaning refers to organizing historical data in the application system database, including deleting historical data, or migrating historical data in a specified range to other locations for archiving.
[0033] In the related art, the traditional application data cleaning method is mostly based on the experience of developers to manually write cleaning statements, and each time a new data cleaning task is faced, a cleaning script needs to be re-written, but manually writing a cleaning script has many disadvantages:
[0034] I. Handwritten scripts are inefficient, as it is necessary to find field names for each table, manually typing code wastes time, is prone to errors, and requires repeated backspace and rewriting, which wastes time and manpower, resulting in high development costs;
[0035] II. The development threshold for manually writing cleaning scripts is high, as developers need to be familiar with both the relevant business properties and technical properties of the data table. However, the levels of developers vary, and it is impossible to eliminate the potential risks caused by the differences in abilities among developers. For example, some developers have low risk awareness, and the scripts they write do not clearly consider risk factors such as cleaning conditions, index hit prediction, and lock table. Moreover, they do not personally confirm whether the risk items can be excluded in the production environment, but only manually write new scripts or modify existing scripts based on experience, resulting in a high error rate. The application data cleaning scheme generated in this way is uncontrollable and poses a significant risk to the system.
[0036] To solve the problems in the prior art, the embodiment of the present application provides a data cleaning method. In a scenario where a data table under a first user name needs to be cleaned, a database connection string carrying a first user identifier is input in a configuration file, data cleaning configuration controls and M data table names of M data tables corresponding to the first user identifier are displayed on a first configuration interface. If the data of a first data table in the M data tables needs to be cleaned, the user can select a first data table name from the M data table names displayed on the first configuration interface. When a first selection operation of selecting the first data table name and a second selection operation of selecting the data cleaning configuration controls are received, a data cleaning configuration operation on the first data table can be triggered. Specifically, in response to the first selection operation and the second selection operation, N fields in the first data table can be displayed, and a third selection operation of selecting a first field from the N fields can be received. Based on this, in response to the third selection operation, the first field can be determined as a cleaning basis field, and the first data table can be divided into data partitions based on the cleaning basis field. By displaying the data distribution of each data partition on a second configuration interface, the user can set the cleaning range according to the data distribution of each data partition. When the cleaning range configuration operation is received on the second configuration interface, the cleaning range can be determined based on the cleaning range configuration operation, and the data in the first data table within the cleaning range can be determined as to-be-cleaned data, so as to effectively clean the to-be-cleaned data. In this way, the table name, field, cleaning condition and other elements in the data cleaning script are displayed on the visual interface in a simple and easy-to-interact manner. The user can dynamically configure the data cleaning according to the actual demand and actual situation, provide dynamic configuration of the application data cleaning scheme, flexibly support system application data cleaning tasks in different business scenarios, effectively save time compared with manually writing a cleaning script, reduce the cost of developers, and in the dynamic configuration mode of the visual interface, the operation is simple and convenient, which can avoid the potential risks of data cleaning scripts and even application systems caused by the gap in the ability of developers in the related art, reduce the error rate, and effectively improve the security of data cleaning.
[0037] The data cleaning method provided by the embodiment of the present application will be described in detail in combination with the drawings, specific embodiments and application scenarios.
[0038] It should be noted that the acquisition, storage, use, processing and the like of data in the embodiment of the present application comply with the relevant provisions of national laws and regulations.
[0039] Figure 1 FIG. 1 is a flowchart of a data cleaning method provided by an embodiment of the present application. The execution subject of the data cleaning method can be an electronic device. It should be noted that the above execution subject does not constitute a limitation on the present application.
[0040] The electronic device can be a mobile phone, a tablet computer, an all-in-one machine, or the like, and can also be a virtual machine or an emulator simulated device, and can also be a cloud server or a server cluster having a storage and computing function.
[0041] As shown in Figure 1 The data cleaning method provided by the embodiments of the present application can include steps 110-160.
[0042] In step 110, when a database connection string is input in a configuration file, a data cleaning configuration control and M data table names corresponding to M data tables of a first user identifier are displayed on a first configuration interface.
[0043] In step 120, a first data table name selected from the M data table names is received on the first configuration interface, and a second selection operation on the data cleaning configuration control is received.
[0044] In step 130, in response to the first selection operation and the second selection operation, N fields in the first data table are displayed, and a third selection operation of selecting a first field from the N fields is received.
[0045] In step 140, in response to the third selection operation, the first field is determined as a cleaning basis field, and the first data table is divided into data partitions based on the cleaning basis field.
[0046] In step 150, a data distribution of each data partition is displayed on a second configuration interface, and a cleaning range configuration operation is received on the second configuration interface.
[0047] In step 160, a cleaning range is determined based on the cleaning range configuration operation, and data in the first data table within the cleaning range is determined as to-be-cleaned data, and the to-be-cleaned data is cleaned.
[0048] The data cleaning method of the embodiment of the application, in a scenario where data cleaning needs to be performed on a data table under a first user name, displays, in a first configuration interface, a data cleaning configuration control and M data table names of M data tables corresponding to the first user identifier, by inputting a database connection string carrying the first user identifier in a configuration file. If the user wants to clean data of a first data table in the M data tables, the user can select a first data table name from the M data table names displayed in the first configuration interface. When a first selection operation of the user selecting the first data table name and a second selection operation on the data cleaning configuration control are received, a data cleaning configuration operation on the first data table can be triggered. Specifically, in response to the first selection operation and the second selection operation, N fields in the first data table can be displayed, and a third selection operation of selecting a first field from the N fields can be received. Based on this, in response to the third selection operation, the first field can be determined as a cleaning basis field, and the first data table can be divided into various data partitions based on the cleaning basis field. By displaying data distribution of the various data partitions in a second configuration interface, the user can set the cleaning range according to the data distribution of the various data partitions. When the cleaning range configuration operation is received in the second configuration interface, the cleaning range can be determined based on the cleaning range configuration operation, and data in the first data table located in the cleaning range can be determined as to-be-cleaned data, so as to effectively clean the to-be-cleaned data. In this way, the table name, field, cleaning condition and other elements in the data cleaning script are displayed on the visual interface in a simple and easy-to-interact manner. The user can dynamically configure the data cleaning according to actual needs and actual situations, provide dynamic configuration of the application data cleaning scheme, flexibly support system application data cleaning tasks in different business scenarios, effectively save time compared with manually writing a cleaning script, reduce the cost of developers, and in the dynamic configuration mode of the visual interface, the operation is simple and convenient, which can avoid the potential risks of data cleaning scripts and even application systems caused by the gap in the ability of developers in related technologies, reduce the error rate, and effectively improve the security of data cleaning.
[0049] The specific implementation of the above steps will be described in detail below in conjunction with specific embodiments.
[0050] In step 110, in the case of inputting a database connection string in a configuration file, a data cleaning configuration control and M data table names of M data tables corresponding to a first user identifier are displayed in a first configuration interface.
[0051] In step 110, the database connection string can carry the first user identifier, which is used to represent the identity information of the first user, so the M data tables are data tables under the first user name, and M is a positive integer. The data cleaning configuration control is used to trigger a data cleaning configuration operation on a first data table corresponding to the first data table name.
[0052] Exemplarily, for the database of the integral mall application system, the data tables can include, for example, an integral mall order table, a refund table, an integral mall user operation log table, and an integral mall order log table, and the corresponding data table names are TD_ORDER, TD_ORDER_REFUND, TD_MEMBER_OPERATION_LOG, and TD_ORDER_LOG, respectively; for the database of the B2C application system, the data tables can include, for example, a personal mall order table, a delivery table, and a personal mall member table, and the corresponding data table names are B2C_ORDER, B2C_ORDER_DELIVERY, and B2C_MALL_MEMBERINFO, respectively.
[0053] In some embodiments, the database connection string can further include a database Internet Protocol (IP) address, an access port number, a login password, and a database name.
[0054] In some embodiments, when it is detected that the connectivity is passed, the data cleaning configuration control and the M data table names of the M data tables corresponding to the first user identifier can be displayed on the first configuration interface.
[0055] In some embodiments, the first configuration interface can include a left column display area and a right column display area, the left column display area is configured to display the M data table names of the M data tables, and when a certain data table name is selected in the left column display area, the right column display area can display the detail information of the data table corresponding to the data table name, which can include, for example, the data volume of the data table, the earliest time data record, and the data distribution density.
[0056] In relation to step 120, the first configuration interface receives a first selection operation of selecting a first data table name from the M data table names and a second selection operation of the data cleaning configuration control.
[0057] In step 120, the first selection operation can be an operation for selecting the first data table name, such as a click operation, a double-click operation, a long-press operation, and the like, and the second selection operation can be an operation for selecting the data cleaning configuration control, such as a click operation, a double-click operation, a long-press operation, and the like.
[0058] In relation to step 130, in response to the first selection operation and the second selection operation, N fields in the first data table are displayed, and a third selection operation of selecting a first field from the N fields is received.
[0059] In step 130, N is a positive integer, N fields are all fields in the first data table, and the third selection operation can be a click operation, a double-click operation, a long-press operation, or other operations for selecting the first field.
[0060] For example, the first data table is an integral mall order table TD_ORDER, and when receiving the first selection operation of clicking "TD_ORDER", all fields in the integral mall order table can be displayed, such as the order ID ORDER_ID, the customer number CST_ID, the actual payment amount PAY_AMOUNT, the creation time CREATE_TIME, the update time UPDATE_TIME, and the region number.
[0061] In some embodiments, in response to the first selection operation, N fields and their annotations can be displayed, and if the field is an index, a partition key, or a time type field, it will be marked separately to facilitate subsequent selection and judgment by project personnel.
[0062] Regarding step 140, in response to the third selection operation, the first field is determined as a cleaning basis field, and the first data table is divided into various data partitions based on the cleaning basis field.
[0063] In one example, if the first field is the region number, the partition rule can be to divide the data in the first data table with the same first three digits of the region number into the same data partition, such as the 440 Guangdong partition, the 110 Beijing partition, etc.
[0064] In another example, if the first field is the creation time, the partition rule can be further selected as division by year / month / day, such as selecting division by year, which can divide the data in the first data table with the same year into the same data partition, such as P_2020, P_2021, P_2022, P_2023, MAX.
[0065] Regarding step 150, the data distribution of each data partition is displayed in the second configuration interface, and a cleaning range configuration operation is received in the second configuration interface.
[0066] In step 150, the data distribution can be the data amount of different data partitions, or the data amount of different data partitions in the data occupancy of the first data table, which can be determined by executing a select count statement to determine the data distribution of each data partition.
[0067] The cleaning range configuration operation can be a user operation of setting the cleaning range of the first data table according to the data distribution of each data partition.
[0068] The step 160 involves determining the cleaning range based on the cleaning range configuration operation, and determining data in the first data table within the cleaning range as to-be-cleaned data, and cleaning the to-be-cleaned data.
[0069] In some embodiments of the present application, the first field can be a partition key, and the second configuration interface can further include a first input box. The step 150 of receiving the cleaning range configuration operation in the second configuration interface can include: receiving the cleaning range configuration operation of inputting a target data partition name in the first input box. The step 160 of determining the data in the first data table within the cleaning range as to-be-cleaned data can include: determining the data in the target data partition as to-be-cleaned data.
[0070] The first field can be a partition field as a partition key in the N fields, and the partition field is set when the first data table is established. The partition key needs to meet the following requirements: the value of the field must be able to clearly distinguish different partitions; the data type of the partition key should be as small as possible to reduce the overhead of index and partition; and the value of the partition key should be as continuous as possible to facilitate query optimization. The target data partition name is the data partition name of the target data partition in each data partition.
[0071] For example, if the region number is the partition key, the region number can be selected as the cleaning basis field.
[0072] In some embodiments of the present application, the first field can be a time type field, and the second configuration interface can further include a second input box and a third input box. The step 150 of receiving the cleaning range configuration operation in the second configuration interface can include: receiving the cleaning range configuration operation of inputting a start date in the second input box and inputting an end date in the third input box. The step 160 of determining the data in the first data table within the cleaning range as to-be-cleaned data can include: determining the data between the start date and the end date as to-be-cleaned data.
[0073] For example, the creation time is a time type field, and the following partitions can be obtained after dividing the creation time as the cleaning basis field: P_2020, P_2021, P_2022, P_2023, and MAX. If the user wants to clean the data of P_2022, the start date 2022.1.1 0:00:00 and the end date 2022.12.31 23:59:59 can be inputted, so as to define the cleaning time range as the final data cleaning range.
[0074] In some embodiments of the present application, Figure 2is a flowchart of a data cleaning method provided by another embodiment of the present application. After determining the data in the first data table within the cleaning range as the data to be cleaned in step 150, before cleaning the data to be cleaned in step 150, the method can further include Figure 2 Steps 210-230 are shown.
[0075] Step 210, determining that the data amount corresponding to the first data table before cleaning the data to be cleaned is a first data amount, and the data amount corresponding to the data to be cleaned is a second data amount.
[0076] Step 220, determining that the data amount corresponding to the first data table after cleaning the data to be cleaned is a third data amount, and the third data amount is the difference between the first data amount and the second data amount.
[0077] Step 230, based on the first data amount and the third data amount, previewing and displaying the data amount comparison of the first data table before and after cleaning the data to be cleaned in the third configuration interface.
[0078] Specifically, the data amount comparison can be directly displaying the first data amount and the third data amount, or displaying a pie chart corresponding to the first data amount and the third data amount, etc.
[0079] In the embodiments of the present application, by displaying the data amount comparison before and after cleaning the data to be cleaned, the user can understand the cleaning effect, so that the user can adjust the cleaning basis field in time when the cleaning effect is not satisfactory. Even if the user does not understand the situation of the first data table, the user can also clearly know the details of the first data table, which reduces the user's dependence on business understanding, and improves the convenience and robustness of migration.
[0080] In some embodiments of the present application, Figure 3 is a flowchart of a data cleaning method provided by another embodiment of the present application. After determining the data in the first data table within the cleaning range as the data to be cleaned in step 150, before cleaning the data to be cleaned in step 150, the method can further include Figure 3 Steps 310-330 are shown.
[0081] Step 310, displaying the first control and the second control in the fourth configuration interface.
[0082] Step 320, receiving a fourth selection operation of selecting a first target control from the first control and the second control.
[0083] Step 330, in response to the fourth selection operation, cleaning the data to be cleaned according to the cleaning method associated with the first target control.
[0084] The fourth selection operation can be a click operation, a double-click operation, a long press operation, or the like on the first control or the second control. The cleaning manner associated with the first control is to directly delete the data to be cleaned. Therefore, by selecting the first control, the electronic device can be triggered to directly delete the data to be cleaned. The cleaning manner associated with the second control is to transfer the data to be cleaned to a historical data table. Therefore, by selecting the second control, the electronic device can be triggered to transfer the data to be cleaned to the historical data table. It should be noted that the cleaning manner requires the user to manually input the name of the historical data table in the input box displayed on the fourth configuration interface.
[0085] In the embodiments of the present application, after the data to be cleaned is determined, two data cleaning manners can be provided for the user to flexibly select, thereby improving the diversity of the data cleaning manner.
[0086] In some embodiments of the present application, the target control can be the first control, Figure 4 FIG. 3 is a flowchart of a data cleaning method according to another embodiment of the present application. The step 330 can include the steps 410-430 shown in FIG. 4. Figure 4 The steps 410-430 shown in FIG. 4.
[0087] In step 410, in response to a fourth selection operation, a third control and a fourth control are displayed on a fifth configuration interface.
[0088] In step 420, a fifth selection operation of selecting a second target control from the third control and the fourth control is received.
[0089] In step 430, in response to the fifth selection operation, the data to be cleaned is cleaned according to a cleaning manner associated with the second target control.
[0090] The cleaning manner associated with the third control is to delete the data to be cleaned from the first data table, and the cleaning manner associated with the fourth control is to delete the first data table after migrating target data to a newly created table. The target data is data other than the data to be cleaned in the first data table.
[0091] In the embodiments of the present application, after the user selects to directly delete the data to be cleaned, the electronic device prompts the user to select whether to directly delete the data to be cleaned from the source table or to transfer the remaining data of the source table to a newly created table, and then drop the source table, thereby providing the user with flexible selection and improving the diversity of the data cleaning manner.
[0092] In some embodiments of the present application, the step 410 of displaying the third control and the fourth control on the fifth configuration interface can include the following steps:
[0093] Determine the data occupancy of the data to be cleaned in the first data table.
[0094] highlight the third control when the data occupancy is less than or equal to the preset occupancy threshold;
[0095] highlight the fourth control when the data occupancy is greater than the preset occupancy threshold.
[0096] Specifically, the third control is highlighted to prompt the user to select the cleaning mode associated with the third control, and the fourth control is highlighted to prompt the user to select the cleaning mode associated with the fourth control.
[0097] For example, the preset occupancy threshold can be 60%, the data amount in the first data table can be 100, if the data amount of the data to be cleaned is 20, the data occupancy is 20% < 60%, the data to be cleaned in the first data table can be directly deleted, and the cleaned first data table is saved; if the data amount of the data to be cleaned is 90, the data occupancy is 90% > 60%, the remaining 10 data in the first data table except the data to be cleaned can be migrated to a newly created table, and the first data table containing 90 data to be cleaned after migration is directly deleted.
[0098] In the embodiments of the present application, considering that the workload of directly deleting the data to be cleaned is small when the data occupancy is small, the third control is highlighted to prompt the user to select the cleaning mode of directly deleting the data to be cleaned from the first data table when the data occupancy is less than or equal to the preset occupancy threshold. Considering that the workload of directly deleting the data to be cleaned is large when the data occupancy is large, and the workload of migrating the remaining data is small, the fourth control is highlighted to prompt the user to select the cleaning mode of migrating the target data to a newly created table and then deleting the first data table when the data occupancy is greater than the preset occupancy threshold. In this way, the present application can calculate the data amount of the data to be cleaned, highlight the controls on the visual interface, provide the user with a relatively reasonable cleaning mode for single-table data cleaning, avoid a large workload in subsequent cleaning of the data to be cleaned, cause excessive occupation of device resources, improve data cleaning efficiency, and save resources.
[0099] In some embodiments, the step 410 of displaying the third control and the fourth control on the fifth configuration interface can include the following steps:
[0100] determining the data occupancy of the data to be cleaned in the first data table;
[0101] highlighting the third control based on the first display parameter and highlighting the fourth control based on the second display parameter when the data occupancy is less than or equal to the preset occupancy threshold;
[0102] highlighting the fourth control based on the first display parameter and highlighting the third control based on the second display parameter when the data occupancy is greater than the preset occupancy threshold.
[0103] The first display parameter is greater than the second display parameter, and the display parameter can be a display size, a display brightness, or the like.
[0104] In some embodiments, after the configuration item of a single data table is completed, cleaning can be directly performed, or configuration items of other data tables are sequentially added, and after the configuration of all data tables is completed, the start control is clicked to execute data cleaning together, at this time, the page prints the progress and related logs. After all processes are completed, the left menu can be refreshed to complete verification.
[0105] It should be noted that the data cleaning method provided in the embodiments of the present application can be executed by an electronic device or a control module in a data cleaning system for executing the data cleaning method. In the embodiments of the present application, the data cleaning device is taken as an example to execute the data cleaning method, and the data cleaning device provided in the embodiments of the present application is described. The data cleaning device is described in detail as follows.
[0106] Figure 5 FIG. 5 is a structural schematic diagram of a data cleaning device provided in the embodiments of the present application. As shown in FIG. 5, the data cleaning device 500 can include a display module 510, a receiving module 520, a determination module 530, and a data cleaning module 540. Figure 5
[0107] The display module 510 is configured to display, in the case that a database connection string is input in a configuration file, data cleaning configuration controls and M data table names of M data tables corresponding to a first user identifier in a first configuration interface, wherein the database connection string carries the first user identifier. The receiving module 520 is configured to receive, in the first configuration interface, a first selection operation of selecting a first data table name from the M data table names, and a second selection operation on the data cleaning configuration controls, wherein the data cleaning configuration controls are configured to trigger a data cleaning configuration operation on a first data table corresponding to the first data table name. The display module 510 is further configured to display N fields in the first data table in response to the first selection operation and the second selection operation, and receive a third selection operation of selecting a first field from the N fields. The determination module 530 is configured to determine the first field as a cleaning basis field in response to the third selection operation, and divide the first data table into data partitions based on the cleaning basis field. The display module 510 is configured to display data distribution of the data partitions in a second configuration interface, and receive a cleaning range configuration operation in the second configuration interface. The data cleaning module 540 is configured to determine a cleaning range based on the cleaning range configuration operation, and determine data in the first data table located in the cleaning range as to-be-cleaned data, and clean the to-be-cleaned data.
[0108] In some embodiments of the present application, the first field is a partition key, the second configuration interface further includes a first input box, and the display module 510 includes: a receiving unit, configured to receive a cleaning range configuration operation of inputting a target data partition name in the first input box, the target data partition name being a data partition name of a target data partition in each data partition; and a determination module 530, specifically configured to determine data located in the target data partition as the to-be-cleaned data.
[0109] In some embodiments of the present application, the first field is a time type field, the second configuration interface further includes a second input box and a third input box, and the display module 510 includes: a receiving unit, configured to receive a cleaning range configuration operation of inputting a start date in the second input box and inputting an end date in the third input box; and a determination module 530, specifically configured to determine data located between the start date and the end date as the to-be-cleaned data.
[0110] In some embodiments of the present application, the apparatus further includes: the determination module 530, further configured to, after determining that the data located in the cleaning range in the first data table is the to-be-cleaned data, and before cleaning the to-be-cleaned data, determine that a data amount corresponding to the first data table before the to-be-cleaned data is cleaned is a first data amount, and a data amount corresponding to the to-be-cleaned data is a second data amount; and the determination module 530, further configured to determine that a data amount corresponding to the first data table after the to-be-cleaned data is cleaned is a third data amount, and the third data amount is a difference between the first data amount and the second data amount; and the display module 510, further configured to, based on the first data amount and the third data amount, preview and display, in the third configuration interface, a data amount comparison situation of the first data table before and after the to-be-cleaned data is cleaned.
[0111] In some embodiments of the present application, the apparatus further includes: the display module 510, further configured to, after determining that the data located in the cleaning range in the first data table is the to-be-cleaned data, display a first control and a second control in a fourth configuration interface, wherein the cleaning method associated with the first control is to directly delete the to-be-cleaned data, and the cleaning method associated with the second control is to transfer the to-be-cleaned data to a historical data table; the receiving module 520, further configured to receive a fourth selection operation of selecting a first target control from the first control and the second control; and the data cleaning module 540, including a data cleaning unit, configured to, in response to the fourth selection operation, clean the to-be-cleaned data according to the cleaning method associated with the first target control.
[0112] In some embodiments of the present application, the target control is the first control, and the data cleaning unit comprises: a display subunit configured to display, in response to a fourth selection operation, a third control and a fourth control in a fifth configuration interface, wherein the third control is associated with a cleaning manner of deleting the data to be cleaned from the first data table, the fourth control is associated with a cleaning manner of deleting the first data table after migrating the target data to a newly created table, and the target data is data other than the data to be cleaned in the first data table; a receiving subunit configured to receive a fifth selection operation of selecting a second target control from the third control and the fourth control; and a data cleaning subunit configured to clean the data to be cleaned according to the cleaning manner associated with the second target control in response to the fifth selection operation.
[0113] In some embodiments of the present application, the display subunit is specifically configured to: determine a data occupancy of the data to be cleaned in the first data table; highlight the third control when the data occupancy is less than or equal to a preset occupancy threshold; and highlight the fourth control when the data occupancy is greater than the preset occupancy threshold.
[0114] The data cleaning device of the embodiment of the present application, in the scenario of needing to clean the data table under the first username, inputs the database connection string carrying the first user identifier in the configuration file, displays the data cleaning configuration control and the M data table names of the M data tables corresponding to the first user identifier in the first configuration interface. If the data of the first data table in the M data tables is to be cleaned, the user can select the first data table name from the M data table names displayed in the first configuration interface, and when the first selection operation of the user selecting the first data table name and the second selection operation of the data cleaning configuration control are received, the data cleaning configuration operation of the first data table can be triggered. Specifically, in response to the first selection operation and the second selection operation, N fields in the first data table can be displayed, and a third selection operation of selecting a first field from the N fields is received. Based on this, in response to the third selection operation, the first field is determined as a cleaning basis field, and the first data table is divided into each data partition based on the cleaning basis field. By displaying the data distribution of each data partition in the second configuration interface, the user can set the cleaning range according to the data distribution of each data partition, and when the cleaning range configuration operation is received in the second configuration interface, the cleaning range can be determined based on the cleaning range configuration operation, and the data in the first data table located in the cleaning range is determined as the data to be cleaned, and the effective cleaning of the data to be cleaned is realized. In this way, the table name, field, cleaning condition and other elements in the data cleaning script are displayed on the visual interface in a simple and interactive manner, the user can dynamically configure the data cleaning at this time according to the actual demand and actual situation, provide dynamic configuration of the application data cleaning scheme, flexibly support the system application data cleaning task in different business scenarios, compared with manually writing the cleaning script, can effectively save time, reduce the cost of developers, and in the dynamic configuration mode of the visual interface, the operation is simple and convenient, which can avoid the potential risks of data cleaning script and even application system caused by the gap in ability among developers in related technologies, reduce the error rate, and effectively improve the security of data cleaning.
[0115] The data cleaning apparatus in the embodiments of the present application can be an apparatus, or a component in a terminal, an integrated circuit, or a chip. The apparatus can be a mobile electronic device, or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a cashier machine, or a self-service machine, etc., and the embodiments of the present application are not limited specifically.
[0116] The data cleaning apparatus in the embodiments of the present application can be an apparatus with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating systems, and the embodiments of the present application are not limited specifically.
[0117] Figure 6 is a schematic diagram of a hardware structure of an electronic device provided in the embodiments of the present application.
[0118] As shown in Figure 6 , the electronic device 600 in the embodiments can include a processor 601 and a memory 602 storing computer program instructions.
[0119] Specifically, the processor 601 can include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or can be configured as one or more integrated circuits implementing the embodiments of the present application.
[0120] The memory 602 can include mass storage for data or instructions. As an example and not by way of limitation, the memory 602 can include a hard disk drive (HDD), a floppy disk drive, flash memory, an optical disc (e.g., a compact disc (CD) or a digital versatile disc (DVD)), a solid-state drive (SSD), a USB drive, or a combination of two or more of these. Where appropriate, the memory 602 can include removable or non-removable (or fixed) media, where appropriate. The memory 602 can be internal or external to the integrated gateway disaster recovery appliance. In particular embodiments, the memory 602 is non-volatile, solid-state memory. The memory can include read-only memory (ROM), random-access memory (RAM), a magnetic disk storage medium, an optical storage medium, flash memory devices, electrical, optical, or other physically tangible storage device. Accordingly, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software that, when executed (by one or more processors), is operable to perform operations described with respect to the methods according to embodiments of the present application.
[0121] The processor 601 implements any of the data cleaning methods described in the above embodiments by reading and executing computer program instructions stored in the memory 602.
[0122] In one example, the electronic device 600 can further include a communication interface 603 and a bus 610. As shown, the processor 601, the memory 602, and the communication interface 603 are connected through the bus 610 and complete communication among each other. Figure 6
[0123] The communication interface 603 is mainly used to realize the communication between the modules, devices, units and / or equipment in the embodiments of the present application.
[0124] Bus 610 includes hardware, software, or both, to couple components of the online data traffic billing device to each other and to couple components to other parallel components for communication. While bus 610 is shown for purposes of example as a single bus, it can comprise one or more buses. Bus 610 can be implemented using any suitable type of bus structure or combination of bus structures, including an accelerated graphics port (AGP) or other graphics bus, an enhanced industry standard architecture (EISA) bus, a front-side bus (FSB), a HyperTransport (HT) interconnect, an industry standard architecture (ISA) bus, an InfiniBand (IB) interconnect, a low pin count (LPC) bus, a memory bus, a microchannel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standards association local (VLB) bus, or another suitable bus or interconnect, or a combination of two or more of these. Where appropriate, bus 610 can be used to implement any of the buses described in the foregoing detailed description and illustrated in the accompanying drawings.
[0125] The electronic device provided by the embodiments of the present application can realize the various processes realized in the method embodiments and can realize the same technical effects. To avoid repetition, the details are not described herein. Figures 1-4 The electronic device provided by the embodiments of the present application can realize the various processes realized in the method embodiments and can realize the same technical effects. To avoid repetition, the details are not described herein.
[0126] In combination with the data cleaning method in the above embodiments, the embodiments of the present application can provide a data cleaning system, which comprises the electronic device in the above embodiments. The specific content of the electronic device can be referred to the related description in the above embodiments, and details are not described herein.
[0127] In addition, in combination with the data cleaning method in the above embodiments, the embodiments of the present application can provide a computer readable storage medium to realize. The computer readable storage medium has computer program instructions stored thereon; the computer program instructions are executed by a processor to realize the steps of any one of the data cleaning methods in the above embodiments.
[0128] In combination with the data cleaning method in the above embodiments, the embodiments of the present application can provide a computer program product to realize. The instructions in the computer program product are executed by the processor of the electronic device, so that the electronic device executes the steps of the data cleaning method shown in any one of the embodiments of the first aspect.
[0129] It needs to be clear that the present application is not limited to the specific configurations and processes described above and shown in the drawings. For the sake of brevity, detailed descriptions of well-known methods are omitted herein. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between steps, after understanding the spirit of the present application.
[0130] The functions noted in the description of the structure block diagrams above can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, and the like. When implemented in software, the elements of the present application are program or code segments that are used to perform the required tasks. The program or code segments can be stored in a machine-readable medium, or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. A "machine-readable medium" includes any medium that can store or transport information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memory, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and the like. The code segments can be downloaded via computer networks such as the Internet, intranets, and the like.
[0131] It is also important to note that the examples mentioned in the present application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the steps mentioned above, that is, the steps can be performed in the order mentioned in the examples, or in an order different from the examples, or several steps can be performed simultaneously.
[0132] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer program instructions can also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other processing device to operate in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the functions / acts specified in the flowchart and / or block diagram block or blocks. The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0133] The above merely describes a specific implementation of the present application. Those skilled in the art can clearly understand the specific working processes of the system, modules and units described above for the convenience and brevity of description, and can refer to the corresponding processes in the foregoing method embodiments, which will not be described herein again. It should be understood that the protection scope of the present application is not limited to this, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered within the protection scope of the present application.
Claims
1. A data cleaning method, characterized by, The method comprises: In the case of inputting a database connection string in a configuration file, displaying data cleaning configuration controls and M data table names of M data tables corresponding to a first user identifier in a first configuration interface, wherein the database connection string carries the first user identifier; In the first configuration interface, receiving a first selection operation of selecting a first data table name from the M data table names and a second selection operation on the data cleaning configuration controls, wherein the data cleaning configuration controls are used to trigger a data cleaning configuration operation on a first data table corresponding to the first data table name; In response to the first selection operation and the second selection operation, displaying N fields in the first data table and receiving a third selection operation of selecting a first field from the N fields; In response to the third selection operation, determining the first field as a cleaning basis field, and dividing the first data table into data partitions based on the cleaning basis field; Displaying data distribution of the data partitions in a second configuration interface, and receiving a cleaning range configuration operation in the second configuration interface; Determining a cleaning range based on the cleaning range configuration operation, determining data in the cleaning range in the first data table as to-be-cleaned data, and cleaning the to-be-cleaned data; After determining that the data in the cleaning range in the first data table is to-be-cleaned data, the method further comprises: Displaying a first control and a second control in a fourth configuration interface, wherein the cleaning method associated with the first control is to directly delete the to-be-cleaned data, and the cleaning method associated with the second control is to transfer the to-be-cleaned data to a historical data table; Receiving a fourth selection operation of selecting a first target control from the first control and the second control; The cleaning of the to-be-cleaned data comprises: In response to the fourth selection operation, cleaning the to-be-cleaned data according to the cleaning method associated with the first target control; The first target control is the first control, and the cleaning of the to-be-cleaned data according to the cleaning method associated with the first target control in response to the fourth selection operation comprises: In response to the fourth selection operation, determining the data occupancy of the to-be-cleaned data in the first data table; In the case that the data occupancy is less than or equal to a preset occupancy threshold, highlighting a third control in a fifth configuration interface; in the case that the data occupancy is greater than the preset occupancy threshold, highlighting a fourth control in a fifth configuration interface, wherein the cleaning method associated with the third control is to delete the to-be-cleaned data from the first data table, and the cleaning method associated with the fourth control is to migrate target data to a newly created table and then delete the first data table, the target data being data in the first data table except the to-be-cleaned data; Receiving a fifth selection operation of selecting a second target control from the third control and the fourth control; In response to the fifth selection operation, cleaning the to-be-cleaned data according to the cleaning method associated with the second target control.
2. The method of claim 1, wherein, The first field is a partition key, and the second configuration interface further comprises a first input box, The receiving the clean-up range configuration operation in the second configuration interface comprises: receiving a clean-up range configuration operation of inputting a target data partition name in the first input box, the target data partition name being a data partition name of a target data partition in the respective data partitions; The determining the data in the first data table within the clean-up range as the data to be cleaned comprises: determining the data within the target data partition as the data to be cleaned.
3. The method of claim 1, wherein, The first field is a time type field, and the second configuration interface further comprises a second input box and a third input box, The receiving the clean-up range configuration operation in the second configuration interface comprises: receiving a clean-up range configuration operation of inputting a start date in the second input box and inputting an end date in the third input box; The determining the data in the first data table within the clean-up range as the data to be cleaned comprises: determining the data between the start date and the end date as the data to be cleaned.
4. The method of claim 1, wherein, After the determining the data in the first data table within the clean-up range as the data to be cleaned, and before the cleaning the data to be cleaned, the method further comprises: determining a first data amount corresponding to the first data table before the data to be cleaned is cleaned, and a second data amount corresponding to the data to be cleaned; determining a third data amount corresponding to the first data table after the data to be cleaned is cleaned, the third data amount being a difference between the first data amount and the second data amount; based on the first data amount and the third data amount, previewing and displaying a data amount comparison of the first data table before and after the data to be cleaned is cleaned in a third configuration interface.
5. A data cleansing apparatus, characterized by, The apparatus comprises: a display module configured to display, in a case where a database connection string is input in a configuration file, a data clean-up configuration control and M data table names of M data tables corresponding to a first user identifier in a first configuration interface, wherein the database connection string carries the first user identifier; a receiving module configured to receive, in the first configuration interface, a first selection operation of selecting a first data table name from the M data table names, and a second selection operation on the data clean-up configuration control, wherein the data clean-up configuration control is configured to trigger a data clean-up configuration operation on a first data table corresponding to the first data table name; the display module is further configured to, in response to the first selection operation and the second selection operation, display N fields in the first data table, and receive a third selection operation of selecting a first field from the N fields; a determination module configured to, in response to the third selection operation, determine that the first field is a clean-up basis field, and divide the first data table into respective data partitions based on the clean-up basis field; a display module configured to display, in a second configuration interface, data distribution of the respective data partitions, and receive a clean-up range configuration operation in the second configuration interface; a data clean-up module configured to determine a clean-up range based on the clean-up range configuration operation, determine data in the first data table within the clean-up range as data to be cleaned, and clean the data to be cleaned. The display module is further configured to display a first control and a second control on a fourth configuration interface after determining that the data in the first data table within the cleaning range is to-be-cleaned data, wherein the cleaning manner associated with the first control is to directly delete the to-be-cleaned data, and the cleaning manner associated with the second control is to transfer the to-be-cleaned data to a historical data table; The receiving module is further configured to receive a fourth selection operation of selecting a first target control from the first control and the second control; The data cleaning module comprises: A data cleaning unit configured to clean the to-be-cleaned data according to the cleaning manner associated with the first target control in response to the fourth selection operation; The first target control is the first control, and the data cleaning unit comprises: A display subunit configured to determine a data occupancy amount of the to-be-cleaned data in the first data table in response to the fourth selection operation; In a case where the data occupancy amount is less than or equal to a preset occupancy threshold, a third control is highlighted on a fifth configuration interface; in a case where the data occupancy amount is greater than the preset occupancy threshold, a fourth control is highlighted on the fifth configuration interface, wherein the cleaning manner associated with the third control is to delete the to-be-cleaned data from the first data table, and the cleaning manner associated with the fourth control is to delete the first data table after migrating target data to a newly created table, the target data being data in the first data table other than the to-be-cleaned data; A receiving subunit configured to receive a fifth selection operation of selecting a second target control from the third control and the fourth control; A data cleaning subunit configured to clean the to-be-cleaned data according to the cleaning manner associated with the second target control in response to the fifth selection operation.
6. An electronic device, comprising: The electronic device comprises a processor and a memory storing computer program instructions; The processor executes the computer program instructions to implement the data cleaning method of any one of claims 1-4.
7. A computer readable storage medium characterized in that, The computer readable storage medium stores computer program instructions, and the computer program instructions are executed by the processor to implement the steps of the data cleaning method of any one of claims 1-4.
8. A computer program product, characterised in that, The instructions in the computer program product are executed by the processor of the electronic device, so that the electronic device performs the steps of the data cleaning method of any one of claims 1-4.
Citation Information
Patent Citations
Data cleaning method
CN110162519A
Data cleaning method and device
CN114138767A