CN110377649B - Construction and query methods, devices, equipment and storage medium of tagged data - Google Patents

Construction and query methods, devices, equipment and storage medium of tagged data Download PDF

Info

Publication number
CN110377649B
CN110377649B CN201910522373.8A CN201910522373A CN110377649B CN 110377649 B CN110377649 B CN 110377649B CN 201910522373 A CN201910522373 A CN 201910522373A CN 110377649 B CN110377649 B CN 110377649B
Authority
CN
China
Prior art keywords
data
request
target
name
acquiring
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.)
Active
Application number
CN201910522373.8A
Other languages
Chinese (zh)
Other versions
CN110377649A (en
Inventor
钟才
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN201910522373.8A priority Critical patent/CN110377649B/en
Publication of CN110377649A publication Critical patent/CN110377649A/en
Application granted granted Critical
Publication of CN110377649B publication Critical patent/CN110377649B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a construction and query method, a device, equipment and a storage medium of labeled data, wherein the construction method of the labeled data comprises the following steps: acquiring a data labelling request, wherein the data labelling request comprises request label names and data source table names corresponding to the request label names, the number of the request label names is N, and N is a positive integer greater than 1; acquiring a data source table according to the data source table name; acquiring a field value corresponding to a request tag name from the data source table based on the request tag name, and taking the user identifier as target data; and synchronizing the target data to a target data table in a preset database, wherein the target data in the target data table corresponds to the request mark one by one. The technical scheme provided by the invention can improve the efficiency of integrating the data and developing the interface by carrying out the labeling processing on the data.

Description

Construction and query methods, devices, equipment and storage medium of tagged data
Technical Field
The invention belongs to the field of cloud storage, and particularly relates to a method, a device, equipment and a storage medium for constructing and inquiring labeled data.
Background
The development interface is a process of integrating data of a plurality of different systems to form an interface, for example, if data of a certain interface is related to data of three systems A, B and C, the development interface needs to integrate data of three systems A, B and C to form an interface.
However, when the systems to which the interfaces relate are different, the interfaces need to be re-developed; even if the system corresponding to the interface is the same, but the specific data acquired are different, the interface still needs to be redeveloped under the condition, and the process is repeated and complex and has low efficiency.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for constructing and inquiring labeled data, which are used for solving the problem of low data integration efficiency at present.
A construction method of labeled data comprises the following steps:
acquiring a data labelling request, wherein the data labelling request comprises request label names and data source table names corresponding to the request label names, the number of the request label names is N, and N is a positive integer greater than 1;
acquiring a data source table according to the data source table name;
acquiring a field value corresponding to a request tag name from the data source table based on the request tag name, and taking the user identifier as target data;
And synchronizing the target data to a target data table in a preset database, wherein the target data in the target data table corresponds to the request mark one by one.
A method of querying tagged data, comprising:
acquiring a query target mark;
forming a target query statement according to the query target label;
acquiring a field value corresponding to the query target label from a target data table according to the target query statement, wherein the target data table is obtained by adopting a construction method of labeled data;
and returning the query target label and the corresponding field value to the client according to a preset table format.
A construction apparatus for tagged data, comprising:
the request acquisition module is used for acquiring a data labelling request, wherein the data labelling request comprises request label names and data source table names corresponding to the request label names, the number of the request label names is N, and N is a positive integer greater than 1;
the source table acquisition module is used for acquiring a data source table according to the data source table name;
the data acquisition module is used for acquiring a field value corresponding to the request tag name and a user identifier from the data source table based on the request tag name as target data;
And the data synchronization module is used for synchronizing the target data to a target data table in a preset database, and the target data in the target data table corresponds to the request mark one by one.
A labeled data query device, comprising:
the tag name acquisition module is used for acquiring a query target tag name;
the query statement forming module is used for forming a target query statement according to the query target label;
the field value acquisition module is used for acquiring a field value corresponding to the query target label from a target data table according to the target query statement, wherein the target data table is obtained by adopting a construction method of labeled data;
and the query value returning module returns the query target label and the corresponding field value to the client according to a preset table format.
The computer equipment comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the construction method of the labeled data or the query method of the labeled data when executing the computer program.
A computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described construction method of tagged data or query method of tagged data.
The construction method, the construction device, the computer equipment and the storage medium of the tagged data are characterized in that a data tagging request is obtained, and the data tagging request comprises a request tag name and a data source table name corresponding to the request tag name; acquiring a data source table according to the name of the data source table; acquiring a field value corresponding to the request tag name from a data source table based on the request tag name, and taking the user identifier as target data; and synchronizing the target data to a target data table in the preset data, wherein the target data corresponds to the request tag name one by one in the target data table. According to the method, data are acquired according to the labels and are synchronized to the target data table in the preset database, so that data related to the project can be concentrated in the target data table, corresponding data can be acquired from the target data table according to the labels, integration and use of the data are facilitated, and data support is provided for improving the efficiency of developing interfaces.
The query method, the query device, the computer equipment and the storage medium for the labeled data form a target query statement according to the name of the query target label by acquiring the query target label; acquiring a field value corresponding to a query target tag name from a target data table according to a target query statement, wherein the target data table is obtained by adopting a construction method of tagged data; and returning the query target label and the corresponding field value to the client according to a preset table format. By constructing the corresponding structured query statement, a user can conveniently extract corresponding tag data from the target data table, so that a corresponding data interface is formed, and the efficiency of developing the interface is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an application environment of a method for constructing tagged data or a method for querying tagged data according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method of constructing tag data in accordance with an embodiment of the present invention;
FIG. 3 is another flow chart of a method of constructing tag-ized data according to an embodiment of the present invention;
FIG. 4 is another flow chart of a method of constructing tag-ized data according to an embodiment of the present invention;
FIG. 5 is another flow chart of a method of constructing tag-ized data according to an embodiment of the present invention;
FIG. 6 is a flow chart of a method of querying tag data in accordance with an embodiment of the present invention;
FIG. 7 is a schematic block diagram of a construction apparatus for labeling data in accordance with an embodiment of the present invention;
FIG. 8 is another functional block diagram of a construction apparatus for labeling data in accordance with an embodiment of the present invention;
FIG. 9 is a schematic block diagram of a query device for identifying data in accordance with an embodiment of the present invention;
FIG. 10 is a schematic diagram of a computer device in accordance with an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The construction method of the labeled data can be applied to an application environment as shown in fig. 1, wherein a client communicates with a server through a network, and the server acquires a data labeling request through the client, wherein the data labeling request comprises a request label name and a data source table name corresponding to the request label name; the server side obtains the data source table name according to the data source table name; acquiring a field value corresponding to the request tag name from a data source table based on the request tag name, and taking the user identifier as target data; and synchronizing the target data to a target data table in a preset database, wherein the target data corresponds to the request tag name one by one in the target data table. The clients may be, but are not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server may be implemented by a stand-alone server or a server cluster formed by a plurality of servers.
In an embodiment, as shown in fig. 2, a method for constructing tagged data is provided, and the method is applied to the server in fig. 1 for illustration, and includes the following steps:
s10: and acquiring a data labeling request, wherein the data labeling request comprises request label names and data source table names corresponding to the request label names, the request label names are N, and N is a positive integer greater than 1.
The data tagging request refers to a request that a user extracts part of common data from databases of different systems of a server according to needs and tags the part of data. For example, when integrated data relates to data of both a and B systems, a data tagging request refers to a request to extract required data from databases of both a and B systems, respectively, and tag the extracted data. In a specific practical manner, a user (developer) can select common data of each system, such as age, gender, academy, license plate number, frame number, insurance policy number and the like, and extract the common data from databases of different systems and perform labeling processing, so that the development of interfaces is facilitated. Optionally, before triggering the data tagging request, the user (developer) may send the data tagging request to the server through the client after logging in through the account password.
The request label is a label corresponding to the data labelling request, the number of the request label is N, and N is a positive integer greater than 1, namely at least two request label. For example, if a certain data table stores data such as the sex, age, and academic of the user, and the user needs to tag both the sex and age, the request tag name is the sex and age. Optionally, at least two systems corresponding to the request tag name are provided, that is, data of more than two systems are integrated. In the database at the server side, the data in the data table is stored in the form of a key value, and the key name (field name) is usually stored in english, for example, age is age, sex is sex, etc. Alternatively, the request tag name may be directly represented in the corresponding english language. Preferably, in order to make the tagged data have strong readability, a corresponding mapping table may be set at the server, where a corresponding chinese name is attached to the mapping table, and the relationship between the mapping tables is described, for example, as shown in the following table:
table 1 mapping table of request tag name and field name
Figure BDA0002097132760000051
Figure BDA0002097132760000061
It should be noted that the tag name and the field name may be different, and the server may obtain the corresponding relationship between the tag name and the field name according to the mapping table.
The name of the data source table corresponding to the request tag name is the name of the source table of the tag-oriented data. For example, the gender is from a user table, the license plate number is from a car table, etc., and then the user table and the car table are the data source table names of which the request tag names are the gender and the license plate number. Optionally, the data source table is more than two, and the data source table corresponds to more than two service data respectively. Optionally, the mapping table further includes a data source table name corresponding to the request label, including a correspondence between the request label and the data source table, for example, as shown in the following table:
table 2 mapping table of request tag name and data source table
Request label Chinese name Data Source Table name Field name
sex Sex (sex) USER sex
age Age of USER age
car_no License plate number CAR car_no
…… …… …… ……
S20: and acquiring the data source table according to the data source table name.
Specifically, the server locates the data source table in the database according to the name of the data source table, and then obtains the corresponding data source table. For example, the data source table name is a user, and the server side finds and acquires the data source table of the user according to the user table name.
S30: and acquiring a field value corresponding to the request tag name from the data source table based on the request tag name, and taking the user identification as target data.
The user identifier refers to a field in the data source table, which is a part of the data source table, and because the data of different systems all have the field of the user identifier, the user identifier can be used as a public field in the construction process of the labeled data.
Specifically, the server side extracts data from corresponding fields in the data source table according to the request label name, and uses the user identification as target data. When the data source tables are different, the server side extracts corresponding data from the different data source tables respectively and then combines the corresponding data according to the user identification to serve as target data. When the server extracts data, the server can extract the data by using a corresponding Structured Query Language (SQL).
For example, the request tag name is sex, the corresponding data source table name is user, and the server side extracts the field value of the field name sex corresponding to the request tag name from the data source table user as the target data.
S40: and synchronizing the target data to a target data table in a preset database, wherein the target data corresponds to the request tag name one by one in the target data table.
The preset database is a database used by the server for storing the target data table, so that the labeled data can be managed in a centralized way, and the reading and the development of the corresponding interface can be facilitated. Optionally, the preset database is a Redis database. The Redis is an open-source log-type and Key-Value database which is written and supported by using ANSI C language, can be based on memory and can be persistent. Because the data in the Redis are cached in the memory, the target data table is arranged in the Redis relative to the read-write speed of the magnetic disk of the common database, so that the extraction and the use of the labeled data can be greatly accelerated.
It should be noted that, when the server side obtains the target data, the target data are extracted according to the user identifier, and in the target data table, the corresponding target data are stored according to the user identifier, for example, as shown in the following table:
table 3 target data table 1
User identification Request label Chinese name Field source Table name Field name
AAAA sex Sex (sex) Watch (watch) user sex
AAAA age Age of Watch (watch) user age
AAAA car_no License plate number Watch (watch) car car_no
…… …… …… …… …… ……
BBBB sex Sex (sex) Watch (watch) user sex
BBBB age Age of Watch (watch) user age
BBBB car_no License plate number Watch (watch) car car_no
…… …… …… …… …… ……
After the target data are acquired, the server synchronizes the extracted target data to a target data table in a preset database. In the target data table, target data corresponds to the request tag names one by one, so that the data can be conveniently inquired or used according to the tag names. Alternatively, the target data table may be format preset, for example, as shown in the following table:
table 4 target data table 2
Figure BDA0002097132760000081
When data is extracted from the data source table, if the data type corresponding to the field type is different from the format preset data type, the data type can be converted into the format preset data type, so that unified management of the data is facilitated.
In the corresponding embodiment of fig. 2, by obtaining a data tagging request, the data tagging request includes a request tag name and a data source table name corresponding to the request tag name; acquiring a data source table according to the name of the data source table; acquiring a field value corresponding to the request tag name from a data source table based on the request tag name, and taking the user identifier as target data; and synchronizing the target data to a target data table in the preset data, wherein the target data corresponds to the request tag name one by one in the target data table. According to the method, data are acquired according to the labels and are synchronized to the target data table in the preset database, so that data related to the project can be concentrated in the target data table, corresponding data can be acquired from the target data table according to the labels, integration and use of the data are facilitated, and data support is provided for improving the efficiency of developing interfaces.
In an embodiment, as shown in fig. 3, after step S10, that is, after the data tagging request is obtained, the method for constructing tagged data according to the embodiment further includes the following steps:
s51: and acquiring the target user identification based on the data tagging request.
The target user identifier refers to a corresponding user identifier for making a data tagging request. It should be noted that, the user identifier of the target user identifier and the user identifier of the tagged data may be identifiers corresponding to different systems, for example, may refer to identifiers of developers, or may be identifiers corresponding to the same system, that is, the developers perform development interfaces on the internal system data. Specifically, the server may obtain a corresponding user ID, an identification card number, or a user number according to the account number registered by the user as the target user identifier. Wherein, the user number refers to the sequence number of the user in the system.
S52: and carrying out authority verification on each request label according to the target user identification.
It can be understood that, in order to make the data of the target data table safe and stable, the server side can set different rights of data tagging processing for different users. Specifically, when the server sets the rights of the data tagging process, different rights may be set for different tags, for example, as shown in the following table:
Table 5 data tag class rights table
Grade Authorized tags
First level sex,age
Second-level sex,age,car_no,frame_no
Three stages sex,age,car_no,frame_no,engine_no,ins_state
At this time, the server first determines the level corresponding to the target user according to the target user identifier, then determines according to the authorized tag corresponding to the level, and determines whether each request tag has the corresponding data tagging right, and when the user does not have the authorization of a certain tag, it means that the user cannot trigger the tagging request for the tag. The level of the target user may be preset by the server.
S53: and if the authority verification of each request label name is passed, executing the step of acquiring the data source table according to the data source table name.
Specifically, the server judges according to the set authority of the request tag, if any one of the N request tag does not have the corresponding authority, the server sends prompt information of failure in tag authority verification to the client, so that the target user corrects the request tag name or applies for the corresponding tag authority; if the authority of each request label passes the verification, step S20 is executed, namely, the data source table is obtained according to the data source table name.
In the embodiment corresponding to fig. 3, by acquiring the target user identifier based on the data tagging request, performing authority verification on each request tag according to the target user identifier, and if the authority verification on each request tag passes, executing the step of acquiring the data source table according to the data source table name. By verifying whether the user has the corresponding tag authority, the security of the tagged data can be improved.
In an embodiment, as shown in fig. 4, after step S40, that is, after synchronizing the target data to the target data table in the preset database, the method for constructing the tagged data according to the embodiment further includes the following steps:
s61: and acquiring a timing synchronization request of the target data.
The timing synchronization request of the target data refers to a request for timing update of the target data table. Optionally, the server may set a corresponding timer, where the timer is set at a preset time interval, and when the preset time interval is reached, the timing synchronization request of the target data is triggered. The preset time interval may be set according to actual needs, for example, 10S, 20S, or 30S, which is not limited herein.
S62: and acquiring a request mark name of the target data table and a data source table name corresponding to the request mark name according to the timing synchronization request.
Specifically, when the server side obtains a timing synchronization request of the target data, the server side obtains a request tag name of the target data table and a data source table name corresponding to the request tag name. It will be appreciated that the data source table name may change, and the server needs to obtain the latest data source table name from the target data table. For example, the data source table name changes from "user" to "person", alternatively, the changed data source table name may be maintained by the user (developer) into the target data table.
Optionally, when the target data table is more than two, the timing synchronization request includes the table name of the target data table, that is, the timing synchronization request designates the updated target data table, and the server obtains the corresponding request label and the corresponding data source table name according to the designated table name of the target data table.
S63: and acquiring updated data from the corresponding data source table according to the request tag name and the data source table name, and updating the updated data to the target data table.
Specifically, the server side obtains a corresponding data source table according to the data source table name, obtains updated data from the data source table according to the corresponding request label, and updates the obtained updated data to the target data table. Alternatively, the data may be retrieved from the data source table using a structured query statement. Alternatively, when the acquired updated data is updated to the target data, the acquired updated data may be overlaid with the original data to complete the update.
In a specific embodiment, a user (developer) may directly modify data of the target data table, and the server monitors the target data table, and if it is found that the data source table name corresponding to the target data is modified, for example, the data source table name in the previous example is changed from "user" to "person", the corresponding data source table is obtained according to the obtained modified data source table name, and then the corresponding data of the data source table is updated. By automatic monitoring of the server side, the modified data source table can be found in time, and updating of the data is completed, so that the data in the target data table is kept effective.
In the corresponding embodiment of fig. 4, the timing synchronization request of the target data is acquired; acquiring a request mark name of a target data table and a data source table name corresponding to the request mark name according to a timing synchronization request; and acquiring updated data from the corresponding data sources according to the request tag names and the data source table names, and updating the updated data to the target data table. By updating the target data table at regular time, timeliness of updating the tagged data can be ensured, and the tagged data can be kept valid all the time.
In an embodiment, as shown in fig. 5, after step S40, that is, after synchronizing the target data table to the target data table in the preset database, the method for constructing the tagged data according to the embodiment further includes the following steps:
s71: and acquiring a new tag request, and acquiring a new tag name of the new tag request according to the new tag request.
Wherein the newly added request label refers to the name of the label newly added to the target data table. For example, if the item changes, or a new item requires more data, and the newly added data is frequently used later, it is necessary to add tagged data to the target data table.
Specifically, the server side obtains a new tag request through the client side, and when the server side obtains the new tag request, the server side obtains the new tag name of the new tag request. Optionally, the new tag request includes a new request tag name, and the server may obtain the new request tag name according to the new tag request.
S72: and acquiring a data source table corresponding to the newly added request label.
Optionally, the data source table corresponding to the new request label may be maintained in the mapping table by a developer, and the server obtains the data source table corresponding to the new request label from the updated mapping table.
Optionally, the new tag request includes a data source table name corresponding to the new tag request, for example, the data source table name corresponding to the new tag request is written into a structured query statement, and then the server may obtain the data source table name corresponding to the new tag request according to the structured query statement, and then obtain the corresponding data source table according to the data source table name.
S73: and acquiring the new target data corresponding to the new request label from the data source table.
Optionally, the updated mapping table includes a field name corresponding to the new request tag, and the server may obtain the field name corresponding to the new request tag from the updated mapping table, and then obtain the data of the corresponding field value from the corresponding data source table according to the corresponding field name.
Alternatively, the field name corresponding to the newly added request tag name may be written into the structured query statement, and the server obtains the value of the corresponding field from the corresponding data source table according to the corresponding field name.
S74: the new request tag name and the new target data are incorporated into a target data table.
Specifically, the server may incorporate the new request tag name and the obtained new target data into the target data table through a structured query statement (for example, unit all), so as to complete updating of the target data table. It will be appreciated that the updated target data table includes the original tag name, the new request tag name, and the corresponding data.
In the embodiment corresponding to fig. 5, the tag name of the new added request is obtained according to the tag request by obtaining the tag request; acquiring a data source table corresponding to the newly added request label; acquiring new target data corresponding to the new request label from a data source table; the new request tag name and the new target data are incorporated into a target data table. By combining the newly added tag and data into the target data table, the stability of the use of the tagged data can be ensured, and the target data table is adapted to new requirements to be correspondingly expanded.
The application also provides a query method of the labeled data, which can also be applied to the application environment as shown in fig. 1, wherein a client communicates with a server through a network, the server obtains a query target label through the client, and a structured query language name is formed according to the query target label; acquiring a field value corresponding to a query target tag name from a target data table according to a target query statement, wherein the target data table is obtained by the construction method of the tagged data provided in the embodiment; and returning the query target label and the corresponding field value to the client according to a preset table format. The clients may be, but are not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server may be implemented by a stand-alone server or a server cluster formed by a plurality of servers.
In an embodiment, as shown in fig. 6, a method for querying tagged data is provided, and the method is applied to the server in fig. 1 for illustration, and includes the following steps:
s10': a query target label name is obtained.
The query target label refers to a label required to be queried. The query target tag name may be obtained by the client, for example, if the user inputs the query target tag name through the client, the server obtains the corresponding query target tag name.
S20': and forming a target query statement according to the query target label.
Optionally, the query target tag name may be input to a preset structured query statement, to obtain a complete query statement, i.e., a target query statement. The preset structured query statement can be made into an interface form, the query target label is input through the made interface, the input label is used as the label, the server obtains the label name input by the interface as the query target label, and then the query target label and the structured query statement of the interface are combined to form the target query statement.
Alternatively, the number of the query target marks may be multiple, for example, if a certain project needs four marks of age, gender, frame number and policy number, the query target marks are the age, gender, frame number and policy number.
In a specific embodiment, after the interface is formed, the access rights of the user can be further set, as shown in the following table:
table 6 team and authorized tag table
Team name Authorized tags
Personal center sex,age
Movable center sex,age,car_no,frame_no,engine_no,ins_state
Policy center ins_begin_date,ins_end_date
I.e. different access rights can be set for different business teams. When a user inquires through a developed interface, the server side firstly judges a team of the user, so that the corresponding inquiry authority is checked; and if the user has the corresponding authority, allowing the user to inquire the corresponding authorization tag, otherwise, refusing to access. Therefore, the security of the data can be ensured, and meanwhile, the access conditions of different teams can be conveniently counted.
In a particular embodiment, the enrollment of the developed interface may also include a user identification. The user may enter a specified user identification, thereby returning tagged data corresponding to the specified user identification.
S30': and acquiring a field value corresponding to the query target tag name from a target data table according to the target query statement, wherein the target data table is obtained by adopting a construction method of tagged data.
The target data table is a data table obtained by adopting the construction method of the tagged data in the embodiment.
Specifically, the server can find the corresponding field value according to the query target identifier and the target user identifier in the target query statement. It should be noted that the default operation object of the target query statement is the target data table, that is, the target data table name is included in the target query statement.
S40': and returning the query target label and the corresponding field value to the client according to a preset table format.
The preset table format may be set according to actual needs, which is not limited herein. For example, in a certain project, the acquired data can be returned according to three dimensions of a person, a car and a policy, for example, the age, the sex or the academic of the person is returned to the dimension of the person, the frame number, the license plate number and the like of the car are returned to the dimension of the car, the starting time and the ending time of the policy or whether the policy is returned to the dimension of the policy in a certain condition, namely, the target data in the target data table is further divided and sorted and then returned to the client, so that the user can conveniently view the data. Optionally, if some data in the project is necessary, the server may bring the data along with the target query statement, for example, the frame number and the policy number of the vehicle, that is, the field name corresponding to the data is preset in the target query statement.
Specifically, the server forms a table form of the query target label and the corresponding field value according to a preset table format, and returns the formed table to the client.
In the embodiment corresponding to fig. 6, a target query statement is formed according to the name of the query target tag by acquiring the query target tag name; acquiring a field value corresponding to a query target tag name from a target data table according to a target query statement, wherein the target data table is obtained by adopting a construction method of tagged data; and returning the query target label and the corresponding field value to the client according to a preset table format. By constructing the corresponding structured query statement, a user can conveniently extract corresponding tag data from the target data table, so that a corresponding data interface is formed, and the efficiency of developing the interface is improved.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
In an embodiment, a device for constructing tagged data is provided, where the device for constructing tagged data corresponds to the method for constructing tagged data in the foregoing embodiment one by one. As shown in fig. 7, the construction apparatus of tagged data includes a request acquisition module 10, a source table acquisition module 20, a data acquisition module 30, and a data synchronization module 40. The functional modules are described in detail as follows:
The request acquisition module 10 is configured to acquire a data tagging request, where the data tagging request includes a request tag number N and a data source table name corresponding to the request tag number N, where N is a positive integer greater than 1;
the source table acquisition module 20 is configured to acquire a data source table according to the name of the data source table;
a data acquisition module 30, configured to acquire, from the data source table, a field value corresponding to the request tag name and a user identifier as target data based on the request tag name;
the data synchronization module 40 is configured to synchronize the target data to a target data table in a preset database, where the target data corresponds to the request tag name one by one.
Further, as shown in fig. 8, the apparatus for constructing tagged data provided in this embodiment further includes a rights verification module 50, where the rights verification module 50 includes an identifier obtaining unit 51, a rights verification unit 52, and a result executing unit 53.
An identification acquisition unit 51 for acquiring a target user identification based on the data tagging request;
a permission checking unit 52, configured to perform permission checking on each request identifier according to the target user identifier;
the result execution unit 53 is configured to execute a step of acquiring the data source table according to the data source table name when the authority verification for each request tag name passes.
Further, the apparatus for constructing tagged data provided in this embodiment further includes a data update module, where the data update module is configured to:
acquiring a timing synchronization request of the target data;
acquiring the request mark name of the target data table and the data source table name corresponding to the request mark name according to the timing synchronization request;
and acquiring updated data from the corresponding data source table according to the request mark name and the data source table name, and updating the updated data to the target data table.
Further, the apparatus for constructing tagged data provided in this embodiment further includes a data adding module, where the data adding module is configured to:
acquiring a new tag request, and acquiring a new tag name of the new tag request according to the new tag request;
acquiring a data source table corresponding to the newly added request label;
acquiring new target data corresponding to the new request label from the data source table;
the new request tag name and the new target data are incorporated into the target data table.
For specific limitations on the construction means of the tagged data, reference may be made to the above limitations on the construction method of the tagged data, and no further description is given here. The modules in the above-described construction apparatus for tagged data may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In an embodiment, a query device for tagged data is provided, where the query device for tagged data corresponds to the query method for tagged data in the foregoing embodiment one by one. As shown in fig. 9, the query device for tagged data includes a tag name acquisition module 10', a query statement formation module 20', a field value acquisition module 30', and a query value return module 40'. The functional modules are described in detail as follows:
a tag name acquisition module 10' for acquiring a query target tag name;
a query statement formation module 20' for forming a target query statement according to the query target tag name;
a field value obtaining module 30' for obtaining a field value corresponding to the query target tag name from a target data table according to the target query statement, wherein the target data table is obtained by adopting a construction method of tagged data;
the query value returning module 40' returns the query target label and the corresponding field value to the client according to the preset table format.
For specific limitations of the query device for the tagged data, reference may be made to the above limitation of the query method for the tagged data, which is not described herein. The above-mentioned various modules in the labeled data query device may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 10. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing a data source table, target data, a target data table and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by the processor, implements a method of constructing tagged data, or the computer program, when executed by the processor, implements a method of querying tagged data.
In one embodiment, a computer device is provided comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of when executing the computer program:
Acquiring a data labelling request, wherein the data labelling request comprises request label names and data source table names corresponding to the request label names, the request label names are N, and N is a positive integer greater than 1;
acquiring a data source table according to the name of the data source table;
acquiring a field value corresponding to the request tag name from a data source table based on the request tag name, and taking the user identifier as target data;
and synchronizing the target data to a target data table in a preset database, wherein the target data corresponds to the request tag name one by one in the target data table.
Alternatively, the processor when executing the computer program performs the steps of:
acquiring a query target mark;
forming a target query statement according to the query target tag name;
acquiring a field value corresponding to a query target tag name from a target data table according to a target query statement, wherein the target data table is obtained by adopting a construction method of tagged data;
and returning the query target label and the corresponding field value to the client according to a preset table format.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a data labelling request, wherein the data labelling request comprises request label names and data source table names corresponding to the request label names, the request label names are N, and N is a positive integer greater than 1;
Acquiring a data source table according to the name of the data source table;
acquiring a field value corresponding to the request tag name from a data source table based on the request tag name, and taking the user identifier as target data;
and synchronizing the target data to a target data table in a preset database, wherein the target data corresponds to the request tag name one by one in the target data table.
Alternatively, the computer program when executed by a processor performs the steps of:
acquiring a query target mark;
forming a target query statement according to the query target tag name;
acquiring a field value corresponding to a query target tag name from a target data table according to a target query statement, wherein the target data table is obtained by adopting a construction method of tagged data;
and returning the query target label and the corresponding field value to the client according to a preset table format.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (6)

1. A method of constructing tagged data, comprising:
acquiring a data labelling request, wherein the data labelling request comprises request label names and data source table names corresponding to the request label names, the number of the request label names is N, and N is a positive integer greater than 1;
Acquiring a target user identifier based on the data tagging request; performing authority verification on each request label according to the target user identifier; if the authority verification of each request label name is passed, acquiring a data source table according to the data source table name;
acquiring a field value corresponding to a request tag name from the data source table based on the request tag name, and taking the user identifier as target data;
synchronizing the target data to a target data table in a preset database, wherein the target data corresponds to the request mark in a one-to-one mode in the target data table;
after the target data is synchronized to the target data table in the preset database, the construction method of the tagged data further comprises the following steps:
acquiring a timing synchronization request of the target data; acquiring the request mark name of the target data table and the data source table name corresponding to the request mark name according to the timing synchronization request; acquiring updated data from the corresponding data source table according to the request mark name and the data source table name, and updating the updated data to the target data table;
after the target data is synchronized to the target data table in the preset database, the construction method of the tagged data further comprises the following steps:
Acquiring a new tag request, and acquiring a new tag name of the new tag request according to the new tag request; acquiring a data source table corresponding to the newly added request label; acquiring new target data corresponding to the new request label from the data source table; the new request tag name and the new target data are incorporated into the target data table.
2. A method for querying tagged data, comprising:
acquiring a query target mark;
forming a target query statement according to the query target label;
acquiring a field value corresponding to the query target label from a target data table according to the target query statement, wherein the target data table is obtained by adopting the construction method of the labeled data in claim 1;
and returning the query target label and the corresponding field value to the client according to a preset table format.
3. A construction apparatus for labeling data, comprising:
the request acquisition module is used for acquiring a data labelling request, wherein the data labelling request comprises request label names and data source table names corresponding to the request label names, the number of the request label names is N, and N is a positive integer greater than 1;
The source table acquisition module is used for acquiring a target user identifier based on the data tagging request; performing authority verification on each request label according to the target user identifier; if the authority verification of each request label name is passed, acquiring a data source table according to the data source table name;
the data acquisition module is used for acquiring a field value corresponding to the request tag name and a user identifier from the data source table based on the request tag name as target data;
the data synchronization module is used for synchronizing the target data to a target data table in a preset database, wherein the target data in the target data table corresponds to the request mark one by one;
the data updating module is used for acquiring the timing synchronization request of the target data; acquiring the request mark name of the target data table and the data source table name corresponding to the request mark name according to the timing synchronization request; acquiring updated data from the corresponding data source table according to the request mark name and the data source table name, and updating the updated data to the target data table;
the data adding module is used for obtaining a new label adding request and obtaining a new label adding request name according to the new label adding request; acquiring a data source table corresponding to the newly added request label; acquiring new target data corresponding to the new request label from the data source table; the new request tag name and the new target data are incorporated into the target data table.
4. A labeled data query device, comprising:
the tag name acquisition module is used for acquiring a query target tag name;
the query statement forming module is used for forming a target query statement according to the query target label;
a field value obtaining module, configured to obtain, according to the target query statement, a field value corresponding to the query target label from a target data table, where the target data table is obtained by using the construction method of the labeled data in claim 1;
and the query value returning module returns the query target label and the corresponding field value to the client according to a preset table format.
5. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the construction method of the tagged data as claimed in claim 1 when executing the computer program or the querying method of the tagged data as claimed in claim 2 when executing the computer program.
6. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the method of constructing tagged data as claimed in claim 1, or wherein the computer program when executed by a processor implements the method of querying tagged data as claimed in claim 2.
CN201910522373.8A 2019-06-17 2019-06-17 Construction and query methods, devices, equipment and storage medium of tagged data Active CN110377649B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910522373.8A CN110377649B (en) 2019-06-17 2019-06-17 Construction and query methods, devices, equipment and storage medium of tagged data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910522373.8A CN110377649B (en) 2019-06-17 2019-06-17 Construction and query methods, devices, equipment and storage medium of tagged data

Publications (2)

Publication Number Publication Date
CN110377649A CN110377649A (en) 2019-10-25
CN110377649B true CN110377649B (en) 2023-07-14

Family

ID=68250408

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910522373.8A Active CN110377649B (en) 2019-06-17 2019-06-17 Construction and query methods, devices, equipment and storage medium of tagged data

Country Status (1)

Country Link
CN (1) CN110377649B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112905586A (en) * 2019-12-03 2021-06-04 阿里巴巴集团控股有限公司 Data processing and accessing method, device, computer system and readable storage medium
CN111353287A (en) * 2020-05-25 2020-06-30 广州市玄武无线科技股份有限公司 Dynamic table generation method, device, equipment and storage medium
CN112527812A (en) * 2020-12-04 2021-03-19 北京顺达同行科技有限公司 Data permission processing method and device based on multiple dimensions and computer equipment
CN114237806B (en) * 2021-12-29 2024-03-12 瀚云科技有限公司 Page information display method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104166862A (en) * 2013-05-16 2014-11-26 中国科学院信息工程研究所 Active and passive RFID-based data acquisition and monitoring method
CN105872083A (en) * 2016-05-19 2016-08-17 湖州微未信息科技有限公司 Method and system supporting server access by different types of clients as well as server
US9940203B1 (en) * 2015-06-11 2018-04-10 EMC IP Holding Company LLC Unified interface for cloud-based backup and restoration
CN109062883A (en) * 2018-07-18 2018-12-21 平安科技(深圳)有限公司 Tables of data dynamic deriving method, device, computer equipment and storage medium
CN109144501A (en) * 2018-08-30 2019-01-04 杭州数澜科技有限公司 A kind of method and system generating API by label

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104166862A (en) * 2013-05-16 2014-11-26 中国科学院信息工程研究所 Active and passive RFID-based data acquisition and monitoring method
US9940203B1 (en) * 2015-06-11 2018-04-10 EMC IP Holding Company LLC Unified interface for cloud-based backup and restoration
CN105872083A (en) * 2016-05-19 2016-08-17 湖州微未信息科技有限公司 Method and system supporting server access by different types of clients as well as server
CN109062883A (en) * 2018-07-18 2018-12-21 平安科技(深圳)有限公司 Tables of data dynamic deriving method, device, computer equipment and storage medium
CN109144501A (en) * 2018-08-30 2019-01-04 杭州数澜科技有限公司 A kind of method and system generating API by label

Also Published As

Publication number Publication date
CN110377649A (en) 2019-10-25

Similar Documents

Publication Publication Date Title
CN110377649B (en) Construction and query methods, devices, equipment and storage medium of tagged data
US11062038B2 (en) Method and system for identity and credential protection and verification via blockchain
US20120265836A1 (en) File sharing system and file sharing method
US20140365523A1 (en) Push subscriptions
CN112434059B (en) Data processing method, data processing device, computer equipment and storage medium
CN107193827B (en) Idempotent control method and device for sub-base and sub-table
CN106789249B (en) Hot updating method, client and server
CN113220669B (en) Service data processing method and device and electronic equipment
US9465954B1 (en) Method and system for tracking masking of data
CN110046155B (en) Method, device and equipment for updating feature database and determining data features
CN109325042B (en) Processing template acquisition method, form processing method, device, equipment and medium
CN115543198A (en) Method and device for lake entering of unstructured data, electronic equipment and storage medium
US20230144072A1 (en) Data storage server and client devices for securely storing data
US20160004850A1 (en) Secure download from internet marketplace
CN112433753A (en) Interface document generation method, device, equipment and medium based on parameter information
CN109840250B (en) Method, device, equipment and storage medium for managing access authority of intermediate field
CN112948884B (en) Method and system for implementing big data access control on application level user
US10474666B2 (en) Metadata validation tool
CN112817931B (en) Incremental version file generation method and device
CN115033592A (en) SQL statement processing method, device, equipment and storage medium based on database
CN112181921A (en) Data processing method and device
CN112102119A (en) Intellectual property information geographical position marking method, device, system, computer equipment and storage medium
CN114153830B (en) Data verification method and device, computer storage medium and electronic equipment
US11030332B1 (en) Database controlled web service type architecture
CN110457346B (en) Data query method, device and computer readable storage medium

Legal Events

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