CN114925041A - Data query method and device - Google Patents

Data query method and device Download PDF

Info

Publication number
CN114925041A
CN114925041A CN202210605399.0A CN202210605399A CN114925041A CN 114925041 A CN114925041 A CN 114925041A CN 202210605399 A CN202210605399 A CN 202210605399A CN 114925041 A CN114925041 A CN 114925041A
Authority
CN
China
Prior art keywords
digital object
version
data
target
identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210605399.0A
Other languages
Chinese (zh)
Inventor
李岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Dt Dream Technology Co Ltd
Original Assignee
Hangzhou Dt Dream Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Dt Dream Technology Co Ltd filed Critical Hangzhou Dt Dream Technology Co Ltd
Priority to CN202210605399.0A priority Critical patent/CN114925041A/en
Publication of CN114925041A publication Critical patent/CN114925041A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution

Abstract

The application provides a data query method and a data query device, which are applied to a background management system, wherein the method comprises the following steps: acquiring a target digital object identifier contained in a data query request initiated by a client, wherein the target digital object indicated by the target digital object identifier is related to version data of a target version; sending the target digital object identifier to a digital object management system, wherein the digital object management system stores digital objects corresponding to version data of each version, and each digital object has a unique digital object identifier; receiving a target digital object returned by the digital object management system according to the target digital object identifier, and acquiring version data of the target version according to the content of the target digital object; and returning the version data of the target version to the client.

Description

Data query method and device
Technical Field
The present application relates to the field of data processing, and in particular, to a data query method and apparatus.
Background
For the same data, a plurality of versions often exist, and in the related technology, historical data version management is often realized in two ways, namely, the way of storing the full version data of each historical version into the same database or respectively storing the full version data into separate databases, and the way of recording data definition statements of version changes in a log file way.
However, in practice, when a user needs to query version data of a specified version, no matter whether historical data version management is implemented in the first mode or the second mode, the version data of the version specified by the user cannot be indexed quickly, the first mode may need to query in a plurality of different database tables, and the second mode needs to analyze change information one by one from the current latest version to finally obtain the version data of the specified version.
Disclosure of Invention
In view of this, the present application provides a data query method and apparatus, so as to implement efficient indexing of version data of a target version.
Specifically, the method is realized through the following technical scheme:
according to a first aspect of the present application, a data query method is provided, which is applied to a background management system, and the method includes:
acquiring a target digital object identifier contained in a data query request initiated by a client, wherein the target digital object indicated by the target digital object identifier is related to version data of a target version;
sending the target digital object identifier to a digital object management system, wherein the digital object management system stores digital objects corresponding to version data of various versions respectively, and each digital object has a unique digital object identifier;
receiving a target digital object returned by the digital object management system according to the target digital object identifier, and acquiring version data of the target version according to the content of the target digital object;
and returning the version data of the target version to the client.
According to a second aspect of the present application, there is provided a data query apparatus, applied to a background management system, the apparatus including:
an identifier obtaining unit, configured to obtain a target digital object identifier included in a data query request initiated by a client, where the target digital object indicated by the target digital object identifier is related to version data of a target version;
an identifier sending unit, configured to send the target digital object identifier to a digital object management system, where digital objects corresponding to version data of respective versions are stored in the digital object management system, and each digital object has a unique digital object identifier;
a data obtaining unit, configured to receive a target digital object returned by the digital object management system according to the target digital object identifier, and obtain version data of the target version according to content of the target digital object;
and the data returning unit is used for returning the version data of the target version to the client.
According to a third aspect of the present application, there is provided an electronic apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method as described in the embodiments of the first aspect above by executing the executable instructions.
According to a fourth aspect of embodiments herein, there is provided a computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method as described in the embodiments of the first aspect above.
According to the technical scheme provided by the application, the digital objects stored in the digital management system in the application are respectively recorded with version data of each version, each digital object is respectively provided with a unique digital object identifier, after a data query request initiated by a client is received by a background management system, a target digital object identifier contained in the data query request is obtained, the corresponding target digital object can be quickly obtained according to the target digital object identifier, further, the version data of the target version can be obtained according to the content of the target digital object and returned to the client, the query in a plurality of different tables is not needed, and the change information is not needed to be analyzed one by one from the initial version to obtain the version data of the target version, so that the efficient indexing of the version data of the target version is realized.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.
FIG. 1 is a schematic diagram of a network architecture of a data query system in accordance with an exemplary embodiment of the present application;
FIG. 2 is a multi-party interactive flow diagram illustrating a data storage method according to an exemplary embodiment of the present application;
FIG. 3 is a schematic diagram illustrating a structure of a digital object according to an exemplary embodiment of the present application;
FIG. 4 is a flow chart illustrating a data query method applied to a backend management system according to an exemplary embodiment of the present application;
FIG. 5 is a multi-party interaction flow diagram illustrating a method of data query according to an exemplary embodiment of the present application;
FIG. 6 is a schematic diagram illustrating an electronic device according to an exemplary embodiment of the present application;
FIG. 7 is a block diagram illustrating a data query device according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if," as used herein, may be interpreted as "at … …" or "when … …" or "in response to a determination," depending on the context.
In the related art, for a plurality of different versions of the same data, each record of each version of data is usually stored in full, and when the version data of all the versions are stored in the same database table, the query performance is obviously reduced along with the increase of the data; when the version data of all versions are stored in different database tables and the version data of a specified version is queried, the query may need to be queried in a plurality of different database tables, and the query performance is also obviously reduced.
In order to save the storage space occupied by the data, a log file recording mode can be selected, only the data definition sentence of the version change is recorded, the version data of each version is not stored in full quantity in the mode, only the changed data needs to be stored, but as the versions are increased, the data of the specified version needs to be analyzed one by one from the current latest version to restore the changed data, and the query performance is still obviously reduced.
The examples of the present application are further illustrated below in conjunction with the following examples:
FIG. 1 is a schematic diagram of a network architecture of a data query system according to an exemplary embodiment of the present application. Referring to fig. 1, a network architecture of the data query system may include a client 11, a backend management system 12, and a Handle system 13. It should be noted that the digital object management system in the present application may be a Handle system. For ease of understanding, the Handle system 13 is illustrated in fig. 1. The background management system 12 and the Handle system 13 may be deployed in a secure environment, and when the client 11 outside the secure environment needs to interact with any object in the secure environment, the interactive data needs to be encrypted, and the corresponding object decrypts the interactive data after entering the secure environment. Similarly, if any object in the secure environment needs to interact with the client 11 outside the secure environment, the transmitted data needs to be encrypted and decrypted by the object receiving the data. The encryption and decryption modes are not limited in the application. The background management system 12 may provide request processing, user control, version management, system operation and maintenance, and other functions. The Handle system 13 is realized by a DOA architecture, and comprises one GHR and a plurality of LHSs, and the LHS is a distributed system and can be dynamically expanded according to requirements to provide good query and storage performance.
As shown in the schematic network architecture of the data query system shown in fig. 1, when a client 11 initiates a data storage request, the backend management system 12 converts the version data into a digital object in response to the data storage request and sends the digital object to the Handle system 13 for storage.
Assume that there are five versions of version data of V1, V2, V3, V4, V5 in the client 11, as shown in tables 1-3 below:
Figure BDA0003670420450000051
TABLE 1
Figure BDA0003670420450000052
TABLE 2
Figure BDA0003670420450000053
TABLE 3
In tables 1 to 3, all columns are of a string type, and the value recorded in the "id" column is UUID (universally unique identifier).
It should be noted that the above tables are illustrative examples, and the description does not limit the above tables.
Referring to fig. 2, fig. 2 is a multi-party interaction flow chart of a data storage method according to an exemplary embodiment of the present application, and please refer to fig. 2, an interaction flow among the client 11, the backend management system 12, and the Handle system 13 includes the following steps:
step 202, sending a data storage request.
The data storage request is used to instruct the backend management system to store the version data corresponding to the data storage request, and the data storage request may be initiated to the backend management system by a client used by a user when the user performs a certain operation, for example: the user may click a certain option on the client to trigger, or trigger through a language or the like, which is not limited in this specification.
The data storage request comprises data information to be stored, and the data information at least comprises version data, a data identifier and a version number.
In the network architecture diagram of the data query system shown in fig. 1, for version data of five versions, V1, V2, V3, V4 and V5, in the client 11, the user a triggers the client 11 to initiate a data storage request for storing V1 version data, a data storage request for storing V2 version data, a data storage request for storing V3 version data, a data storage request for storing V4 version data, and a data storage request for storing V5 version data to the backend management system 12.
Step 204, receiving a data storage request.
And after receiving the data storage request, the background management system converts the version data to be stored into a digital object.
In one embodiment, the structure of the digital object is as shown in fig. 3, and fig. 3 is a schematic structural diagram of a digital object according to an exemplary embodiment of the present application. The digital object includes a digital object identifier, a data type identifier, a table field attribute, a field value attribute, an upper version identifier, and a lower version identifier.
The digital object identifier is used for indicating only one digital object recorded with version data of a certain version, and the version data of a specified version can be quickly accessed through the digital object identifier;
the data type identification is used for indicating whether the content recorded by the digital object is full data of the version data of the current version or incremental data relative to the version data of the previous version;
the table field attribute is used for recording a table structure of the version data of the current version, the field value attribute is used for recording a data value of the version data of the current version, and the version data of the current version can be acquired through the table field attribute and the field value attribute; the table field attribute and the field value attribute are both stored in a json (JavaScript Object notification, a lightweight data interaction format) format, so that the reading and writing speed of the version data is faster, and the compression capability of the version data is provided.
The upper version identifier is used for indicating a digital object for recording version data of a previous version of a current version, the lower version identifier is used for indicating a digital object for recording version data of a next version of the current version, and the upper version identifier and the lower version identifier can be associated with version data of different versions, so that the change conditions of the table structure and the data value of the data in different versions are obtained.
For version data of a first version, a digital object corresponding to the version data needs to record full data of the version data, for version data of other versions, if a variation of the version data of a current version compared with the version data of a previous version is smaller than or equal to a preset threshold, the digital object corresponding to the version data can select to record incremental data of the version data compared with the version data of the previous version, and can also select to record full data of the version data, and if the variation of the version data of the current version compared with the version data of the previous version is larger than the preset threshold, the digital object corresponding to the version data needs to record full data of the version data.
When the digital object records are full data, the attribute of the table field and the attribute of the field value are in a json array format, the array lengths are consistent, the same array position of the table field and the field value represents a certain column and the value of the column in the database, other digital objects do not need to be acquired for processing, and the query efficiency is high; when the digital object records incremental data, the attribute of the table field and the attribute of the field value are in a json key-value pair format, and only the changed content is recorded, so that the occupation of storage space can be reduced.
In an embodiment, when the background management system executes step 204, a preset role may be further set for a user at the client, where the preset role is used to characterize a set of users that have query rights for one or more digital objects managed by the digital object management system.
Continuing the example from the above example, after the back-end management system 12 receives the data storage request for storing the V1 version data, since the V1 version is the first version and needs to store the full amount of data, the back-end management system 12 converts the V1 version data into the digital objects shown in table 4:
Figure BDA0003670420450000071
Figure BDA0003670420450000081
TABLE 4
As shown in table 4, "digital object identifier" includes a fixed prefix "86.100," data identifiers "6118 a3a 6-" and a data version number "V1," Y "corresponding to the data type identifier" indicates that the digital object records the full amount of data of the V1 version, "table field attribute" and "field value attribute" record the table structure of the V1 version data and its corresponding data value in json array format, and the same array position represents a certain column and the value of the column in the library, for example, in the V1 version, the 0 th bits of both represent: the id column data type is string, the value of the id column data type is 6118a3a6, a complete table structure and the data value of the current version can be specified through the table field attribute and the field value attribute, and the 'lower version identifier' indicates a digital object for recording the version data of the next version of the V1 version data, namely the digital object for recording the V2 version data;
after the back office management system 12 receives the data storage request for storing the V2 version data, since the V2 version has only one data value changed compared to the previous version (V1 version), and only incremental data can be stored, the back office management system 12 converts the V2 version data into the digital objects shown in table 5:
attribute name Attribute value
Digital object identifier 86.100/6118a3a6~.v2
Data type identification N
Table field attributes
Field value attribute {"col3":"3_2"}
Top version identifier 86.100/6118a3a6~.v1
Lower version identifier 86.100/6118a3a6~.v3
TABLE 5
As shown in table 5, "digital object identifier" includes a fixed prefix "86.100," data identifiers "6118 a3a 6-" and a data version number "V2," N "corresponding to the data type identifier" indicates that incremental data of V2 version is recorded in the digital object, "field value attribute" records changed data in V2 version data in json key-value pair format, attribute name indicates changed column information, and attribute value indicates changed value, { "col3": "3_2", i.e., the value indicating the column of "col3" becomes "3_2", "upper version identifier" indicates a digital object recording version data of the last version of the V2 version data, i.e., a digital object recording the V1 version data, the "lower version identifier" indicates a digital object recording version data of the next version of the V2 version data, i.e., a digital object recording the V3 version data;
after the back office management system 12 receives the data storage request for storing the V3 version data, since the V3 version has more data changed compared to the previous version (V2 version), it can choose to store the full amount of data, and the back office management system 12 converts the V3 version data into the digital objects shown in table 6:
Figure BDA0003670420450000091
TABLE 6
As shown in table 6, "digital object identifier" contains a fixed prefix "86.100," data identifiers "6118 a3a 6-" and a data version number "V3," and "Y" corresponding to the data type identifier "indicates that the digital object records the full amount of data of the V3 version," table field attribute "and" field value attribute "record the table structure of the V3 version data and its corresponding data value in json array format, and the complete table structure and the data value of the current version can be specified by the table field attribute and the field value attribute," upper version identifier "indicates a digital object recording version data of the previous version of the V3 version data, i.e., a digital object recording V2 version data, and" lower version identifier "indicates a digital object recording version data of the next version of the V3 version data, i.e., a digital object recording V4 version data;
after the background management system 12 receives the data storage request for storing the V4 version data, since the V4 version has a smaller variation compared to the previous version (V3 version), a column of data is deleted and a column of data is added, and only incremental data can be stored, the background management system 12 converts the V4 version data into the digital objects shown in table 7:
Figure BDA0003670420450000101
TABLE 7
As shown in table 7, "digital object identifier" contains a fixed prefix "86.100," data identifiers "6118 a3a 6-" and a data version number "V4," N "corresponding to the data type identification" indicates that the digital object records incremental data of V4 version, "table field attribute" records change of table in json key value pair format, where "index" indicates the position of the operated column in the table field attribute, "name" indicates the name of the operated column, "op" indicates the operation type, "del" indicates the deleted column, "add" indicates the new added column, and { "index":1, "name": col1, "" op ": del" }, i.e. the col1 column at the 1 st bit in the deletion array, { "index":3, "name": col4, "" ad ": i.e. add" column information at the last col 4. A "field value attribute" records a change in a data value in a json key-value pair format, the attribute name indicates column information in which the change has occurred, the attribute value indicates a value after the change, { "col4": 4"}, i.e., a value indicating a column of" col4 "has changed to" 4"," upper version identifier "indicates a digital object recording version data of a previous version of V4 version data, i.e., a digital object recording V3 version data, and" lower version identifier "indicates a digital object recording version data of a next version of V4 version data, i.e., a digital object recording V5 version data;
after the back-end management system 12 receives the data storage request for storing the data of the V5 version, since the V5 version has more data changed compared with the previous version (V4 version), it can choose to store the full amount of data, and the back-end management system 12 converts the data of the V5 version into the digital objects shown in table 8:
Figure BDA0003670420450000111
TABLE 8
As shown in table 8, "digital object identifier" includes a fixed prefix "86.100," data identifiers "6118 a3a 6-" and a data version number "V5," a "Y" corresponding to the data type identifier "indicates that the digital object records the full amount of data of the V5 version," table field attribute "and" field value attribute "record the table structure of the data of the V5 version and its corresponding data value in json array format, and the complete table structure and the data value of the current version can be specified by the table field attribute and the field value attribute, and" upper version identifier "indicates the digital object recording the version data of the previous version of the data of the V5 version, that is, the digital object recording the data of the V4 version.
In this embodiment, user A is set to a pre-set role of supervisor, who possesses the query right to query all digital objects having a digital object identifier prefix of "86.100".
Step 206, the digital object is transmitted.
And after converting the version data into a digital object, the background management system sends the digital object to the digital object management system for storage.
At step 208, the digital object is received and stored.
And the digital object management system receives and stores the digital object sent by the background management system.
In an embodiment, when step 208 is executed, the digital object management system may also preset rights information for the digital object, where the rights information represents a set of users who have query rights for the digital object.
Continuing the example from the above example, the back office system 12 sends the digital objects shown in tables 4-8 to the Handle system 13 for storage.
In this embodiment, all digital objects whose data identifiers are "6118 a3a 6" among the preset digital object identifiers can be queried by the user a.
In the data query system shown in fig. 1, a user-specified version of version data can be quickly queried in a digital object that has been stored according to the aforementioned data storage method, based on a digital object identifier.
Fig. 4 is a flowchart illustrating a data query method applied to a backend management system according to an exemplary embodiment of the present application. Referring to fig. 4, the method is applied to a background management system, and the method may include the following steps:
step 402, obtaining a target digital object identifier contained in a data query request initiated by a client, wherein the target digital object indicated by the target digital object identifier is related to version data of a target version.
The data query request is used to instruct the backend management system to return version data of a target version corresponding to the data query request to the client, where the data query request may be initiated by the client used by the user to trigger the user to perform a certain operation, for example: the user may click a certain option on the client to trigger, or trigger in a language or the like, which is not limited in this specification.
When the backstage management system receives a data query request initiated by a client, the backstage management system acquires a target digital object identifier contained in the data query request so as to acquire the target digital object recording the version data of the target version based on the target digital object identifier.
In an embodiment, the target digital object identifier includes a version number of the target version and a data identifier of the version data, so as to determine a target version specified by a user and facilitate management, where the data identifier of the version data uses a UUID (universal unique identifier) to ensure uniqueness of the target digital object identifier. Of course, the target digital object identifier may also be extended to a more complex format, for example, adding one or more of a project name, a database table name, etc., which the present specification does not limit.
For example, if the user a specifies the version data of the query V2, the user a triggers the client 11 to initiate a data query request including the identifier of the target digital object, i.e., the digital object identifiers "86.100/6118 a3a 6-. V2" corresponding to the digital object including the version data of the record V2 in the data query request.
Step 404, sending the target digital object identifier to a digital object management system, where the digital object management system stores digital objects corresponding to version data of each version, and each digital object has a unique digital object identifier.
The digital object management system can determine the unique target digital object and return the target digital object to the background management system because each digital object has a unique digital object identifier.
In one embodiment, before the background management system sends the target digital object identifier to the digital object management system, the user is verified, whether the user has the right to query the target digital object is judged, and the target digital object identifier is sent to the digital object management system under the condition that the user is determined to have the right to query, so that the user right management is realized, and illegal users are prevented from accessing data or illegal users can be prevented from accessing data.
The specific implementation manner of the user right verification may be that a preset role corresponding to the user is determined based on the user information at the client, one or more digital objects of which the preset role has the query right are further determined according to a correspondence between the stored user role and the digital object having the query right, and the target digital object identifier is sent to the digital object management system when the determined one or more digital objects of which the preset role has the query right include the target digital object. When the determined one or more digital objects of which the preset roles have the query right contain the target digital object, the user is indicated to have the query right for the target digital object, so that the target digital object identifier can be sent to the digital object management system.
The preset role corresponding to the user is determined based on the user information at the client, the preset role corresponding to the user may be determined according to the user information and a user role corresponding relationship maintained by the background management system, or the preset role including the user may be found by traversing a user set corresponding to each preset role, which is not limited in this specification.
As to the method for determining whether the target digital object is included in the one or more digital objects of which the preset role has the query right, it may be to determine whether the target digital object matches with the one or more determined digital objects of which the preset role has the query right, if so, determine that the target digital object is included in the one or more digital objects of which the preset role has the query right, that is, determine that the preset role has the query right for the target digital object, and send the target digital object identifier to a digital object management system, if not, determine that the target digital object is not included in the one or more digital objects of which the preset role has the query right, that is, determine that the preset role does not have the query right for the target digital object, and stop processing the received data query request, data leakage or data tampering is avoided.
Continuing with the example above, after the backend management system 12 receives the data query request sent by the client 11, it determines that the preset role of the user a at the client 11 is the master according to the maintained user role relationship, further determines that the user a has the right to query the digital object with the digital object identifier "86.100/6118 a3a 6-. v 2", and sends "86.100/6118 a3a 6-. v 2" (target digital object identifier) to the Handle system 13.
In one embodiment, after the background management system sends the target digital object identifier to the digital object management system, the digital object management system may further perform the following steps:
the digital object management system receives a target digital object identifier sent by a background management system based on a data query request initiated by a client, wherein the target digital object indicated by the target digital object identifier is related to version data of a target version;
then, the digital object management system determines the target digital object from the stored digital objects according to the target digital object identifier; the digital object management system stores digital objects corresponding to version data of various versions respectively, and each digital object has a unique digital object identifier respectively.
And finally, the digital object management system returns the target digital object to the background management system, so that the background management system acquires the version data of the target version according to the content of the target digital object and returns the version data of the target version to the client.
After receiving a target digital object identifier, the digital object management system analyzes the target digital object identifier, determines the target digital object in the stored digital objects after the analysis is completed, and returns the target digital object to the background management system, so that the background management system acquires the version data of the target version according to the content of the target digital object and returns the version data to the client.
In an embodiment, in order to ensure data security, the digital object management system performs query right verification on a user at the client before querying a target digital object corresponding to the target digital object identifier, and determines the target digital object from stored digital objects according to the target digital object identifier under the condition that the user is determined to have query right on the target digital object, thereby implementing refined right control on each digital object.
As to a specific manner of determining whether the user has the query right for the target digital object, user information of the user at the client may be acquired, whether the identifier of the target digital object matches with the user right information set in advance is determined, and if the identifier of the target digital object matches with the user right information set in advance, it is determined that the user has the query right, or the user information of the user at the client is acquired, whether the user information matches with right information set in advance for the target digital object is determined, and if the identifier of the user matches with the right information set in advance, it is determined that the user has the query right, which is not limited in this specification.
For example, after receiving the target digital object identifier "86.100/6118 a3a 6-. v 2", the Handle system 13 determines that the user a at the client 11 has the right to query the target digital object according to the preset digital object right information, queries the target digital object according to the target digital object identifier, and returns the target digital object to the background management system 12.
Step 406, receiving the target digital object returned by the digital object management system according to the target digital object identifier, and obtaining the version data of the target version according to the content of the target digital object.
After receiving a target digital object returned by a digital object management system, a background management system analyzes, assembles, decompresses and the like the target digital object to obtain version data of the target version recorded by the target digital object.
In an embodiment, to reduce the storage space occupied by the data, for version data of two adjacent versions, if the amount of change of the current version relative to the previous version data is small, only incremental data is stored, that is, only the changed data is stored.
In this embodiment, the content of the target digital object includes a data type identifier for indicating whether the content recorded by the target digital object is full data of the version data of the target version or incremental data relative to the version data of the previous version, and the content of the target digital object further includes an upper version identifier for indicating a digital object recording the version data of the previous version of the target version and/or a lower version identifier for indicating a digital object recording the version data of the next version of the target version.
In this embodiment, to ensure that the full-volume data is obtained, it is necessary to determine whether the version data recorded by the target digital object is the full-volume data according to the data type identifier, and if the target digital object is the incremental data, obtain a digital object corresponding to the version data of the previous version according to the upper version identifier or the lower version identifier, obtain the full-volume data of the version data of the previous version recorded by the digital object, and generate the version data of the target version according to the obtained incremental data and the full-volume data.
After receiving the target digital object, the background management system judges whether the version data recorded by the target digital object is full data according to the data type identifier included by the target digital object, returns the full data to the client if the version data is the full data, and acquires the digital object recording the full data from the digital object management system if the version data is not the full data, namely the version data is incremental data.
If the target digital object comprises the version identifier, the background management system sends the version identifier to the digital object management system to acquire the digital object recorded with the version data of the previous version of the target version, and the specific manner of acquiring the digital object is the same as that of acquiring the target digital object, which is not described herein again. Of course, if the full amount of data is not acquired after acquiring the version data of the previous version of the target version, the above operation may be performed multiple times until the full amount of data is acquired. Version data of a previous version of the current version can be more efficiently acquired through the previous version identifier.
If the target digital object includes the lower version identifier, the back-end management system may request the digital object management system to determine that the lower version identifier is a digital object of the target digital object identifier, and specifically, may traverse through the digital objects until finding a digital object whose lower version identifier is the target digital object identifier. Of course, if the full amount of data is not acquired after acquiring the version data of the previous version of the target version, the above operation may be performed multiple times until the full amount of data is acquired. The acquired data can be verified through the next version identifier to ensure that accurate full data is acquired.
If the target digital object includes an upper version identifier and a lower version identifier, the back office management system may obtain the full amount of data based on the upper version identifier and may also obtain the full amount of data based on the lower version identifier, which is not limited in this specification.
And if the incremental data of only one version is acquired, covering the acquired data corresponding to the incremental data in the acquired full-scale data by using the acquired incremental data, thereby generating the version data of the target version.
If the incremental data of the multiple versions are acquired, the acquired incremental data are sequentially used for covering the data corresponding to the incremental data in the acquired full-volume data from back to front according to the acquired sequence, namely the data corresponding to the incremental data in the acquired full-volume data are covered by the acquired incremental data firstly, and the data corresponding to the incremental data in the acquired full-volume data are covered by the acquired incremental data firstly, so that the version data of the target version are generated correctly.
For example, digital object a records a first version of version data, digital object B records a second version of version data as compared to the first version of version data, and digital object C records a third version of version data as compared to the second version of version data. If the user specifies to acquire the third version of version data, after acquiring the digital object C, determining that the digital object C records incremental data, further acquiring a digital object B recording the second version data, determining that the digital object B still records the incremental data, further acquiring a digital object a recording the first version data, and determining that the digital object a records the full data, in order to acquire the third version of version data, it is necessary to adapt to the fact that the incremental data acquired from the digital object B covers corresponding data in the full data, and then, the incremental data acquired from the digital object C covers corresponding data in the full data, thereby generating the third version of version data.
Step 408, returning the version data of the target version to the client.
And the background management system returns the version data of the target version to the client according to the version data of the target version acquired by the target digital object, wherein the version data of the target version is the version data of the specified version requested to be inquired by the user.
Continuing with the above example, after the backend management system 12 receives the digital object corresponding to the target digital identifier returned by the Handle system, it determines that only incremental data is recorded in the digital object according to the value "N" of the data type identifier of the digital object, acquires the digital object corresponding to the upper version identifier from the Handle system 13 through the version identifier "86.100/6118 a3a6 to. V1", determines that all data is recorded in the digital object according to the value "Y" of the data type identifier of the digital object, overwrites the acquired incremental data with the acquired all data to generate version data of the target version (V2 version), and returns the version data of the target version to the client 11.
In an embodiment, a user may further trigger a version change tracing request, where the version change tracing request indicates that a background management system counts changes of version data in different versions, and a specific statistical process may be that, after acquiring a digital object recording version data of any version, the background management system acquires version data before the version through an "upper version identifier", acquires version data after the version through a "lower version identifier", and further integrates and compares all acquired version data to obtain a table structure of the version data in different versions and changes of the version data itself, so as to finally obtain changes of the version data in different versions.
For example, after the background management system 12 acquires a digital object recording version data of version V2, through the upper version identifier and the lower version identifier of the digital object, the digital object recording the version data of the V1 version and the digital object recording the version data of the V3 version are obtained, the digital object recording the version data of the V4 version is further obtained through the lower version identifier in the digital object recording the version data of the V3 version, the digital object recording the version data of the V5 version is further obtained through the lower version identifier in the digital object recording the version data of the V4 version, and finally the background management system 12 integrates and compares the version data of the five versions to obtain the table structure of the version data and the change condition of the data per se in different versions, and finally the change condition of the version data in different versions is obtained.
As can be seen from the foregoing embodiments, in the present application, the digital objects stored in the digital management system respectively record version data of each version, and each digital object has a unique digital object identifier, after receiving a data query request initiated by a client in the background management system, a target digital object identifier included in the data query request is obtained, a corresponding target digital object can be quickly obtained according to the target digital object identifier, further, the version data of the target version can be obtained according to the content of the target digital object and returned to the client, there is no need to perform query in multiple different tables, and there is no need to analyze change information one by one from a current latest version to obtain the version data of the target version, so that the version data of the target version can be efficiently indexed.
On the basis of the embodiment shown in fig. 2, that is, the Handle system has stored version data of five versions V1, V2, V3, V4, and V5 according to the digital object format shown in fig. 3, and the preset role corresponding to the user a in the background management system 12 is a supervisor, which possesses query authority for querying all digital objects with a digital object identifier prefix of "86.100", all digital objects with a digital object identifier of "6118 a3a 6" in the Handle system can be queried by the user a, taking the user a as an example for specifying the version data of the query version V2, the following describes in detail the case of querying data with reference to fig. 5, and fig. 5 is a multi-party interaction flow chart of data query according to an exemplary embodiment of the present application. Referring to fig. 5, the interaction flow between the client 11, the backend management system 12, and the Handle system 13 includes the following steps:
step 502, sending a data query request.
After user a triggers a data query request for version data of version V2, client 11 initiates a data query request containing a target digital object identifier to back office management system 12.
Step 504, obtaining the target digital object identifier contained in the data query request.
Step 506, determining the preset role corresponding to the user.
Step 508, determining whether the preset role has the query right to the target digital object.
After receiving a data query request initiated by a client, the background management system 12 obtains user information corresponding to a user at the client 11 and a target digital object identifier included in the data query request, determines a preset role corresponding to the user according to the user information and a user role corresponding relationship maintained by the background management system 12, further determines whether the target digital object matches with one or more determined digital objects of which the preset role has query permission, if so, determines that the preset role has query permission for the target digital object, executes step 510, sends the target digital object identifier, and if not, determines that the preset role has no query permission for the target digital object, and stops a data query process.
The background management system 12 acquires the user information of the user a and the identifier of the target digital object is "86.100/6118 a3a 6-. V2", determines that the preset role corresponding to the user a is a master according to the user information of the user a, and determines that the master has the inquiry authority for the digital object recording the version data of the version V2.
At step 510, the destination digital object identifier is sent.
The backend management system 12 sends the target digital object identifier to the Handle system 13.
At step 512, a target digital object identifier is received.
At step 514, it is determined whether the user at the client has query rights to the target digital object.
The Handle system 13 obtains the user information of the user at the client 11, determines whether the user information matches the permission information set in advance for the target digital object, if yes, determines that the user has the query permission, executes step 516, returns to the target digital object, and if not, determines that the user does not have the query permission, and stops the data query process.
The Handle system 13 receives the target digital object identifiers of "86.100/6118 a3a 6-. v 2", acquires the user information of the user a, determines that the user a can access the digital objects of which the digital object identifiers are "86.100/6118 a3a 6-. v 2", and performs step 516.
Step 516, return the target digital object.
The Handle system 13 returns the target digital object to the back office system 12.
Step 518, obtaining version data of the target version according to the content of the target digital object.
Step 520, judging whether the version data of the target version is full data.
After receiving the target digital object, the back-end management system 12 determines whether the version data recorded by the back-end management system is full amount according to the data type identifier included in the target digital object, if the recorded version data is full amount data, step 526 is executed, the version data of the target version is returned, and if the recorded version data is incremental data, step 522 is executed, and the digital object recording the version data of the previous version of the target version is obtained.
After the back office management system 12 receives the digital object with the digital object identifier "86.100/6118 a3a 6-. v 2", it determines that the digital object record is incremental data according to the data type identifier of the digital object, and then executes step 522.
At step 522, a digital object is obtained that records version data of a previous version of the target version.
At step 524, version data of the target version is generated.
The back-end management system 12 obtains the digital object corresponding to the version data of the previous version from the Handle system 13 according to the version identifier, and obtains the total data of the version data of the previous version recorded by the digital object.
The backend management system 12 acquires digital objects with digital object identifiers "86.100/6118 a3a6 to. V1" from the Handle system 13, acquires the total amount of data of the version V1 version data recorded in the digital object, overwrites data corresponding to the acquired total amount of data of the V1 version with the acquired incremental data of the V2 version, and executes step 526.
Step 526, return the version data of the target version.
The background management system 12 returns the full amount of the acquired version data of the target version to the client 11.
The background management system 12 returns the full amount of data shown in table 9 to the client 11 where the user a is located.
Figure BDA0003670420450000211
TABLE 9
In this step, the background management system 12 is deployed inside the secure environment, and the client 11 is deployed outside the secure environment. In order to prevent the processing result from being leaked, the background management system 12 may use the public identity key of the client 11 to perform asymmetric encryption on the processing result, and the client 11 obtains the encrypted processing result and then decrypts the processing result using the private identity key. Of course, the above encryption and decryption modes are only simply exemplified in the present application, and other applicable encryption and decryption modes can be applied to the present application.
In correspondence with the foregoing embodiment of a data query method, the present application also provides an embodiment of a data query apparatus.
Fig. 6 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application. Referring to fig. 6, at the hardware level, the electronic device includes a processor 602, an internal bus 604, a network interface 606, a memory 608, and a non-volatile memory 610, but may also include hardware required for other services. The processor 602 reads a corresponding computer program from the non-volatile memory 610 into the memory 608 and runs it, forming a data processing apparatus on a logical level. Of course, besides the software implementation, the present application does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
FIG. 7 is a block diagram of a data query device, shown in accordance with an exemplary embodiment of the present application. Referring to fig. 7, the apparatus is applied to a background management system, and the apparatus may include:
an identifier obtaining unit 702 is configured to obtain a target digital object identifier included in a data query request initiated by a client, where the target digital object indicated by the target digital object identifier is related to version data of a target version.
Optionally, the target digital object identifier includes: a version number of the target version and a data identifier of the version data.
An identifier sending unit 704, configured to send the target digital object identifier to a digital object management system, where the digital object management system stores digital objects corresponding to version data of respective versions, and a unique digital object identifier exists for each digital object.
Optionally, the identifier sending unit 704 is specifically configured to:
determining a preset role corresponding to a user at the client, wherein the preset role is used for representing a user set having query authority for one or more digital objects managed by the digital object management system;
and under the condition that the preset role has the inquiry authority to the target digital object, sending the target digital object identifier to a digital object management system.
Optionally, after sending the target digital object identifier to the digital object management system, the apparatus further includes:
an identifier receiving unit 710, configured to receive, by the digital object management system, a target digital object identifier sent by the back-end management system based on the data query request initiated by the client, where the target digital object indicated by the target digital object identifier is related to the version data of the target version.
A digital object determining unit 712, configured to determine the target digital object from the stored digital objects according to the target digital object identifier by the digital object management system; the digital object management system stores digital objects corresponding to version data of various versions respectively, and each digital object has a unique digital object identifier respectively.
Optionally, the digital object determining unit 712 is specifically configured to:
in the event that it is determined that the user at the client has query rights to the target digital object, the target digital object is determined from among the stored digital objects based on the target digital object identifier.
A digital object returning unit 714, configured to return the target digital object to the backend management system by the digital object management system, so that the backend management system obtains the version data of the target version according to the content of the target digital object and returns the version data of the target version to the client.
A data obtaining unit 706, configured to receive a target digital object returned by the digital object management system according to the target digital object identifier, and obtain version data of the target version according to the content of the target digital object.
Optionally, the content of the target digital object includes a data type identifier, where the data type identifier is used to indicate whether the content recorded by the target digital object is full amount data of the version data of the target version or incremental data relative to the version data of the previous version, and the content of the target digital object further includes an upper version identifier and/or a lower version identifier, where the upper version identifier is used to indicate a digital object recording the version data of the previous version of the target version, and the lower version identifier is used to indicate a digital object recording the version data of the next version of the target version; the device also includes:
a data amount determination unit 716, configured to determine whether the version data of the target digital object record is full data according to the data type identifier.
A full data obtaining unit 718, configured to, in a case where the target digital object record is incremental data, obtain a digital object corresponding to the version data of the previous version according to the upper version identifier or the lower version identifier, and obtain full data of the version data of the previous version of the digital object record.
And a target data generating unit 720, configured to generate version data of the target version according to the obtained incremental data and the full data.
A data returning unit 708, configured to return the version data of the target version to the client.
Optionally, the apparatus further comprises:
a digital object conversion unit 722, configured to, in response to a digital object storage request initiated by a user, convert the version data corresponding to the digital object storage request into a digital object, where a unique digital object identifier exists in the digital object.
A digital object sending unit 724 for sending the digital object to a digital object management system.
Digital object storage unit 726 for the digital object management system to receive and store the digital object.
The specific details of the implementation process of the functions and actions of each unit in the above device are the implementation processes of the corresponding steps in the above method, and are not described herein again.
For the device embodiment, since it basically corresponds to the method embodiment, reference may be made to the partial description of the method embodiment for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
In an exemplary embodiment, there is also provided a non-transitory computer readable storage medium, for example a memory, comprising instructions executable by a processor of a data processing apparatus to perform a method as in any one of the above embodiments, such as the method may comprise:
acquiring a right use request which is sent by a client and aims at a target digital object and a structured query request which is expressed in the form of the target digital object; approving the permission use request, and enabling an analysis system to analyze the structured query request under the condition that the permission use request is approved; and returning a processing result to the client, wherein the processing result is obtained by executing the analyzed structured query request by the database.
The non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like, which are not limited in this application.
The above description is only a preferred embodiment of the present application and should not be taken as limiting the present application, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A data query method is applied to a background management system, and comprises the following steps:
acquiring a target digital object identifier contained in a data query request initiated by a client, wherein the target digital object indicated by the target digital object identifier is related to version data of a target version;
sending the target digital object identifier to a digital object management system, wherein the digital object management system stores digital objects corresponding to version data of various versions respectively, and each digital object has a unique digital object identifier;
receiving a target digital object returned by the digital object management system according to the target digital object identifier, and acquiring version data of the target version according to the content of the target digital object;
and returning the version data of the target version to the client.
2. The method of claim 1, wherein the target digital object identifier comprises: a version number of the target version and a data identifier of the version data.
3. The method of claim 1, further comprising:
responding to a digital object storage request initiated by a user, converting version data corresponding to the digital object storage request into a digital object, wherein the digital object has a unique digital object identifier;
sending the digital object to a digital object management system;
the digital object management system receives the digital object and stores it.
4. The method of claim 1, wherein sending the target digital object identifier to a digital object management system comprises:
determining a preset role corresponding to the user based on the user information at the client;
determining one or more digital objects of which the preset roles have the inquiry authority according to the corresponding relation between the stored user roles and the digital objects having the inquiry authority;
and under the condition that the determined one or more digital objects of which the preset roles have the query authority contain the target digital object, sending the target digital object identifier to a digital object management system.
5. The method of claim 1, wherein after sending the target digital object identifier to a digital object management system, the method further comprises:
the digital object management system receives a target digital object identifier sent by a background management system based on a data query request initiated by a client, wherein the target digital object indicated by the target digital object identifier is related to version data of a target version;
the digital object management system determines the target digital object from the stored digital objects according to the target digital object identifier; the digital object management system stores digital objects corresponding to version data of various versions respectively, and each digital object has a unique digital object identifier;
and the digital object management system returns the target digital object to the background management system, so that the background management system acquires the version data of the target version according to the content of the target digital object and returns the version data of the target version to the client.
6. The method of claim 5, wherein said determining the target digital object from the stored digital objects based on the target digital object identifier comprises:
and under the condition that the user at the client side is determined to have the inquiry authority on the target digital object, determining the target digital object in the stored digital objects according to the target digital object identifier.
7. The method according to claim 1, wherein the content of the target digital object comprises a data type identifier for indicating whether the content recorded by the target digital object is full data of the version data of the target version or incremental data with respect to the version data of the previous version, and the content of the target digital object further comprises an upper version identifier for indicating a digital object recording the version data of the previous version of the target version and/or a lower version identifier for indicating a digital object recording the version data of the next version of the target version;
the obtaining of the version data of the target version according to the content of the target digital object includes:
determining whether the version data of the target digital object record is full data according to the data type identifier;
under the condition that the target digital object records incremental data, acquiring a digital object corresponding to the version data of the previous version according to the identifier of the previous version or the identifier of the next version, and acquiring the total data of the version data of the previous version recorded by the digital object;
and generating version data of the target version according to the acquired incremental data and the full data.
8. A data query device is applied to a background management system, and the device comprises:
an identifier obtaining unit, configured to obtain a target digital object identifier included in a data query request initiated by a client, where the target digital object indicated by the target digital object identifier is related to version data of a target version;
an identifier sending unit, configured to send the target digital object identifier to a digital object management system, where the digital object management system stores digital objects corresponding to version data of each version, and each digital object has a unique digital object identifier;
a data obtaining unit, configured to receive a target digital object returned by the digital object management system according to the target digital object identifier, and obtain version data of the target version according to content of the target digital object;
and the data returning unit is used for returning the version data of the target version to the client.
9. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any one of claims 1-7 by executing the executable instructions.
10. A computer-readable storage medium having stored thereon computer instructions, which when executed by a processor, perform the steps of the method according to any one of claims 1-7.
CN202210605399.0A 2022-05-30 2022-05-30 Data query method and device Pending CN114925041A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210605399.0A CN114925041A (en) 2022-05-30 2022-05-30 Data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210605399.0A CN114925041A (en) 2022-05-30 2022-05-30 Data query method and device

Publications (1)

Publication Number Publication Date
CN114925041A true CN114925041A (en) 2022-08-19

Family

ID=82811811

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210605399.0A Pending CN114925041A (en) 2022-05-30 2022-05-30 Data query method and device

Country Status (1)

Country Link
CN (1) CN114925041A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116303458A (en) * 2023-03-17 2023-06-23 北京信源电子信息技术有限公司 Management method for data objects in handle system
CN116522404A (en) * 2023-07-05 2023-08-01 北京数牍科技有限公司 Data processing method, device, equipment and computer storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116303458A (en) * 2023-03-17 2023-06-23 北京信源电子信息技术有限公司 Management method for data objects in handle system
CN116303458B (en) * 2023-03-17 2023-10-13 北京信源电子信息技术有限公司 Management method for data objects in handle system
CN116522404A (en) * 2023-07-05 2023-08-01 北京数牍科技有限公司 Data processing method, device, equipment and computer storage medium
CN116522404B (en) * 2023-07-05 2023-09-22 北京数牍科技有限公司 Data processing method, device, equipment and computer storage medium

Similar Documents

Publication Publication Date Title
US11132346B2 (en) Information processing method and apparatus
CN104281672B (en) Method and device for processing log data
CN107798038B (en) Data response method and data response equipment
CN114925041A (en) Data query method and device
US8924373B2 (en) Query plans with parameter markers in place of object identifiers
US8583657B2 (en) Method and apparatus for using a hash-partitioned index to access a table that is not partitioned or partitioned independently of the hash partitioned index
EP3767483A1 (en) Method, device, system, and server for image retrieval, and storage medium
CN106407360B (en) Data processing method and device
CN108614837B (en) File storage and retrieval method and device
US9323798B2 (en) Storing a key value to a deleted row based on key range density
US20160275199A1 (en) Data processing device, data processing method, and non-transitory computer readable medium
EP2778953A1 (en) Encoded-search database device, method for adding and deleting data for encoded search, and addition/deletion program
US20230267116A1 (en) Translation of tenant identifiers
CN112262379A (en) Storing data items and identifying stored data items
CN104615785A (en) Data storage method and device based on TYKY cNosql
CN108154024B (en) Data retrieval method and device and electronic equipment
CN115168338A (en) Data processing method, electronic device and storage medium
KR102253841B1 (en) Apparatus for Processing Transaction with Modification of Data in Large-Scale Distributed File System and Computer-Readable Recording Medium with Program
US20140081949A1 (en) Data processor, data management system, data processing method, and computer program product
CN109753505B (en) Method and system for creating temporary storage unit in big data storage system
CN116069810A (en) Data query method and device and terminal equipment
CN112035413B (en) Metadata information query method, device and storage medium
US11151110B2 (en) Identification of records for post-cloning tenant identifier translation
US11620290B2 (en) Method and system for performing data cloud operations
CN110990394A (en) Distributed column database table-oriented line number statistical method and device and storage medium

Legal Events

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