Data query method and device, electronic equipment and storage medium

By establishing and updating the attribute information of the data set locally in the terminal and using query tags to determine the target field, the performance impact and low query accuracy caused by frequent server metadata access is solved, and efficient and accurate data query is achieved.

CN119441284APending Publication Date: 2025-02-14CHINA MOBILE CHENGDU INFORMATION & TELECOMM TECH CO LTD +1
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310981452.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-04
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

When the terminal querys data through the server, frequent metadata accesses lead to inefficient server performance, and due to poor uniformity of metadata fields, the query results are low accuracy.

Method used

By establishing multiple field sets locally in the terminal, periodically update the attribute information of the data set obtained from the server, determine the target field using the query tag, and send the target field to the server to obtain the target data set.

Benefits of technology

It reduces the computing pressure of the server, improves the efficiency of the terminal in querying data from the server, reduces noise interference, and improves the accuracy of querying data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441284A_ABST
    Figure CN119441284A_ABST
Patent Text Reader

Abstract

The invention provides a data query method and device, electronic equipment and a storage medium, and relates to the technical field of databases, the method comprises the following steps: in response to an obtained query instruction, determining a query tag corresponding to the query instruction; determining a corresponding target field in a plurality of local field sets based on the query tag; the target field is a related field of a target data set; wherein the plurality of field sets are attribute information sets of the data set periodically updated from the server; fields representing the same service attribute in the multiple field sets correspond to the same label; and sending the target field to the server, and receiving a target data set fed back by the server in response to the target field. According to the method, the efficiency of querying data from the server by the terminal is improved, and the accuracy of querying the data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database technology, and in particular to a data query method, device, electronic device and storage medium. Background Art

[0002] In the related art, when the terminal queries data, it will frequently access metadata of the target database of the server, which has a certain performance impact on the server, resulting in low efficiency of the terminal querying data through the server. In addition, because the metadata of the target database of the server is of various types and the fields are poorly uniform, when the server queries the various metadata, it will also cause the server to have a lot of calculation processes, resulting in low efficiency of the terminal querying data through the server. In addition, due to the poor uniformity of the fields of the metadata, the server will have a lot of noise when facing metadata with poor uniformity, resulting in low accuracy of the query results. Summary of the invention

[0003] A data query method, device, electronic device and storage medium provided in the embodiments of the present application can improve the efficiency and accuracy of terminal data query.

[0004] The technical solution of this application is implemented as follows:

[0005] The present application provides a data query method, including:

[0006] In response to the acquired query instruction, determine the query tag corresponding to the query instruction;

[0007] Determine a corresponding target field in a local plurality of field sets based on the query tag; the target field is a related field of the target data set;

[0008] The plurality of field sets are attribute information sets of data sets periodically updated from the server; the fields representing the same business attribute in the plurality of field sets correspond to the same label;

[0009] The target field is sent to the server, and the target data set fed back by the server in response to the target field is received.

[0010] The present application also provides a data query method, including:

[0011] A target field sent by a receiving terminal; wherein the target field is determined in a plurality of field sets of the terminal using a query tag, and the plurality of field sets are attribute information sets of data sets periodically synchronized to the terminal; fields in the plurality of field sets representing the same service attribute correspond to the same tag;

[0012] The corresponding target data set is searched based on the target field and fed back to the terminal.

[0013] The present application also provides a data query device, including:

[0014] A response unit, used to respond to the acquired query instruction and determine the query tag corresponding to the query instruction;

[0015] A determination unit, configured to determine a corresponding target field in a plurality of local field sets based on the query tag; the target field is a related field of a target data set;

[0016] The plurality of field sets are attribute information sets of data sets periodically updated from the server; the fields representing the same business attribute in the plurality of field sets correspond to the same label;

[0017] The transceiver unit is used to send the target field to the server and receive the target data set fed back by the server in response to the target field.

[0018] The present application also provides a data query device, including:

[0019] A receiving unit, used for receiving a target field sent by a terminal;

[0020] A sending unit is used to search for a corresponding target data set based on the target field and feed it back to the terminal; wherein the target field is determined in a plurality of field sets of the terminal using a query tag, and the plurality of field sets are attribute information sets of data sets periodically synchronized to the terminal; and fields representing the same business attribute in the plurality of field sets correspond to the same tag.

[0021] An embodiment of the present application also provides an electronic device, including a first memory and a first processor, wherein the first memory stores a computer program that can be run on the first processor, and when the first processor executes the program, the steps in the terminal side method are implemented.

[0022] An embodiment of the present application also provides an electronic device, including a second memory and a second processor, wherein the second memory stores a computer program that can be run on the second processor, and when the second processor executes the program, the steps in the method on the server side are implemented.

[0023] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the method on the terminal side are implemented.

[0024] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the method on the server side are implemented.

[0025] In an embodiment of the present application, in response to the acquired query instruction, a query tag corresponding to the query instruction is determined; based on the query tag, the corresponding target field is determined in the local multiple field sets; the target field is a related field of the target data set; wherein the multiple field sets are attribute information sets of the data set obtained from the server periodically updated; the fields in the multiple field sets that represent the same business attribute correspond to the same tag; the target field is sent to the server, and the target data set fed back by the server in response to the target field is received. In this way, since the attribute information set of the server's data set is synchronized to the terminal side in the present application, when the user queries the data, it only needs to access the data attribute information on the terminal side, which reduces the computing pressure of the server, thereby improving the efficiency of the terminal querying data from the server, and because the fields representing the same business attribute correspond to the same tag, the noise interference when accessing the field metadata is reduced, and the terminal can quickly determine the target field in multiple field sets according to the query tag, thereby improving the accuracy of the query data. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 An optional flowchart of a data query method provided in an embodiment of the present application;

[0027] Figure 2 An optional flowchart of a data query method provided in an embodiment of the present application;

[0028] Figure 3 An optional flowchart of a data query method provided in an embodiment of the present application;

[0029] Figure 4 An optional flowchart of a data query method provided in an embodiment of the present application;

[0030] Figure 5 An optional flowchart of a data query method provided in an embodiment of the present application;

[0031] Figure 6 An optional flowchart of a data query method provided in an embodiment of the present application;

[0032] Figure 7 An optional effect diagram of the data query method provided in the embodiment of the present application;

[0033] Figure 8 An optional effect diagram of the data query method provided in the embodiment of the present application;

[0034] Fig. 9 An optional effect diagram of the data query method provided in the embodiment of the present application;

[0035] Fig.10 An optional flowchart of a data query method provided in an embodiment of the present application;

[0036] Fig.11 An optional flowchart of a data query method provided in an embodiment of the present application;

[0037] Fig.12 An optional flowchart of a data query method provided in an embodiment of the present application;

[0038] Fig.13 An interactive schematic diagram of a data query method provided in an embodiment of the present application;

[0039] Fig.14 A schematic diagram of the structure of the data query device provided in the embodiment of the present application Figure 1 ;

[0040] Fig.15 A hardware entity diagram of an electronic device provided in an embodiment of the present application Figure 1 ;

[0041] Fig.16 A schematic diagram of the structure of the data query device provided in the embodiment of the present application Figure 2 ;

[0042] Fig.17 A hardware entity diagram of an electronic device provided in an embodiment of the present application Figure 2 . DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0044] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0045] If similar descriptions of "first / second" appear in the application documents, the following instructions are added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0047] In the related technology, data query is mainly divided into three steps. The first step is to establish field standard detection rules, including field name, field type, field length and other information; the second step is to establish different detection tasks for different field metadata, such as field name detection task, field type detection task, and output the detection results; the third step is to modify the Structured Query Language (SQL) statement for non-standard fields according to the field detection results, modify the field structure, and complete the field standardization work. At present, the content of field standardization work includes standardizing field names, field types, field annotations, field lengths, field constraints, and field value space and other metadata, and giving fields corresponding business attributes, so that fields are not simple and arbitrary characters, but standardized and business-oriented data assets, which solves many problems caused by non-standard and non-uniform fields in existing business system databases.

[0048] In the related art, the metadata of the target data set library is frequently accessed and detected, which has a certain performance impact on the target data set library, resulting in low efficiency of the terminal querying data through the server. In addition, because the metadata of the target data set library of the server is of various types and the fields are poorly uniform, when the server faces a large number of metadata for querying, it will also cause the server to have a large number of calculation processes, resulting in low efficiency of the terminal querying data through the server. In addition, due to the poor uniformity of the metadata fields, the server will have a large amount of noise when facing poorly uniform metadata, resulting in low accuracy of the query results. In the related art, the SQL statement for executing field modification on the target data set library involves information such as field name, field type, and field length, which will make the existing business system unable to access the table data normally, resulting in errors in the query results.

[0049] This application embodiment provides a data query method, see Figure 1 , is an optional flow chart of the data query method provided in the embodiment of the present application, which will be combined with Figure 1 The steps shown are explained.

[0050] S101. In response to an acquired query instruction, determine a query tag corresponding to the query instruction.

[0051] In the embodiment of the present application, the terminal may receive a query instruction and determine a corresponding query tag based on the query instruction, wherein the query tag may be relevant information of a target data set corresponding to the query instruction.

[0052] In the embodiment of the present application, the terminal can also receive a query instruction input by the user in the query interface, respond to the query instruction, and determine the query tag in the query interface. The query interface may include multiple tags, and the user clicks a tag in the query interface to determine the query tag corresponding to the query instruction.

[0053] In some other embodiments, the terminal may also obtain a query instruction sent by other terminals, wherein the query instruction includes a corresponding query tag.

[0054] In the embodiment of the present application, the terminal needs to establish a communication connection with the database of the server before S101. The terminal can establish a communication connection with the database of the server after pinging the server.

[0055] S102. Determine a corresponding target field in a plurality of local field sets based on the query tag; wherein the plurality of field sets are attribute information sets of data sets periodically updated from a server; and fields in the plurality of field sets that represent the same business attribute correspond to the same tag.

[0056] In the embodiment of the present application, since the fields representing the same business attribute in multiple field sets in the local database correspond to the same label, a business attribute field can be determined in multiple field sets by querying the label, and the target field can be further determined in multiple field sets using the business attribute field. The target field is a related field of the target data set. The target field may include: an identification field of the target data set and an identification field of the database to which the target data set belongs.

[0057] In an embodiment of the present application, each field set of the local database includes: a local data attribute set and multiple local field attribute sets corresponding to the local data attribute set; wherein the local data attribute set is used to represent the attribute information set of the corresponding data set; the local field attribute set is used to represent the attribute information set of each field of the corresponding data set. Since the fields representing the same business attribute in multiple field sets in the local database correspond to the same label, a business attribute field can be determined by querying the label. Based on the business attribute field, the local field attribute set to which it belongs is determined, and based on the data attribute field in the local data attribute set corresponding to the determined local field attribute set, the target field is determined.

[0058] In an embodiment of the present application, the terminal may synchronize the data attribute information sets of multiple data sets of the server to the local in advance to form multiple field sets. The terminal may construct a correspondence between the fields representing the same business attribute and the same label in multiple field sets. Among them, the fields "student grades" and "student scores" in multiple field sets may represent the same business attribute. The fields "mobile phone number" and "mobile phone number" in multiple field sets may represent the same business attribute.

[0059] S103: Send the target field to the server, and receive the target data set fed back by the server in response to the target field.

[0060] In the embodiment of the present application, the target field may be carried in the data request and sent to the server. The server responds to the data request, searches for the corresponding target data set in the database based on the target field, and feeds back to the terminal.

[0061] In the embodiment of the present application, since the target field may include: an identification field of the target data set and an identification field of the database to which the target data set belongs. The server may determine the corresponding target database based on the identification field of the database to which the target data set belongs, and determine the corresponding target data set in the target database based on the identification field of the target data set, and feed the target data set back to the terminal.

[0062] In an embodiment of the present application, in response to the query instruction obtained, the query tag corresponding to the query instruction is determined; based on the query tag, the corresponding target field is determined in the local multiple field sets; the target field is a related field of the target data set; wherein the multiple field sets are attribute information sets of the data set obtained from the server periodically updated; the fields in the multiple field sets that represent the same business attribute correspond to the same tag; the target field is sent to the server, and the target data set fed back by the server in response to the target field is received. In this way, since the attribute information set of the server's data set is synchronized to the terminal side in the present application, when the user queries the data, it only needs to access the data attribute information on the terminal side, which reduces the computing pressure of the server, thereby improving the efficiency of the terminal querying data from the server, and because the fields representing the same business attribute correspond to the same tag, the noise interference in the multiple field sets is reduced, and the terminal can quickly determine the target field according to the query tag, thereby improving the accuracy of the query data.

[0063] In some embodiments, see Figure 2 , Figure 2 An optional flowchart of a data query method provided in an embodiment of the present application is provided. Figure 1 The illustrated S101 may also include S104 to S105, which will be described in conjunction with each step.

[0064] S104. Periodically obtain each current field set from the server.

[0065] In the embodiment of the present application, the terminal periodically sends a field set acquisition request to the server, and the server responds to the field set acquisition request and feeds back each current field set to the terminal. Each current field set represents a set of attribute information of a corresponding data set in the server and a set of attribute information of each field of the corresponding data set.

[0066] In an embodiment of the present application, the field set acquisition request may include a database information field or a data set information field. The server may acquire the current field set of each data set of the corresponding database based on the database information field. The server may also acquire the current field set of the corresponding data set based on the data set information field.

[0067] S105: Based on the consistency between each of the current field sets and the multiple field sets, update the multiple field sets in the local database.

[0068] In an embodiment of the present application, the terminal may compare the fields included in the current field set with the fields included in multiple field sets, and update the multiple field sets in the local database using the current field set based on the comparison result.

[0069] In the embodiment of the present application, the terminal may also perform consistency analysis on the current field set and each field set through a consistency algorithm, and update multiple field sets in the local database with the current field set based on the consistency analysis result. Exemplarily, the consistency algorithm may include: Hash algorithm.

[0070] In the embodiment of the present application, before performing a data query, the terminal periodically obtains the current field set from the server to update multiple field sets in the local database. In this way, when the user queries data, only the data attribute information needs to be accessed on the terminal side, which reduces the computing pressure of the server and improves the efficiency of the terminal querying data from the server.

[0071] In some embodiments, see Figure 3 , Figure 3 An optional flowchart of a data query method provided in an embodiment of the present application is provided. Figure 2 The illustrated S104 to S105 may also be implemented through S106 to S111 , which will be described in conjunction with each step.

[0072] S106: Periodically send a first request to the server.

[0073] In the embodiment of the present application, the terminal may periodically send a first request to the server, wherein the first request includes: a database information field and a mode information field.

[0074] The database information field and the mode information field may be preset or obtained from other terminals. For example, the period may be 1 day or one week. In the embodiment of the present application, there is no specific restriction on the length of the period.

[0075] S107: Receive each of the data attribute sets fed back by the server in response to the first request.

[0076] In an embodiment of the present application, after receiving the first request, the server can find the corresponding data set based on the database information field and the mode information field included in the first request, and obtain the data attribute set based on the data set. The data attribute set is sent to the terminal. The current field set includes: a data attribute set and multiple field attribute sets corresponding to the data attribute set. The data attribute set is used to characterize the attribute information set of the corresponding data set.

[0077] The data attribute set may include attribute information such as the name, alias, mode, field json string, resource path, storage type, whether it is a partition table, data volume, and data definition language (DDL) of the corresponding data set.

[0078] S108. Send a second request to the server for each of the data attribute sets.

[0079] In the embodiment of the present application, the terminal receives each data attribute set sent by the server, and each data attribute set includes a data set information field of the corresponding data set. The terminal sends a second request to the server, wherein the second request includes: a database information field, a mode information field, and a data set information field in the corresponding data attribute set for each data attribute set.

[0080] S109: Receive a plurality of the field attribute sets corresponding to each of the data attribute sets fed back by the server in response to the second request.

[0081] In an embodiment of the present application, after receiving the second request, the server can obtain each field of the corresponding data set based on the database information field, the mode information field, and the data set information field included in the second request, and obtain the field attribute set corresponding to each field based on each field of the corresponding data set. The server packages the field attribute set corresponding to each field of the corresponding data set and sends it to the terminal. Among them, the field attribute set is used to characterize the attribute information set of each field of the corresponding data set. There is a corresponding relationship between the data attribute set corresponding to each data set and the multiple field attribute sets of each data set.

[0082] The field attribute set may include attribute information such as the name, field sequence number, field name, field comment, field type, field length, field precision, field default value, etc. of the field of the corresponding data set.

[0083] S110: Compare the current resource path field in the data attribute set corresponding to each current field set with the resource path fields in the local data attribute sets corresponding to the plurality of field sets, to obtain a first comparison result.

[0084] In an embodiment of the present application, each field set includes: a local data attribute set and multiple local field attribute sets corresponding to the local data attribute set. The terminal can compare the current resource path field in the data attribute set corresponding to each current field set with the resource path field in the local data attribute sets corresponding to the multiple field sets to obtain a first comparison result.

[0085] In an embodiment of the present application, the terminal may compare a Uniform Resource Name (urn) field in a data attribute set corresponding to each current field set with a urn field in a local attribute set corresponding to each field set to obtain a first comparison result.

[0086] S111. Update the plurality of field sets in the local database based on the first comparison result.

[0087] In an embodiment of the present application, the terminal may add the current field set to the local database based on the first comparison result, or use the current field set to update the field set in the local database that includes the same resource path field.

[0088] In some other embodiments, since the attribute information of the data set in the server database may change due to the business, in the embodiment of the present application, the URN field in the current field set is fully compared with the URN of the synchronized field set to perform an update operation, and there are the following rules:

[0089] 1. The urn field of the current field set does not exist in the synchronized urn field set range, indicating that the local database has not synchronized the current data set. In this case, use the saveMetaData() method to synchronize the current data set to the local database.

[0090] 2. The synchronized URN field does not exist in the URN field set range of each current field set, indicating that the server database has deleted the data set corresponding to the synchronized URN. Then use the saveMetaData0a() method to delete this synchronized field set in the local database.

[0091] 3. The urn field of the current field set exists within the range of the synchronized urn field set, indicating that there is a field set in the local database that is the same as the data set corresponding to the current field set. Then use the saveMetaData() method to update the data attribute set and multiple field attribute sets corresponding to the current field set to the corresponding field set. The saveMetaData() method will use the current field set to update the alias, is_partitioned, record_count, ddl, and storage_type fields of the corresponding field set.

[0092] In the embodiment of the present application, before performing a data query, the terminal periodically obtains a data attribute set and a plurality of field attribute sets corresponding to each data attribute set from the server. Based on the consistency of the data attribute set and the corresponding fields in the local data attribute set, the plurality of field attribute sets of the data attribute set are used to update the plurality of field sets in the local database. In this way, the validity of the plurality of field sets in the local database can be guaranteed, and when the user queries the data, only the data attribute information needs to be accessed on the terminal side, which reduces the computing pressure of the server, thereby improving the efficiency of the terminal in querying the data from the server.

[0093] In some embodiments, the shown S111 may also be implemented by any one of S1111 to S1113, which will be described in conjunction with the steps.

[0094] S1111. If the first comparison result indicates that the current resource path field and the resource path fields corresponding to the multiple field sets are all different, then each of the data attribute sets and its corresponding multiple field attribute sets are added to the local database as new field sets.

[0095] In the embodiment of the present application, the terminal may package each data attribute set with corresponding multiple field attribute sets to form a new field set and add it to the local database.

[0096] S1112: If the first comparison result indicates that the resource path field included in the first field set is different from the current resource path field corresponding to each of the current field sets, then deleting the first field set in the local database; the first field set belongs to multiple field sets.

[0097] In the embodiment itself, if the first comparison result indicates that the resource path field included in the first field set is different from the current resource path field corresponding to each of the current field sets, it means that the corresponding database has deleted the data set corresponding to the first field set, and the terminal can delete the first field set in the local database.

[0098] S1113. If the first comparison result indicates that the current resource path field is the same as the resource path field included in the second field set, then based on the consistency between the predetermined field in the data attribute set and the predetermined field in the local data attribute set corresponding to the second field set, update the second field set; wherein the second field set belongs to multiple field sets; and the predetermined field is used to represent the field attribute information of the corresponding data set.

[0099] In an embodiment of the present application, if the first comparison result indicates that the current resource path field is the same as the resource path field included in the second field set, it means that the second field set in the local database is the same as the data set corresponding to the current field set. Then, the field representing the field attribute information in the data attribute set can be compared with the field representing the field attribute information in the local data attribute set of the second field set to determine the second comparison result, and the second field set can be updated using the current field set based on the second comparison result.

[0100] In an embodiment of the present application, if the first comparison result indicates that the current resource path field is the same as the resource path field included in the second field set, indicating that the second field set in the local database and the data set corresponding to the current field set are the same, then each field in the data attribute set can be compared with each field in the local data attribute set of the second field set to determine the second comparison result, and based on the second comparison result, the second field set can be updated using the current field set.

[0101] Exemplarily, the second field set includes: a local data attribute set and a local field attribute set. The data structure of the local data attribute set can be shown in Table 1, and the data structure of the local field attribute set can be shown in Table 2.

[0102] Field Name Chinese meaning id Dataset id, primary key name name alias Aliases schema model fields Field json string urn Resource Path storage_type Storage type, or view is_partitioned Is it a partition table? record_count Data volume ddl DDL Statement

[0103] Table 1

[0104]

[0105]

[0106] Table 2

[0107] In an embodiment of the present application, the data attribute set of the current field set may include attribute information such as the name, alias, mode, field json string, resource path, storage type, whether it is a partition table, data volume and DDL of the corresponding data set. The field attribute set of the current field set may include attribute information such as the name, field sequence number, field name, field comment, field type, field length, field precision, and field default value of the field of the corresponding data set. The attribute information in the data attribute set of the current field set may be used to update the local data attribute set included in the second field set, that is, to update Table 1. The attribute information in the field attribute set of the current field set may be used to update the local field attribute set included in the second field set, that is, to update Table 2.

[0108] In the embodiment of the present application, multiple field sets are updated based on the comparison results of the current resource path field and the resource path fields corresponding to the multiple field sets. Since the resource path field represents the storage location information of the corresponding data set, based on the comparison of the current resource path field and the resource path fields of the multiple field sets, it can be accurately determined whether there is a property information set of the corresponding data set in the local database, thereby improving the update accuracy of the multiple field sets.

[0109] In some embodiments, S1113 shown may also be implemented through S1114 to S1115, which will be described in conjunction with the steps.

[0110] S1114: Perform consistency comparison between the predetermined field in the data attribute set and the predetermined field in the local data attribute set corresponding to the second field set to obtain a second comparison result.

[0111] In the embodiment of the present application, the terminal may compare the fields in the data attribute set that record the corresponding data set field metadata with the fields in the local data attribute set of the second field set that record the corresponding data set field metadata for consistency to obtain a second comparison result.

[0112] In the embodiment of the present application, the terminal may compare the fields in the data attribute set with the fields in the local data attribute set corresponding to the second field set to obtain a second comparison result.

[0113] The fields field is a field json string, and the fields field records the field attribute information of the corresponding data set. The fields field content is a json array, and each element in the array corresponds to the metadata of a field of the data set, fieldName: field name, dataType: field type, fieldComment: field comment, sortId sequence number, the format of the fields field in the local data attribute set is as follows:

[0114]

[0115]

[0116] In an embodiment of the present application, the terminal may convert the fields in the data attribute set into the above format, and compare the converted fields with the fields in the second field set for consistency to obtain a second comparison result.

[0117] S1115. Update the second field set based on the second comparison result.

[0118] In the embodiment of the present application, if the second comparison result indicates that the predetermined field in the data attribute set is consistent with the predetermined field corresponding to the local data attribute set, the second field set is not updated.

[0119] In an embodiment of the present application, if the second comparison result indicates that the predetermined field in the data attribute set is inconsistent with the predetermined field corresponding to the second field set, the local data attribute set included in the second field set is updated using the data attribute set, and the multiple local field attribute sets included in the second field set are updated using multiple field attribute sets.

[0120] In an embodiment of the present application, the terminal may compare the md5 value of the fields field in the data attribute set with the md5 value of the fields field in the second field set. If the md5 value of the fields field in the data attribute set is inconsistent with the md5 value of the fields field in the second field set, the fields field in the data attribute set is used to update the fields field in the local data attribute set of the second field set, and the field attribute set corresponding to the data attribute set is used to update the local field source data set corresponding to the second field set. If the md5 value of the fields field in the data attribute set is consistent with the md5 value of the fields field in the second field set, no update operation is performed.

[0121] In an embodiment of the present application, the terminal can use the saveMetaData() method to synchronize a field attribute set corresponding to a data attribute set to a local field attribute set corresponding to a second field set. The local field source data set includes the data set id associated with the field, the field sequence number, the field name, the field comment, the field type, the field length, the field precision, the field default value, the data item id associated with the field, and other contents.

[0122] In an embodiment of the present application, based on the comparison result of the fields field in the data attribute set and the fields field in the local data attribute set of the second field set, the second field set is updated using the data attribute set and the corresponding multiple field attribute sets. Since the comparison using the fields field is the field comparison with the smallest granularity, it is possible to accurately determine whether the content of the second field set is consistent with the current field set.

[0123] In some embodiments, see Figure 4 , Figure 4 An optional flow chart of a data query method provided for an embodiment of the present application will be described in conjunction with each step.

[0124] S301: Receive a database synchronization request.

[0125] In the embodiment of the present application, the terminal periodically receives a synchronization database request in response to a preset program, or the terminal periodically receives a synchronization database request sent by other devices.

[0126] S302: Call a predetermined communication protocol to access a database.

[0127] In the embodiment of the present application, the terminal responds to the synchronization database request, pings the database of the server, and detects whether the database is reachable through the network.

[0128] In an embodiment of the present application, the terminal connects to the server through the Boolean ping (Properties prop) protocol. The method is used to ping the access database to see whether the network is reachable or the service is available. It receives a Properties object, which is a key-value array whose content is the connection information of the database. It returns a Boolean value, true if the database is reachable, and false if the database is unreachable.

[0129] S303: Is it reachable?

[0130] In the embodiment of the present application, the terminal can determine whether the database of the server is reachable based on the Boolean value returned by the server.

[0131] S304: Access failed.

[0132] In the embodiment of the present application, if the Boolean value is false, it indicates that the database is unreachable.

[0133] S305: Establish a database connection.

[0134] In the embodiment of the present application, if the Boolean value is true, it indicates that the database is reachable. The terminal can use the TgetConnection(Properties prop) method to establish a database connection. The terminal sends a connection request to the server, receives the Properties object fed back by the server, which is a key-value array containing the connection information of the database, and returns a JDBC Connection generic object.

[0135] S306: Obtain each data attribute set.

[0136] In the embodiment of the present application, the terminal can list <datasetdo>The getTables(Connection conn,String data base,String schema) method obtains a data attribute set from the server. This method obtains an array of data tables under the specified database and specified schema, and requests a data table wrapper object DataSetDO array (that is, a data attribute set) from the server through the Connection object, database name, and schema name.

[0137] S307: Obtain multiple field attribute sets corresponding to each data attribute set.

[0138] In the embodiment of the present application, the terminal can list <datasetfielddo>The getColumns(Connectionconn,String database,String schema,String tableName) method obtains the field attribute set from the server. This method obtains the field metadata array under the specified data table. Through the Connection object, database name, schema name, and dataset name, it requests a database field metadata packaging object DataSetFieldDO array (that is, the field attribute set) from the server.

[0139] S308. Update the local database through each data attribute set and multiple field attribute sets.

[0140] In the embodiment of the present application, the terminal accesses the data attribute set under the target database through the saveMetaData() method, and synchronizes it to the data_set table of the local database. A set of target data and metadata corresponds to a record in the data_set table. The content table includes the table name, table alias, table mode, field json string, resource path field, storage type, whether it is a partition table, data volume, and DDL statement. The resource path urn field records the unique database table resource path under the global context. In the process of accessing the metadata of the target database, the getTables() method will construct the urn of each target table. The structure of urn is data source id: / / database name / mode name / table name. For example: 35: / / school / public / info represents the info table under the public mode under the school database under the data source with id 35.

[0141] In the embodiment of the present application, the DataSetDO array and DataSetFieldDO array are obtained from the server to update two core data table structures, namely the data_set and data_set_field data tables. The data_set records the attribute information of the data set, that is, the return data of the getTables() method; the data_set_field records the attribute information of the field, that is, the return data of the getColumns() method.

[0142] In the embodiment of the present application, the Java DataBase Connectivity (JDBC) protocol is used to obtain the target database metadata and synchronize it to the local database. The data_set and data_set_field tables are used to store the metadata image of the target database. Multiple heterogeneous databases are supported, and the metadata is periodically synchronized and updated, so that the metadata is decoupled from the target database, and there is no need to frequently operate the target database, thereby reducing the operation and maintenance risks.

[0143] The embodiment of the present application proposes a method for metadata standardization of database fields, which synchronizes field information under the target database to the local database, maps and associates the field standards under the business field with the fields stored in the built-in database, avoids modifications to the underlying database that affect existing businesses, and solves many problems caused by the non-standardization and non-uniformity of fields in existing business system databases.

[0144] The embodiment of the present application supports synchronization of data sources such as MYSQL database, Oracle Database, SQLSERVER database, and HIVE database, and supports expansion of data source types through plug-ins, providing a global wide area network (WorldWide Web, web) interface that integrates multiple data sources, which to a certain extent reduces the usage costs brought by various database clients.

[0145] In the related technology, field standardization construction relies on the business experience of database personnel, which is inefficient, involves a lot of repetitive work, and is prone to errors. The application upgrades engineering to informatization, conveniently completes field standardization work, solidifies field standards into data sets, builds once, and reuses multiple times, which improves correctness and data query efficiency. This application uses the synchronization of heterogeneous database field attribute sets to the local database without modifying the field attributes of the target database. It solves the problem of cumbersome field metadata management under multiple databases and the impact of field standardization work on existing business operations, and reduces the access burden of the target database.

[0146] In some embodiments, see Figure 5 , Figure 5 An optional flowchart of a data query method provided in an embodiment of the present application is provided. Figure 1 The step S101 shown may also include S112 implementation, which will be described in conjunction with the steps.

[0147] S112: Establish a correspondence between the fields in the plurality of field sets representing the same service attribute and the corresponding tags.

[0148] In an embodiment of the present application, after the terminal obtains multiple field sets from the server for the first time through synchronization, it can determine the fields representing the same business attribute in the multiple field sets, and construct a correspondence between at least one field representing the same business attribute and the corresponding same tag. The terminal can add the constructed correspondence between at least one field representing the same business attribute and the corresponding same tag to the correspondence set. The correspondence set includes: multiple tags, and at least one field corresponding to each tag.

[0149] In the embodiment of the present application, after the terminal obtains multiple field sets from the server for the first time through synchronization, the terminal can also construct a correspondence between fields representing the same business attribute in the field set and corresponding tags under the operation instruction of the user.

[0150] In some other embodiments, the terminal may also obtain the current field set from the server each time and update the local database with the current field set. If the update adds a new field set to the local database, it is necessary to establish a corresponding relationship between the field representing the same business attribute and the corresponding label for the newly added field set.

[0151] In the embodiment of the present application, before performing data query, a correspondence between the fields representing the same business attribute in the multiple field sets and the corresponding labels is established. In this way, since the fields representing the same business attribute in the multiple field sets correspond to the same label, noise interference in the multiple field sets is reduced, and the terminal can quickly determine the target field in the local database according to the query label, thereby improving the accuracy of the query data.

[0152] In some embodiments, see Figure 6 , Figure 6 An optional flowchart of a data query method provided in an embodiment of the present application is provided. Figure 5 The illustrated S112 to S102 may also be implemented through S113 to S118, which will be described in conjunction with each step.

[0153] S113. Obtain data item sets corresponding to multiple business attributes respectively; wherein each of the data item sets includes standard attribute information of the corresponding business attribute field; the data item set belongs to the corresponding data subclass set, the data subclass set belongs to the corresponding data class set, the data class set belongs to the corresponding data subset, and the data subset belongs to the corresponding data set; the local field attribute set representing the same business attribute in the local database corresponds to the same data item set.

[0154] In an embodiment of the present application, a terminal can obtain a data set, wherein the data set includes a data subset, each data subset includes a data class set, each data class set includes a data subclass set, and each data subclass set includes a data item set. Among them, the data items in the data item set are used to describe the standard metadata of the corresponding field. The upper layer of the data item has classification objects such as data sets, data subsets, data classes, and data subclasses. The classification objects hierarchically divide the data item sets from different business dimensions. The data item set includes attribute information such as the number of the corresponding field, the name of the data item, the Chinese introduction, the type, the length, the constraint, the value space, the explanation / example, etc.

[0155] In an embodiment of the present application, the terminal obtains a data set, and the content of the data set includes the standard name, standard source, and version number of the data set. The terminal obtains a data subset included in the data set, and the content of the data subset includes the name of the data subset. The terminal obtains a data class set included in the data subset, and the content of the data class set includes the data subset to which it belongs, the data class to which it belongs, the name, and the description, and returns the created data class. The terminal obtains a data item set included in the data class set, and the content of the data item set includes the encoding of the corresponding field, the Chinese abbreviation, the name, the data type, the length, the value space, the explanation / example, the reference number, and the constraint, and returns the created data item.

[0156] Exemplary, combined Figure 7 , a data set may include a corresponding data subset. The data subset may include data set 1 to data set n. Wherein, data set 1 may also include data sub-set 1 to data sub-set n. Wherein, each data sub-set may include: a data item set. The attributes of the corresponding field in the data item set may include: number, data item name, Chinese abbreviation, type, length, constraint, value space, explanation / example.

[0157] Exemplary, combined Figure 8 For example, the general primary and secondary school management information data set includes school profile data subsets and student management data subsets. Among them, the student management data subset includes student basic data sets and student status data sets. The student status data set includes entrance examination data sub-sets and disciplinary data sub-sets. The entrance examination data sub-set contains multiple data item sets. Among them, the Chinese abbreviations of multiple data item sets under the entrance examination data sub-set include: examination course name (KSKCMC) and score examination results (FSLKSCJ).

[0158] In the embodiment of the present application, the attribute information in the data item set corresponds to the attribute information in the local field attribute set. For example, as shown in Table 3:

[0159] Data item set properties Local Field Property Set Properties Chinese abbreviation Field Notes Data item name Field Name type Field Data Type length Field data length Value Space Field value range constraint Field Not Null Constraint

[0160] Table 3

[0161] Among them, the Chinese abbreviation value in the data item set corresponds to the field note in the local field attribute set, the data item name corresponds to the field name, the type corresponds to the field data type, the length corresponds to the field data length, the value space corresponds to the field value range, and the constraint corresponds to the field non-null constraint. The value space describes the value range of the field. For example, the value range of the college category field can include: 01, 02, 03, etc., and each value corresponds to a college name. Exemplarily, the values ​​of the value space and the corresponding Chinese can be shown in Table 4:

[0162]

[0163]

[0164] Table 4

[0165] S114. Construct a correspondence between the field representing the same business attribute in the local field attribute set in the local database and the label of the data item set corresponding to the same business attribute; wherein the correspondence belongs to a correspondence set; the label includes: the data item in the data item set corresponding to the same business attribute, and an identifier corresponding to at least one of the data subclass set, the data class set, the data subset and the data set to which the data item set belongs.

[0166] In an embodiment of the present application, the terminal can determine the fields of the same business attribute in a plurality of local field attribute sets in a local database based on a preset program, and determine the data item set corresponding to the business attribute in a plurality of data item sets. A correspondence is established between the plurality of fields of the business attribute and the data items in the data item set corresponding to the business attribute. And the data subclass set, data class set, data subset and data set to which the data item set corresponding to the business attribute belongs are determined. A correspondence is established between the plurality of fields of the business attribute and the identifier corresponding to at least one of the data subclass set, data class set, data subset and data set to which the data item set corresponding to the business attribute belongs.

[0167] In an embodiment of the present application, the terminal can display all fields in the local field set in the local database in the interface, and display at least one corresponding label in the corresponding directory of each field (each label can be the Chinese abbreviation of the data item that matches the field note of the corresponding field, and the identifier corresponding to at least one of the data subclass set, data class set, data subset and data set to which the data item belongs). When there is a label in the corresponding directory of the field, the corresponding relationship between the field and the corresponding label is established based on a preset program. When there are multiple labels in the corresponding directory of the field, the terminal can establish a corresponding relationship between the field and one of the corresponding multiple labels based on the user's operation instructions.

[0168] For example, Fig. 9 As shown, Fig. 9 The display interface effect diagram when establishing the correspondence between fields and labels for the terminal. Among them, the label corresponding to the field named "XM" is the "Name" data item in the "Personnel Basic Data Subclass Set" under the "Education Management Basic Information Subset". When a field corresponds to multiple labels, you can select which data item to associate based on the operation instruction. For example, the field "LXDH" contact number corresponds to multiple labels. The user can select a label (Contact Number (Higher Education Management Information-Recruitment Notice Auxiliary Subclass) from multiple labels to establish a correspondence with the field.

[0169] S115. In response to the obtained query instruction, determine the query tag in the query interface; the query tag includes a corresponding target data item and an identifier corresponding to at least one of the data class, the data subset, and the data set to which the target data item belongs.

[0170] In an embodiment of the present application, the terminal can construct a query interface based on the corresponding relationship set, and each field in the query interface corresponds to a label. The terminal responds to the user's query instruction and determines the corresponding query label in the query interface. The query label includes the corresponding target data item, and the identifier corresponding to at least one of the data class, the data subset, and the data set to which the target data item belongs.

[0171] S116: Determine a corresponding query field in the corresponding relationship set based on the query tag.

[0172] In the embodiment of the present application, since the corresponding relationship set includes: multiple tags and at least one field corresponding to each tag, the corresponding query field can be determined in the corresponding relationship set based on the query tag.

[0173] S117: Determine a target local field attribute set based on the query field.

[0174] In the embodiment of the present application, since each field belongs to a corresponding local field attribute set, the corresponding field can be determined in the corresponding relationship set through the determined query tag, and then the target local field attribute set is determined based on the corresponding field.

[0175] In the embodiment of the present application, when the query tag corresponds to one field, a target local field attribute set can be determined based on the field. When the query tag corresponds to multiple fields, multiple target local field attribute sets can be determined based on the multiple fields.

[0176] In some other embodiments, after the terminal establishes a correspondence between a tag and a corresponding field, since the tag includes a data item, the data item belongs to a corresponding data item set, and the field belongs to a corresponding local field attribute set. In other words, a correspondence between the corresponding data item set and the corresponding local field attribute set is established. Exemplarily, the data structure of the data item set can be embodied in Table 5.

[0177] Fields Chinese meaning id Data item ID data_catalog_id Data subclass ID number serial number chinese_abbreviation Chinese abbreviation name Data item name data_type Data Types data_size length value_space_code_standard_name Value Space Description explain_example Explanation / Example restrain Constraints (0 required; 1 optional)

[0178] Table 5

[0179] Among them, the data_item_id field in the data item set corresponds to the data_item_id in the local field attribute set. In other words, the local field attribute set corresponding to the data item can be determined through the data_item_id field in Table 5 (Table 2). In the embodiment of the present application, after determining the query tag, the corresponding target local field attribute set can also be determined through the data_item_id field in the data item set to which the target data item in the query tag belongs.

[0180] S118. Determine the target field based on the target local data attribute set to which the target local field attribute set belongs.

[0181] In the embodiment of the present application, since the field set in the local database includes: a local data attribute set, and multiple local field attribute sets corresponding to the local data attribute set. After determining the target local field attribute set, the corresponding target local data attribute set can be determined based on the target local field attribute set. The field representing the data set information in the data attribute set is determined to be the target field.

[0182] For example, in combination with Table 1 and Table 2, the dataset_id field in Table 2 corresponds to the id field in Table 1. Then, the correspondence between Table 1 and Table 2 can be determined based on the dataset_id field in Table 2, and the corresponding target local data attribute set can be determined based on the dataset_id field in the target local field set.

[0183] In the embodiment of the present application, before performing a data query, a correspondence between the fields representing the same business attribute in the multiple field sets and the corresponding tags is established. In this way, since the fields representing the same business attribute in the multiple field sets correspond to the same tag, noise interference is reduced when the terminal performs field metadata access, and the terminal can quickly determine the target field in the local database according to the query tag, thereby improving the accuracy of the query data.

[0184] In some embodiments, see Fig.10 , Fig.10 An optional flowchart of a data query method provided in an embodiment of the present application is provided. Figure 6 The illustrated S118 can also be implemented through S119, which will be described in conjunction with each step.

[0185] S119: Determine the mode information field and the data set information field included in the target local data set, and the database information field determined by the operation instruction as the target field.

[0186] In an embodiment of the present application, the terminal can determine the mode information field and the data set information field in the target local data set, and obtain the database information field obtained by the user when sending the query instruction. The mode information field, the data set information field and the database information field are determined as the target field. The target field is sent to the server to obtain the corresponding target data set.

[0187] In an embodiment of the present application, the terminal can determine the name field and the schema field in the target local data set, and obtain the database information field obtained when the user sends the query instruction. The name field, the schema field and the database information field are determined as the target fields.

[0188] In some embodiments, see Fig.11 , Fig.11 An optional flow chart of a data query method provided for an embodiment of the present application will be described in conjunction with each step.

[0189] S201. Receive a target field sent by a terminal; wherein the target field is determined in a plurality of field sets of the terminal using a query tag, and the plurality of field sets are attribute information sets of data sets periodically synchronized to the terminal; and fields in the plurality of field sets that represent the same business attribute correspond to the same tag.

[0190] In an embodiment of the present application, the server receives a target field sent by the terminal. The target field is a relevant field of the target data set. The server can be based on the relevant field of the target data set. Among them, the target field is determined in multiple field sets of the local database of the terminal using a query tag, and the multiple field sets are attribute information sets of the data set periodically synchronized to the terminal; the fields representing the same business attribute in the multiple field sets correspond to the same tag.

[0191] S202: Search for a corresponding target data set based on the target field, and feed back the data to the terminal.

[0192] In the embodiment of the present application, the server may search the corresponding database for the corresponding target data set based on the relevant fields of the target data set, and send the result to the terminal.

[0193] In an embodiment of the present application, the server may determine the corresponding target database based on the database information field, and determine the corresponding target data set in the target database based on the mode information field and the data set information field, and feed the target data set back to the terminal.

[0194] In an embodiment of the present application, a target field sent by a receiving terminal is received; wherein the target field is determined in a plurality of field sets of the terminal using a query tag, and the plurality of field sets are attribute information sets of a data set that are periodically synchronized to the terminal; the fields representing the same business attribute in the plurality of field sets correspond to the same tag; the corresponding target data set is searched based on the target field, and fed back to the terminal. In this way, since the attribute information set of the data set of the server is synchronized to the terminal side in the present application, when the user queries the data, it only needs to access the data attribute information on the terminal side, which reduces the computing pressure of the server, thereby improving the efficiency of the terminal querying data from the server, and because the fields representing the same business attribute correspond to the same tag, the noise interference in the plurality of field sets is reduced, and the terminal can quickly determine the target field according to the query tag, thereby improving the accuracy of the query data.

[0195] In some embodiments, see Fig.12 , Fig.12 An optional flowchart of a data query method provided in an embodiment of the present application is provided. Fig.11 The illustrated S201 may also include S203 to S206 , which will be described in conjunction with each step.

[0196] S203: Receive a first request sent by the terminal.

[0197] In the embodiment of the present application, the terminal may periodically send a first request to the server. The server receives the first request. The first request includes: a database information field and a mode information field.

[0198] S204: Based on the database information field and the mode information field, determine a data attribute set in the corresponding database, and send it to the terminal.

[0199] In the embodiment of the present application, after receiving the first request, the server can find the corresponding data set based on the database information field and the mode information field included in the first request, obtain the data attribute set based on the data set, and send the data attribute set to the terminal.

[0200] S205: The receiving terminal sends a second request.

[0201] In the embodiment of the present application, the terminal receives each data attribute set sent by the server, and each data attribute set includes a data set information field of the corresponding data set. The terminal sends a second request to the server, wherein the second request includes: a database information field, a mode information field, and a data set information field in the corresponding data attribute set for each data attribute set. The server receives the second request.

[0202] S206: Based on the database information field, the mode information field and the data set information field, determine a plurality of field attribute sets in the corresponding data set, and send them to the terminal.

[0203] In the embodiment of the present application, after receiving the second request, the server can obtain each field of the corresponding data set based on the database information field, the mode information field, and the data set information field included in the second request, and obtain the field attribute set corresponding to each field based on each field of the corresponding data set. The server packages the field attribute set corresponding to each field of the corresponding data set and sends it to the terminal.

[0204] In some embodiments, see Fig.13 , Fig.13 An interactive schematic diagram of a data query method provided in an embodiment of the present application.

[0205] S401: The terminal responds to the acquired query instruction and determines a query tag corresponding to the query instruction.

[0206] In the embodiment of the present application, the specific implementation process of S401 can refer to S101 and will not be described in detail here.

[0207] S402. The terminal determines the corresponding target field in multiple local field sets based on the query tag; wherein the multiple field sets are attribute information sets of data sets periodically updated from the server; and the fields in the multiple field sets representing the same business attribute correspond to the same tag.

[0208] In the embodiment of the present application, the specific implementation process of S402 can refer to S102 and will not be described in detail here.

[0209] S403: The terminal sends the target field to the server, and receives the target data set fed back by the server in response to the target field.

[0210] In the embodiment of the present application, the specific implementation process of S403 can refer to S103 and will not be described in detail here.

[0211] In some embodiments, see Fig.14 , Fig.14 A schematic diagram of the structure of the data query device provided in the embodiment of the present application Figure 1 .

[0212] The embodiment of the present application further provides a data query device 600 , including: a responding unit 601 , a determining unit 602 and a transceiver unit 60 .

[0213] A response unit 601 is used to respond to the acquired query instruction and determine the query tag corresponding to the query instruction;

[0214] A determination unit 602 is used to determine a corresponding target field in a plurality of local field sets based on the query tag; the target field is a related field of a target data set;

[0215] The plurality of field sets are attribute information sets of data sets periodically updated from the server; the fields representing the same business attribute in the plurality of field sets correspond to the same label;

[0216] The transceiver unit 603 is configured to send the target field to the server, and receive the target data set fed back by the server in response to the target field.

[0217] In the embodiment of the present application, the transceiver unit 603 in the data query device 600 is used to periodically obtain each current field set from the server; wherein each current field set represents a set of attribute information of a corresponding data set in the server and a set of attribute information of each field of the corresponding data set;

[0218] Based on the consistency between each of the current field sets and the plurality of field sets, the plurality of field sets in the local database are updated.

[0219] In an embodiment of the present application, the current field set includes: a data attribute set and multiple field attribute sets corresponding to the data attribute set; in an embodiment of the present application, the transceiver unit 603 in the data query device 600 is used to periodically send a first request to the server; the first request includes: a database information field and a mode information field; receive each of the data attribute sets fed back by the server in response to the first request; wherein the data attribute set is used to characterize the attribute information set of the corresponding data set; send a second request to the server for each of the data attribute sets; the second request includes: the database information field, the mode information field and the corresponding data set information field in the data attribute set; receive multiple field attribute sets corresponding to each of the data attribute sets fed back by the server in response to the second request; wherein the field attribute set is used to characterize the attribute information set of each field of the corresponding data set.

[0220] In an embodiment of the present application, each of the field sets includes: a local data attribute set and multiple local field attribute sets corresponding to the local data attribute set; the data query device 600 is used to compare the current resource path field in the data attribute set corresponding to each of the current field sets with the resource path field in the local data attribute sets corresponding to the multiple field sets, to obtain a first comparison result; and update the multiple field sets in the local database based on the first comparison result.

[0221] In the embodiment of the present application, the data query device 600 is used to add each of the data attribute sets and the corresponding multiple field attribute sets as new field sets to the local database if the first comparison result indicates that the current resource path field and the resource path fields corresponding to the multiple field sets are all different;

[0222] If the first comparison result indicates that the resource path field included in the first field set is different from the current resource path field corresponding to each of the current field sets, then deleting the first field set in the local database; the first field set belongs to a plurality of the field sets;

[0223] If the first comparison result indicates that the current resource path field is the same as the resource path field included in the second field set, the second field set is updated based on the consistency of the predetermined field in the data attribute set and the predetermined field in the local data attribute set corresponding to the second field set; wherein the second field set belongs to multiple field sets; and the predetermined field is used to represent the field attribute information of the corresponding data set.

[0224] In an embodiment of the present application, the data query device 600 is used to perform consistency comparison between the predetermined field in the data attribute set and the predetermined field in the local data attribute set corresponding to the second field set to obtain a second comparison result; based on the second comparison result, the second field set is updated.

[0225] In the embodiment of the present application, the data query device 600 is used for not updating the second field set if the second comparison result indicates that the predetermined field in the data attribute set is consistent with the predetermined field corresponding to the local data attribute set;

[0226] If the second comparison result indicates that the predetermined field in the data attribute set is inconsistent with the predetermined field corresponding to the second field set, the local data attribute set included in the second field set is updated using the data attribute set, and the multiple local field attribute sets included in the second field set are updated using multiple field attribute sets.

[0227] In an embodiment of the present application, each of the field sets includes: a local data attribute set and multiple local field attribute sets corresponding to the local data attribute set; the data query device 600 is used to obtain data item sets corresponding to multiple business attributes respectively; wherein, each of the data item sets includes standard attribute information of the corresponding business attribute field; the data item set belongs to the corresponding data subclass set, the data subclass set belongs to the corresponding data class set, the data class set belongs to the corresponding data subset, and the data subset belongs to the corresponding data set; the data query device 600 is used to construct a correspondence between the field representing the same business attribute in the local field attribute set in the local database and the label of the data item set corresponding to the same business attribute; wherein, the correspondence belongs to a correspondence set; the label includes: the data item in the data item set, and the identifier corresponding to at least one of the data subclass set, the data class set, the data subset and the data set to which the data item set belongs.

[0228] In an embodiment of the present application, the determination unit 602 in the data query device 600 is used to determine the corresponding query field in the corresponding relationship set based on the query tag; determine the target local field attribute set to which it belongs based on the query field; and determine the target field based on the target local data attribute set to which the target local field attribute set belongs.

[0229] In the embodiment of the present application, the determination unit 602 in the data query device 600 is used to determine that the mode information field and the data set information field included in the target local data set, and the database information field determined by the operation instruction are the target field.

[0230] In an embodiment of the present application, the response unit 601 in the data query device 600 is used to respond to the obtained query instruction and determine the query tag in the query interface; the query tag includes the corresponding target data item, and an identifier corresponding to at least one of the data class, the data subset and the data set to which the target data item belongs.

[0231] It should be noted that in the embodiment of the present application, if the above-mentioned data query method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including a number of instructions to enable a data query device (which can be a personal computer, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.

[0232] Correspondingly, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the client-side method are implemented.

[0233] Correspondingly, an embodiment of the present application provides an electronic device 700, including a first memory 702 and a first processor 701, wherein the first memory 702 stores a computer program that can be executed on the first processor 701, and the first processor 701 implements the steps in the above method when executing the program.

[0234] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0235] It should be noted that Fig.15 A hardware entity diagram of an electronic device provided in an embodiment of the present application Figure 1 ,like Fig.15 As shown, the hardware entity of the electronic device 700 includes: a first processor 701 and a first memory 702, wherein;

[0236] The first processor 701 generally controls the overall operations of the electronic device 700 .

[0237] The first memory 702 is configured to store instructions and applications executable by the first processor 701, and can also cache data to be processed or processed by the first processor 701 and various modules in the electronic device 700 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0238] See also Fig.16 , Fig.16 A schematic diagram of the structure of the electronic device provided in the embodiment of the present application Figure 2 .

[0239] The embodiment of the present application further provides a data query device 800 , including: a receiving unit 801 and a sending unit 802 .

[0240] The receiving unit 801 is configured to receive a target field sent by a terminal; wherein the target field is determined in a plurality of field sets of the terminal using a query tag, and the plurality of field sets are attribute information sets of data sets periodically synchronized to the terminal; and fields in the plurality of field sets representing the same service attribute correspond to the same tag;

[0241] The sending unit 802 is configured to search for a corresponding target data set based on the target field, and feed the search result back to the terminal.

[0242] In the embodiment of the present application, the receiving unit 801 in the data query device 800 is used to receive a first request sent by a terminal; the first request includes: a database information field and a mode information field;

[0243] In the embodiment of the present application, the sending unit 802 in the data query device 800 is used to determine a data attribute set in the corresponding database based on the database information field and the mode information field, and send it to the terminal;

[0244] In the embodiment of the present application, the receiving unit 801 in the data query device 800 is used to receive a second request sent by a terminal; the second request includes: the database information field, the mode information field and the corresponding data set information field in the data attribute set;

[0245] In the embodiment of the present application, the sending unit 802 in the data query device 800 is used to determine multiple field attribute sets in the corresponding data set based on the database information field, the mode information field and the data set information field, and send them to the terminal.

[0246] Correspondingly, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the server-side method are implemented.

[0247] Correspondingly, an embodiment of the present application provides an electronic device 900, including a second memory 902 and a second processor 901, wherein the second memory 902 stores a computer program that can be executed on the second processor 901, and the second processor 901 implements the steps in the above method when executing the program.

[0248] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0249] It should be noted that Fig.17 A hardware entity diagram of an electronic device provided in an embodiment of the present application Figure 2 ,like Fig.17 As shown, the hardware entity of the electronic device 900 includes: a second processor 901 and a second memory 902, wherein;

[0250] The second processor 901 generally controls the overall operation of the electronic device 900 .

[0251] The second memory 902 is configured to store instructions and applications executable by the second processor 901, and can also cache data to be processed or processed by the second processor 901 and various modules in the electronic device 900 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0252] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the serial number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.

[0253] It should be noted that, in this article, the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0254] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.

[0255] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0256] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0257] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: a mobile storage device, a read-only memory (ROM), a magnetic disk or an optical disk, and other media that can store program codes.

[0258] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a mobile storage device, a ROM, a magnetic disk, or an optical disk.

[0259] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.< / datasetfielddo> < / datasetdo>

Claims

1. A data query method, characterized in that: include: In response to the acquired query instruction, determine the query tag corresponding to the query instruction; Determine a corresponding target field in a local plurality of field sets based on the query tag; The target field is a relevant field corresponding to the target data set; The plurality of field sets are attribute information sets of data sets periodically updated from the server; the fields representing the same business attribute in the plurality of field sets correspond to the same label; The target field is sent to the server, and the target data set fed back by the server in response to the target field is received.

2. The data query method according to claim 1, characterized in that: Before the query instruction obtained in response to the query instruction is determined, the method further includes: Periodically obtaining each current field set from the server; wherein each current field set represents a set of attribute information of a corresponding data set in the server, and a set of attribute information of each field of the corresponding data set; Based on the consistency between each of the current field sets and the plurality of field sets, the plurality of field sets in the local database are updated.

3. The data query method according to claim 2, characterized in that: The current field set includes: a data attribute set and a plurality of field attribute sets corresponding to the data attribute set; and periodically obtaining each current field set from the server includes: Periodically sending a first request to the server; the first request includes: a database information field and a mode information field; receiving each of the data attribute sets fed back by the server in response to the first request; wherein the data attribute set is used to represent a set of attribute information of the corresponding data set; Sending a second request to the server for each of the data attribute sets; the second request includes: the database information field, the mode information field and the corresponding data set information field in the data attribute set; Receive multiple field attribute sets corresponding to each data attribute set fed back by the server in response to the second request; wherein the field attribute set is used to represent a set of attribute information of each field of the corresponding data set.

4. The data query method according to claim 3, characterized in that: Each of the field sets includes: a local data attribute set and a plurality of local field attribute sets corresponding to the local data attribute set; and updating the plurality of field sets in the local database based on the consistency between each of the current field sets and the plurality of field sets includes: Compare the current resource path field in the data attribute set corresponding to each of the current field sets with the resource path fields in the local data attribute sets corresponding to the plurality of field sets, to obtain a first comparison result; The plurality of field sets in the local database are updated based on the first comparison result.

5. The data query method according to claim 4, characterized in that: The updating of the plurality of field sets in the local database based on the first comparison result includes any one of the following: If the first comparison result indicates that the current resource path field and the resource path fields respectively corresponding to the plurality of field sets are not the same, then each of the data attribute sets and the plurality of field attribute sets corresponding thereto are added to the local database as new field sets; If the first comparison result indicates that the resource path field included in the first field set is different from the current resource path field corresponding to each of the current field sets, then deleting the first field set in the local database; the first field set belongs to a plurality of the field sets; If the first comparison result indicates that the current resource path field is the same as the resource path field included in the second field set, the second field set is updated based on the consistency of the predetermined field in the data attribute set and the predetermined field in the local data attribute set corresponding to the second field set; wherein the second field set belongs to multiple field sets; and the predetermined field is used to represent the field attribute information of the corresponding data set.

6. The data query method according to claim 5, characterized in that: The updating of the second field set based on the consistency between the predetermined field in the data attribute set and the predetermined field in the local data attribute set corresponding to the second field set includes: Performing consistency comparison between the predetermined field in the data attribute set and the predetermined field in the local data attribute set corresponding to the second field set to obtain a second comparison result; Based on the second comparison result, the second field set is updated.

7. The data query method according to claim 6, characterized in that: The updating of the second field set based on the second comparison result includes any one of the following: If the second comparison result indicates that the predetermined field in the data attribute set is consistent with the predetermined field corresponding to the local data attribute set, then the second field set is not updated; If the second comparison result indicates that the predetermined field in the data attribute set is inconsistent with the predetermined field corresponding to the second field set, the local data attribute set included in the second field set is updated using the data attribute set, and the multiple local field attribute sets included in the second field set are updated using multiple field attribute sets.

8. The data query method according to any one of claims 1 to 7, characterized in that: Each of the field sets includes: a local data attribute set and a plurality of local field attribute sets corresponding to the local data attribute set; before the query instruction obtained in response to the method is determined to correspond to the query tag of the query instruction, the method further includes: Acquire data item sets corresponding to a plurality of business attributes respectively; wherein each of the data item sets includes standard attribute information of a corresponding business attribute field; the data item set belongs to a corresponding data subclass set, the data subclass set belongs to a corresponding data class set, the data class set belongs to a corresponding data subset, and the data subset belongs to a corresponding data set; Constructing a correspondence between the fields representing the same business attribute in the local field attribute set in the local database and the labels of the data item set corresponding to the same business attribute; Among them, the corresponding relationship belongs to a corresponding relationship set; the label includes: the data items in the data item set corresponding to the same business attribute, and the identifier corresponding to at least one of the data subclass set, the data class set, the data subset and the data set to which the data item set belongs.

9. The data query method according to claim 8, characterized in that: The determining the corresponding target field in the local multiple field sets based on the query tag includes: Determining a corresponding query field in the corresponding relationship set based on the query tag; Determine a target local field attribute set based on the query field; The target field is determined based on a target local data attribute set to which the target local field attribute set belongs.

10. The data query method according to claim 9, characterized in that: The determining the target field based on the target local data attribute set to which the target local field attribute set belongs includes: The mode information field and the data set information field included in the target local data set and the database information field determined by the operation instruction are determined as the target field.

11. The data query method according to claim 8, characterized in that: The step of responding to the query instruction and determining a query tag corresponding to the query instruction includes: In response to the query instruction obtained, the query tag is determined in the query interface; the query tag includes the corresponding target data item and an identifier corresponding to at least one of the data class, the data subset and the data set to which the target data item belongs.

12. A data query method, characterized in that: include: A target field sent by a receiving terminal; wherein the target field is determined in a plurality of field sets of the terminal using a query tag, and the plurality of field sets are attribute information sets of data sets periodically synchronized to the terminal; fields in the plurality of field sets representing the same service attribute correspond to the same tag; The corresponding target data set is searched based on the target field and fed back to the terminal.

13. The data query method according to claim 12, characterized in that: Before the receiving terminal sends a target field, the method further includes: A first request sent by a receiving terminal; wherein the first request includes: a database information field and a mode information field; Based on the database information field and the mode information field, determine a data attribute set in a corresponding database and send it to the terminal; The receiving terminal sends a second request; the second request includes: the database information field, the mode information field and the corresponding data set information field in the data attribute set; Based on the database information field, the mode information field and the data set information field, a plurality of field attribute sets are determined in the corresponding data set and sent to the terminal.

14. A data query device, characterized in that: include: A response unit, used to respond to the acquired query instruction and determine the query tag corresponding to the query instruction; A determination unit, configured to determine a corresponding target field in a local plurality of field sets based on the query tag; The target field is a relevant field corresponding to the target data set; The plurality of field sets are attribute information sets of data sets periodically updated from the server; the fields representing the same business attribute in the plurality of field sets correspond to the same label; The transceiver unit is used to send the target field to the server and receive the target data set fed back by the server in response to the target field.

15. A data query device, characterized in that: include: A receiving unit, configured to receive a target field sent by a terminal; wherein the target field is determined in a plurality of field sets of the terminal using a query tag, and the plurality of field sets are attribute information sets of data sets periodically synchronized to the terminal; and fields in the plurality of field sets representing the same service attribute correspond to the same tag; The sending unit is used to search for a corresponding target data set based on the target field and feed back the data to the terminal.

16. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the steps of the method described in any one of claims 1 to 11, or implements the steps of the method described in claim 12 or 13 when executing the computer program.

17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 11, or implements the steps of the method according to claim 12 or 13.

Citation Information

Cited By

  • Data query method and device, computer equipment, readable storage medium and program product

    CN120429339A

  • Data query method and device, computer device, readable storage medium and program product

    CN120429339B