CN115357598A - Data modification method and device, computer equipment and storage medium - Google Patents

Data modification method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115357598A
CN115357598A CN202211114028.9A CN202211114028A CN115357598A CN 115357598 A CN115357598 A CN 115357598A CN 202211114028 A CN202211114028 A CN 202211114028A CN 115357598 A CN115357598 A CN 115357598A
Authority
CN
China
Prior art keywords
data
field
type
modified
modification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211114028.9A
Other languages
Chinese (zh)
Inventor
刘健君
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202211114028.9A priority Critical patent/CN115357598A/en
Publication of CN115357598A publication Critical patent/CN115357598A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the field of data processing, and discloses a data modification method, a data modification device, computer equipment and a storage medium, wherein the method comprises the steps of receiving a data type selection instruction, and selecting a data type to be modified from a data modification type table according to the data type selection instruction; acquiring a type field table, and finding out a field to be modified corresponding to the type of the data to be modified in the type field table; acquiring a check formula table, and searching a check formula corresponding to the field to be modified in the check formula table; verifying the data of the field to be modified according to a verification formula to generate a field verification result; and determining abnormal data of the field to be modified according to the field verification result, and updating the abnormal data to finish data modification. The invention can integrate different data modification types together, realize self-service operation and check abnormal data, simplify the data modification process and facilitate the operation of users; meanwhile, data modification can be configured in real time, and the data modification efficiency is improved.

Description

Data modification method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a data modification method and apparatus, a computer device, and a storage medium.
Background
Structured Query Language (SQL) is a database Query and programming Language for accessing data and querying, updating, and managing relational database systems. People can not study and live with various application software, the application software inevitably generates data errors when in use, and abnormal data of an SQL database needs to be checked and modified into correct data. The existing database modification mainly depends on a user to manually correct data to find errors and submit exceptions, an operation and maintenance manager writes SQL statements to check and modify the exception data according to the exceptions submitted by the user, a data modification function available for the user is added, and configuration of correct data is completed by reissuing an application version.
When a user submits abnormal data once, an operation and maintenance manager needs to add a data modification function once, and needs to reconfigure an application delivery version to complete modification, so that the data modification operation is inconvenient, the modification efficiency is low, and the use experience of the user is influenced.
Disclosure of Invention
Therefore, in order to solve the technical problems, it is necessary to provide a data modification method, apparatus, computer device and storage medium, so as to solve the problems of inconvenient operation and low modification efficiency caused by the fact that the application is re-issued by an operation and maintenance administrator after a user submits each data modification.
A method of data modification, comprising:
receiving a data type selection instruction, and selecting a data type to be modified from a data modification type table according to the data type selection instruction;
acquiring a type field table, and finding out a field to be modified corresponding to the type of the data to be modified in the type field table;
acquiring a check formula table, and searching a check formula corresponding to the field to be modified in the check formula table;
verifying the data of the field to be modified according to the verification formula to generate a field verification result;
and determining abnormal data of the field to be modified according to the field checking result, and updating the abnormal data to finish data modification.
A data modification apparatus, comprising:
the type selection module is used for receiving a data type selection instruction and selecting a data type to be modified from a data modification type table according to the data type selection instruction;
the field searching module is used for acquiring a type field table and searching a field to be modified corresponding to the type of the data to be modified in the type field table;
the formula searching module is used for acquiring a check formula table and searching a check formula corresponding to the field to be modified in the check formula table;
the formula checking module is used for checking the data of the field to be modified according to the checking formula to generate a field checking result;
and the data modification module is used for determining the abnormal data of the field to be modified according to the field verification result and updating the abnormal data to complete data modification.
A computer device comprising a memory, a processor and computer readable instructions stored in the memory and executable on the processor, the processor implementing the data modification method when executing the computer readable instructions.
One or more readable storage media storing computer-readable instructions which, when executed by one or more processors, cause the one or more processors to perform a data modification method as described above.
According to the data modification method, the data modification device, the computer equipment and the storage medium, the data type to be modified is selected from the data modification type table according to the data type selection instruction by receiving the data type selection instruction; acquiring a type field table, and searching out a field to be modified corresponding to the type of the data to be modified in the type field table; acquiring a check formula table, and finding out a check formula corresponding to the field to be modified in the check formula table; verifying the data of the field to be modified according to a verification formula to generate a field verification result; and determining abnormal data of the field to be modified according to the field verification result, and updating the abnormal data to finish data modification. The data modification method provided by the invention can integrate different data modification types through the data modification type table, so that a user can conveniently select and operate the data modification type table; the abnormal data is verified through self-service operation according to the corresponding relation of the data modification type table, the type field table and the verification formula table, and a user does not need to feed back the abnormal data with an operation and maintenance manager, so that the data modification process is simplified, and a large amount of time and labor are saved; meanwhile, data modification can be configured in real time, codes do not need to be modified by an operation and maintenance manager, and the application version is reissued, so that the data modification efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a flow chart of a data modification method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a data modification apparatus according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
In one embodiment, as shown in FIG. 1, a data modification method is provided, comprising the following steps S10-S50.
S10, receiving a data type selection instruction, and selecting a data type to be modified from a data modification type table according to the data type selection instruction.
Understandably, the data modification method provided by the embodiment is used for modifying the data of the database by a common user (not an administrator). A database is a collection of tables (tables), which are the basic elements of a database, the database objects used to store data in a relational database. The database contains one or more tables, and these tables can be modeled as relational tables. A table is made up of columns (columns), each column must have a corresponding data type, which contains table name information, and a type field, which contains column name information, the columns store data objects according to a defined data type, and each column corresponds to a data object. The data types of the SQL database are as follows: integer type, floating point type, string data type, boolean type.
In this embodiment, all modifiable data modification types in the database are collected into one data modification type table, and when a user wants to modify a certain data object, the user first selects a data modification type on a front-end page, and the database background receives a data type selection instruction, and selects a data type to be modified from the data modification type table according to the data type selection instruction.
S20, a type field table is obtained, and a field to be modified corresponding to the data type to be modified is found in the type field table.
Understandably, the type field is a field or a name that a data type needs to be displayed, one data type corresponds to a plurality of type fields, in this embodiment, the type display fields corresponding to all modifiable data types in the database are collected into one type field table, and after the data type to be modified is selected, the database background automatically finds out the field to be modified corresponding to the data type to be modified from the type field table.
For example, as shown in table 1 below, a configuration table for a rental contract for a user page:
table 1 contract table for renting house
ID Name (I) Telephone set Amount of contract
101 Zhang San 12345678910 1000
102 Li Si 12345678911 1100
103 Wang Wu 12345678912 1200
104 Zhao Liu 12345678914 1300
The ID in table 1 is a unique number identifier corresponding to each row of data, and is not repeatable, and is defaulted to an automatic number sequence, and is used for determining a unique corresponding data object according to the type field of each column and the ID of each row. In this embodiment, the user selects an integer type as the data type to be modified from the data modification type table corresponding to the house-renting contract table, and the field to be modified corresponding to the data type to be modified is an ID field, a telephone field, and a contract amount field.
And S30, acquiring a check formula table, and searching for a check formula corresponding to the field to be modified in the check formula table.
Understandably, the check formula is used to check the data objects of each row in the columns of the type field one by one, and each column type field corresponds to one check formula. In this embodiment, the check formulas corresponding to all the modifiable type fields in the database are collected into one check formula table, and after the field to be modified is found, the database background automatically finds the check formula corresponding to the field to be modified from the check formula table. In this embodiment, the field to be modified is an ID field, a telephone field, and a contract amount field, and the check formula corresponding to the field to be modified is an ID check formula, a telephone check formula, and a contract amount check formula.
And S40, verifying the data of the field to be modified according to the verification formula to generate a field verification result.
Understandably, each column of fields to be modified comprises a plurality of data objects, after the check formula corresponding to the fields to be modified is found out, the data objects of each column of fields to be modified are checked line by line through the corresponding check formula, the data objects meeting the check formula are marked as normal data, and the data objects not meeting the check formula are marked as abnormal data. For example, in the present embodiment, the data objects ("12345678910", "12345678911", "12345678912", and "12345678914") included in the column corresponding to the telephone field are checked line by line according to the telephone check formula, so as to obtain the normal telephone data ("12345678910", "12345678911", "12345678912") and the abnormal telephone data ("12345678914"), and generate the check result.
S50, determining abnormal data of the field to be modified according to the field verification result, and updating the abnormal data to complete data modification.
Understandably, the field checking result comprises two results of checking normal and checking abnormal, data modification is not needed for the data object which is checked normally, and data modification is carried out for the abnormal data which is checked abnormally. For example, in the present embodiment, according to the field check result, no operation is performed on the normal telephone data ("12345678910", "12345678911", "12345678912"), and the data modification is completed after the correct data is entered for the abnormal telephone data ("12345678914") and updated to the correct data ("12345678913").
In the embodiment, the data type to be modified is selected from the data modification type table according to the data type selection instruction by receiving the data type selection instruction; acquiring a type field table, and finding out a field to be modified corresponding to the type of the data to be modified in the type field table; acquiring a check formula table, and searching a check formula corresponding to the field to be modified in the check formula table; verifying the data of the field to be modified according to a verification formula to generate a field verification result; and determining abnormal data of the field to be modified according to the field verification result, and updating the abnormal data to finish data modification. In the embodiment, different data modification types are integrated through the data modification type table, so that a user can conveniently select and operate the data modification type table; self-service operation verification is realized through the corresponding relation of the data modification type table, the type field table and the verification formula table, a user does not need to feed back with an operation and maintenance manager, the data modification process is simplified, and a large amount of time and labor are saved; meanwhile, data modification can be configured in real time, codes do not need to be modified by an operation and maintenance manager, and the application version is re-issued, so that the data modification efficiency is improved.
Optionally, in step S20, that is, before the obtaining the type field table and finding the to-be-modified field corresponding to the to-be-modified data type in the type field table, the method includes:
s201, generating a query SQL statement corresponding to the field to be modified according to a first preset format;
s202, adding the query SQL statement into a preset query SQL table to generate a query SQL table; the preset query SQL table is used for configuring query SQL sentences corresponding to the specified fields;
s203, acquiring a plurality of source data of the field to be modified, and generating a plurality of modified SQL statements corresponding to the source data according to a second preset format;
s204, adding the plurality of modified SQL statements into a preset modified SQL table to generate a modified SQL table; and the preset modified SQL table is used for configuring modified SQL statements corresponding to the specified source data.
Understandably, the application software needs to operate the SQL database through the SQL statements, and the conventional basic operations of the SQL database include: adding (insert), deleting (delete), modifying (update), and querying (select). After the field to be modified corresponding to the type of the data to be modified is found in the type field table, query operation needs to be performed on the SQL database to obtain all data objects contained in the field to be modified. The first preset format is a common format for query SQL statements, such as: select column name from table name, where "column name" corresponds to the field to be modified and "table name" is included in the information of the data type to be modified. Generating query SQL statement parameters, namely a column name parameter and a table name parameter, according to the field to be modified, and substituting the column name parameter and the table name parameter into a first preset format to generate a complete query SQL statement, namely the query SQL statement corresponding to the field to be modified.
In the SQL database, the relational schema in the conventional relational model is called a Base Table (Base Table), the Base Table is an independent Table, and one relationship corresponds to one Base Table. Before the field to be modified corresponding to the data type to be modified is found in the type field table, the query SQL sentence corresponding to the field to be modified is configured on a basic table to obtain a preset query SQL table, so that the corresponding query SQL sentence can be found according to the field to be modified. The preset query SQL table is used for configuring the query SQL statements corresponding to the specified fields, the preset query SQL table is a basic table before the query SQL statements corresponding to the fields to be modified are added, and the generated query SQL table is a basic table after the complete query SQL statements are added.
When the field check result contains abnormal data, the SQL database needs to be modified to obtain a database of correct data objects. The second preset format is a general format for modifying SQL statements, such as: the set column name of the update table name = the name of the correct data where the column name of the set column name is the column corresponding to the field to be modified, the correct data is the modified data object value, and the name of the correct column = the data value is the value of the data object to be modified in a certain row and a certain column. The SQL database includes a plurality of data tables, each data table storing data includes source data and target data, as shown in table 2 below, a table is configured for the source data of a rental contract of the SQL database, the source data is original data, i.e., correct data, of the data stored in the SQL database, as shown in table 1 above, the target data is data of a user page, i.e., data to be modified, which is equivalent to mapping of the source data, and abnormal data may be generated due to an error in operation of application software, and the corresponding source data, i.e., correct data, may be found out according to the abnormal data. And generating a modified SQL statement parameter according to correct data in the source data, and substituting the modified SQL statement parameter into a second preset format to generate a complete modified SQL statement, namely the modified SQL statement corresponding to the source data. Before the field to be modified corresponding to the data type to be modified is found in the type field table, the modified SQL statement is configured on a basic table to obtain a preset modified SQL table, so that the modified SQL statement corresponding to the source data can be found according to the abnormal data. The preset modified SQL table is used for configuring modified SQL sentences corresponding to the specified source data, the preset modified SQL table is a basic table before the modified SQL sentences corresponding to the source data of the fields to be modified are added, and the generated modified SQL table is a basic table after the complete modified SQL sentences are added.
Table 2 source data of contract table for renting house
ID Name (I) Telephone set Amount of contract
101 Zhang San 12345678910 1000
102 Li Si 12345678911 1100
103 Wang Wu 12345678912 1200
104 Zhao liu xi 12345678913 1300
In the embodiment, the query SQL statement corresponding to the field to be modified is generated according to the first preset format and added to the query SQL table, and the modification SQL statement corresponding to the source data is generated according to the second preset format and added to the modification SQL table, so that the user can compile the SQL statement by the operation and maintenance manager without feedback with the operation and maintenance manager, self-service query and modification are realized, the data modification process is simplified, and a large amount of time and labor are saved.
Optionally, in step S40, that is, the verifying the data of the field to be modified according to the verification formula, and generating a field verification result, the method includes:
s401, loading the query SQL table, and finding out a query SQL statement corresponding to the field to be modified in the query SQL table;
s402, executing the query SQL sentence to query a database to obtain the target data of the field to be modified;
and S403, verifying the target data according to the verification formula to generate a field verification result.
Understandably, when the field to be modified is the phone field in this embodiment, the corresponding query SQL statement is found from the query SQL table as "select phone from rented house contract table", and the statement is executed to query the database, so as to obtain the target data ("12345678910", "12345678911", "12345678912", and "12345678914") corresponding to the phone field in the rented house contract table. And acquiring a telephone verification formula corresponding to the telephone field, and performing line-by-line verification on the data object corresponding to the telephone field according to the telephone verification formula to acquire normal telephone data ("12345678910", "12345678911", "12345678912") and abnormal telephone data ("12345678914"), and generating a verification result.
In the embodiment, the query SQL statement corresponding to the field to be modified is found out in the query SQL table, the query SQL statement is executed to query the database to obtain the target data, the target data is verified according to the verification formula corresponding to the field to be modified, and the field verification result is generated, so that the user does not need to feed back the verification formula to an operation and maintenance manager, self-service query and verification are realized, and the data modification process is simplified.
Optionally, in step S50, that is, the determining abnormal data of the field to be modified according to the field verification result, and updating the abnormal data to complete data modification includes:
s501, if the field verification result is abnormal, acquiring the source data of the field to be modified;
s502, loading the modified SQL table, and finding out a modified SQL statement corresponding to the source data in the modified SQL table;
s503, executing the SQL modifying statement to modify the database so as to write the source data into the field to be modified.
Understandably, in this embodiment, according to the field check result, no operation is performed on the normal telephone data ("12345678910", "12345678911", "12345678912"), and the correct data ("12345678913") corresponding to the source data of the telephone field is acquired for the abnormal telephone data ("12345678914"), and the modified SQL statement "update rente contract table set telephone =12345678913where id =104" corresponding to the correct data is found in the modified SQL table, and is executed to modify the database, and the correct data is entered into the telephone field of the user page, and then the data modification is completed. And the background can carry out corresponding statement format verification on the entered correct data during entry, after the statement format verification is passed, the submitted correct data is further subjected to security problem detection such as SQL injection, xss attack and the like, and the abnormal data can be modified after the detection is passed.
In the embodiment, the modified SQL statement corresponding to the source data of the abnormal data is found out in the modified SQL table, and the modified SQL statement is executed to modify the database so as to record the source data as correct data to complete data modification, so that a user does not need to rely on an operation and maintenance manager to modify codes to reissue an application version, self-service modification is realized, and a data modification flow is simplified; format verification and safety detection are carried out during recording, and the safety of data modification is ensured; meanwhile, data modification can be configured in real time, and the data modification efficiency is improved.
Optionally, in step S10, before the step of selecting the data type to be modified from the data modification type table according to the data type selection instruction, the method includes:
s101, receiving a data modification type newly increased instruction, and creating a data modification type according to the data modification type newly increased instruction;
s102, judging whether the data newly-added modification type exists in a preset modification type table, wherein the preset modification type table is used for configuring a specified data modification type;
s103, if the new data addition modification type does not exist in the preset modification type table, adding the new data addition modification type into the preset modification type table to generate the data modification type table.
Understandably, all modifiable data types in the database are configured on a basic table to obtain a preset modification type table, and the preset modification type table is used for configuring the specified data modification type so that a user can select the data type to be modified. The preset modification type table is used for a user to select a data type to be modified from the preset modification type table, and can be continuously updated when the data modification type in the database changes. When the data type in the modification type table cannot meet the modification requirement, a data modification type adding instruction can be generated according to the requirement, a corresponding data addition modification type is created and added to the existing modification type table, the preset modification type table is a basic table before the data addition modification type is added, and the generated data modification type table is a basic table after the data addition modification type is added. In this embodiment, if the user wants to modify the data of the string data, a new string data modification type is created, whether the new string data modification type exists in the preset modification type table is determined, and when the new string data modification type does not exist in the preset modification type table, the new string data modification type is added to the preset modification type table to generate the data modification type table.
The embodiment realizes the addition and update of the data newly added modification type through the data modification type newly added instruction, integrates different data modification types, completes the generation and update of the data modification type table before the user selects the data modification type, is convenient for the user to operate, and ensures the efficiency of data modification.
Optionally, in step S20, before the obtaining the type field table and finding the to-be-modified field corresponding to the to-be-modified data type in the type field table, the method further includes:
s205, analyzing the data newly added modification type to obtain a display field corresponding to the data newly added modification type;
s206, creating a type newly-added field according to the display field;
and S207, adding the type newly added field into a preset field table to generate the type field table.
Understandably, the display field is a field or a name of the data type to be displayed, and when the data addition modification type appears in the data modification type table, the data addition modification type is analyzed to obtain the corresponding display field; and when the existing data modification type has a new added column, creating a type new added field according to the display field of the new added column. The preset field table is used for configuring type fields corresponding to the specified data types, and configuring the type fields corresponding to the specified data modification types in the data modification type table to a basic table to obtain the preset field table, so that the corresponding fields to be modified can be found out according to the data types to be modified. The preset field table is used for searching the field to be modified, and can be continuously updated when the type field corresponding to the data modification type changes. The preset field table is a basic table before the type new field is added, and the generated type field table is a basic table after the type new field is added. In this embodiment, a string data modification type is added to the data modification type table, if a display field corresponding to the string data modification type in table 1 is a name field, a name addition field is created, it is determined whether the name addition field exists in the preset field table, and if the name addition field does not exist in the preset field table, the name addition field is added to the preset field table to generate a type field table.
The embodiment creates the type new field by analyzing the data new modification type, realizes the addition and update of the type new field, integrates the type fields corresponding to the data modification type, is convenient for searching the type fields corresponding to the data modification type, and ensures the efficiency of data modification.
Optionally, in step S30, before obtaining the check formula table and finding the check formula corresponding to the field to be modified in the check formula table, the method includes:
s301, judging whether a check formula corresponding to the type added field exists in a database or not;
s302, if the new type field exists, acquiring a check formula corresponding to the new type field as a new check formula; if the type of the new field does not exist, creating a new verification formula corresponding to the type of the new field according to a pre-configured verification rule;
and S303, adding the check new formula into a preset formula table to generate the check formula table.
Understandably, the preset formula table is used for configuring the check formula corresponding to the specified type field, the check formula is a formula for checking a column of data objects contained in the type field, and the check formula corresponding to the specified type field in the type field table is configured on a basic table to obtain the preset formula table, so that the corresponding check formula can be found out according to the field to be modified. The preset formula table is used for searching the check formula corresponding to the field to be modified, and can be continuously updated when the check formula corresponding to the type field changes. When the newly added type field appears in the type field table, inquiring the database to judge whether a check formula corresponding to the newly added type field exists, and if so, importing the check formula corresponding to the newly added type field from the database according to the user authority to serve as the newly added check formula; and if the new check formula does not exist, creating a new check formula corresponding to the type new field according to the pre-configured check rule of the data object in the database, and adding the new check formula into a preset formula table. The preset formula table is a basic table before the new check formula is added, and the generated check formula table is a basic table after the new check formula is added. In this embodiment, a name field is newly added to the type field table, it is determined whether a name check formula exists in the database to create a name check formula, it is further determined whether a name check formula exists in the preset formula table, and when the name check formula does not exist in the preset formula table, the name check formula is added to the preset formula table to generate a check formula table.
In the embodiment, the check formula in the database is judged to obtain the check new formula corresponding to the type new field, so that the addition and the update of the check new formula are realized, the check formulas corresponding to the type field are integrated, the check formula corresponding to the type field is convenient to search, and the check accuracy and the data modification efficiency are ensured.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In an embodiment, a data modification apparatus is provided, and the data modification apparatus corresponds to the data modification method in the above embodiment one to one. As shown in fig. 2, the data modification apparatus includes a type selection module 10, a field lookup module 20, a formula lookup module 30, a formula check module 40, and a data modification module 50. The functional modules are explained in detail as follows:
the type selection module 10 is configured to receive a data type selection instruction, and select a data type to be modified from a data modification type table according to the data type selection instruction;
a field searching module 20, configured to obtain a type field table, and search for a to-be-modified field corresponding to the to-be-modified data type in the type field table;
the formula searching module 30 is configured to obtain a check formula table, and search for a check formula corresponding to the field to be modified in the check formula table;
the formula checking module 40 is configured to check the data of the field to be modified according to the checking formula, and generate a field checking result;
and the data modification module 50 is configured to determine abnormal data of the field to be modified according to the field verification result, and update the abnormal data to complete data modification.
Optionally, the field lookup module 20 includes:
the query SQL sentence generating unit is used for generating a query SQL sentence corresponding to the field to be modified according to a first preset format;
the query SQL table generating unit is used for adding the query SQL statement into a preset query SQL table to generate a query SQL table; the preset query SQL table is used for configuring query SQL sentences corresponding to the specified fields;
the modified SQL statement generating unit is used for acquiring a plurality of source data of the field to be modified and generating a plurality of modified SQL statements corresponding to the source data according to a second preset format;
the modified SQL table generating unit is used for adding the modified SQL sentences into a preset modified SQL table to generate a modified SQL table; and the preset modified SQL table is used for configuring modified SQL statements corresponding to the specified source data.
Optionally, the formula checking module 40 includes:
the query SQL sentence acquisition unit is used for loading the query SQL table and finding out a query SQL sentence corresponding to the field to be modified in the query SQL table;
the data query unit is used for executing the query SQL statement to query a database to obtain the target data of the field to be modified;
and the data checking unit is used for checking the target data according to the checking formula to generate a field checking result.
Optionally, the data modification module 50 includes:
a source data obtaining unit, configured to obtain source data of the field to be modified if the field check result is abnormal;
a modified SQL statement obtaining unit, configured to load the modified SQL table, and find a modified SQL statement corresponding to the source data in the modified SQL table;
and the data modification unit is used for executing the SQL modification statement to modify the database so as to write the source data into the field to be modified.
Optionally, the type selecting module 10 includes:
the data modification type adding unit is used for receiving a data modification type adding instruction and creating a data modification type according to the data modification type adding instruction;
a type table to be updated judging unit, configured to judge whether the data newly added modification type exists in a preset modification type table, where the preset modification type table is used to configure a specified data modification type;
and the data modification type table generating unit is used for adding the data new modification type into the preset modification type table to generate the data modification type table if the data new modification type does not exist in the preset modification type table.
Optionally, the field searching module 20 further includes:
the newly added modification type analysis unit is used for analyzing the newly added modification type of the data to obtain a display field corresponding to the newly added modification type of the data;
the type added field creating unit is used for creating a type added field according to the display field;
and the type field table generating unit is used for adding the type newly added field into a preset field table to generate the type field table.
Optionally, the formula lookup module 30 includes:
a check formula query judging unit, configured to judge whether a check formula corresponding to the type added field exists in the database;
a check new-added formula generating unit, configured to, if the check new-added formula exists, obtain a check formula corresponding to the type new-added field as a check new-added formula; if the type of the new field does not exist, creating a new verification formula corresponding to the type of the new field according to a pre-configured verification rule;
and the verification formula table generating unit is used for adding the verification new formula into a preset formula table to generate the verification formula table.
For the specific definition of the data modification device, reference may be made to the above definition of the data modification method, which is not described herein again. The modules in the data modification apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a readable storage medium and an internal memory. The readable storage medium stores an operating system, computer readable instructions, and a database. The internal memory provides an environment for the operating system and execution of computer-readable instructions in the readable storage medium. The database of the computer device is used for storing data related to the data modification method. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer readable instructions, when executed by a processor, implement a data modification method. The readable storage media provided by the present embodiments include non-volatile readable storage media and volatile readable storage media.
In one embodiment, a computer device is provided comprising a memory, a processor, and computer readable instructions stored on the memory and executable on the processor, the processor when executing the computer readable instructions implementing the steps of:
receiving a data type selection instruction, and selecting a data type to be modified from a data modification type table according to the data type selection instruction;
acquiring a type field table, and finding out a field to be modified corresponding to the type of the data to be modified in the type field table;
acquiring a check formula table, and searching a check formula corresponding to the field to be modified in the check formula table;
verifying the data of the field to be modified according to the verification formula to generate a field verification result;
and determining abnormal data of the field to be modified according to the field checking result, and updating the abnormal data to finish data modification.
In one embodiment, one or more computer-readable storage media storing computer-readable instructions are provided, the readable storage media provided by the embodiments including non-volatile readable storage media and volatile readable storage media. The readable storage medium has stored thereon computer readable instructions which, when executed by one or more processors, perform the steps of:
receiving a data type selection instruction, and selecting a data type to be modified from a data modification type table according to the data type selection instruction;
acquiring a type field table, and searching out a field to be modified corresponding to the type of the data to be modified in the type field table;
acquiring a check formula table, and searching out a check formula corresponding to the field to be modified in the check formula table;
verifying the data of the field to be modified according to the verification formula to generate a field verification result;
and determining abnormal data of the field to be modified according to the field checking result, and updating the abnormal data to finish data modification.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware related to computer readable instructions, which may be stored in a non-volatile readable storage medium or a volatile readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It should be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units and modules is only used for illustration, and in practical applications, the above function distribution may be performed by different functional units and modules as needed, that is, the internal structure of the apparatus may be divided into different functional units or modules to perform all or part of the above described functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein.

Claims (10)

1. A method of modifying data, comprising:
receiving a data type selection instruction, and selecting a data type to be modified from a data modification type table according to the data type selection instruction;
acquiring a type field table, and finding out a field to be modified corresponding to the type of the data to be modified in the type field table;
acquiring a check formula table, and searching a check formula corresponding to the field to be modified in the check formula table;
verifying the data of the field to be modified according to the verification formula to generate a field verification result;
and determining abnormal data of the field to be modified according to the field checking result, and updating the abnormal data to finish data modification.
2. The data modification method of claim 1, wherein before obtaining the type field table and finding the field to be modified corresponding to the data type to be modified in the type field table, the method comprises:
generating an inquiry SQL statement corresponding to the field to be modified according to a first preset format;
adding the query SQL statement into a preset query SQL table to generate a query SQL table; the preset query SQL table is used for configuring query SQL sentences corresponding to the specified type fields;
obtaining a plurality of source data of the field to be modified, and generating a plurality of modified SQL statements corresponding to the source data according to a second preset format;
adding the plurality of modified SQL statements into a preset modified SQL table to generate a modified SQL table; and the preset modified SQL table is used for configuring modified SQL statements corresponding to the specified source data.
3. The data modification method of claim 2, wherein the verifying the data of the field to be modified according to the verification formula to generate a field verification result comprises:
loading the query SQL table, and finding out a query SQL sentence corresponding to the field to be modified in the query SQL table;
executing the query SQL statement to query a database to obtain the target data of the field to be modified;
and verifying the target data according to the verification formula to generate a field verification result.
4. The data modification method of claim 2, wherein the determining abnormal data of the field to be modified according to the field check result, and updating the abnormal data to complete data modification comprises:
if the field check result is abnormal, acquiring the source data of the field to be modified;
loading the modified SQL table, and finding out a modified SQL statement corresponding to the source data in the modified SQL table;
and executing the modified SQL statement to modify the database so as to write the source data into the field to be modified.
5. The data modification method according to claim 1, wherein before the data type to be modified is selected from the data modification type table according to the data type selection instruction, the method comprises:
receiving a data modification type newly-increased instruction, and creating a data modification type according to the data modification type newly-increased instruction;
judging whether the data newly-added modification type exists in a preset modification type table, wherein the preset modification type table is used for configuring a specified data type;
and if the data newly added modification type does not exist in the preset modification type table, adding the data newly added modification type into the preset modification type table to generate the data modification type table.
6. The data modification method of claim 5, wherein before obtaining the type field table and finding the field to be modified corresponding to the data type to be modified in the type field table, the method further comprises:
analyzing the data newly added and modified type to obtain a display field corresponding to the data newly added and modified type;
creating a type newly-added field according to the display field;
and adding the type newly added field into a preset field table to generate the type field table.
7. The data modification method of claim 6, wherein before obtaining the check formula table and finding the check formula corresponding to the field to be modified in the check formula table, the method comprises:
judging whether a check formula corresponding to the type added field exists in a database or not;
if yes, acquiring a check formula corresponding to the type newly added field as a check newly added formula; if the verification rule does not exist, creating a new verification formula corresponding to the type new field according to a pre-configured verification rule;
and adding the check new formula into a preset formula table to generate the check formula table.
8. A data modification apparatus, comprising:
the type selection module is used for receiving a data type selection instruction and selecting a data type to be modified from a data modification type table according to the data type selection instruction;
the field searching module is used for acquiring a type field table and searching a field to be modified corresponding to the type of the data to be modified in the type field table;
the formula searching module is used for acquiring a check formula table and searching a check formula corresponding to the field to be modified in the check formula table;
the formula checking module is used for checking the data of the field to be modified according to the checking formula to generate a field checking result;
and the data modification module is used for determining the abnormal data of the field to be modified according to the field verification result and updating the abnormal data to complete data modification.
9. A computer device comprising a memory, a processor and computer readable instructions stored in the memory and executable on the processor, wherein the processor when executing the computer readable instructions implements a data modification method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform a data modification method as claimed in any one of claims 1 to 7.
CN202211114028.9A 2022-09-14 2022-09-14 Data modification method and device, computer equipment and storage medium Pending CN115357598A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211114028.9A CN115357598A (en) 2022-09-14 2022-09-14 Data modification method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211114028.9A CN115357598A (en) 2022-09-14 2022-09-14 Data modification method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115357598A true CN115357598A (en) 2022-11-18

Family

ID=84006932

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211114028.9A Pending CN115357598A (en) 2022-09-14 2022-09-14 Data modification method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115357598A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116911269A (en) * 2023-06-05 2023-10-20 杭州观远数据有限公司 Method for modifying and splitting aggregated data into details

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116911269A (en) * 2023-06-05 2023-10-20 杭州观远数据有限公司 Method for modifying and splitting aggregated data into details
CN116911269B (en) * 2023-06-05 2024-02-20 杭州观远数据有限公司 Method for modifying and splitting aggregated data into details

Similar Documents

Publication Publication Date Title
CN109032824A (en) Database method of calibration, device, computer equipment and storage medium
US11841963B2 (en) Data aggregation system for enabling query operations on restricted data that originates from multiple independent multiple sources
CN112148509A (en) Data processing method, device, server and computer readable storage medium
CN110795455A (en) Dependency relationship analysis method, electronic device, computer device and readable storage medium
CN109033150A (en) Sensitive word verification method, device, computer equipment and storage medium
WO2020186808A1 (en) Page permission testing method and apparatus, computer device and storage medium
CN115357598A (en) Data modification method and device, computer equipment and storage medium
CN114003432A (en) Parameter checking method and device, computer equipment and storage medium
CN111984659B (en) Data updating method, device, computer equipment and storage medium
CN112256672B (en) Database change approval method and device
CN109669977A (en) Data cut-in method, device, computer equipment and the storage medium of integration across database
CN116048480B (en) Method and device for automatically generating chart based on code tool
CN116450607A (en) Data processing method, device and storage medium
US10838947B2 (en) Consistency check for foreign key definition
US20230195792A1 (en) Database management methods and associated apparatus
CN115438024A (en) Method, device and system for importing data into middle station, electronic equipment and storage medium
CN114238273A (en) Database management method, device, equipment and storage medium
CN111159162B (en) Database configuration method and equipment
CN113723911A (en) Nuclear power plant unit management method, device, equipment and storage medium
CN111143399A (en) Data processing method, data processing device, storage medium and computer equipment
CN114327377B (en) Method and device for generating demand tracking matrix, computer equipment and storage medium
CN116383147A (en) File data processing method, device, equipment and medium
CN113052463B (en) Workflow verification method, workflow verification device, computer equipment and storage medium
CN111158701B (en) Library module issuing method, device, equipment and storage medium
US20160292210A1 (en) System and method for automatically and efficiently validating database objects

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination