CN115718766A - Multi-database data sharing management method, system and storage medium - Google Patents

Multi-database data sharing management method, system and storage medium Download PDF

Info

Publication number
CN115718766A
CN115718766A CN202211482940.XA CN202211482940A CN115718766A CN 115718766 A CN115718766 A CN 115718766A CN 202211482940 A CN202211482940 A CN 202211482940A CN 115718766 A CN115718766 A CN 115718766A
Authority
CN
China
Prior art keywords
data
query
acquiring
account
database
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.)
Withdrawn
Application number
CN202211482940.XA
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.)
Weizheng Technology Service Co ltd
Original Assignee
Weizheng Technology Service 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 Weizheng Technology Service Co ltd filed Critical Weizheng Technology Service Co ltd
Priority to CN202211482940.XA priority Critical patent/CN115718766A/en
Publication of CN115718766A publication Critical patent/CN115718766A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a method, a system and a storage medium for sharing management of multi-database data, which belong to the technical field of data processing, and the method comprises the following steps: acquiring query request information of a target database; acquiring a current query account based on the query request information; judging whether the current query account belongs to a target database; if not, acquiring query data of the target database based on the query request information; generating mirror image data based on the query data; and acquiring mirror data to inquire the data based on the inquiry request information. The method and the device have the effects of preventing the data of the database from being damaged as much as possible and reducing the risk of all data leakage.

Description

Multi-database data sharing management method, system and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method, a system, and a storage medium for managing data sharing among multiple databases.
Background
At present, with the continuous deepening of information-based application, the requirement of information interaction inside enterprises is increasingly strong, and the existing information needs to be integrated urgently, namely the information island is communicated, and information fusion and sharing realized by communication among a plurality of databases is an effective measure for solving the information island.
With the continuous deepening of the communication among the databases, more and more information can be shared among different databases, and the login account of the same database is logged in and accessed in different databases, so that the information of the databases is acquired.
However, the above method also results in that one login account can directly enter all the communicated databases, so as to directly contact all the data of the databases, and when the login account of one database enters another database, it is easy for some people with other purposes to destroy the data of the database or cause leakage of all the data.
Disclosure of Invention
In order to prevent the data of the database from being damaged as much as possible and reduce the risk of all data leakage, the application provides a method, a system and a storage medium for sharing and managing the data of multiple databases.
In a first aspect, the present application provides a method for managing data sharing among multiple databases, which adopts the following technical solutions:
a sharing management method for multiple database data comprises the following steps:
acquiring query request information of a target database;
acquiring a current query account based on the query request information;
judging whether the current query account belongs to the target database;
if the current query account does not belong to the target database, acquiring query data of the target database based on the query request information;
generating mirror image data based on the query data;
and acquiring the mirror image data based on the query request information to query the query data.
By adopting the technical scheme, when data query needs to be carried out from the target database, query request information of the target database is obtained, then the current query account is obtained according to the query request information, and whether the current query account belongs to the target database is judged, so that whether the internal account of the target database is included is determined. If not, acquiring query data of the target database according to the query request information, generating mirror image data according to the query data, and finally acquiring the mirror image data according to the query request to query the query data. Therefore, the inquiry account which does not belong to the target database can be prevented from directly contacting the inquiry data as far as possible through the mirror image data, the data of the database can be prevented from being damaged as far as possible, and the risk of all data leakage can be reduced by inquiring through the mirror image data.
Preferably, the generating mirror data based on the query data includes:
obtaining a classification mark of the query data;
acquiring the belonged classification of the query data in the target database based on the classification mark as a target classification;
acquiring all data of the target classification as classification data, wherein the classification data comprises the query data;
and copying the classified data to a preset mirror image space to generate the mirror image data.
By adopting the technical scheme, all data of the target classification are obtained and are used as classification data and are copied into the mirror image space, so that mirror image data are formed, and a user can conveniently inquire data related to the inquired data from the database as far as possible.
Preferably, the copying the classified data to a preset mirror space to generate the mirror image data includes:
after the classified data is copied to the mirror image space, taking the copied classified data as copied data;
judging whether first encrypted data exists in the copied data or not;
if so, acquiring a data password of the first encrypted data;
decrypting the first encrypted data based on the data cipher to obtain decrypted data;
encrypting the decrypted data in the mirror space, and obtaining second encrypted data and a random password of the second encrypted data;
acquiring data except the first encrypted data in the copied data as residual data;
generating the mirror data based on the remaining data and the second encrypted data;
sending the random password to the current query account;
and if the mirror image data does not exist, directly generating the mirror image data based on the copied data.
By adopting the technical scheme, whether the first encrypted data exists in the copied data or not is judged, if so, the data password is obtained, and the first encrypted data is decrypted according to the data password, so that a user can conveniently check the data. And then, encrypting the decrypted data again in the mirror space to obtain second encrypted data and a random password, thereby preventing other account numbers from reading the decrypted data as much as possible, enabling the current inquiry account number to obtain the random password for decryption, and further improving the security of the data due to the random generation of the password.
Preferably, if the current query account belongs to the target database, the method includes:
acquiring department information of the current query account;
acquiring request query data based on the query request information;
judging whether the request query data is matched with the department information;
if so, acquiring data corresponding to the request query data in the target database;
and if not, sending the query request information to a corresponding administrator of the target database to determine whether the current query account allows the target database to be accessed.
By adopting the technical scheme, whether the request query data are matched with department information or not is judged, whether a person gets over a department to obtain the data or not can be judged, and if not, the query request information is sent to a corresponding administrator of the target database to determine whether the current query account number allows the target database to be accessed or not, so that the security of data query can be further improved.
Preferably, before the sending the query request information to the administrator of the corresponding target database to determine whether the current query account allows access to the target database, the method further includes:
acquiring the current query account corresponding to the request query data which is not matched with the department information as a temporary query account;
taking the target database which is requested to be accessed by the temporary query account as a request database;
judging whether a historical query record of the temporary query account exists in the request database;
if yes, acquiring data corresponding to the request query data in the target database;
if not, the next step is carried out.
By adopting the technical scheme, whether the historical query record of the temporary query account exists in the request database or not is judged, whether the temporary query account normally acquires data or not can be judged, if yes, the temporary query account is proved to have queried related data in the request database, at the moment, the data can be directly acquired, otherwise, the step of sending the query request information to the corresponding administrator of the target database is continuously executed to determine whether the current query account allows to access the target database or not, and therefore the security of data query can be further improved.
Preferably, after the obtaining the mirror data based on the query request information to query the query data, the method further includes:
acquiring a login state of the current query account in a preset mirror image space, wherein the login state comprises an online state and an offline state;
when the login state is an offline state, acquiring the offline duration of the current query account;
judging whether the offline time length is greater than a preset time length or not;
and if so, acquiring a deleting instruction to delete the mirror image data.
By adopting the technical scheme, whether the offline time length is greater than the preset time length or not can be judged, whether the mirror image data of the mirror image space needs to be deleted or not can be judged, the validity of the mirror image data can be ensured as far as possible, meanwhile, the mirror image space can be cleaned in time, and the possibility of the occurrence of the insufficient space condition can be reduced as far as possible.
Preferably, before the obtaining the deletion instruction to delete the mirrored data, the method further includes:
acquiring a database to which the current query account belongs as a first database;
acquiring the login state of the current query account in the first database;
if the login state is an offline state, the deleting instruction is not acquired;
and if the login state is the online state, carrying out the next step.
By adopting the technical scheme, the login state of the current query account in the first database is judged, whether the current account exits from the mirror space due to an unexpected reason can be judged, if the login state in the first database is an offline state, the fact that the current query account exits from the login due to the unexpected reason is proved, if the login state is an online state, the fact that the current query account exits from the mirror space actively due to a high probability is proved, and therefore a deleting instruction can be obtained. Thereby, the accuracy of acquiring the deletion instruction can be improved.
Preferably, after the obtaining the mirror data based on the query request information to query the query data, the method further includes:
acquiring all the query data as query set data;
judging whether the same query data exist in the query set data or not;
if yes, acquiring a target database corresponding to the same query data as a query database;
judging whether the query databases are the same;
and if not, storing the same query data to a preset fusion database connected with the target database, and clearing the query data from the target database.
By adopting the technical scheme, the same query data is stored in the preset fusion database, the fusion database is communicated with the target database, and then the query data is cleared from the target database, so that the possibility of repeated storage of the same data can be effectively reduced, and the occupancy rate of repeated data of the database can be further reduced.
In a second aspect, the present application provides a system for sharing and managing multiple database data, which adopts the following technical solutions:
a system for shared management of multiple database data, comprising:
a memory for storing a computer program capable of running on the processor;
the processor, when executing the computer program, is capable of performing the steps of any of the above described methods.
By adopting the technical scheme, the memory can store information, and the processor can call the information and send out a control instruction, so that the ordered execution of the program is ensured, and the effect of the scheme is realized.
In a third aspect, the present application provides a computer-readable storage medium, which adopts the following technical solutions:
a computer readable storage medium storing a computer program that can be loaded by a processor and executed to perform any of the methods described above.
By adopting the technical scheme, after the computer-readable storage medium is loaded into any computer, any computer can execute the multi-database data sharing management method provided by the application.
In summary, the present application includes at least one of the following beneficial technical effects:
1. whether the current query account belongs to the target database or not can be judged, whether the query is performed by an internal person or not can be judged, the query account which does not belong to the target database can be prevented as far as possible from directly contacting query data through mirror image data, the data of the database can be prevented as far as possible from being damaged, and the risk of data leakage can be reduced by performing the query through the mirror image data;
2. all data of the target classification are obtained and are used as classification data and copied into a mirror image space, so that mirror image data are formed, and a user can conveniently inquire data related to the inquired data from a database as much as possible;
3. and judging whether the first encrypted data exists in the copied data, if so, obtaining the data password, and decrypting the first encrypted data according to the data password, thereby facilitating the user to check the data. And then, encrypting the decrypted data again in the mirror image space to obtain second encrypted data and a random password, thereby preventing other account numbers from reading the decrypted data as far as possible, enabling the current inquiry account number to obtain the random password for decryption, and further improving the security of the data due to the random generation of the password.
Drawings
Fig. 1 is a schematic flowchart of a method for managing sharing of multiple database data according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of steps S11 to S14 according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of steps S21 to S29 according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of steps S31 to S35 according to an embodiment of the present application;
FIG. 5 is a schematic flow chart of steps S41 to S45 according to an embodiment of the present application;
FIG. 6 is a schematic flow chart of steps S51 to S54 according to an embodiment of the present application;
FIG. 7 is a schematic flow chart of steps S61 to S64 according to an embodiment of the present application;
fig. 8 is a schematic flowchart of steps S71 to S75 in an embodiment of the present application.
Detailed Description
The present application is described in further detail below with reference to figures 1 to 8.
The embodiment of the application discloses a method for sharing and managing data of multiple databases.
Referring to fig. 1, the method for managing sharing of multiple database data includes:
s1, acquiring query request information of a target database;
s2, acquiring a current query account based on the query request information;
s3, judging whether the current query account belongs to a target database;
s4, if the current query account does not belong to the target database, acquiring query data of the target database based on the query request information;
s5, generating mirror image data based on the query data;
and S6, acquiring mirror image data based on the query request information to query the query data.
Specifically, when a user logs in a plurality of databases through an account to query, update or insert data, query request information of a target database is acquired. The target database is a database to be accessed by a user, the query request information is request information when the user accesses the target database, and the query request information comprises an account number accessed by the user currently, namely a current query account number, and also comprises a data name, a code number or other keywords which can be matched with data in the database.
And then, acquiring the current query account according to the query request information, namely reading the account in the query request information, and judging whether the current query account belongs to the target database. The judgment method may be that the system stores account lists of all accounts of each database in advance, and certainly, the account lists of each database are independent lists, and each list corresponds to a corresponding database. The account list of each database comprises all accounts of the database corresponding to the account list. And then acquiring an account list of the target database, matching the current query account with accounts in the account list, and if the current query account can be matched with the same account, proving that the current query account belongs to the target database, otherwise, not belonging to the target database.
If the current query account belongs to the target database, it is proved that the current query account is an internal account of the current target database, and at this time, the target database may be directly accessed.
If the current query account does not belong to the target database, the current query account proves that the accounts of other databases need to access the target database, and at the moment, in order to prevent the data in the target database from being modified as much as possible, the query data of the target database is obtained according to the query request information, namely, the data name, code number or other keywords which can be matched with the data in the target database are obtained, then the keywords are matched with the data in the target database, and the matched data in the target database is the query data.
And then generating mirror image data according to the query data, wherein the generation mode can be that the query data is copied, the copied data is used as mirror image data, and then the mirror image data is moved to an independent space. And finally, acquiring mirror image data according to the query request information to query the query data, namely directly acquiring mirror image data of an independent space according to the keywords in the query request information, so that the data to be queried can be viewed.
Therefore, the query account which does not belong to the target database can be prevented from directly contacting with the query data as far as possible through the mirror image data, the data of the target database can be prevented from being maliciously updated, deleted or inserted and the like as far as possible, and the data except the query request information can be prevented from being checked by the current query account through the query of the mirror image data, so that the risk of all data leakage can be reduced.
Of course, in order to further improve the security of data, in an implementation manner of this embodiment, each query request message may only be provided with one type of keyword, that is, a plurality of keywords that may be similar words may be provided, and meanwhile, in order to further improve the security, each keyword may also be only one keyword, and of course, a specific setting manner may be set according to an actual situation.
Referring to fig. 2, in order to further improve the security of the data in the target database when being queried and facilitate the query on the data, in another embodiment, the step S5 of generating the mirrored data based on the query data includes:
s11, acquiring a classification mark of query data;
s12, acquiring the belonged classification of the query data in a target database based on the classification mark as a target classification;
s13, acquiring all data of target classification as classification data, wherein the classification data comprises query data;
s14, copying the classified data to a preset mirror image space to generate mirror image data.
Specifically, the step of generating mirrored data based on query data may perform the following operations: firstly, the classification marks of the query data are obtained, the query data in the database are correspondingly provided with labels, the labels are the classification marks, and the database classifies the data according to the labels of the data, so that the data can be conveniently queried. Meanwhile, there is a correlation between data belonging to the same category. Of course, there may be different levels of labeling, e.g., the higher the level the more data included in the classification, the weaker the association with the query data. In an implementation manner of this embodiment, a level of the classification flag may be preset, for example, if the level of the flag has ten levels, the obtained classification flag may be set as two levels, or certainly, the obtained classification flag may be three levels, and the specific setting may be set according to an actual situation.
And then acquiring the belonged classification of the query data in the target database according to the classification mark as a target classification, and then acquiring all data in the target classification as classification data, wherein the classification data comprises the query data.
Finally, the classified data is copied to a preset mirror image space to generate mirror image data, namely, the copied classified data is used as mirror image data. Therefore, the data range of the query data can be expanded as much as possible, and the user can obtain as much data as possible in the target database, so that the user can conveniently query more data related to the query data.
And the mirror image data is checked in the mirror image space, and the mirror image space is a data space independent from the target database, so that the user can be prevented from checking data except the mirror image data as much as possible, and the safety of the data in the target database can be improved.
Referring to fig. 3, in order to improve the security of the mirrored data in the mirror space, in another embodiment, the copying the classified data to a preset mirror space to generate the mirrored data includes:
s21, after the classification data are copied to the mirror space, the copied classification data are used as copy data;
s22, judging whether first encrypted data exist in the copied data or not;
s23, if the first encrypted data exists, acquiring a data password of the first encrypted data;
s24, decrypting the first encrypted data based on the data password to obtain decrypted data;
s25, encrypting the decrypted data in the mirror image space, and obtaining second encrypted data and a random password of the second encrypted data;
s26, acquiring data except the first encrypted data in the copied data as residual data;
s27, mirror image data are generated based on the residual data and the second encrypted data;
s28, sending the random password to the current query account;
and S29, if the data does not exist, directly generating mirror image data based on the copied data.
Specifically, in the process of copying the classified data to a preset mirror space to generate mirror image data, after the classified data is copied to the mirror space, the copied classified data is used as copied data, and at this time, whether first encrypted data exists in the copied data is judged, that is, whether encrypted data exists in the data copied from the target database is judged, that is, data which cannot be interpreted or analyzed by the system is judged, that is, the first encrypted data is obtained. Of course, the encrypted data in the target database may have preset marks, and when the system recognizes the marks in the image space, it may be determined that the first encrypted data exists in the copied data. Otherwise, it is absent.
If the first encrypted data does not exist, the copied data can be proved to be known by others and is not confidential data, so that the mirror image data can be directly generated according to the copied data, namely the copied data is directly used as the mirror image data.
If the first encrypted data exists, the data password of the first encrypted data is acquired at this time, and the acquisition mode may be that when the system decrypts the data in the mirror space, a decryption request of the first encrypted data is sent to an administrator of the target database, that is, the administrator inputs the data password, and when the system acquires the input data password, the first encrypted data can be decrypted according to the data password, so as to acquire decrypted data. Of course, if the administrator does not enter the data password, decryption cannot be performed at this time.
And after the decrypted data is obtained, encrypting the decrypted data again in the mirror space according to a preset encryption rule so as to obtain second encrypted data, and randomly generating a decryption password, namely a random password, of the second encrypted data while encrypting.
Then, data other than the first encrypted data in the copied data is obtained as residual data, and mirror image data is generated according to the residual data and the second encrypted data, that is, the residual data and the second encrypted data are combined, that is, the generated mirror image data includes the residual data and the second encrypted data.
Meanwhile, the system sends the generated random password to the current inquiry account, and when the decrypted data is encrypted again in the mirror image space, other inquiry accounts entering the mirror image space can be prevented from obtaining the decrypted data as far as possible. Meanwhile, the current query account can decrypt the second encrypted data according to the received random password, so that the required data can be obtained, and the security of the data can be further improved.
Of course, in other real-time manners implemented in this embodiment, in order to further improve the security of the data, the random password is generated again every time the preset time duration elapses, and the changed random password is sent to the current query account again, and the random password may also be generated without passing through the random time duration, so that the security of the second encrypted data can be improved.
Referring to fig. 4, when the current query account belongs to the target database, since the data queried by different departments are usually different, if the queried data is different from the normal data of the department, there may be a case of data theft, and therefore there may be a certain security. Therefore, in order to prevent the above situation as much as possible, in another embodiment, if the current query account belongs to the target database, the method includes:
s31, acquiring department information of the current query account;
s32, acquiring request query data based on the query request information;
s33, judging whether the request query data are matched with department information or not;
s34, if the data are matched, acquiring data corresponding to the request query data in the target database;
and S35, if not, sending the query request information to the corresponding administrator of the target database to determine whether the current query account allows the target database to be accessed.
Specifically, when the current query account belongs to the target database, the department information of the current query account is obtained, that is, the query request information includes the current query account and the department information corresponding to the current query account, where the department information includes a department name and a query keyword corresponding to a department.
And then acquiring request query data according to the query request information, wherein the request query data is the data name, code number or other keywords of the data to be queried, and the keywords can be matched with the data in the database. And then judging whether the query request data is matched with the department information, namely judging whether the keywords in the query request data and the query keywords have the same or similar keywords, wherein the similarity refers to the keywords being similar words. If so, a match is verified, otherwise, a mismatch is verified.
If the data is matched with the data, the account number corresponding to the department currently performing data query is proved, the queried data is the same as the department, and therefore the data irrelevant to the department is not queried suddenly, the possibility of stealing the data is low, and the data corresponding to the data requested to be queried in the target database can be directly obtained at the moment.
If the data is not matched with the account number, the account number corresponding to the department currently performing data query is proved, the queried data is different from the department, so that the data irrelevant to the department is queried suddenly with high probability, and the possibility of stealing the data is high. Therefore, at this time, the query request information is sent to the administrator of the corresponding target database to determine whether the current query account allows access to the target database.
That is, the administrator manually determines to determine whether the data query performed by the user corresponding to the current query account meets the requirement, if so, the administrator allows the current query account to access the target database, otherwise, the administrator does not allow the current query account to access the target database. Therefore, the security of the current query account accessing the target database can be further improved.
Referring to fig. 5, to further improve the accuracy of determining whether the current query account has the possibility of stealing data, in another embodiment, before sending the query request information to the administrator of the corresponding target database to determine whether the current query account allows accessing the target database, the method further includes:
s41, acquiring a current query account corresponding to the request query data which is not matched with the department information, and taking the current query account as a temporary query account;
s42, taking a target database which is temporarily inquired for account number request access as a request database;
s43, judging whether a historical query record of the temporary query account exists in the request database;
s44, if the query data exists, acquiring data corresponding to the query data in the target database;
and S45, if the current query account number does not exist, sending the query request information to the corresponding administrator of the target database to determine whether the current query account number allows the target database to be accessed.
Specifically, before the query request information is sent to the administrator of the corresponding target database to determine whether the current query account allows access to the target database, the current query account corresponding to the query request data which does not match with department information is acquired as a temporary query account, and the target database which is requested to be accessed by the temporary query account is taken as the request database.
Then, whether a historical query record of the temporary query account exists in the request database is judged, that is, if the current query account enters the target database to query data, or data is copied from the target database, a query record of the current query account is generated, that is, the query record includes the current query account, and then query records formed by all accounts form the historical query record.
If the historical query record of the temporary query account exists in the request database, the temporary query account is proved to enter the request database for data query, so that the data query is proved not to be temporarily carried out at the moment. Otherwise, it turns out that the data query is suddenly performed.
Therefore, if the historical query record of the temporary query account exists in the request database, it can be proved that the possibility of stealing data by the current query account, namely the temporary query account, is low, so that the data corresponding to the request query data in the target database can be directly obtained at the moment. And if the historical query record of the temporary query account does not exist in the request database, the possibility that the temporary query account steals data is proved to be high, so that the step of sending the query request information to the corresponding administrator of the target database to determine whether the current query account allows the target database to be accessed is continuously executed at the moment. Therefore, the method and the device can improve the possible accuracy of judging whether the data are stolen or not in the current query account, and ensure the safety of the data as much as possible.
Referring to fig. 6, in order to save resource occupation of the image space as much as possible, in another embodiment, after obtaining the image data based on the query request information to query the query data, the method further includes:
s51, acquiring a login state of a current query account in a preset mirror image space;
s52, when the login state is the offline state, acquiring the offline duration of the current query account;
s53, judging whether the offline time length is greater than a preset time length or not;
and S54, if yes, acquiring a deleting instruction to delete the mirror image data.
Specifically, after acquiring mirror image data to query the query data based on the query request information, acquiring a login state of a current query account in a preset mirror image space, wherein the login state includes an online state and an offline state.
If the login state is the online state, it is proved that the current query account may still need to view mirror image data in the mirror image space, so that no other operation is required at this time. If the login state is the offline state, it is proved that the current query account may have completed the viewing of the mirror image data, and certainly may not have completed the viewing, and in order to further determine, the offline duration of the current query account is obtained at this time.
That is, the current time point and the offline time point when the current query account is offline are recorded through the timing system, and then the offline time point is subtracted from the current time point, so that the obtained value is the offline duration. And then judging whether the offline time length is greater than a preset time length or not, so that whether the current query account is offline for a long time or not can be judged, wherein the preset time length can be set according to actual conditions.
If the offline duration is longer than the preset duration, it is proved that the current query account leaves the mirror space for a long time, and the data query does not need to be continued at this time, so that the deletion instruction is obtained in order to save the space occupation of the mirror space at this time, and the mirror data queried by the current query account in the mirror space is deleted. And if the offline duration is less than or equal to the preset duration, the fact that the time for the current query account to leave the mirror space is short at the moment is proved to be temporary offline, so that a deleting instruction does not need to be acquired at the moment, the mirror data does not need to be deleted, and the deletion is carried out until the offline duration is longer than the preset duration.
Therefore, through the mode, whether the mirror image data needs to be deleted or not can be judged according to the offline duration of the current query account, and then the current query account can be on-line again to check the mirror image data when the current query account is offline unexpectedly, and meanwhile, the mirror image space can be cleaned in time when the current query account is offline for a long time, and further the sufficient space of the mirror image space can be ensured as much as possible.
Referring to fig. 7, in order to further determine whether the current query account is unexpectedly offline from the mirror space, in another embodiment, before obtaining a deletion instruction to delete mirror data, the method further includes:
s61, acquiring a database to which the current query account belongs as a first database;
s62, acquiring the login state of the current query account in a first database;
s63, if the login state is the offline state, not obtaining a deleting instruction;
and S64, if the login state is the online state, executing the step of acquiring a deletion instruction to delete the mirror image data.
Specifically, before a deletion instruction is obtained to delete mirror image data, a database to which a current query account belongs is obtained as a first database, that is, the current query account is matched with accounts in an account list, and if the matching is successful, a database corresponding to the account list which is successfully matched is obtained, that is, the first database.
And then, acquiring the login state of the current query account in the first database, so as to determine whether the current query account is completely offline, and if the login state of the current query account in the first database is an offline state, the current query account is probably offline due to an unexpected condition, such as power failure, so that the data query of the current query account in a mirror space is not completed, and at this time, no deleting instruction is acquired.
If the login state of the current query account in the first database is an online state, it is proved by a large probability that the current query account is actively offline when offline from the mirror image space, which means that the data query of the current query account in the mirror image space is completed, so that the step of obtaining the delete instruction to delete the mirror image data is continuously executed at this time. Therefore, the mirror space can be cleaned, and the cleaning accuracy is improved.
Referring to fig. 8, in order to reduce redundancy of data in the target database, in another embodiment, after obtaining the mirrored data based on the query request information to query the query data, the method further includes:
s71, acquiring all query data as query set data;
s72, judging whether the same query data exist in the query set data or not;
s73, if yes, obtaining a target database corresponding to the same query data as a query database;
s74, judging whether the query databases are the same;
and S75, if the query data are different, storing the same query data into a preset fusion database connected with the target database, and clearing the query data from the target database.
Specifically, after acquiring the mirror data based on the query request information to query the query data, all the query data is acquired as the query set data, that is, the query data in each different target database is acquired.
Then, whether the same query data exists in the query set data is judged, so that whether the same data exists in different target databases is determined. If not, no further action is required. And if so, acquiring a target database corresponding to the same query data as the query database. And marking the query data in each target database with a preset database mark, and acquiring the corresponding mark to obtain the corresponding target database.
Then, whether the query databases are the same or not is judged, so that whether the same query data are data in the same database or not can be determined. If the query databases are the same, other operations are not needed; if the query databases are different, the same query data are proved to be stored in different query databases, so that repeated storage of the data is caused, data redundancy is caused, and a large amount of unnecessary space is occupied.
At the moment, the same query data is stored in a preset fusion database connected with the target database, and the query data is removed from the target database, namely the query data is removed from the query database, so that the same query data is stored in the fusion database, and the space of the target database can be saved. Meanwhile, a connection relation exists between the target database and the fusion database, and query data in the fusion database can still be read.
The implementation principle of the method for sharing and managing the data of multiple databases in the embodiment of the application is as follows: when data query needs to be performed from a target database, query request information of the target database is obtained, then a current query account is obtained according to the query request information, and whether the current query account belongs to the target database is judged, so that whether an internal account of the target database exists is determined. If not, acquiring the query data of the target database according to the query request information, generating mirror image data according to the query data, and finally acquiring the mirror image data according to the query request to query the query data. Therefore, the inquiry account which does not belong to the target database can be prevented from directly contacting the inquiry data as far as possible through the mirror image data, the data of the database can be prevented from being damaged as far as possible, and the risk of all data leakage can be reduced by inquiring through the mirror image data.
The embodiment of the application also discloses a multi-database data sharing management system, which comprises a memory and a processor. A memory storing an intelligent computer program. And the processor can execute the steps of the method for sharing and managing the data of the multiple databases when the intelligent computer program is operated. The intelligent computer program can adopt a known processing program to carry out a series of steps such as inquiry, judgment and the like on data, thereby realizing the sharing management of the data of multiple databases.
The embodiment of the present application further discloses a computer-readable storage medium, which stores a computer program that can be loaded by a processor and execute the method for managing sharing of multiple database data as described above, and the computer-readable storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are preferred embodiments of the present application, and the protection scope of the present application is not limited by the above embodiments, so: equivalent changes in structure, shape and principle of the present application shall be covered by the protection scope of the present application.

Claims (10)

1. A method for managing data sharing of multiple databases is characterized by comprising the following steps:
acquiring query request information of a target database;
acquiring a current query account based on the query request information;
judging whether the current query account belongs to the target database;
if the current query account does not belong to the target database, acquiring query data of the target database based on the query request information;
generating mirror image data based on the query data;
and acquiring the mirror image data based on the query request information to query the query data.
2. The sharing management method according to claim 1, wherein the generating mirrored data based on the query data includes:
acquiring a classification mark of the query data;
acquiring the belonged classification of the query data in the target database based on the classification mark as a target classification;
acquiring all data of the target classification as classification data, wherein the classification data comprises the query data;
and copying the classified data to a preset mirror image space to generate the mirror image data.
3. The sharing management method according to claim 2, wherein the copying the classified data to a preset mirror space to generate the mirror data comprises:
after the classified data is copied to the mirror image space, taking the copied classified data as copied data;
judging whether first encrypted data exists in the copied data or not;
if so, acquiring a data password of the first encrypted data;
decrypting the first encrypted data based on the data cipher to obtain decrypted data;
encrypting the decrypted data in the mirror space, and obtaining second encrypted data and a random password of the second encrypted data;
acquiring data except the first encrypted data in the copied data as residual data;
generating the mirror data based on the remaining data and the second encrypted data;
sending the random password to the current query account;
and if the mirror image data does not exist, directly generating the mirror image data based on the copied data.
4. The sharing management method according to claim 1, wherein if the current query account belongs to the target database, the method includes:
acquiring department information of the current query account;
acquiring request query data based on the query request information;
judging whether the request query data is matched with the department information;
if the data is matched with the query request data, acquiring data corresponding to the query request data in the target database;
and if not, sending the query request information to a corresponding administrator of the target database to determine whether the current query account allows the target database to be accessed.
5. The sharing management method according to claim 4, before the sending the query request information to the administrator of the corresponding target database to determine whether the current query account allows access to the target database, further comprising:
acquiring the current query account corresponding to the request query data which is not matched with the department information as a temporary query account;
taking the target database which is requested to be accessed by the temporary query account as a request database;
judging whether a historical query record of the temporary query account exists in the request database;
if yes, acquiring data corresponding to the request query data in the target database;
if not, the next step is carried out.
6. The sharing management method according to claim 1, further comprising, after the acquiring the mirrored data based on the query request information to query the query data:
acquiring a login state of the current query account in a preset mirror image space, wherein the login state comprises an online state and an offline state;
when the login state is an offline state, acquiring the offline duration of the current query account;
judging whether the offline time length is greater than a preset time length or not;
and if so, acquiring a deleting instruction to delete the mirror image data.
7. The sharing management method according to claim 6, further comprising, before the obtaining a deletion instruction to delete the mirrored data:
acquiring a database to which the current query account belongs as a first database;
acquiring the login state of the current query account in the first database;
if the login state is an offline state, the deleting instruction is not acquired;
and if the login state is the online state, carrying out the next step.
8. The sharing management method according to claim 1, further comprising, after the acquiring the mirrored data based on the query request information to query the query data:
acquiring all the query data as query set data;
judging whether the same query data exist in the query set data or not;
if yes, acquiring a target database corresponding to the same query data as a query database;
judging whether the query databases are the same;
and if not, storing the same query data to a preset fusion database connected with the target database, and clearing the query data from the target database.
9. A system for managing sharing of multiple database data, comprising:
a memory for storing a computer program operable on the processor;
the processor, when executing the computer program, is capable of performing the steps of the method according to any of claims 1 to 8.
10. A computer-readable storage medium characterized by: a computer program which can be loaded by a processor and which performs the method according to any one of claims 1 to 8.
CN202211482940.XA 2022-11-24 2022-11-24 Multi-database data sharing management method, system and storage medium Withdrawn CN115718766A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211482940.XA CN115718766A (en) 2022-11-24 2022-11-24 Multi-database data sharing management method, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211482940.XA CN115718766A (en) 2022-11-24 2022-11-24 Multi-database data sharing management method, system and storage medium

Publications (1)

Publication Number Publication Date
CN115718766A true CN115718766A (en) 2023-02-28

Family

ID=85256317

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211482940.XA Withdrawn CN115718766A (en) 2022-11-24 2022-11-24 Multi-database data sharing management method, system and storage medium

Country Status (1)

Country Link
CN (1) CN115718766A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116702110A (en) * 2023-06-15 2023-09-05 深圳千岸科技股份有限公司 Method, device, equipment and storage medium for sharing big data of supply chain

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116702110A (en) * 2023-06-15 2023-09-05 深圳千岸科技股份有限公司 Method, device, equipment and storage medium for sharing big data of supply chain

Similar Documents

Publication Publication Date Title
JP3678746B2 (en) Data storage device and method
US7111005B1 (en) Method and apparatus for automatic database encryption
CN101410837B (en) System and method for effecting information governance
KR101371608B1 (en) Database Management System and Encrypting Method thereof
CN101751452B (en) Information processing apparatus and information processing method
US20070136202A1 (en) Personal-information managing apparatus, method of providing personal information, computer product, and personal-information-providing system
US20030208686A1 (en) Method of data protection
AU2002213436A1 (en) Method and apparatus for automatic database encryption
JPH09311806A (en) Method for detecting illegal update of data
CN100578518C (en) Content use management system, content-providing system, content-using device and method
KR100483025B1 (en) A method for determining validity of command and a system thereof
US20030229782A1 (en) Method for computer identification verification
US7234060B1 (en) Generation and use of digital signatures
CN115718766A (en) Multi-database data sharing management method, system and storage medium
CN112182604A (en) File detection system and method
JP2004164226A (en) Information processor and program
JP2007188445A (en) Information leakage prevention system and information leakage prevention method
CN116232773A (en) Information release method, device, equipment and medium
JP3734132B2 (en) Key recovery authority management method, apparatus and program recording medium
Liu et al. Vaccine:: Obfuscating access pattern against file-injection attacks
CN113343257A (en) Computer software protection method
CN112115448A (en) Management system for intelligently encrypting and preventing document from being lost
CN117828644B (en) Computer storage system with information security protection mode
KR101122413B1 (en) A method for determining validity of command and a system thereof
WO2023119554A1 (en) Control method, information processing device, and control program

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20230228

WW01 Invention patent application withdrawn after publication