CN114428815A - Data storage method and device, electronic equipment and computer readable medium - Google Patents

Data storage method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN114428815A
CN114428815A CN202210050965.6A CN202210050965A CN114428815A CN 114428815 A CN114428815 A CN 114428815A CN 202210050965 A CN202210050965 A CN 202210050965A CN 114428815 A CN114428815 A CN 114428815A
Authority
CN
China
Prior art keywords
data
information
storage
data information
verification
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
CN202210050965.6A
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.)
Duodian Life Chengdu Technology Co ltd
Original Assignee
Duodian Life Chengdu Technology Co 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 Duodian Life Chengdu Technology Co ltd filed Critical Duodian Life Chengdu Technology Co ltd
Priority to CN202210050965.6A priority Critical patent/CN114428815A/en
Publication of CN114428815A publication Critical patent/CN114428815A/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/25Integrating or interfacing systems involving database management systems
    • G06F16/254Extract, transform and load [ETL] procedures, e.g. ETL data flows in data warehouses
    • 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/2358Change logging, detection, and notification
    • 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/2365Ensuring data consistency and integrity
    • 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/242Query formulation
    • G06F16/2433Query languages
    • G06F16/2443Stored procedures
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Abstract

The embodiment of the disclosure discloses a data storage method, a data storage device, an electronic device and a computer readable medium. One embodiment of the method comprises: receiving data information to be put in storage, wherein the data information to be put in storage is user identity information to be stored in a target database; carrying out data verification on the data information to be put in storage to generate a verification result; responding to the verification result to represent that the data information to be warehoused passes data verification, and storing the data information to be warehoused into a data table of the target database; responding to the verification result to represent that the data information to be put in storage does not pass data verification, and generating abnormal prompt information; and displaying the abnormal prompt information on a display interface so that the target user can modify the information of the data to be put in storage. The implementation mode ensures the accuracy and the integrity of the data in the data storage process.

Description

Data storage method and device, electronic equipment and computer readable medium
Technical Field
Embodiments of the present disclosure relate to the field of computer technologies, and in particular, to a data storage method and apparatus, an electronic device, and a computer-readable medium.
Background
Data storage refers to a technique of operating on a database to store data in a data table of the database. At present, when data storage is performed, the following methods are generally adopted: and operating the data table one by one to enter data. For example, when data to be stored is in a plurality of data tables, each data table needs to be operated on in turn.
However, when the data storage is performed in the above manner, there are often the following technical problems:
firstly, data verification is not carried out before data storage, and the accuracy and the integrity of the data cannot be guaranteed;
secondly, the unified operation on a plurality of data tables cannot be carried out, and the consistency of data cannot be ensured;
thirdly, the field length, the value range and the data type of the data are not verified before the data are stored, so that the accuracy of the field length, the data value and the data type of the data cannot be ensured;
fourthly, sensitive word check is not performed on the data before data storage, so that whether the data contain sensitive words cannot be confirmed, and the accuracy of the data stored in the database cannot be guaranteed.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter. Some embodiments of the present disclosure propose data storage methods, apparatuses, electronic devices and computer readable media to solve the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a data storage method, including: receiving data information to be put in storage, wherein the data information to be put in storage is user identity information to be stored in a target database; carrying out data verification on the data information to be put in storage to generate a verification result; responding to the verification result to represent that the data information to be warehoused passes data verification, and storing the data information to be warehoused into a data table of the target database; responding to the verification result to represent that the data information to be put in storage does not pass data verification, and generating abnormal prompt information; and displaying the abnormal prompt information on a display interface so that the target user can modify the information of the data to be put in storage.
In a second aspect, some embodiments of the present disclosure provide a data storage device, the device comprising: the system comprises a receiving unit, a storage unit and a storage unit, wherein the receiving unit is configured to receive data information to be stored in a database, and the data information to be stored in the database is user identity information to be stored in a target database; the checking unit is configured to perform data checking on the data information to be put into a warehouse so as to generate a checking result; the storage unit is configured to respond to the verification result that the data information to be warehoused passes data verification, and store the data information to be warehoused into a data table of the target database; the information prompting unit is configured to respond to the verification result that the data information to be warehoused does not pass the data verification, and generate abnormal prompting information; and the display unit is configured to display the abnormal prompt information on a display interface so that a target user can modify the information of the data to be put in storage.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium on which a computer program is stored, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect.
The above embodiments of the present disclosure have the following advantages: by the data storage method of some embodiments of the present disclosure, data storage is performed, and accuracy and integrity of data are improved. Specifically, the reasons for the low accuracy and integrity of data are: data is not verified before data storage. Based on this, the data storage method of some embodiments of the present disclosure includes: firstly, receiving data information to be put in storage. And then, carrying out data verification on the data information to be put in storage to generate a verification result, and ensuring the accuracy and the effectiveness of the data through data verification. And secondly, responding to the verification result that the data information to be warehoused passes data verification, and storing the data information to be warehoused into a data table of the target database. And then, responding to the verification result that the data information to be put in storage does not pass the data verification, and generating abnormal prompt information. And finally, displaying abnormal prompt information on a display interface to allow the target user to modify the information of the data to be put in storage. Therefore, by adding the data verification step, the accuracy and the integrity of the data can be effectively ensured.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
FIG. 1 is a schematic diagram of one application scenario of a data storage method of some embodiments of the present disclosure;
FIG. 2 is a flow diagram of some embodiments of a data storage method according to the present disclosure;
FIG. 3 is a schematic structural diagram of some embodiments of a data storage device according to the present disclosure;
FIG. 4 is a schematic block diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of an application scenario of a data storage method of some embodiments of the present disclosure.
In the application scenario of fig. 1, first, in step 102, the information generating terminal may send the to-be-warehoused data information 103. Then, in step 104, the data processing terminal in the computing device 101 may receive the to-be-warehoused data information 103. Next, in step 105, the data processing terminal may perform data verification on the to-be-warehoused data information 103 to generate a verification result. Next, in step 106, the data processing terminal may respond to the verification result that the to-be-warehoused data information 103 is represented to pass data verification, and store the to-be-warehoused data information 103 into a data table of a target database. Then, in step 107, the data processing terminal may generate an exception prompting message 108 in response to the verification result indicating that the to-be-warehoused data information 103 does not pass the data verification. Finally, in step 109, the display terminal may display the exception prompting information 108 on the display interface, so that the target user may modify the to-be-warehoused data information 103.
The computing device 101 may be hardware or software. When the computing device is hardware, it may be implemented as a distributed cluster composed of multiple servers or terminal devices, or may be implemented as a single server or a single terminal device. When the computing device is embodied as software, it may be installed in the hardware devices enumerated above. It may be implemented, for example, as multiple software or software modules for providing distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of computing devices in FIG. 1 is merely illustrative. There may be any number of computing devices, as implementation needs dictate.
With continued reference to fig. 2, a flow 200 of some embodiments of a data storage method according to the present disclosure is shown. The data storage method comprises the following steps:
step 201, receiving information of data to be put in storage.
In some embodiments, an executing body of the data storage method (for example, the computing device 101 shown in fig. 1) may receive the information about the data to be warehoused by means of wired connection or wireless connection. The data information to be put in storage may be user identity information to be stored in a target database, the target database may be a database storing user identity information, and the user identity information may be information representing user identity. For example, the target database may be a MySQL database.
As an example, the information of the data to be put into storage may include a user name, a user number, and an organization number. The user number is a number representing the uniqueness of the user, and the mechanism number is a number representing a mechanism where the user is located. For example, the information of the data to be put into storage may be { user name: sheet XX, user number: 0001, organization number: a001 }.
Step 202, performing data verification on the data information to be put in storage to generate a verification result.
In some embodiments, the execution subject may perform data verification on the to-be-warehoused data information to generate the verification result. The verification result may be a result representing whether the data information to be put into storage passes data verification.
As an example, the execution main body may perform data duplication check on the to-be-warehoused data information, so as to perform data check on the to-be-warehoused data information, so as to generate the check result. The execution main body may compare the information of the data to be put into storage with data stored in a data table in the target database, and generate a verification result representing that the information of the data to be put into storage is repeated in response to the data table in the target database having data identical to the information of the data to be put into storage. And responding to the data table in the target database without data which is the same as the information of the data to be stored, and generating a verification result representing that the information of the data to be stored is not repeated. For example, the information of the data to be put into storage may be { user name: sheet XX, user number: 0001, organization number: a001 }.
In some optional implementations of some embodiments, the check result may include: and collecting a target verification result. The target verification result in the target verification result set may be used to represent whether the data information passes data missing verification. The executing step of performing data verification on the data information to be put into storage to generate a verification result may include the following steps:
firstly, performing field analysis on the data information to be put into a database to generate a data information set.
The data information in the data information set may be information obtained by performing field analysis on the data information to be put in storage. The execution main body can identify the fields in the data information to be put in storage and the values corresponding to the fields to obtain the data information so as to generate the data information set. For example, the data information may be { user name: sheet XX }.
And secondly, performing data missing verification on each data information in the data information set to generate a target verification result corresponding to the data information, so as to obtain the target verification result set.
The execution main body may compare the length of the data information with a target length, and generate a verification result representing that the data information passes data missing verification in response to the fact that the length of the data information is not equal to the target length, so as to obtain the target verification result. The target length may be a data length at which the characterization data is missing.
As an example, the data information may be { user name: zhang three }, the target length may be 0 bytes.
And thirdly, determining the data length of the data information to obtain data length information.
The data length information may be information representing a data length.
As an example, the data information may be { user name: zhang three }, the data length is 4 bytes.
And fourthly, in response to the fact that the data length of the data length information representing the data information is consistent with the target length, determining a verification result representing data missing as a target verification result corresponding to the data information.
The execution main body may determine, in response to determining that the data length represented by the data length information is consistent with the target length, a verification result representing that data is missing as a target verification result corresponding to the data information.
As an example, the data information may be { user name: "}, the data length is 0 bytes.
In some optional implementation manners of some embodiments, the check result may further include: the first check result set, the second check result set and the third check result set. The executing body performs data verification on the data information to be put into storage to generate a verification result, and the executing body further includes the following steps:
executing a first data verification step for each data information in the data information set:
the first substep is to perform field length check on the data information to generate a check result corresponding to the data information, and obtain a first check result.
The first check result may be used to characterize whether the data information passes a field length check. The execution main body may compare the length of the data information with a preset length, and generate a verification result indicating that the data information passes field length verification in response to that the length of the data information is smaller than the preset length, so as to obtain the first verification result. The preset length may be a maximum length of the corresponding field of the data information in the data table of the target database.
And a second substep, performing value range verification on the data information to generate a verification result corresponding to the data information, and obtaining a second verification result.
The second check result may be used to represent whether the data information passes the value range check. The execution main body may compare the value of the data information with a value range preset in a data table in the target database, and generate a verification result representing that the data information passes a value range verification in response to that the value of the data information is within the preset value range, so as to obtain the second verification result. The preset value range may be a value range of a corresponding field of the data information in the data table of the target database.
And a third substep of performing data type verification on the data information to generate a verification result corresponding to the data information, so as to obtain a third verification result.
The third verification result may be used to represent whether the data information passes the data type verification. The execution main body may compare the data type of the data information with a preset data type, and generate a verification result representing that the data information passes through data type verification in response to that the data type of the data information is consistent with the preset data type, so as to obtain the third verification result. The preset data type may be a data type of a corresponding field of the data information in the data table of the target database.
The first data verification step and the related content thereof are used as an invention point of the embodiment of the disclosure, and the technical problems mentioned in the background art are solved, namely, the field length, the value range and the data type of the data are not verified before the data is stored, and the accuracy of the field length, the data value and the data type of the data cannot be ensured. Since the field length, the value range and the data type of the data are not checked before the data are stored, the accuracy of the field length, the data value and the data type of the data cannot be ensured. Therefore, the field length, the value range and the data type of the data are checked before the data are stored, and the accuracy of the field length, the data value and the data type of the data can be ensured. In order to ensure the accuracy of the field length, the data value and the data type of the data, firstly, the field analysis is performed on the data information to be put in storage to generate a data information set. In practical situations, the data information to be put into storage often includes values corresponding to different fields, and the field lengths, value ranges, and data types of the different fields are often different, so that the data information to be put into storage needs to be subjected to field analysis. Then, a field length check is performed on the data information to generate a first check result. In an actual situation, the field length of the value corresponding to the field is often a preset value, and when the field length is greater than the preset value corresponding to the field, the value corresponding to the field cannot be normally stored in the database, and thus the data storage fails. And secondly, carrying out value range verification on the data information to generate a second verification result. In practical situations, the value corresponding to the field is often within a preset value range, and when the value corresponding to the field is outside the preset value range, the value corresponding to the field cannot be normally stored in the database, so that the data storage fails. And then, carrying out data type verification on the data information to generate a third verification result. In an actual situation, the data type of the value corresponding to the field is often consistent with the preset data type, and when the data type of the value corresponding to the field is inconsistent with the preset data type, the value corresponding to the field cannot be normally stored in the database, so that the data storage fails. Therefore, the field length, the value range and the data type of the data are verified, and the accuracy of the field length, the data value and the data type of the data is ensured.
Optionally, the verification result may further include: and a fourth checking result set. And the fourth verification result in the fourth verification result set can be used for representing whether the data information passes the sensitive word verification or not. The executing body performs data verification on the data information to be put into storage to generate a verification result, and the executing body further includes the following steps:
for each data information in the data information set, executing a second data verification step:
and the first substep, performing sensitive word matching on the data information and each sensitive word in the sensitive word library to generate a sensitive word matching result and obtain a sensitive word matching result set.
The sensitive word matching result may be used to represent whether the data information has a sensitive word, and the sensitive word bank may be a data file containing a plurality of sensitive words. The execution main body can match the data in the data information with each sensitive word in a sensitive word bank, and generates a sensitive word matching result representing that the data information has the sensitive word in response to the matching of the data in the data information with the sensitive word in the sensitive word bank.
As an example, the data information may be { user name: sheet XX }. The sensitive word bank may be a data table in a MySQL database containing a plurality of sensitive words.
And a second substep, responding to the mismatching of the data in the data information and the sensitive words in the sensitive word bank, and generating a sensitive word matching result representing that no sensitive words exist in the data information.
And a third substep, in response to the existence of a target sensitive word matching result in the sensitive word matching result set, determining the target sensitive word matching result as a fourth verification result corresponding to the data information.
And the target sensitive word matching result represents that the data information contains sensitive words.
The first substep to the third substep and the related contents thereof are regarded as an invention point of the embodiment of the present disclosure, and solve the technical problem mentioned in the background art, i.e., "the data is not subjected to sensitive word check before data storage, so that it is not possible to confirm whether the data contains sensitive words, and thus accuracy of the data stored in the database cannot be guaranteed". Since the sensitive words of the data are not checked before the data are stored, whether the data contain the sensitive words cannot be determined, and therefore the accuracy of the data stored in the database cannot be guaranteed. Therefore, sensitive word check is carried out on the data before data storage, whether the data contain sensitive words or not can be confirmed, and therefore accuracy of the data stored in the database is guaranteed. In order to ensure the accuracy of the data, firstly, sensitive word matching is carried out on the data information and each sensitive word in a sensitive word bank to generate a sensitive word matching result, and a sensitive word matching result set is obtained. In an actual situation, a value corresponding to a field in the data information may have a sensitive word, and when the value corresponding to the field in the data information matches the sensitive word in the sensitive word library, the value corresponding to the field in the data information may not be normally stored in the database, thereby causing a storage failure. And then, responding to the fact that the data in the data information is not matched with the sensitive words in the sensitive word bank, and generating a sensitive word matching result representing that the data information does not have the sensitive words. Thus, it is confirmed that the sensitive word is not present in the data information. And finally, in response to the existence of a target sensitive word matching result in the sensitive word matching result set, determining the target sensitive word matching result as a fourth verification result corresponding to the data information. Therefore, sensitive word verification on the data is completed, whether the data contain sensitive words or not is confirmed, and therefore accuracy of the data stored in the database is guaranteed.
Step 203, responding to the data verification result that the data information to be warehoused is represented to pass the data verification, and storing the data information to be warehoused into a data table of the target database.
In some embodiments, the executing body may store the to-be-warehoused data information into a data table of a target database in response to the verification result indicating that the to-be-warehoused data information passes data verification.
As an example, the execution main body may store the data information in the data information to be warehoused in a data table of a target database in response to the verification result indicating that the data information to be warehoused passes data verification. For example, the data table of the target database may be a user information table in a MySQL database. The information of the data to be put in storage may be { user name: sheet XX, user number: 0001, organization number: a001, store number: a1 }.
In some optional implementation manners of some embodiments, the executing main body, in response to that the verification result represents that the data information to be warehoused passes data verification, stores the data information to be warehoused into a data table of a target database, and may include the following steps:
and step one, generating a database insertion statement corresponding to the to-be-put data information.
The execution body can generate a database insertion statement according to the information of the data to be put into storage.
As an example, the database insertion statement corresponding to the data information to be put in storage may be a MySQL insertion statement with the data information to be put in storage. For example, the database insertion statement may be INSERT INTO first data table (userNo, vender No, orgNo, userName) VALUES (0001, A1, A101, "Zhang three").
And secondly, operating the database insertion statement to store the data information to be put into the database into a data table of the target database.
Wherein, the data table of the target database may include: the first data table, the second data table, the third data table, the fourth data table, the fifth data table, the sixth data table and the seventh data table. The execution main body can run the database insertion statement, recognize the data information in the database insertion statement, and store the data information to be put into a database into a data table of the target database.
As an example, the first data table may be a user information table. The user information table is used for representing basic information of a user and information of a store where the user is located, and the fields of the user information table may include: a user name, a user number, a store number, and an organization number. The organization number may be a unique number that indicates an organization where the user is located, and the store number may be a unique number that indicates a store where the user is located. The second data table may be an institution table. The institution table is used for representing basic information of an institution in a store, and the fields of the institution table may include: organization number, organization name, and store number. Where the organization name may be used to characterize the names of different organizations under the store. The third data sheet may be a job schedule. The job table is used for representing basic information of jobs performed by users in the store, and the fields of the job table may include: a job number, a store number, a job name, and a standard job code. The job number may be a number representing a job assumed by the user, the job name may be a name representing the job assumed by the user, and the standard job code may be a unique code identifying the job assumed by the user. The fourth data table may be a station table. Wherein, the position table is used for representing the basic information of the user position under different positions of different organizations in the store, and the fields of the position table can include: a post number, a store number, an organization name, and a job number. The station number may be a unique number used for representing a station. The fifth data table may be an occupational relationship table. The job relation table is used for representing jobs and positions assumed by the user, and the fields of the job relation table may include: a post number, a user number, and a job number. The sixth data table may be a report relation table. The report relation table is used to represent information of users and superior users to which the users belong, and the fields of the report relation table may include: a user number and an upper level user number. The superior user number is used to represent uniqueness of the superior user, and the superior user may be superior to the user. The seventh data table may be a position relation table. The post relationship table is used for representing information of posts and upper posts to which the posts belong, and the fields of the post relationship table may include: the post numbers and the superior post numbers. The number of the upper post is used for representing the uniqueness of the upper post, and the upper post can be the upper post of the post. The user number may be a main key in the user information table, or may be an external key of the report relation table and the job relation table. The post number may be a main key of the post table or an external key of the job relation table and the post relation table.
Optionally, the data table of the target database may include: a first data table. The first data table may be a user information table. The step of storing the information of the data to be put into storage into the data table of the target database by the execution main body may include the following steps:
first, a target database insert statement is generated. The target database insertion statement may be a target database insertion statement with data information to be put in storage.
As an example, the execution body may generate a target database insertion statement according to the to-be-warehoused data information. For example, the database insertion statement may be INSERT INTO first data table (userNo, vender No, orgNo, userName) VALUES (0001, A1, A101, "Zhang three").
And secondly, operating the target database insert statement to store the data information to be put into a database into a first data table included in the target database.
As an example, the executing body running the target database insertion statement to store the to-be-warehoused data information into a first data table included in the target database may include the following substeps:
the execution main body runs the target database insertion statement to store the data information to be put into a database into a first data table included in the target database. For example, the execution agent may compare { user name: sheet XX, user number: 0001, organization number: a101, store number: a1 into the first data table.
A second substep of operating the sixth data table and the seventh data table based on a trigger and the user number.
As an example, the execution main body may detect that the user information table completes data storage in response to the trigger, and simultaneously perform data storage on the report relation table and the post relation table. The trigger may be an INSERT trigger, and the user number may be a main key in the user information table or an external key of the report relation table and the arbitrary relation table.
As another example, the execution main body may detect that the user information table completes data deletion in response to the trigger, and delete data of the sixth data table and the seventh data table at the same time. The trigger may be a DELETE trigger, and the user number may be a primary key in the user information table or a foreign key in the report relation table and the job relation table.
The content of step 203 solves the problem that the data consistency can not be ensured because the unified operation can not be performed on a plurality of data tables. Because the relation between the data tables is not clear, the operation on the data tables is complex, a plurality of data tables cannot be operated uniformly, and the data consistency is extremely easy to damage. Therefore, when the problem that the relation between the data tables is not clear is solved, the unified operation on the plurality of data tables can be finished, and the consistency of the data is ensured. In order to achieve the effect of operating a plurality of data tables in a unified manner, step 203 first establishes a relationship between the data tables by setting a plurality of data tables and setting a primary key and a foreign key, thereby defining the relationship between the data tables. And then, finishing the unified operation on the plurality of data tables by utilizing the relation between the trigger and the data tables. Therefore, the effect of performing unified operation on a plurality of data tables is achieved, the problem that the plurality of data tables cannot be operated in a unified mode is solved, and the consistency of data is guaranteed on the premise of improving the data processing efficiency.
And step 204, responding to the data verification result that the data information to be stored does not pass the data verification, and generating abnormal prompt information.
In some embodiments, the execution main body may generate the exception prompt information in response to the verification result indicating that the information of the data to be put into storage does not pass the data verification. The verification result may be a verification result indicating that the data information to be warehoused fails in data verification, and the abnormality prompting information may be information prompting that the data information to be warehoused is abnormal.
As an example, the information of the data to be put into storage may be { user name: sheet XX, user number: 0001, organization number: and A001, the executing body can generate abnormal prompt information for representing that the user number has a repeated value in response to the verification result representing that the user number 0001 does not pass data repeated verification.
And step 205, displaying the abnormal prompt information on a display interface so that the target user can modify the information of the data to be put into storage.
In some embodiments, the execution main body may display the exception prompt information on a display interface, so that the target user can modify the information of the data to be put into storage. The display interface is an interface for displaying data abnormal information.
As an example, the execution subject may display, on an operation result interface of MySQL, an abnormal prompt message that a null value exists in the user name, so that the target user can modify the user name.
The above embodiments of the present disclosure have the following beneficial effects: by the data storage method of some embodiments of the present disclosure, data storage is performed, and accuracy and integrity of data are improved. In particular, the reasons for the low accuracy and integrity of data are: data is not verified before data storage. Based on this, the data storage method of some embodiments of the present disclosure includes: firstly, receiving data information to be put in storage. And then, carrying out data verification on the data information to be put in storage to generate a verification result, and ensuring the accuracy and the effectiveness of the data through data verification. And secondly, responding to the verification result that the data information to be warehoused passes data verification, and storing the data information to be warehoused into a data table of the target database. And then, responding to the verification result that the data information to be put in storage does not pass the data verification, and generating abnormal prompt information. And finally, displaying abnormal prompt information on a display interface to allow the target user to modify the information of the data to be put in storage. Therefore, by adding the data verification step, the accuracy and the integrity of the data can be effectively ensured.
With further reference to fig. 3, as an implementation of the methods illustrated in the above figures, the present disclosure provides some embodiments of a data storage device, which correspond to those illustrated in fig. 2, and which may be particularly applicable in various electronic devices.
As shown in FIG. 3, data storage device 300 of some embodiments includes: a receiving unit 301, a verification unit 302, a storage unit 303, an information presentation unit 304, and a display unit 305. The receiving unit 301 is configured to receive data information to be warehoused, where the data information to be warehoused is user identity information to be stored in a target database; the checking unit 302 is configured to perform data checking on the data information to be put into storage to generate a checking result; the storage unit 303 is configured to store the to-be-warehoused data information into a data table of the target database in response to the verification result indicating that the to-be-warehoused data information passes data verification; the information prompt unit 304 is configured to generate exception prompt information in response to the verification result indicating that the data information to be warehoused does not pass data verification; the display unit 305 is configured to display the exception prompting information on a display interface for a target user to modify the information of the data to be warehoused.
It will be understood that the units described in the apparatus 300 correspond to the various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 300 and the units included therein, and are not described herein again.
Referring now to FIG. 4, shown is a block diagram of an electronic device (such as computing device 101 shown in FIG. 1)400 suitable for use in implementing some embodiments of the present disclosure. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 4, electronic device 400 may include a processing device (e.g., central processing unit, graphics processor, etc.) 401 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage device 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the electronic apparatus 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 404 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408 including, for example, tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the electronic device 400 to communicate wirelessly or by wire with other devices to exchange data. While fig. 4 illustrates an electronic device 400 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 4 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through the communication device 409, or from the storage device 408, or from the ROM 402. The computer program, when executed by the processing apparatus 401, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: and receiving data information to be put into a warehouse, wherein the data information to be put into the warehouse is user identity information to be stored in a target database. And carrying out data verification on the data information to be put in storage to generate a verification result. And responding to the verification result that the data information to be warehoused passes data verification, and storing the data information to be warehoused into a data table of the target database. And responding to the verification result that the data information to be put in storage does not pass the data verification, and generating abnormal prompt information. And displaying abnormal prompt information on a display interface so that the target user can modify the information of the data to be put in storage.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor comprises a receiving unit, a checking unit, a storage unit, an information prompting unit and a display unit. The names of the units do not form a limitation on the units themselves in some cases, for example, the verification unit may also be described as a "unit that performs data verification on the data information to be put into storage to generate a verification result".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (8)

1. A method of data storage, comprising:
receiving data information to be put in storage, wherein the data information to be put in storage is user identity information to be stored in a target database;
carrying out data verification on the data information to be put in storage to generate a verification result;
responding to the verification result to represent that the data information to be warehoused passes data verification, and storing the data information to be warehoused into a data table of the target database;
responding to the verification result that the data information to be put in storage does not pass data verification, and generating abnormal prompt information;
and displaying the abnormal prompt information on a display interface so that a target user can modify the information of the data to be put in storage.
2. The method of claim 1, wherein the verification result comprises: a target verification result set; and
the data verification of the data information to be put into storage to generate a verification result includes:
performing field analysis on the data information to be put in storage to generate a data information set;
and performing data missing verification on each data information in the data information set to generate a target verification result corresponding to the data information, so as to obtain the target verification result set.
3. The method of claim 2, wherein the performing data missing check on each data information in the data information set to generate a target check result corresponding to the data information includes:
determining the data length of the data information to obtain data length information;
and in response to the fact that the data length of the data information represented by the data length information is consistent with the target length, determining a verification result representing data missing as a target verification result corresponding to the data information.
4. The method according to claim 1, wherein the storing the data information to be warehoused into the data table of the target database in response to the verification result indicating that the data information to be warehoused passes data verification comprises:
generating a database insertion statement corresponding to the to-be-put-in data information;
and operating the database insertion statement to store the data information to be put into a database into a data table of the target database.
5. The method of claim 4, wherein the data table of the target database comprises: a first data table; and
the step of storing the information of the data to be put into the warehouse into a data table of the target database comprises the following steps:
generating a target database insertion statement;
and operating the target database insertion statement to store the data information to be put into a warehouse into a first data table included in the target database.
6. A data storage device comprising:
the system comprises a receiving unit, a storage unit and a storage unit, wherein the receiving unit is configured to receive data information to be stored in a database, and the data information to be stored in the database is user identity information to be stored in a target database;
the checking unit is configured to perform data checking on the data information to be put into a warehouse so as to generate a checking result;
the storage unit is configured to respond to the verification result that the data information to be warehoused passes data verification, and store the data information to be warehoused into a data table of the target database;
the information prompt unit is configured to respond to the verification result that the data information to be warehoused does not pass the data verification, and generate abnormal prompt information;
and the display unit is configured to display the abnormal prompt information on a display interface so that a target user can modify the information of the data to be put into storage.
7. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
8. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-5.
CN202210050965.6A 2022-01-17 2022-01-17 Data storage method and device, electronic equipment and computer readable medium Pending CN114428815A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210050965.6A CN114428815A (en) 2022-01-17 2022-01-17 Data storage method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210050965.6A CN114428815A (en) 2022-01-17 2022-01-17 Data storage method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN114428815A true CN114428815A (en) 2022-05-03

Family

ID=81312811

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210050965.6A Pending CN114428815A (en) 2022-01-17 2022-01-17 Data storage method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN114428815A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115221184A (en) * 2022-09-01 2022-10-21 北京理工大学 Basic geographic data sending method, device, equipment and computer readable medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107844400A (en) * 2017-10-16 2018-03-27 阿里巴巴集团控股有限公司 The method of calibration and device of a kind of daily record data
WO2018157858A1 (en) * 2017-03-03 2018-09-07 腾讯科技(深圳)有限公司 Information storage method, device, and computer-readable storage medium
US20200050782A1 (en) * 2018-08-08 2020-02-13 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for operating database
CN111626865A (en) * 2020-05-22 2020-09-04 泰康保险集团股份有限公司 Data processing method and device, electronic equipment and storage medium
CN112287009A (en) * 2020-11-03 2021-01-29 平安普惠企业管理有限公司 Interface calling and interface data warehousing method, device, equipment and storage medium
CN112463729A (en) * 2020-11-27 2021-03-09 中国工商银行股份有限公司 Data file storage method and device, electronic equipment and medium
WO2021238902A1 (en) * 2020-05-25 2021-12-02 中兴通讯股份有限公司 Data import method and apparatus, service platform, and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018157858A1 (en) * 2017-03-03 2018-09-07 腾讯科技(深圳)有限公司 Information storage method, device, and computer-readable storage medium
CN107844400A (en) * 2017-10-16 2018-03-27 阿里巴巴集团控股有限公司 The method of calibration and device of a kind of daily record data
US20200050782A1 (en) * 2018-08-08 2020-02-13 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for operating database
CN111626865A (en) * 2020-05-22 2020-09-04 泰康保险集团股份有限公司 Data processing method and device, electronic equipment and storage medium
WO2021238902A1 (en) * 2020-05-25 2021-12-02 中兴通讯股份有限公司 Data import method and apparatus, service platform, and storage medium
CN112287009A (en) * 2020-11-03 2021-01-29 平安普惠企业管理有限公司 Interface calling and interface data warehousing method, device, equipment and storage medium
CN112463729A (en) * 2020-11-27 2021-03-09 中国工商银行股份有限公司 Data file storage method and device, electronic equipment and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115221184A (en) * 2022-09-01 2022-10-21 北京理工大学 Basic geographic data sending method, device, equipment and computer readable medium

Similar Documents

Publication Publication Date Title
CN108897691B (en) Data processing method, device, server and medium based on interface simulation service
CN111581291B (en) Data processing method, device, electronic equipment and readable medium
CN109684188B (en) Test method and device
CN108933695B (en) Method and apparatus for processing information
CN113268761B (en) Information encryption method and device, electronic equipment and computer readable medium
CN117156012B (en) Exception request data processing method, device, equipment and computer readable medium
CN112035344A (en) Multi-scenario test method, device, equipment and computer readable storage medium
CN111221727A (en) Test method, test device, electronic equipment and computer readable medium
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
CN112416632A (en) Event communication method and device, electronic equipment and computer readable medium
CN114428815A (en) Data storage method and device, electronic equipment and computer readable medium
CN107403112B (en) Data checking method and equipment thereof
CN112800363A (en) Page display method and device, electronic equipment and computer readable medium
CN110347973B (en) Method and device for generating information
EP4365808A1 (en) Data verification method and apparatus
CN113283891A (en) Information processing method and device and electronic equipment
CN112084114A (en) Method and apparatus for testing an interface
CN112184406A (en) Data processing method, system, electronic device and computer readable storage medium
CN112667119A (en) Measuring point batch correlation method and device, electronic equipment and computer readable medium
CN112463616A (en) Chaos testing method and device for Kubernetes container platform
CN111930704B (en) Service alarm equipment control method, device, equipment and computer readable medium
CN112261072A (en) Service calling method, device, equipment and storage medium
CN110262756B (en) Method and device for caching data
CN112783753B (en) Testing method and device for stream data processing system
CN114090603A (en) Article information updating method, system, electronic device and computer readable medium

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