CN118114261A - Data processing method and device and terminal equipment - Google Patents

Data processing method and device and terminal equipment Download PDF

Info

Publication number
CN118114261A
CN118114261A CN202211506442.4A CN202211506442A CN118114261A CN 118114261 A CN118114261 A CN 118114261A CN 202211506442 A CN202211506442 A CN 202211506442A CN 118114261 A CN118114261 A CN 118114261A
Authority
CN
China
Prior art keywords
data
target
tag set
type tag
stored
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
CN202211506442.4A
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202211506442.4A priority Critical patent/CN118114261A/en
Publication of CN118114261A publication Critical patent/CN118114261A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

The disclosure provides a data processing method and device, wherein the method comprises the following steps: after receiving a data acquisition request including an identifier of a target user and a first type tag set associated with data to be acquired, a first mapping relation table may be traversed to acquire a second type tag set associated with the identifier of the target user, then, the target type tag set to be searched may be determined according to the second type tag set and the first type tag set, the second mapping relation table may be traversed to determine a first target data index corresponding to the target type tag set, and then, based on the first target data index, a search interface of a database may be invoked to acquire target data corresponding to the first target data index. Therefore, the multi-tenant privacy control is realized while the usability of data acquisition is improved, and the safety of the data is improved. Further, target data is directly obtained according to the first target data index, so that complexity of a database retrieval process is reduced, and data obtaining efficiency is improved.

Description

Data processing method and device and terminal equipment
Technical Field
The disclosure relates to the field of computer technologies, and in particular, to a data processing method, device, system and terminal equipment.
Background
With the continuous development of artificial intelligence technology, the demand for data is increasing, and the demand for data storage is increasing.
In the related art, data of all users are stored in the same database, and when the access amount is large, the phenomenon of access request congestion occurs, so that the efficiency of data acquisition is affected.
Disclosure of Invention
The disclosure provides a data processing method and device for improving data acquisition efficiency. The technical scheme of the present disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, the embodiments of the present disclosure provide a method for processing data, including:
Receiving a data acquisition request, wherein the acquisition request comprises an identification of a target user and a first type tag set associated with data to be acquired;
traversing the first mapping relation table to obtain a second type tag set associated with the identification of the target user;
Determining a target type tag set to be retrieved according to the second type tag set and the first type tag set;
traversing the second mapping relation table to determine a first target data index corresponding to the target type tag set;
And calling a retrieval interface of the database based on the first target data index to acquire target data corresponding to the first target data index.
In the disclosure, after receiving a data acquisition request including an identifier of a target user and a first type tag set associated with data to be acquired, a first mapping relation table may be traversed to acquire a second type tag set associated with the identifier of the target user, then, the target type tag set to be retrieved may be determined according to the second type tag set and the first type tag set, and the second mapping relation table may be traversed to determine a first target data index corresponding to the target type tag set, and then, based on the first target data index, a retrieval interface of a database may be invoked to acquire target data corresponding to the first target data index. Therefore, the user can acquire the target data only by inputting the first type tag set associated with the data to be acquired, and the usability of data acquisition is improved. Meanwhile, the identification of the target user is associated with the second type tag set with the access right, and the target type tag set is determined according to the first type tag set and the second type tag set, so that multi-tenant privacy management and control is realized, out-of-range access is prevented, and the safety of data is improved. Further, according to the first target data index corresponding to the target type tag set, the retrieval interface of the database is called to directly acquire target data, so that the complexity of the database retrieval process is reduced, and the data acquisition efficiency is improved. In a possible implementation manner of the embodiment of the first aspect of the present disclosure, traversing the second mapping relation table to determine a first target data index corresponding to the target type tag set includes:
traversing the second mapping relation table to determine a second target data index corresponding to each target type tag in the target type tag set;
And determining a first target data index corresponding to the target type label set according to the intersection set of each second target data index associated with each target type label in the target type label set.
In a possible implementation manner of the embodiment of the first aspect of the present disclosure, the method further includes:
Receiving a data storage request, wherein the storage request comprises data to be stored, a third type tag set associated with the data to be stored and a user identifier;
Based on the data to be stored, invoking a database retrieval interface to acquire similar data of the data to be stored from a database;
under the condition that similar data of the data to be stored are not obtained, generating a first data index corresponding to the data to be stored based on a preset data index generation rule;
Calling a data writing interface of a database, and storing the data to be stored and the first data index in the database in an associated manner;
Updating the second mapping relation table according to the third type tag set and the first data index;
and updating the first mapping relation table according to the third type tag set and the user identification.
In a possible implementation manner of the embodiment of the first aspect of the present disclosure, the method further includes:
under the condition that similar data of the data to be stored are obtained, obtaining a second data index corresponding to the similar data;
and updating the second mapping relation table according to the third type tag set and the second data index.
In a possible implementation manner of the embodiment of the first aspect of the present disclosure, storing the data to be stored, the first data index, in association in a database includes:
encrypting data to be stored;
and calling a data writing interface of the database, and storing the encrypted data and the first data index in the database in an associated manner.
In a possible implementation manner of the embodiment of the first aspect of the present disclosure, after obtaining the target data corresponding to the first target data index, the method further includes:
Under the condition that the target data is encrypted data, acquiring a key of the target user according to the identification of the target user;
and decrypting the target data by using the key.
According to a second aspect of the embodiments of the present disclosure, there is provided a data processing apparatus, including:
the receiving and transmitting module is used for receiving a data acquisition request, wherein the acquisition request comprises an identification of a target user and a first type tag set associated with data to be acquired;
the acquisition module is used for traversing the first mapping relation table to acquire a second type tag set associated with the identification of the target user;
The determining module is used for determining the target type tag set to be retrieved according to the second type tag set and the first type tag set;
The determining module is further configured to traverse the second mapping relationship table to determine a first target data index corresponding to the target type tag set;
the acquisition module is further configured to call a search interface of the database based on the first target data index to acquire target data corresponding to the first target data index.
In a possible implementation manner of the second aspect of the embodiment of the present disclosure, the determining module is configured to:
traversing the second mapping relation table to determine a second target data index corresponding to each target type tag in the target type tag set;
And determining a first target data index corresponding to the target type label set according to the intersection set of each second target data index associated with each target type label in the target type label set.
In one possible implementation manner of the embodiment of the second aspect of the present disclosure, the transceiver module is further configured to:
Receiving a data storage request, wherein the storage request comprises data to be stored, a third type tag set associated with the data to be stored and a user identifier;
The acquisition module is further used for calling a database retrieval interface based on the data to be stored so as to acquire similar data of the data to be stored from the database;
The device further comprises:
the generation module is used for generating a first data index corresponding to the data to be stored based on a preset data index generation rule under the condition that similar data of the data to be stored are not acquired;
the storage module is used for calling a data writing interface of the database and storing the data to be stored and the first data index in the database in an associated mode;
The updating module is used for updating the second mapping relation table according to the third type tag set and the first data index;
The updating module is further configured to update the first mapping relation table according to the third type tag set and the user identifier.
In a possible implementation manner of the embodiment of the second aspect of the present disclosure, the obtaining module is further configured to:
under the condition that similar data of the data to be stored are obtained, obtaining a second data index corresponding to the similar data;
the updating module is further configured to update the second mapping relation table according to the third type tag set and the second data index.
In one possible implementation manner of the second aspect of the embodiment of the present disclosure, the method further includes:
The key module is used for encrypting the data to be stored;
The storage module is also used for calling a data writing interface of the database and storing the encrypted data and the first data index in the database in a related way.
In a possible implementation manner of the embodiment of the second aspect of the present disclosure, the obtaining module is further configured to:
Under the condition that the target data is encrypted data, acquiring a key of the target user according to the identification of the target user;
The key module is also used for decrypting the target data by using the key.
According to a third aspect of the embodiments of the present disclosure, there is provided a terminal device, including:
A processor;
a memory for storing processor-executable instructions;
Wherein the processor is configured to execute instructions to implement a method of processing data as in the embodiments of the first aspect described above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium, which when executed by a processor of a terminal device, enables the terminal device to perform a method of processing data as in the embodiments of the above aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method for processing data of the embodiments of the above aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects: after receiving a data acquisition request including an identifier of a target user and a first type tag set associated with data to be acquired, a first mapping relation table may be traversed to acquire a second type tag set associated with the identifier of the target user, then, the target type tag set to be searched may be determined according to the second type tag set and the first type tag set, the second mapping relation table may be traversed to determine a first target data index corresponding to the target type tag set, and then, based on the first target data index, a search interface of a database may be invoked to acquire target data corresponding to the first target data index. Therefore, the user can acquire the target data only by inputting the first type tag set associated with the data to be acquired, and the usability of data acquisition is improved. Meanwhile, the identification of the target user is associated with the second type tag set with the access right, and the target type tag set is determined according to the first type tag set and the second type tag set, so that multi-tenant privacy management and control is realized, out-of-range access is prevented, and the safety of data is improved. Further, according to the first target data index corresponding to the target type tag set, the retrieval interface of the database is called to directly acquire target data, so that the complexity of the database retrieval process is reduced, and the data acquisition efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
Fig. 1 is a flow chart of a data processing method according to a first embodiment of the disclosure;
FIG. 2 is a schematic diagram of a data store provided by the present disclosure;
FIG. 3 is a schematic diagram of another data store provided by the present disclosure;
FIG. 4 is a schematic diagram of another data store provided by the present disclosure;
fig. 5 is a flowchart illustrating another data processing method according to a second embodiment of the present disclosure;
fig. 6 is a flowchart illustrating another data processing method according to a third embodiment of the present disclosure;
fig. 7 is a flowchart illustrating another data processing method according to a fourth embodiment of the present disclosure;
Fig. 8 is a schematic structural diagram of a data processing apparatus according to a fourth embodiment of the present disclosure;
Fig. 9 is a block diagram of a terminal device showing processing of one data according to an exemplary embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
In general, in the case that text data of a large number of users are stored in the same database, all users access the database through a unified data access interface, and when the access amount of the users is large, a phenomenon of access request congestion may occur. In the method, the data index corresponding to the data to be acquired is determined in advance, and then the retrieval interface of the database is called directly based on the data index, so that the target data is acquired rapidly, the complexity of database retrieval is reduced, and the data acquisition efficiency is improved.
Data processing methods and apparatuses according to embodiments of the present disclosure are described below with reference to the accompanying drawings. The method for processing data provided by the present disclosure may be performed by a processing device for processing data provided by the present disclosure (hereinafter referred to as a processing device), where the processing device may be configured on a server side, and the present disclosure is not limited thereto.
Fig. 1 is a flowchart of a data processing method according to an embodiment of the disclosure, including the following steps:
Step 101, receiving a data acquisition request, wherein the acquisition request comprises an identification of a target user and a first type tag set associated with data to be acquired.
The target user may be a user who requests to acquire data, and the identification of the target user may be any information that can uniquely determine the target user, for example, an account name of the user, etc. The type tag may be used to identify a scene to which the data belongs, for example, the type tag corresponding to the data of the home appliance scene may be "home appliance", the type tag corresponding to the data of the after-sales scene may be "after-sales", etc. In addition, some data may be associated with multiple types of tags, for example, data in an after-market home appliance scene may be associated with two types of tags, namely, a home appliance tag and an after-market tag.
Optionally, the type tag may further include service department identification information, so as to isolate data of different service departments, and ensure security of the data. For example, the type tag corresponding to the service department 1 may be "service department 1 identification_home appliance" or the like.
In general, when a user needs to acquire data, keywords of the data to be acquired can be input into the database through a retrieval interface of the database, and then the database can match all data in the database according to the keywords so as to search target data comprising the keywords, so that the data acquisition efficiency is low.
In the present disclosure, in a data analysis scene, specific data information is not known, but only general scene information is known, and therefore, data cannot be obtained through keywords of the data. In order to solve the problem that the data cannot be acquired through the keywords of the data, different type tags can be set for each data to indicate the scene corresponding to each data, then when a target user needs to acquire the data from the database, one or more type tags corresponding to the data can be input into a client for data processing, the client can generate a data acquisition request according to the input type tags and the identification of the target user, and the data acquisition request information is sent to a server (i.e. a processing device) for data processing to acquire the target data, so that fuzzy search is realized. Thereby not only improving the efficiency of data acquisition, but also improving the usability of data acquisition.
For example, when the type labels corresponding to certain data are "after-sale" and "home appliance", the user can input "after-sale and home appliance" in the client to obtain all data associated with the two types of labels simultaneously.
Alternatively, in the case that the reference data is included in the data acquisition request, the first type tag set associated with the reference data may be extracted using a semantic analysis service.
In the present disclosure, when a user knows one representative data corresponding to a certain data analysis scene, the data may be directly input as reference data into a client. And then, the client can generate a data acquisition request according to the reference data and the identification of the target user and send the data acquisition request to the server. The server side can extract the first type tag set associated with the reference data by utilizing semantic analysis service. Thereby, the ease of use of the system is improved.
Step 102, traversing the first mapping relation table to obtain a second type tag set associated with the identification of the target user.
The first mapping relation table comprises the association relation between the identification of each user and each type of label.
In the disclosure, since the data of each user is stored in one database, in order to ensure the privacy of the data, the multi-tenant privacy control is realized, and the access authority can be set for each data so as to limit each user to only access the data with the access authority, thereby preventing out-of-range access.
In the disclosure, the identifier of each user and the type tag with access right of each user may be stored in a preset first mapping relationship table in an associated manner. As shown in fig. 2, if the users corresponding to the user identifier 1, the user identifier 3 and the user identifier 20 all have access rights to the data associated with the type tag 1, the type tag 1 may be stored in association with the user identifier 1, the user identifier 3 and the user identifier 20. Similarly, if the user corresponding to the user identifier 1, the user identifier 3, the user identifier 209 and the user identifier 309 all have the access right of the data associated with the type tag 2, the type tag 2 may be stored in association with the user identifier 1, the user identifier 3, the user identifier 209 and the user identifier 309. And then, the second type tag set associated with the identification of the target user can be obtained by traversing the first mapping relation table, namely, all types of tags with access rights of the target user are determined. Thus, the target user can access the data associated with each type of tag that has access rights.
Optionally, when the target user needs to obtain the access right of a certain type of tag, the fourth type of tag set for application authorization can be input into the client, and the client can generate the application request according to the fourth type of tag set and the identifier of the target user and send the application request to the server. After the server side obtains the permission application request, the first mapping relation table can be updated according to the identification of the target user and the fourth type tag set under the condition that a pass instruction of the application request is received. Thus, the target user has access rights to the data associated with each type of tag in the fourth type of tag set.
Step 103, determining the target type tag set to be retrieved according to the second type tag set and the first type tag set.
In the present disclosure, each type of tag in the first type of tag set may be compared with each type of tag in the second type of tag set, respectively, to determine whether the second type of tag set includes all types of tags in the first type of tag set. When the second type tag set includes all types of tags in the first type tag set, it may be determined that the target user has access rights to each type of tag in the first type tag set. Thus, the first type of tag set may be determined to be the target type of tag set. When the second type of tag set does not contain any type of tag in the first type of tag set, it may be determined that the target user does not have access rights to any type of tag. Thus, to prevent access violations, the target type tag set may be set to an empty set without returning any data.
Step 104, traversing the second mapping relation table to determine the first target data index corresponding to the target type tag set.
The second mapping relation table may include association relations between various types of labels and data indexes. The data index may be any information that can uniquely identify the data, and this disclosure is not limited in this regard.
In the disclosure, the data indexes of the types of labels and the data corresponding to the types of labels can be stored in a preset second mapping relation table in an associated mode. As shown in fig. 3, the type tag 1 may be stored in association with the data index 1, the data index 2, and the data index 330, if the data index 1, the data index 2, and the data index 330 correspond to the data association type tag 1. Similarly, if data index 1, data index 5, data index 450, and data index 998 correspond to data association type tag 2, type tag 2 may be stored in association with data index 1, data index 5, data index 450, and data index 998. Then, when the target type label set only contains one target type label, the first target data index corresponding to the target type label can be determined by traversing the second mapping relation table.
Optionally, when the target type tag set includes a plurality of target type tags, it is indicated that the data to be acquired needs to be associated with the plurality of target type tags at the same time, that is, the data to be acquired should belong to a plurality of scenes corresponding to the plurality of target type tags at the same time. At this time, the second mapping relation table may be traversed to determine a second target data index corresponding to each target type tag in the target type tag set, and then, an intersection of the second target data indexes associated with each target type tag in the target type tag set may be calculated by establishing hashmap a map or the like, and each target data index in the intersection is determined as a first target data index corresponding to the target type tag set.
It will be appreciated that the plurality of second object data indices with which each object type tag may be associated, and thus the intersection of the second object data indices with which each object type tag in the set of object type tags is associated, may comprise a plurality of data indices, and the first object data index may be one or more.
Step 105, based on the first target data index, a search interface of the database is called to obtain target data corresponding to the first target data index.
In the present disclosure, to improve efficiency of data acquisition, data may be stored in a database in association with its corresponding data index. As shown in fig. 4, the data index corresponding to the data 1 is 1381293912213, and the data index corresponding to the data 2 is 21378387213832. And then, the retrieval interface of the database can be called through the first target data index to directly acquire the target data corresponding to the first target data index, so that the complexity of database retrieval is avoided, and the data acquisition efficiency is improved.
Optionally, the data and the corresponding type tag can be stored in the database in an associated manner, so that the corresponding type tag of the data can be directly queried when the data is acquired, and verification and management of the data are facilitated.
Optionally, a tag update request including a fifth type tag set of the data to be updated and a third data index corresponding to the data to be updated may also be obtained, and the second mapping relationship table may be updated according to the fifth type tag and the third data index.
In the present disclosure, after target data is acquired, the target data may be analyzed to determine a new type tag set corresponding to the target data. And then, the target data can be used as data to be updated, the new type tag set is used as a fifth type tag set of the data to be updated, the data index corresponding to the target data is used as a third data index corresponding to the data to be updated, and the second mapping relation table is updated according to the fifth type tag and the third data index. Therefore, the type labels corresponding to the data are enriched, and the accuracy and the flexibility of data acquisition are improved.
In the disclosure, after receiving a data acquisition request including an identifier of a target user and a first type tag set associated with data to be acquired, a first mapping relation table may be traversed to acquire a second type tag set associated with the identifier of the target user, then, the target type tag set to be retrieved may be determined according to the second type tag set and the first type tag set, and the second mapping relation table may be traversed to determine a first target data index corresponding to the target type tag set, and then, based on the first target data index, a retrieval interface of a database may be invoked to acquire target data corresponding to the first target data index. Therefore, the user can acquire the target data only by inputting the first type tag set associated with the data to be acquired, and the usability of data acquisition is improved. Meanwhile, the identification of the target user is associated with the second type tag set with the access right, and the target type tag set is determined according to the first type tag set and the second type tag set, so that multi-tenant privacy management and control is realized, out-of-range access is prevented, and the safety of data is improved. Further, according to the first target data index corresponding to the target type tag set, the retrieval interface of the database is called to directly acquire target data, so that the complexity of the database retrieval process is reduced, and the data acquisition efficiency is improved.
Fig. 5 is a flowchart of a data processing method according to an embodiment of the disclosure, including the following steps:
step 501, a data storage request is received, where the storage request includes data to be stored, a third type tag set associated with the data to be stored, and a user identifier.
In the disclosure, a service node needing to store data can be marked in a buried point mode, and when a service system executes to the service node, the service system can acquire the data generated by the service node. And then, the service system can generate a type label associated with the data of the service node by analyzing the attribute information of the service node, and acquire one or more user identifications which are preset in the system and have access rights to the data corresponding to the service node, namely the user identifications associated with the data to be stored. Then, the service system can generate a storage request of the data according to the acquired data, the type tag set and the user identifier, and send the storage request to a data processing server. The attribute information of the service node may include scene description information of the service, for example, after-sales service of home appliances. Step 502, based on the data to be stored, invoking a database retrieval interface to obtain similar data of the data to be stored from the database.
In this disclosure, the same data may exist in different services. Therefore, before the data is stored in the database, fuzzy search can be performed on the data to be stored to judge whether the data similar to the data is already stored in the database, and in the case that the similar data is stored in the database, the data can not be stored repeatedly. In the case where similar data is not stored in the database, the data is stored in the database again. Thereby reducing the redundancy of the data and further avoiding the waste of data storage resources.
In step 503, when similar data of the data to be stored is not obtained, a first data index corresponding to the data to be stored is generated based on a preset data index generating rule.
In the present disclosure, a first data index corresponding to data to be stored may be generated according to a time sequence in which the data to be stored is received. Or the first data index corresponding to the data to be stored can be generated according to the quantity of the stored data. The present disclosure is not limited in this regard.
Step 504, a data writing interface of the database is called, and the data to be stored and the first data index are stored in the database in an associated mode.
In the present disclosure, the data required by the user may be the same in different data analysis services. In this case, if each user individually builds a personal sample library, not only a waste of storage space is caused, but also a great risk in data management and privacy may be caused. Therefore, the data of each user can be stored in one database, and then the data stored in the database can be accessed under the condition that each user has the access right of the data, so that the multiplexing of the data is realized, the waste of data storage resources is avoided, and the complexity of data management is reduced.
Step 505, updating the second mapping relation table according to the third type tag set and the first data index.
In the disclosure, the second mapping relation table may be updated according to the third type tag set and the first data index, so as to ensure the correctness of the corresponding relation between the type tag and the data index.
Optionally, under the condition that similar data of the data to be stored is obtained, a second data index corresponding to the similar data is obtained, and the second mapping relation table is updated according to the third type tag set and the second data index.
In the disclosure, when similar data of data to be stored exists in the database, the data does not need to be repeatedly stored at this time, and only the third type tag set associated with the data to be stored is required to be associated with the second data index of the similar data for storage. Therefore, the accuracy and the richness of the type label associated with the data are ensured while the data storage space is reduced.
Step 506, updating the first mapping relation table according to the third type tag set and the user identification.
In the present disclosure, the first mapping relationship table may be updated according to the third type tag set and the user identifier, so as to ensure that the user has the right to access the data. Thereby realizing isolation and privacy of data.
It can be appreciated that when the user identifier is plural, the first mapping table is updated according to the third type tag set and the user identifier. Therefore, a plurality of users have access rights to the data to be stored, and multiplexing of the data is realized. In step 507, a data acquisition request is received, where the acquisition request includes an identifier of a target user and a first type tag set associated with data to be acquired.
Step 508, traversing the first mapping relation table to obtain a second type tag set associated with the identification of the target user.
Step 509, determining the target type tag set to be retrieved according to the second type tag set and the first type tag set.
Step 510, traversing the second mapping relation table to determine the first target data index corresponding to the target type tag set.
Step 511, based on the first target data index, call the search interface of the database to obtain the target data corresponding to the first target data index.
In the present disclosure, the specific process of step 507 to step 511 may be referred to the detailed description of any embodiment of the present disclosure, which is not repeated herein.
In the present disclosure, the specific processes of step 501 to step 506 may be performed in parallel with step 507 to step 511, or may be performed after step 507 to step 511, which is not limited in this disclosure. In the disclosure, after a data storage request including data to be stored, a third type tag set associated with the data to be stored and a user identifier is received, a database retrieval interface may be called based on the data to be stored to obtain similar data of the data to be stored from a database, under the condition that similar data of the data to be stored is not obtained, a rule is generated based on a preset data index, a first data index corresponding to the data to be stored is generated, a write data interface of the database is called to store the data to be stored and the first data index in the database in an associated manner, meanwhile, the second mapping relation table may be updated according to the third type tag set and the first data index, and the first mapping relation table may be updated according to the third type tag set and the user identifier. Therefore, under the condition that similar data of the data to be stored is not obtained, a data writing interface of the database is called, the data to be stored and a first data index of the data to be stored are stored in the database in an associated mode, and the first mapping relation table is updated according to a third type tag set and a user identifier associated with the data to be stored, so that multiplexing of the data is achieved, and waste of data storage resources is avoided.
Fig. 6 is a flowchart of a data processing method according to an embodiment of the disclosure, including the following steps:
In step 601, a data storage request is received, where the storage request includes data to be stored, a third type tag set associated with the data to be stored, and a user identifier.
In the present disclosure, the specific process of step 601 may refer to the detailed description of any embodiment of the present disclosure, which is not repeated herein.
Step 602, based on the data to be stored, invoking a database retrieval interface to obtain similar data of the data to be stored from the database.
Optionally, when the encrypted data is stored in the database, after receiving the data storage request, a search interface of the database may be called to obtain all the stored data, decrypt the obtained data based on the common key, calculate the similarity between the data to be stored and the decrypted data, and when the similarity between any decrypted data and the data to be stored is greater than a threshold value, determine that any decrypted data is similar data of the data to be stored.
Step 603, generating a first data index corresponding to the data to be stored based on a preset data index generating rule under the condition that similar data of the data to be stored is not obtained.
In the present disclosure, the specific process of step 603 may refer to the detailed description of any embodiment of the present disclosure, which is not repeated herein.
Step 604, encrypt the data to be stored.
In the present disclosure, in order to ensure data security, a preset asymmetric encryption algorithm (such as RSA encryption) may be used to automatically encrypt data to be stored, and the encrypted data may be stored in a database.
Step 605, the write data interface of the database is called, and the encrypted data, the first data index, and the association are stored in the database.
Step 606, updating the second mapping relation table according to the third type tag set and the first data index;
In step 607, the first mapping table is updated according to the third type tag set and the user identifier.
Step 608, a data acquisition request is received, where the acquisition request includes an identification of a target user and a first type tag set associated with data to be acquired.
Step 609, traversing the first mapping relation table to obtain a second type tag set associated with the identification of the target user.
In step 610, a target type tag set to be retrieved is determined according to the second type tag set and the first type tag set.
Step 611, traversing the second mapping relation table to determine the first target data index corresponding to the target type tag set.
Step 612, based on the first target data index, a search interface of the database is called to obtain target data corresponding to the first target data index.
In this disclosure, the specific process from step 606 to step 612 may refer to the detailed description of any embodiment of the disclosure, which is not repeated herein.
Step 613, obtaining the key of the target user according to the identification of the target user.
In the present disclosure, when encrypting data stored by a target user, a key may be automatically generated for the target user, and the key may be stored in association with an identifier of the target user. Thereafter, when the target data is acquired, the key of the target user may be determined by the query. Thus realizing the decryption process without perception of the user.
Step 614 decrypts the target data using the key.
In the disclosure, after receiving a data storage request including data to be stored, a third type tag set associated with the data to be stored and a user identifier, a database retrieval interface may be called based on the data to be stored to obtain similar data of the data to be stored from a database, under the condition that the similar data of the data to be stored is not obtained, a first data index corresponding to the data to be stored is generated based on a preset data index generation rule, the data to be stored is encrypted, a write data interface of the database is called, the encrypted data and the first data index are associated and stored in the database, meanwhile, a second mapping relation table may be updated according to the third type tag set and the first data index, the first mapping relation table may be updated according to the third type tag set and the user identifier, after that, after receiving a data acquisition request including the identifier of a target user and the first type tag set associated with the data to be obtained, authorization checking may be performed on each tag in the first type tag set, the target type tag set to be determined to be retrieved according to the second type tag set and the first type tag set, the target type tag set to be searched is searched, the target type tag set is mapped to the first data is mapped to the first type tag set, and the target key is mapped to the first data corresponding to the target user identifier is obtained, and the target key can be retrieved according to the first data index. Therefore, the data to be stored is encrypted, and the encrypted data is stored in the database, so that the safety of the data is ensured.
Fig. 7 is a flowchart of a data processing method according to an embodiment of the present disclosure. As shown in fig. 7, when receiving a data acquisition request sent by a user a and including a first type tag set associated with data to be acquired, the processor may first verify access rights of the user a, that is, corresponds to a process of determining a target type tag set to be retrieved. Thereafter, a second target data index associated with each target type tag may be determined from the tag-sample library (i.e., corresponding to the second mapping relationship table), and tag merging (i.e., calculating an intersection of the second target data indexes associated with each target type tag) may be routed to determine the first target data index. Then, based on the first target data index, a retrieval interface of the database is called, and target data corresponding to the first target data index is obtained. When a new type tag is generated by performing data analysis or model identification on the target data, the type tag corresponding to the target data may be updated.
In addition, when a data acquisition request including reference data sent by the user C is received, the reference data may be parsed to determine a type tag set of the reference data, and the type tag set of the reference data is determined as a first type tag set associated with a data pair to be acquired, and then, target data may be acquired according to the first type tag set.
Fig. 8 is a block diagram of a data processing apparatus according to an exemplary embodiment. Referring to fig. 8, the apparatus includes a transceiver module 810, an acquisition module 820, and a determination module 830.
The transceiver module 810 is configured to receive a data acquisition request, where the acquisition request includes an identifier of a target user and a first type tag set associated with data to be acquired;
an obtaining module 820, configured to traverse the first mapping relationship table to obtain a second type tag set associated with the identifier of the target user;
a determining module 830, configured to determine a target type tag set to be retrieved according to the second type tag set and the first type tag set;
The determining module 830 is further configured to traverse the second mapping relationship table to determine a first target data index corresponding to the target type tag set;
the obtaining module 820 is further configured to call a search interface of the database based on the first target data index to obtain target data corresponding to the first target data index.
In one possible implementation manner of the embodiment of the present disclosure, the determining module 830 is configured to:
traversing the second mapping relation table to determine a second target data index corresponding to each target type tag in the target type tag set;
And determining a first target data index corresponding to the target type label set according to the intersection set of each second target data index associated with each target type label in the target type label set.
In one possible implementation manner of the embodiment of the present disclosure, the transceiver module 810 is further configured to:
Receiving a data storage request, wherein the storage request comprises data to be stored, a third type tag set associated with the data to be stored and a user identifier;
The obtaining module 820 is further configured to invoke a database retrieval interface to obtain similar data of the data to be stored from the database based on the data to be stored;
The device further comprises:
the generation module is used for generating a first data index corresponding to the data to be stored based on a preset data index generation rule under the condition that similar data of the data to be stored are not acquired;
the storage module is used for calling a data writing interface of the database and storing the data to be stored and the first data index in the database in an associated mode;
The updating module is used for updating the second mapping relation table according to the third type tag set and the first data index;
The updating module is further configured to update the first mapping relation table according to the third type tag set and the user identifier.
In one possible implementation manner of the embodiment of the present disclosure, the obtaining module 820 is further configured to:
under the condition that similar data of the data to be stored are obtained, obtaining a second data index corresponding to the similar data;
the updating module is further configured to update the second mapping relation table according to the third type tag set and the second data index.
In one possible implementation manner of the embodiment of the disclosure, the method further includes:
The key module is used for encrypting the data to be stored;
The storage module is also used for calling a data writing interface of the database and storing the encrypted data and the first data index in the database in a related way.
In one possible implementation manner of the embodiment of the present disclosure, the obtaining module 820 is further configured to:
Under the condition that the target data is encrypted data, acquiring a key of the target user according to the identification of the target user;
The key module is also used for decrypting the target data by using the key.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
In the disclosure, after receiving a data acquisition request including an identifier of a target user and a first type tag set associated with data to be acquired, a first mapping relation table may be traversed to acquire a second type tag set associated with the identifier of the target user, then, the target type tag set to be retrieved may be determined according to the second type tag set and the first type tag set, and the second mapping relation table may be traversed to determine a first target data index corresponding to the target type tag set, and then, based on the first target data index, a retrieval interface of a database may be invoked to acquire target data corresponding to the first target data index. Therefore, the user can acquire the target data only by inputting the first type tag set associated with the data to be acquired, and the usability of data acquisition is improved. Meanwhile, the identification of the target user is associated with the second type tag set with the access right, and the target type tag set is determined according to the first type tag set and the second type tag set, so that multi-tenant privacy management and control is realized, out-of-range access is prevented, and the safety of data is improved. Further, according to the first target data index corresponding to the target type tag set, the retrieval interface of the database is called to directly acquire target data, so that the complexity of the database retrieval process is reduced, and the data acquisition efficiency is improved.
Fig. 9 is a block diagram of a terminal device showing processing of one data according to an exemplary embodiment.
As shown in fig. 9, the terminal device 900 includes:
Memory 910 and processor 920, bus 930 connecting the different components (including memory 910 and processor 920), memory 910 storing a computer program that when executed by processor 920 implements the data processing method according to the embodiments of the present disclosure.
Bus 930 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Terminal device 900 typically includes a variety of electronic device readable media. Such media can be any available media that is accessible by terminal device 900 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 910 may also include computer-system readable media in the form of volatile memory such as Random Access Memory (RAM) 940 and/or cache memory 950. Terminal device 900 can further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 960 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 9, commonly referred to as a "hard disk drive"). Although not shown in fig. 9, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 930 via one or more data medium interfaces. Memory 910 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the various embodiments of the disclosure.
A program/utility 980 having a set (at least one) of program modules 970 may be stored, for example, in memory 910, such program modules 970 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 970 generally perform the functions and/or methods in the embodiments described in this disclosure.
Terminal device 900 can also communicate with one or more external devices 990 (e.g., keyboard, pointing device, display 991, etc.), one or more devices that enable a user to interact with terminal device 900, and/or any devices (e.g., network card, modem, etc.) that enable terminal device 900 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 992. Also, terminal device 900 can communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through network adapter 993. As shown, network adapter 993 communicates with other modules of terminal device 900 over bus 930. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with terminal device 900, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processor 920 performs various functional applications and data processing by running programs stored in the memory 910.
It should be noted that, the implementation process and the technical principle of the terminal device in this embodiment refer to the foregoing explanation of the data processing method in the embodiment of the disclosure, and are not repeated herein.
In the disclosure, after receiving a data acquisition request including an identifier of a target user and a first type tag set associated with data to be acquired, a first mapping relation table may be traversed to acquire a second type tag set associated with the identifier of the target user, then, the target type tag set to be retrieved may be determined according to the second type tag set and the first type tag set, and the second mapping relation table may be traversed to determine a first target data index corresponding to the target type tag set, and then, based on the first target data index, a retrieval interface of a database may be invoked to acquire target data corresponding to the first target data index. Therefore, the target data is directly acquired through the first target data index, so that the complexity of the database retrieval process is reduced, and the data acquisition efficiency is improved.
In an exemplary embodiment, the present disclosure also provides a computer-readable storage medium including instructions, such as a memory including instructions, executable by a processor of a terminal device to perform the above-described method. Alternatively, the computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
In order to implement the above embodiments, the present disclosure also provides a computer program product which, when executed by a processor of a terminal device, enables the terminal device to perform the method of processing data as described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method of processing data, comprising:
Receiving a data acquisition request, wherein the acquisition request comprises an identification of a target user and a first type tag set associated with data to be acquired;
Traversing a first mapping relation table to obtain a second type tag set associated with the identification of the target user;
determining a target type tag set to be retrieved according to the second type tag set and the first type tag set;
traversing a second mapping relation table to determine a first target data index corresponding to the target type tag set;
and calling a retrieval interface of a database based on the first target data index to acquire target data corresponding to the first target data index.
2. The method of claim 1, wherein traversing the second mapping table to determine the first target data index corresponding to the target type tag set comprises:
Traversing a second mapping relation table to determine a second target data index corresponding to each target type tag in the target type tag set;
and determining a first target data index corresponding to the target type label set according to the intersection set of each second target data index associated with each target type label in the target type label set.
3. The method as recited in claim 1, further comprising:
Receiving a data storage request, wherein the storage request comprises data to be stored, a third type tag set associated with the data to be stored and a user identifier;
Based on the data to be stored, invoking the database retrieval interface to acquire similar data of the data to be stored from the database;
under the condition that similar data of the data to be stored is not obtained, generating a first data index corresponding to the data to be stored based on a preset data index generation rule;
Invoking a data writing interface of a database, and storing the data to be stored and the first data index in the database in an associated manner;
updating the second mapping relation table according to the third type tag set and the first data index;
And updating the first mapping relation table according to the third type tag set and the user identification.
4. A method as recited in claim 3, further comprising:
Under the condition that similar data of the data to be stored are obtained, obtaining a second data index corresponding to the similar data;
and updating the second mapping relation table according to the third type tag set and the second data index.
5. The method of claim 3, wherein storing the data to be stored, the first data index, in association in the database, comprises:
Encrypting the data to be stored;
and calling a data writing interface of a database, and storing the encrypted data and the first data index in the database in an associated way.
6. The method of claim 5, further comprising, after the obtaining the target data corresponding to the first target data index:
under the condition that the target data is encrypted data, acquiring a key of the target user according to the identification of the target user;
and decrypting the target data by using the key.
7. A data processing apparatus, comprising:
the receiving and transmitting module is used for receiving a data acquisition request, wherein the acquisition request comprises an identification of a target user and a first type tag set associated with data to be acquired;
the acquisition module is used for traversing the first mapping relation table to acquire a second type tag set associated with the identification of the target user;
The determining module is used for determining a target type tag set to be retrieved according to the second type tag set and the first type tag set;
The determining module is further configured to traverse a second mapping relationship table to determine a first target data index corresponding to the target type tag set;
the acquisition module is further configured to call a search interface of a database based on the first target data index to acquire target data corresponding to the first target data index.
8. A terminal device, comprising:
A processor;
A memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of processing data according to any of claims 1-6.
9. A computer readable storage medium, which when executed by a processor of a terminal device, causes the terminal device to perform the method of processing data according to any of claims 1-6.
10. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the method of processing data according to any of claims 1-6.
CN202211506442.4A 2022-11-29 2022-11-29 Data processing method and device and terminal equipment Pending CN118114261A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211506442.4A CN118114261A (en) 2022-11-29 2022-11-29 Data processing method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211506442.4A CN118114261A (en) 2022-11-29 2022-11-29 Data processing method and device and terminal equipment

Publications (1)

Publication Number Publication Date
CN118114261A true CN118114261A (en) 2024-05-31

Family

ID=91216512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211506442.4A Pending CN118114261A (en) 2022-11-29 2022-11-29 Data processing method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN118114261A (en)

Similar Documents

Publication Publication Date Title
CN107948152B (en) Information storage method, information acquisition method, information storage device, information acquisition device and information acquisition equipment
CN109657492B (en) Database management method, medium, and electronic device
CN109977690A (en) A kind of data processing method, device and medium
US11811907B2 (en) Data processing permits system with keys
CN111737720B (en) Data processing method and device and electronic equipment
JP2007500912A (en) Method and apparatus for encrypting database columns
US8799677B2 (en) Encrypted search database device, encrypted search data adding/deleting method and adding/deleting program
CN110324416B (en) Download path tracking method, device, server, terminal and medium
CN113806777A (en) File access realization method and device, storage medium and electronic equipment
CN112541009B (en) Data query method, device, electronic equipment and storage medium
CN112307052A (en) Data management method, service system, terminal and storage medium
WO2019022669A1 (en) Searchable encryption with hybrid index
CN113691374A (en) Data encryption method and device, storage medium and electronic equipment
WO2019138542A1 (en) Countermeasure formulation assistance device, countermeasure formulation assistance method, and countermeasure formulation assistance program
CN110830428A (en) Block chain financial big data processing method and system
JP2006189925A (en) Private information management system, private information management program, and private information protection method
US20210110052A1 (en) Method and apparatus for data encryption, method and apparatus for data decryption
US10963587B1 (en) User action collection for sensitive customer data
CN114969832B (en) Private data management method and system based on server-free architecture
CN113254983B (en) Data processing method and device
CN118114261A (en) Data processing method and device and terminal equipment
CN116069810A (en) Data query method and device and terminal equipment
CN112149140A (en) Prediction method, device, equipment and storage medium
CN114638007B (en) Method, system, device and medium for determining community relation based on graph data
CN118095442B (en) Power data tracing method, power system, power equipment and storage medium

Legal Events

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