Data deletion result detection method, device, electronic device and storage medium
By filtering and processing data in the database, calculating data volume comparison, and automatically judging data deletion results, the problem of difficulty in determining the deletion results in traditional methods is solved, and the accuracy and efficiency of data deletion are improved.
Patent Information
- Application Number
- CN202211247555.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-12
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-10-12
AI Technical Summary
Traditional data deletion methods are difficult to determine the deletion results, and there are missed and false deletion phenomena, which requires manual review of data and inefficient.
By obtaining preset configuration information, filtering candidate data from the database, filtering and deleting according to the deletion condition information, calculating the data quantity and comparing it, generating data processing result information, and automatically determining the data deletion result.
It realizes automatic and rapid acquisition of data deletion results, saves manual judgment time, and improves the accuracy and efficiency of data deletion.
Smart Images

Figure CN115543982B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to a method, device, electronic device, and storage medium for detecting data deletion results. Background Art
[0002] Data has permeated every industry, such as transaction data from e-commerce platforms, medical data in the healthcare sector, driving data in the transportation sector, meteorological data in the meteorological sector, monitoring data in the surveillance sector, and test data in the testing sector. Data processing in these fields generates massive amounts of data, which consumes significant storage space on storage devices. Therefore, selectively deleting some data is necessary to conserve storage resources. Traditional data deletion methods rely on direct deletion, but the results are difficult to determine, requiring manual review of the data to determine the results, which is inefficient. Therefore, how to automatically and quickly obtain the results of data deletion has become a pressing technical challenge. Summary of the Invention
[0003] The main purpose of the embodiments of the present application is to propose a data deletion result detection method, device, electronic device and storage medium, aiming to automatically and quickly obtain the results of data deletion.
[0004] To achieve the above objectives, a first aspect of an embodiment of the present application provides a method for detecting data deletion results, the method comprising:
[0005] Acquire pre-configured preset configuration information; wherein the preset configuration information includes: database information and deletion condition information;
[0006] Filtering candidate data from a preset database according to the database information;
[0007] Screening the candidate data according to the deletion condition information to obtain selected data;
[0008] Performing data volume calculation on the selected data to obtain a first data volume, and performing data volume calculation on the candidate data to obtain a second data volume;
[0009] Deleting the candidate data according to the selected data to obtain current data;
[0010] Calculating the data volume of the current data to obtain a third data volume;
[0011] Comparing the first data volume, the second data volume, and the third data volume to obtain data volume comparison information;
[0012] Data processing result information is generated according to the data volume comparison information; wherein the data processing result information is used to indicate whether the data deletion is successful or failed.
[0013] In some embodiments, the database information includes: database name information and table name information, and the step of screening candidate data from a preset database based on the database information includes:
[0014] The preset database is screened according to the database name information to obtain a target database; wherein the target database includes at least one preset data table;
[0015] The candidate data is screened out from the preset data table according to the table name information.
[0016] In some embodiments, the deletion condition information includes: business requirement information and data category information, and the step of screening the candidate data according to the deletion condition information to obtain the selected data includes:
[0017] Acquire data information of the candidate data; wherein the data information includes: call frequency information, data tag information, and creation time information;
[0018] Screening the candidate data according to the business demand information, the creation time information, and the call frequency information to obtain pre-selected data;
[0019] The pre-selected data is screened according to the data category information and the data tag information to obtain the selected data.
[0020] In some embodiments, the current data includes currently selected data and currently reserved data, the third data amount includes currently selected data amount and currently reserved data amount, and the step of calculating the data amount of the current data to obtain the third data amount includes:
[0021] Filter the current data according to the deletion condition information to obtain the currently selected data;
[0022] Filtering the current data according to the currently selected data to obtain the currently retained data;
[0023] Calculating the amount of the currently selected data to obtain the amount of the currently selected data;
[0024] Calculating the amount of the currently retained data to obtain the currently retained data amount.
[0025] In some embodiments, the data volume comparison information includes omission and deletion determination information and erroneous deletion determination information; and the step of comparing the first data volume, the second data volume, and the third data volume to obtain the data volume comparison information includes:
[0026] Perform omission and deletion determination based on the first data amount and the currently selected data amount to obtain the omission and deletion determination information;
[0027] An erroneous deletion determination is performed based on the first data amount, the second data amount, and the currently retained data amount to obtain the erroneous deletion determination information.
[0028] In some embodiments, the data processing result information includes: deletion success information, omission deletion warning information, and erroneous deletion warning information, and the step of generating the data processing result information based on the data volume comparison information includes one of the following steps:
[0029] If the omission deletion determination information indicates that no data is omission-deleted, and the erroneous deletion determination information indicates that no data is erroneously deleted, generating the deletion success information;
[0030] If the omission and deletion determination information indicates that data is omission and deletion is detected, generating the omission and deletion warning information;
[0031] If the erroneous deletion determination information indicates erroneous deletion of data, the erroneous deletion warning information is generated.
[0032] In some embodiments, after the step of generating data processing result information based on the data volume comparison information, the method further includes:
[0033] Repairing the currently retained data specifically includes:
[0034] receiving the retained data information fed back by the user according to the mistaken deletion warning information;
[0035] Extracting backup data from a preset backup database according to the retained data information;
[0036] The currently retained data is repaired according to the backup data.
[0037] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a data deletion result detection device, the device comprising:
[0038] An information acquisition module, configured to acquire pre-configured preset configuration information; wherein the preset configuration information includes: database information and deletion condition information;
[0039] A first data screening module, configured to screen candidate data from a preset database according to the database information;
[0040] A second data screening module is used to screen the candidate data according to the deletion condition information to obtain selected data;
[0041] a first calculation module, configured to calculate the data volume of the selected data to obtain a first data volume, and to calculate the data volume of the candidate data to obtain a second data volume;
[0042] A data deletion module, configured to delete the candidate data according to the selected data to obtain current data;
[0043] A second calculation module is used to calculate the data volume of the current data to obtain a third data volume;
[0044] a comparison processing module, configured to compare the first data volume, the second data volume, and the third data volume to obtain data volume comparison information;
[0045] An information prompt module is used to generate data processing result information based on the data volume comparison information; wherein, the data processing result information is used to indicate whether the data deletion is successful or failed.
[0046] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the method described in the first aspect when executing the computer program.
[0047] To achieve the above-mentioned purpose, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method described in the first aspect.
[0048] The data deletion result detection method, device, electronic device, and storage medium proposed in this application screen out candidate data from a database based on preset database information, screen out selected data to be deleted from the candidate data based on preset deletion condition information, and delete the candidate data based on the selected data to obtain the current data. By respectively calculating the data volume of the candidate data and the selected data before the deletion operation and the data volume of the current data after the deletion operation, and comparing the data volume before and after the deletion operation to determine the data deletion result, the data deletion result is automatically obtained, eliminating the need for manual review of the data to determine the result, saving the time required for determination, and enabling the data deletion result to be quickly obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a flow chart of a method for detecting data deletion results provided by an embodiment of the present application;
[0050] Figure 2 yes Figure 1 Flowchart of step S102 in FIG.
[0051] Figure 3 yes Figure 1 Flowchart of step S103 in FIG.
[0052] Figure 4 yes Figure 1 Flowchart of step S106 in FIG.
[0053] Figure 5 yes Figure 1 Flowchart of step S107 in FIG.
[0054] Figure 6 yes Figure 1 Flowchart of step S108 in FIG.
[0055] Figure 7 is a flow chart of a method for detecting data deletion results provided by another embodiment of the present application;
[0056] Figure 8 Schematic diagram of the structure of the data deletion result detection device provided in an embodiment of the present application;
[0057] Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0059] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0061] First, let’s analyze some of the terms used in this application:
[0062] Artificial intelligence (AI) is a new technical discipline that studies and develops theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence. A branch of computer science, AI seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thinking. It also encompasses the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.
[0063] Big data refers to a collection of data so large that it significantly exceeds the capabilities of traditional database software tools in terms of acquisition, storage, management, and analysis. It is characterized by massive data size, rapid data flow, diverse data types, and low value density. Big data requires new processing models to enable stronger decision-making, insight discovery, and process optimization to accommodate the massive, rapidly growing, and diverse nature of information assets. Big data is often used to describe the vast amounts of unstructured and semi-structured data generated by a company, which would be prohibitively time-consuming and expensive to download into relational databases for analysis. Big data analysis is often linked to cloud computing, as real-time analysis of large datasets requires frameworks like MapReduce to distribute the work across dozens, hundreds, or even thousands of computers. Technically, big data and cloud computing are as inseparable as the two sides of a coin. Big data cannot be processed by a single computer and must utilize a distributed architecture. Its hallmark lies in distributed data mining of massive amounts of data, but this relies on cloud computing's distributed processing, distributed databases, cloud storage, and virtualization technologies.
[0064] Cloud computing refers to the process of breaking down massive data processing programs into countless smaller programs via the "cloud." These programs are then processed and analyzed by a system of multiple servers, generating results and returning them to users. Cloud computing refers to a system of immense computing power, built over a computer network (mostly referring to the Internet), that can store and aggregate related resources and provision them on demand, providing personalized services to users. The "cloud" is essentially a network. In a narrow sense, cloud computing is a network that provides resources, allowing users to access them at any time, use them on demand, and be considered infinitely scalable, paying only for what they use. Broadly speaking, cloud computing is a service related to information technology, software, and the internet. This shared pool of computing resources is called a "cloud." Cloud computing aggregates many computing resources and automates their management through software, enabling rapid resource provision with minimal human involvement. In other words, computing power becomes a commodity that can be circulated online, making it easily accessible and affordable. Cloud computing has strong scalability and demand, and can provide users with a brand new experience. The core of cloud computing is that it can coordinate many computer resources together, so that users can obtain unlimited resources through the Internet, and the resources obtained are not restricted by time and space.
[0065] Data has permeated every industry, such as transaction data from e-commerce platforms, medical data in the healthcare field, driving data in the transportation field, meteorological data in the meteorological field, monitoring data in the monitoring field, test data in the testing field, and so on. Data processing in these fields generates a large amount of data, which takes up a large amount of storage space on storage devices. Therefore, it is necessary to selectively delete some data to save storage resources. The traditional data deletion method is direct deletion, but the results of the deletion are difficult to determine, and there may be omissions and accidental deletions. Subsequent manual review of the data is required to determine the results of the deletion, which is time-consuming and labor-intensive. Therefore, how to automatically and quickly obtain the results of data deletion has become a technical problem that needs to be solved urgently.
[0066] Based on this, the embodiments of the present application provide a method, device, electronic device and storage medium for detecting the results of data deletion, which aim to automatically and quickly obtain the results of data deletion.
[0067] The data deletion result detection method, device, electronic device and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the data deletion result detection method in the embodiments of the present application is described.
[0068] The embodiments of the present application can acquire and process relevant data based on technologies such as artificial intelligence, big data, and cloud computing. Artificial intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.
[0069] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0070] The result detection method for data deletion provided in the embodiment of the present application relates to the field of artificial intelligence technology. The result detection method for data deletion provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the result detection method for data deletion, etc., but is not limited to the above forms.
[0071] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0072] It should be noted that in each specific embodiment of the present application, when it comes to the need to perform relevant processing based on data related to the user's identity or characteristics, such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of such data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0073] Figure 1 This is an optional flowchart of the data deletion result detection method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S108:
[0074] Step S101, obtaining pre-configured preset configuration information; wherein the preset configuration information includes: database information and deletion condition information;
[0075] Step S102, screening candidate data from a preset database based on database information;
[0076] Step S103, screening the candidate data according to the deletion condition information to obtain selected data;
[0077] Step S104, calculating the data volume of the selected data to obtain a first data volume, and calculating the data volume of the candidate data to obtain a second data volume;
[0078] Step S105, deleting the candidate data according to the selected data to obtain the current data;
[0079] Step S106, calculating the data volume of the current data to obtain a third data volume;
[0080] Step S107: Compare the first data volume, the second data volume, and the third data volume to obtain data volume comparison information;
[0081] Step S108: Generate data processing result information based on the data volume comparison information; wherein the data processing result information is used to indicate whether the data deletion is successful or failed.
[0082] In steps S101 to S108 of the embodiment of the present application, candidate data is screened from the database based on preset database information, selected data to be deleted is screened from the candidate data based on preset deletion condition information, and the candidate data is deleted based on the selected data to obtain the current data. By respectively calculating the data volume of the candidate data and the selected data before the deletion operation and the data volume of the current data after the deletion operation, and comparing the data volume before and after the deletion operation to determine the data deletion result, the data deletion result is automatically obtained, eliminating the need for manual review of the data to determine the result, saving the time required for determination, and enabling the data deletion result to be quickly obtained.
[0083] In step S101 of some embodiments, database information can be pre-configured in a data configuration table according to different requirements, and the corresponding database information can be called in the data configuration table according to the requirements when applied. Taking the data warehouse hive as an example, it contains multiple databases such as sx_hx-safe, sx_bdp_lbs_safe, sx_bdp_fds_safe, etc. The database information such as the names and storage addresses of these databases are stored in the data configuration table, and the corresponding configuration information names are set, such as "database configuration 1, database configuration 2, database configuration 3", etc. When it is necessary to call the database information, it is only necessary to find the required database configuration in the data configuration table according to the configuration information name. It should be noted that one configuration information in the data configuration table may correspond to one or more database information, and the type, number and data storage architecture of the database in the embodiment of the present application are not specifically limited.
[0084] It should be noted that the deletion condition information can also be pre-configured in a condition configuration table according to different needs, and the corresponding deletion condition information can be called in the condition configuration table according to actual needs when applied. For example, the deletion condition information includes time condition information, and the time condition information is represented by a selected time interval range, and the selected time interval range can be set in multiple ways, and the multiple selected time interval ranges are "first time interval range, second time interval range, third time interval range". The selected time interval ranges are stored in the condition configuration table, and the corresponding configuration information names are set, such as "condition configuration 1, condition configuration 2, condition configuration 3". When a certain deletion condition needs to be called, it is only necessary to find the corresponding condition configuration in the condition configuration table according to the configuration information name. It should be noted that the deletion condition information can also be set to include multiple condition types at the same time, such as time conditions, label conditions, call frequency conditions, etc. In this embodiment, the number and types of condition types are not specifically limited.
[0085] In other embodiments, the database information and deletion condition information can also be customized by programming instructions when deleting data.
[0086] In step S102 of some embodiments, the preset database refers to multiple databases participating in the screening. One or more target databases meeting the requirements are screened out from the preset database according to the database information, and the data in the target database is the candidate data. It can be understood that the candidate data can be a data set composed of data stored in different storage devices. The storage devices can be personal computers, servers, or network devices, etc., which communicate and transfer data through a network.
[0087] In step S103 of some embodiments, the selected data is the data to be deleted screened out from the candidate data according to the data deletion condition characterized by the deletion condition information. The relevant instructions for the data deletion condition are manually configured by the user. Taking the data warehouse hive as an example, if it is necessary to delete the data two years ago and only keep the data in the most recent two years, the relevant instructions for the data deletion condition can be configured as: proc_date < add_months(sysdate, -24). After this instruction is executed, the data with a storage time exceeding two years will be screened out from the candidate data as the selected data.
[0088] In step S104 of some embodiments, the first data volume is obtained by calculating the data volume of the selected data, and the second data volume is obtained by calculating the data volume of the candidate data. In addition to the selected data to be deleted in the candidate data, there is also a part of the data that needs to be retained. The difference between the second data volume and the first data volume is the data volume of this part of the data that needs to be retained.
[0089] In step S105 of some embodiments, the selected data in the candidate data is deleted to obtain the current data. The current data can be divided into the first part of the data and the second part of the data. The first part of the data is the data in the current data that does not meet the deletion condition, and the second part of the data is the data in the current data that meets the deletion condition. It should be noted that, ideally, the first part of the data is equivalent to the part of the data that needs to be retained in the original candidate data, and the second part of the data is blank data (invalid data). However, in actual applications, there may be situations where the operation of deleting data fails due to reasons such as data structure defects, that is: the second part of the data is not blank data, and / or, the first part of the data is not equivalent to the part of the data that needs to be retained in the original candidate data.
[0090] In step S106 of some embodiments, the third data volume is obtained by calculating the data volume of the current data. The third data volume represents the proportion of the data in the current data that does not meet the deletion condition and the proportion that meets the deletion condition.
[0091] In step S107 of some embodiments, a data volume comparison is performed based on the data volume of the candidate data and the selected data before the deletion operation and the data volume of the current data after the deletion operation to determine the data deletion result and generate corresponding data volume comparison information.
[0092] In step S108 of some embodiments, data processing result information is generated based on the data volume comparison result and sent to the user to inform the user of the result of the data deletion. After receiving the data processing result information, the user can choose the next step according to the information indicated.
[0093] In an illustrative embodiment, the data deletion result detection method of the present application can also set preset principle condition information. Based on the preset principle condition information, a data volume comparison process is performed against the first, second, and third data volumes to generate principle comparison information, which is then used to make a principled judgment on the result of the data deletion operation. Because the relevant instructions for the data deletion conditions are manually configured by the user, it is possible that the data deletion conditions configured by the user, due to carelessness or other reasons, may not meet the expectations. For example, a preset principle condition may state that data less than one year old cannot be deleted. A user intended to delete data from two years ago, but mistakenly configured the deletion conditions to delete data less than two years old. This manual error cannot be detected through the data volume comparison process of the first, second, and third data volumes. By setting preset principle conditions, manual errors can be promptly detected, preventing data and property losses caused by human factors. If a violation of the preset principle condition is detected, resulting in accidental and / or missed deletions, the data processing result information will indicate the violation of the principle condition. After receiving the data processing result information, the user can review and modify the relevant instructions for the configured data deletion condition, restore the deleted data from the backup database, and then retry the deletion operation.
[0094] See also Figure 2 In some embodiments, the database information includes: library name information and table name information. Step S102 includes but is not limited to steps S201 and S202:
[0095] Step S201: screening the preset database according to the database name information to obtain a target database; wherein the target database includes at least one preset data table;
[0096] Step S202: Filter candidate data from a preset data table according to the table name information.
[0097] In steps S201 and S202 shown in the embodiment of the present application, the preset database refers to multiple databases involved in the screening, and the preset data table is a data set obtained by classifying the data in the database according to certain rules. One or more target databases that meet the requirements are screened from the preset database based on the library name information, and then one or more target data tables are screened from the target database based on the table name information to obtain candidate data in the table. By screening data from the preset database using the library name information and table name information, candidate data can be obtained accurately and efficiently.
[0098] It is understood that the candidate data may be a data set composed of data stored in different storage devices. The storage devices may be personal computers, servers, or network devices, etc., which communicate and transmit data via a network.
[0099] In step S201 of some embodiments, the database name information includes the name information of at least one target database. The target database name information is matched with the name information of the preset databases to obtain a preset database with matching name information, thereby obtaining the target database. The name information of each database can be pre-configured in a data configuration table.
[0100] In some embodiments, in step S202, the table name information includes the name information of at least one target data table, and matching and screening are performed in the target database based on the name information of the target data table. The name information of each data table can be pre-configured in a data configuration table, and a corresponding mapping relationship is suggested with the name information of the corresponding database.
[0101] See also Figure 3 In some embodiments, the deletion condition information includes: business requirement information and data category information. Step S103 includes but is not limited to steps S301 to S303:
[0102] S301, obtaining data information of candidate data; wherein the data information includes: call frequency information, data tag information, and creation time information;
[0103] S302, screening candidate data based on business demand information, creation time information, and call frequency information to obtain pre-selected data;
[0104] S303: Screen the pre-selected data according to the data category information and the data tag information to obtain the selected data.
[0105] In steps S301 to S303 of the embodiment of the present application, candidate data is initially screened based on business requirement information and the creation time and call frequency information of the candidate data to obtain pre-selected data that is not needed. The pre-selected data is then secondary screened based on the data category information and the data tag information of the candidate data to obtain the selected data. Therefore, by screening the selected data from the candidate data and the selected data being redundant data, it is easy to delete the redundant data and retain the data that better meets the actual application requirements.
[0106] In step S301 of some embodiments, call frequency information, i.e., the frequency and number of times data is called to perform related tasks, indicates the importance of the data. Creation time information is used to indicate the duration of data storage. Data tag information is tag information assigned based on the characteristics of the data. It is understood that in the art, data information may also include other types of information, and other types of information in the data information can be obtained based on the defined deletion condition information. This is not specifically limited in this embodiment.
[0107] In step S302 of some embodiments, the business demand information is data screening condition information about data creation time and data call frequency determined according to actual needs. It should be noted that data can be screened selectively or jointly based on data creation time and data call frequency.
[0108] For example, one of the screening conditions for business requirement information representation is: data creation time is two years ago or data call frequency is less than 10. Then the screening process for obtaining pre-selected data can be: first, based on the data creation time condition, filter out dataset A from two years ago and dataset B from within two years from the candidate data; then, based on the data call frequency condition, filter out dataset B1 with a call frequency less than 10 from dataset B; and integrate dataset A and dataset B1 to obtain pre-selected data. Similarly, if filtering is performed based on the data call frequency condition first, the process for obtaining pre-selected data is: first, based on the data call frequency condition, filter out dataset C with a data call frequency less than 10 and dataset D with a data call frequency greater than or equal to 10 from the candidate data; then, based on the data creation time condition, filter out dataset D1 from two years ago from dataset D; and integrate datasets C and D1 to obtain pre-selected data. As another example, the common screening conditions for business requirement information representation are: data creation time is two years ago and data call frequency is less than 10. The screening process for obtaining the preselected data can be as follows: based on the data creation time condition, select dataset E from two years ago from the candidate data, and then based on the data call frequency condition, select dataset F with a call frequency less than 10 from dataset E to obtain the preselected data. It should be noted that the business requirement information may also include other types of screening condition information, which is not specifically limited in other embodiments.
[0109] In step S303 of some embodiments, the data category information corresponds to the data label information, and both are used to indicate the characteristics of the data. The pre-selected data is screened and processed according to the data category information and the data label information, that is, data with a certain data characteristic is screened out from the pre-selected data. For a specific example, Company M has sold three products in the past two years: Product A, Product B, and Product C, of which Product A and Product B are currently on sale, and Product C has been discontinued. Therefore, the data corresponding to Product A and Product B in the pre-selected data have data labels for products on sale, while the data corresponding to Product C in the pre-selected data have data labels for discontinued products. If it is necessary to know the current sales status of the company's products based on the pre-selected data, the data category information can be configured as discontinued product data, and the data of discontinued products can be screened out from the pre-selected data as selected data. After deleting the selected data, the sales status of the company's products can be analyzed through the retained data. In other embodiments, the data characteristics indicated by the data category information and the data label information are not specifically limited.
[0110] See also Figure 4 In some embodiments, the current data includes: currently selected data and currently reserved data; the third data volume includes: the currently selected data volume and the currently reserved data volume; step S106 includes but is not limited to steps S401 to S404:
[0111] Step S401, filtering the current data according to the deletion condition information to obtain the currently selected data;
[0112] Step S402, filtering the current data according to the currently selected data to obtain the currently retained data;
[0113] Step S403, calculating the data volume of the currently selected data to obtain the currently selected data volume;
[0114] Step S404: Calculate the amount of currently retained data to obtain the currently retained data amount.
[0115] In steps S401 to S404 of the embodiment of the present application, the current data is filtered and divided by deletion condition information to obtain the currently retained data and the currently selected data, and the data volume of the currently retained data and the data volume of the currently selected data are directly calculated to facilitate subsequent data deletion result judgment.
[0116] In other embodiments, the amount of all valid data in the storage space where the data that needs to be retained in the candidate data is located after the data deletion operation is performed can also be calculated as the amount of data currently retained, and the amount of all valid data in the storage space where the selected data is located can be calculated as the amount of data currently selected data.
[0117] In step S401 of some embodiments, the currently selected data is the data in the current data that meets the deletion condition, that is, the data that is expected to be deleted.
[0118] In step S402 of some embodiments, the currently retained data is the data in the current data that does not meet the deletion condition, that is, the data expected to be retained. It is understood that after the currently selected data is filtered out from the current data using the deletion condition information, the portion of the current data excluding the currently selected data is the currently retained data.
[0119] In step S403 and step S404 of some embodiments, after the currently selected data and the currently retained data are screened out according to the deletion condition information, the data volumes are calculated to obtain the currently selected data volume and the currently retained data volume, respectively.
[0120] See also Figure 5 In some embodiments, the data volume comparison information includes: omission and deletion determination information and erroneous deletion step S107 includes but is not limited to step S501 and step S502:
[0121] Step S501, performing omission and deletion determination based on the first data volume and the currently selected data volume to obtain omission and deletion determination information;
[0122] Step S502: Perform an erroneous deletion determination based on the first data amount, the second data amount, and the current retained data amount to obtain erroneous deletion determination information.
[0123] In step S501 and step S502 shown in the embodiment of the present application, ideally, after the candidate data is deleted according to the selected data, the current retained data volume is equal to the difference between the second data volume and the first data volume, and the current selected data volume is equal to zero, that is, the current data contains and only contains the part of the candidate data that needs to be retained. If the operation of deleting data makes an error, then: the current retained data volume is less than the difference between the second data volume and the first data volume, that is, there is an erroneous deletion, and / or the current selected data volume is not equal to zero, that is, there is a missed deletion. By comparing the data volume of the candidate data and the selected data before the deletion operation and the data volume of the current data after the deletion operation, and separately determining missed deletion and erroneous deletion, a more accurate data deletion result can be obtained.
[0124] In step S501 of some embodiments, before the data deletion operation is performed, the selected data is not blank data and the first data amount is not zero. After the data deletion operation is performed, under normal circumstances, the currently selected data is blank data and the currently selected data amount is zero. If the data deletion operation fails, the currently selected data amount is not zero, and the omission determination information indicates that omissions have occurred.
[0125] In step S502 of some embodiments, the difference between the second data amount and the first data amount represents the amount of data in the candidate data that needs to be retained. Normally, the amount of data in the candidate data that needs to be retained remains unchanged before and after the data deletion operation. Therefore, the current retained data amount is equal to the difference between the second data amount and the first data amount. If the current retained data amount is less than the difference between the second data amount and the first data amount, it indicates that an error has occurred.
[0126] See also Figure 6 In some embodiments, the data processing result information includes: deletion success information, omission deletion warning information, and mistaken deletion warning information. Step S108 includes but is not limited to one of the following steps:
[0127] Step S601: If the omission deletion determination information indicates that no data is omission-deleted and the erroneous deletion determination information indicates that no data is erroneously deleted, then deletion success information is generated;
[0128] Step S602: If the omission determination information indicates that data is omission-deleted, omission-deletion warning information is generated;
[0129] Step S603: If the erroneous deletion determination information indicates erroneous deletion of data, erroneous deletion warning information is generated.
[0130] In steps S601 to S603 shown in the embodiment of the present application, if the amount of currently retained data is equal to the difference between the second amount of data and the first amount of data, and the amount of currently selected data is equal to zero, then the data processing result information indicates that the data deletion is successful; if the amount of currently retained data is less than the difference between the second amount of data and the first amount of data, that is, there is an erroneous deletion, and / or the amount of currently selected data is not equal to zero, that is, there is an omission, then the data processing result information indicates that the data deletion failed, and prompts that there is an erroneous deletion and / or an omission in the data deletion operation. The data deletion result represented by the data amount comparison information generates data processing result information and sends it to the user, so that the user can obtain the execution status of the data deletion operation.
[0131] In step S601 of some embodiments, if the omission deletion determination information indicates that no data is omission-deleted and the erroneous deletion determination information indicates that no data is erroneously deleted, it indicates that the data deletion operation is successfully executed, and a deletion success message is generated to inform the user.
[0132] In step S602 of some embodiments, if the omission determination information indicates that data has been missed, a omission warning message is generated to prompt the user that a omission has occurred. The user can manually delete the missed data or reconfigure the data deletion conditional instructions and then perform the automatic deletion operation again.
[0133] In step S603 of some embodiments, if the mistaken deletion determination information indicates mistaken deletion of data, a mistaken deletion warning message is generated to prompt the user of mistaken deletion, and the user can restore the mistakenly deleted data from a pre-backed-up database.
[0134] See also Figure 7 In some embodiments, after step S108, the method for detecting data deletion results further includes but is not limited to:
[0135] Repairing the currently retained data specifically includes but is not limited to steps S701 to S703:
[0136] Step S701: receiving the retained data information fed back by the user according to the mistaken deletion warning information;
[0137] Step S702: extracting backup data from a preset backup database according to the retained data information;
[0138] Step S703: Repair the currently retained data according to the backup data.
[0139] In steps S701 to S703 illustrated in this embodiment of the present application, after receiving the mistaken deletion warning message, the user feeds back retained data information based on the data to be retained to the operating system or device performing the data deletion operation. The operating system or device extracts backup data from the backup database based on the fed-back retained data information and uses the backup data to restore the missing portions of the currently retained data, thereby ensuring that all data required to be retained remains intact after the deletion operation.
[0140] In step S701 of some embodiments, the retained data information is information provided by the user based on the accidental deletion warning information and the data intended to be retained. The user can search for the accidentally deleted data based on the accidental deletion warning information and, through relevant operating instructions, provide retained data information that accurately corresponds to the accidentally deleted data, facilitating subsequent recovery of the accidentally deleted data. In other embodiments, the user can also provide complete information about the data intended to be retained to the relevant operating system or device, thereby saving the time of manually searching for the accidentally deleted data.
[0141] In step S702 of some embodiments, corresponding backup data is searched in a preset backup database based on the retained data information fed back by the user, so as to repair the mistakenly deleted data.
[0142] In step S703 of some embodiments, after the corresponding backup data is found in the preset backup database, it is written to the storage space location of the mistakenly deleted data to repair the currently retained data so that the repaired data is consistent with the expected data to be retained.
[0143] See also Figure 8The present application also provides a data deletion result detection device that can implement the above-mentioned data deletion result detection method. The device includes:
[0144] An information acquisition module is used to acquire pre-configured preset configuration information; wherein the preset configuration information includes: database information and deletion condition information;
[0145] A first data screening module is used to screen candidate data from a preset database based on database information;
[0146] The second data screening module is used to screen the candidate data according to the deletion condition information to obtain the selected data;
[0147] A first calculation module is used to calculate the data volume of the selected data to obtain a first data volume, and to calculate the data volume of the candidate data to obtain a second data volume;
[0148] The data deletion module is used to delete the candidate data according to the selected data to obtain the current data;
[0149] A second calculation module is used to calculate the data volume of the current data to obtain a third data volume;
[0150] a comparison processing module, configured to compare the first data volume, the second data volume, and the third data volume to obtain data volume comparison information;
[0151] The information prompt module is used to generate data processing result information based on the data volume comparison information; wherein the data processing result information is used to indicate whether the data deletion is successful or failed.
[0152] The specific implementation of the data deletion result detection device is basically the same as the specific embodiment of the data deletion result detection method described above, and will not be repeated here.
[0153] The present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned data deletion result detection method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, an in-vehicle computer, or the like.
[0154] See also Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:
[0155] The processor 901 may be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0156] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the data deletion result detection method of the embodiments of this application;
[0157] Input / output interface 903, used to implement information input and output;
[0158] Communication interface 904, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);
[0159] Bus 905 , which transmits information between various components of the device (e.g., processor 901 , memory 902 , input / output interface 903 , and communication interface 904 );
[0160] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0161] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, which implements the above-mentioned data deletion result detection method when executed by a processor.
[0162] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0163] The data deletion result detection method, device, electronic device and storage medium proposed in this application automatically obtain the data deletion result by calculating the data volume of relevant data before and after the deletion operation, and comparing the data volume to determine the data deletion result. There is no need to manually review the data to determine the result, which saves the time required for judgment and can quickly obtain the data deletion result.
[0164] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0165] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0166] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0167] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0168] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are applicable to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0169] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0170] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0171] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0172] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0173] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0174] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.
Claims
1. A method for detecting data deletion results, characterized in that: The method comprises: Obtain pre-configured preset configuration information; wherein the preset configuration information includes: database information and deletion condition information; the database information includes: library name information and table name information; the deletion condition information includes: business requirement information and data category information; Filtering candidate data from a preset database according to the database information; Screening the candidate data according to the deletion condition information to obtain selected data; Performing data volume calculation on the selected data to obtain a first data volume, and performing data volume calculation on the candidate data to obtain a second data volume; Deleting the candidate data according to the selected data to obtain current data; wherein the current data includes: currently selected data and currently retained data; Calculating the data volume of the current data to obtain a third data volume; wherein the third data volume includes: a currently selected data volume and a currently retained data volume; Comparing the first data volume, the second data volume, and the third data volume to obtain data volume comparison information; wherein the data volume comparison information includes omission and deletion determination information and erroneous deletion determination information; Generating data processing result information according to the data volume comparison information; wherein the data processing result information is used to indicate whether the data deletion is successful or failed; The step of calculating the data volume of the current data to obtain the third data volume includes: Filter the current data according to the deletion condition information to obtain the currently selected data; Filtering the current data according to the currently selected data to obtain the currently retained data; Calculating the amount of the currently selected data to obtain the amount of the currently selected data; Calculating the amount of the currently retained data to obtain the currently retained data amount; The step of comparing the first data volume, the second data volume, and the third data volume to obtain data volume comparison information includes: Perform omission and deletion determination based on the first data amount and the currently selected data amount to obtain the omission and deletion determination information; An erroneous deletion determination is performed based on the first data amount, the second data amount, and the currently retained data amount to obtain the erroneous deletion determination information.
2. The method for detecting data deletion results according to claim 1, wherein: The step of screening candidate data from a preset database according to the database information includes: The preset database is screened according to the database name information to obtain a target database; wherein the target database includes at least one preset data table; The candidate data is screened out from the preset data table according to the table name information.
3. The method for detecting data deletion results according to claim 1, wherein: The step of screening the candidate data according to the deletion condition information to obtain selected data includes: Acquire data information of the candidate data; wherein the data information includes: call frequency information, data tag information, and creation time information; Screening the candidate data according to the business demand information, the creation time information, and the call frequency information to obtain pre-selected data; The pre-selected data is screened according to the data category information and the data tag information to obtain the selected data.
4. The method for detecting data deletion results according to claim 1, wherein: The data processing result information includes: deletion success information, omission deletion warning information, and erroneous deletion warning information. The step of generating the data processing result information based on the data volume comparison information includes one of the following steps: If the omission deletion determination information indicates that no data is omission-deleted, and the erroneous deletion determination information indicates that no data is erroneously deleted, generating the deletion success information; If the omission and deletion determination information indicates that data is omission and deletion is detected, generating the omission and deletion warning information; If the erroneous deletion determination information indicates erroneous deletion of data, the erroneous deletion warning information is generated.
5. The method for detecting data deletion results according to claim 4, wherein: After the step of generating data processing result information according to the data volume comparison information, the method further includes: Repairing the currently retained data specifically includes: receiving the retained data information fed back by the user according to the mistaken deletion warning information; Extracting backup data from a preset backup database according to the retained data information; The currently retained data is repaired according to the backup data.
6. A data deletion result detection device, characterized in that: The device comprises: An information acquisition module, configured to acquire pre-configured preset configuration information; wherein the preset configuration information includes: database information and deletion condition information; A first data screening module is configured to screen candidate data from a preset database based on the database information; the database information includes: database name information and table name information; the deletion condition information includes: business requirement information and data category information; A second data screening module is used to screen the candidate data according to the deletion condition information to obtain selected data; a first calculation module, configured to calculate the data volume of the selected data to obtain a first data volume, and to calculate the data volume of the candidate data to obtain a second data volume; A data deletion module is used to delete the candidate data according to the selected data to obtain current data; wherein the current data includes: currently selected data and currently retained data; A second calculation module is configured to calculate the data volume of the current data to obtain a third data volume; wherein the third data volume includes: a currently selected data volume and a currently retained data volume; a comparison processing module, configured to compare the first data volume, the second data volume, and the third data volume to obtain data volume comparison information; wherein the data volume comparison information includes omission and deletion determination information and erroneous deletion determination information; An information prompt module, configured to generate data processing result information based on the data volume comparison information; wherein the data processing result information is used to indicate whether the data deletion is successful or failed; The step of calculating the data volume of the current data to obtain the third data volume includes: Filter the current data according to the deletion condition information to obtain the currently selected data; Filtering the current data according to the currently selected data to obtain the currently retained data; Calculating the amount of the currently selected data to obtain the amount of the currently selected data; Calculating the amount of the currently retained data to obtain the currently retained data amount; The step of comparing the first data volume, the second data volume, and the third data volume to obtain data volume comparison information includes: Perform omission and deletion determination based on the first data amount and the currently selected data amount to obtain the omission and deletion determination information; An erroneous deletion determination is performed based on the first data amount, the second data amount, and the currently retained data amount to obtain the erroneous deletion determination information.
7. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the data deletion result detection method according to any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for detecting data deletion results according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Data deleting method and terminal
CN104679851A
Database data deletion method and device, electronic equipment and storage medium
CN107368563A