Data query method and device
By assigning a unique identifier to each version of data in the digital object management system, the problem of low efficiency in querying specified version data in the existing technology is solved, fast and accurate data indexing and permission control are achieved, and query performance and storage efficiency are improved.
Patent Information
- Application Number
- CN202210605399.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-05-30
AI Technical Summary
The existing technology cannot quickly index when querying version data of a specified version, resulting in reduced query performance, especially when querying multiple database tables or parsing change information from the latest version one by one.
By storing the version data of each version in the digital object management system and assigning a unique digital object identifier to each digital object, the data query request initiated by the client contains the target digital object identifier. The backend management system can quickly locate and obtain the version data of the target version, avoiding the steps of querying and parsing change information one by one in multiple database tables.
It achieves fast and efficient indexing of the target version's version data, improves query performance, reduces storage space usage, and implements refined permission control.
Smart Images

Figure CN114925041B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a data query method and device. Background Art
[0002] There are often many versions of the same data. In related technologies, two methods are often used to implement historical data version management. The first method is to store the full version data of each historical version in the same database or in separate databases. The second method is to record the data definition statements of version changes by recording log files.
[0003] However, in practice, when a user needs to query the version data of a specified version, whether method one or method two is used to implement historical data version management, it is impossible to quickly index the version data of the user-specified version. Method one may need to query in multiple different database tables, and method two needs to parse the change information one by one starting from the current latest version to finally obtain the version data of the specified version. Summary of the Invention
[0004] In view of this, the present application provides a data query method and device to achieve efficient indexing of version data of a target version.
[0005] Specifically, this application is implemented through the following technical solutions:
[0006] According to the first aspect of the present application, a data query method is proposed, which is applied to a background management system. The method includes:
[0007] Obtaining 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;
[0008] Sending the target digital object identifier to a digital object management system, wherein the digital object management system stores digital objects corresponding to respective versions of the version data, and each digital object has a unique digital object identifier;
[0009] receiving a target digital object returned by the digital object management system according to the target digital object identifier, and obtaining version data of the target version according to the content of the target digital object;
[0010] The version data of the target version is returned to the client.
[0011] According to a second aspect of the present application, a data query device is provided, which is applied to a background management system, and the device includes:
[0012] An identifier obtaining unit, configured to obtain a target digital object identifier included 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;
[0013] an identifier sending unit, configured to send the target digital object identifier to a digital object management system, wherein the digital object management system stores digital objects corresponding to respective versions of the version data, and each digital object has a unique digital object identifier;
[0014] a data acquisition unit, configured to receive the target digital object returned by the digital object management system according to the target digital object identifier, and acquire version data of the target version according to the content of the target digital object;
[0015] A data returning unit is configured to return the version data of the target version to the client.
[0016] According to a third aspect of the present application, an electronic device is provided, including:
[0017] processor;
[0018] a memory for storing processor-executable instructions;
[0019] The processor implements the method described in the embodiment of the first aspect above by running the executable instructions.
[0020] According to a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in the embodiment of the first aspect are implemented.
[0021] It can be seen from the technical solution provided by the above application that the digital objects stored in the digital management system in the present application respectively record the version data of each version, and each digital object has a unique digital object identifier. After the background management system receives the data query request initiated by the client, it obtains the target digital object identifier contained in the data query request, and can quickly obtain the corresponding target digital object based on the target digital object identifier. Further, it can obtain the version data of the target version based on the content of the target digital object and return it to the client. There is no need to query in multiple different tables, nor is there any need to parse the change information one by one from the initial version to obtain the version data of the target version, thereby realizing efficient indexing of the version data of the target version. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0023] Figure 1 is a schematic diagram of a network architecture of a data query system according to an exemplary embodiment of the present application;
[0024] Figure 2 This is a multi-party interaction flow chart of a data storage method according to an exemplary embodiment of the present application;
[0025] Figure 3 is a structural diagram of a digital object according to an exemplary embodiment of the present application;
[0026] Figure 4 This is a flow chart of a data query method applied to a backend management system according to an exemplary embodiment of the present application;
[0027] Figure 5 This is a multi-party interaction flow chart of a data query method according to an exemplary embodiment of the present application;
[0028] Figure 6 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application;
[0029] Figure 7 It is a block diagram of a data query device according to an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0030] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to 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.
[0031] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, 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.
[0032] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0033] In related technologies, for multiple different versions of the same data, each record of each version of the data is often saved in full. When the version data of all versions are stored in the same database table, as the data grows, the query performance will be significantly reduced; when the version data of all versions are stored in different database tables, when querying the version data of a specified version, it may be necessary to query in multiple different database tables, and the query performance will also be significantly reduced.
[0034] To save storage space occupied by data, you can also choose to record log files to only record data definition statements for version changes. This method does not require storing all version data for each version, but only the changed data. However, as the number of versions increases, obtaining data for a specified version requires parsing the change information one by one from the current latest version, and restoring the changed data. This will still significantly reduce query performance.
[0035] Next, the embodiments of the present application are further described with reference to the following embodiments:
[0036] Figure 1 This is a network architecture diagram of a data query system according to an exemplary embodiment of the present application. Figure 1 The network architecture of the data query system may include a client 11, a background management system 12 and a Handle system 13. It is worth noting that the digital object management system in this application may be a Handle system. Figure 1The Handle system 13 is taken as an example. Among them, the background management system 12 and the Handle system 13 can be deployed in a secure environment. 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 then decrypted by the corresponding object 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 also needs to be encrypted and then decrypted by the object receiving the data. This application does not limit the encryption and decryption methods. The background management system 12 can provide request processing, user control, version management, system operation and maintenance and other functions. The Handle system 13 is an implementation of the DOA architecture, consisting of a GHR and multiple LHSs. The LHS is a distributed system that can be dynamically expanded according to demand to provide good query and storage performance.
[0037] like Figure 1 As shown in the network architecture diagram of the data query system, when the client 11 initiates a data storage request, the background management system 12 will respond to the data storage request by converting the version data into a digital object and sending it to the Handle system 13 for storage.
[0038] Assume that there are five versions of version data, V1, V2, V3, V4, and V5, in the client 11, as shown in Tables 1 to 3 below:
[0039]
[0040] Table 1
[0041]
[0042] Table 2
[0043]
[0044] Table 3
[0045] In Tables 1 to 3, all columns are of string type, and the value recorded in the "id" column is UUID (universally unique identifier).
[0046] It should be noted that the above tables are illustrative examples and this specification does not limit them.
[0047] The following combination Figure 2 A detailed introduction to data storage. Figure 2 This is a multi-party interaction flow chart of a data storage method according to an exemplary embodiment of the present application. Please refer to Figure 2The interaction process between the client 11, the background management system 12 and the Handle system 13 includes the following steps:
[0048] Step 202: Send a data storage request.
[0049] The data storage request is used to instruct the background management system to store the version data corresponding to the data storage request. The data storage request can be initiated to the background management system by the client used by the user when the user performs a certain operation. For example, the user can trigger it by clicking an option on the client, or trigger it through language, etc. This manual does not limit this.
[0050] The data storage request includes data information to be stored, and the data information includes at least version data, a data identifier, and a version number.
[0051] exist Figure 1 In the network architecture diagram of the data query system shown, for the five versions of version data V1, V2, V3, V4, and V5 in the client 11, user A triggers the client 11 to initiate a data storage request to store V1 version data, a data storage request to store V2 version data, a data storage request to store V3 version data, a data storage request to store V4 version data, and a data storage request to store V5 version data to the background management system 12.
[0052] Step 204: Receive a data storage request.
[0053] After receiving the data storage request, the background management system converts the version data to be stored into a digital object.
[0054] In one embodiment, the structure of a digital object is as follows Figure 3 As shown, Figure 3 This is a schematic diagram of a digital object structure according to an exemplary embodiment of the present application. The digital object includes a digital object identifier, a data type identifier, table field attributes, field value attributes, an upper version identifier, and a lower version identifier.
[0055] The digital object identifier is used to indicate a unique digital object that records a certain version of version data, and the digital object identifier can be used to quickly access the version data of the specified version;
[0056] The data type identifier is used to indicate whether the content recorded in the digital object is the full data of the current version of the version data or the incremental data relative to the previous version of the version data;
[0057] The table field attributes are used to record the table structure of the version data of the current version, and the field value attributes are used to record the data value of the version data of the current version. The version data of the current version can be obtained through the table field attributes and field value attributes; the table field attributes and field value attributes are both stored in json (JavaScript Object Notation, a lightweight data interaction format) format, which makes the version data reading and writing speed faster and provides version data compression capabilities.
[0058] The previous version identifier is used to indicate a digital object that records the version data of the previous version of the current version, and the next version identifier is used to indicate a digital object that records the version data of the next version of the current version. The previous version identifier and the next version identifier can be used to associate version data of different versions, thereby obtaining the changes in the table structure and data values of the data in different versions.
[0059] For the first version of the version data, its corresponding digital object needs to record the full data of the version data. For other versions of the version data, if the change in the current version of the version data compared to the previous version of the version data is less than or equal to the preset threshold, then the corresponding digital object can choose to record the incremental data of the version data compared to the previous version of the version data, or can choose to record the full data of the version data. If the change in the current version of the version data compared to the previous version of the version data is greater than the preset threshold, then the corresponding digital object must record the full data of the version data.
[0060] When a digital object records full data, the table field attributes and field value attributes are in JSON array format and have the same array length. The same array position of the two represents a column in the database and the value of the column. There is no need to obtain other digital objects for processing, which has higher query efficiency. When a digital object records incremental data, the table field attributes and field value attributes are in JSON key-value pair format. Only the changed content is recorded to reduce storage space.
[0061] In one embodiment, when executing step 204, the backend management system may also set a preset role for the user at the client, wherein the preset role is used to represent a set of users having query rights for one or more digital objects managed by the digital object management system.
[0062] Continuing with the above example, after the backend management system 12 receives a data storage request to store version V1 data, since version V1 is the first version and the full amount of data needs to be stored, the backend management system 12 converts the version V1 data into the digital object shown in Table 4:
[0063]
[0064]
[0065] Table 4
[0066] As shown in Table 4, the "digital object identifier" contains the fixed prefix "86.100", the data identifier "6118a3a6~" and the data version number "V1". The "Y" corresponding to the "data type identifier" indicates that the digital object records the full data of version V1. The "table field attributes" and "field value attributes" record the table structure of the V1 version data and its corresponding data values in json array format. The same array position of the two represents a column in the library and the value of the column. For example, in version V1, the 0th bit of the two indicates that the data type of the id column is string and its value is 6118a3a6~. The complete table structure and the data value of the current version can be specified through the table field attributes and field value attributes. The "next version identifier" indicates the digital object that records the version data of the next version of the V1 version data, that is, the digital object that records the V2 version data.
[0067] After the backend management system 12 receives the data storage request to store the V2 version data, since only one data value has changed in the V2 version compared to its previous version (V1 version), only the incremental data can be stored. The backend management system 12 converts the V2 version data into the digital object shown in Table 5:
[0068] Attribute Name Property Value Digital Object Identifier 86.100 / 6118a3a6~.v2 Data type identifier N Table field properties Field Value Properties {"col3":"3_2"} Previous version identifier 86.100 / 6118a3a6~.v1 Next version identifier 86.100 / 6118a3a6~.v3
[0069] Table 5
[0070] As shown in Table 5, the "digital object identifier" contains the fixed prefix "86.100", the data identifier "6118a3a6~" and the data version number "V2". The "N" corresponding to the "data type identifier" indicates that the digital object records the incremental data of version V2. The "field value attribute" records the changed data in the V2 version data in the JSON key-value pair format. The attribute name indicates the changed column information, and the attribute value indicates the changed value. {"col3":"3_2"} means that the value of the "col3" column becomes "3_2". The "previous version identifier" indicates the digital object that records the version data of the previous version of the V2 version data, that is, the digital object that records the V1 version data. The "next version identifier" indicates the digital object that records the version data of the next version of the V2 version data, that is, the digital object that records the V3 version data.
[0071] After the backend management system 12 receives the data storage request to store the V3 version data, since the V3 version has more data changes than its previous version (V2 version), the backend management system 12 can choose to store the full amount of data. The backend management system 12 converts the V3 version data into the digital object shown in Table 6:
[0072]
[0073] Table 6
[0074] As shown in Table 6, the "digital object identifier" contains the fixed prefix "86.100", the data identifier "6118a3a6~" and the data version number "V3". The "Y" corresponding to the "data type identifier" indicates that the digital object records the full data of version V3. The "table field attributes" and "field value attributes" record the table structure of the V3 version data and its corresponding data values in JSON array format. The complete table structure and the data value of the current version can be specified through the table field attributes and field value attributes. The "previous version identifier" indicates the digital object that records the version data of the previous version of the V3 version data, that is, the digital object that records the V2 version data. The "next version identifier" indicates the digital object that records the version data of the next version of the V3 version data, that is, the digital object that records the V4 version data.
[0075] After the backend management system 12 receives the data storage request to store the V4 version data, since the V4 version has a small change compared to its previous version (V3), one column of data is deleted and one column of data is added, only the incremental data can be stored. The backend management system 12 converts the V4 version data into the digital object shown in Table 7:
[0076]
[0077] Table 7
[0078] As shown in Table 7, the "digital object identifier" contains the fixed prefix "86.100", the data identifier "6118a3a6~" and the data version number "V4". The "N" corresponding to the "data type identifier" indicates that the digital object records the incremental data of the V4 version. The "table field attributes" record the changes in the table in the JSON key-value pair format, where "index" indicates the position of the operated column in the table field attributes, "name" indicates the name of the operated column, "op" indicates the operation type, "del" indicates deleting a column, and "add" indicates adding a new column. {"index":1,"name":"col1","op":"del"} means deleting the col1 column at the first position in the array, and {"index":3,"name":"col4","op":"add"} means adding the column information named "col4" at the end. "Field value attributes" record data value changes in JSON key-value pair format. The attribute name indicates the column information that has changed, and the attribute value indicates the changed value. For example, {"col4":"4"} means that the value of the "col4" column has changed to "4". "Previous version identifier" indicates the digital object that records the version data of the previous version of the V4 version data, that is, the digital object that records the V3 version data. "Next version identifier" indicates the digital object that records the version data of the next version of the V4 version data, that is, the digital object that records the V5 version data.
[0079] After the backend management system 12 receives the data storage request to store the V5 version data, since the V5 version has more data changes compared to its previous version (V4 version), the backend management system 12 can choose to store the full amount of data. The backend management system 12 converts the V5 version data into the digital object shown in Table 8:
[0080]
[0081] Table 8
[0082] As shown in Table 8, the "digital object identifier" contains the fixed prefix "86.100", the data identifier "6118a3a6~" and the data version number "V5". The "Y" corresponding to the "data type identifier" indicates that the digital object records the full data of the V5 version. The "table field attributes" and "field value attributes" record the table structure of the V5 version data and its corresponding data values in json array format. The complete table structure and the data value of the current version can be specified through the table field attributes and field value attributes. The "previous version identifier" indicates the digital object that records the version data of the previous version of the V5 version data, that is, the digital object that records the V4 version data.
[0083] In this embodiment, the preset role of user A is set as a supervisor, and the supervisor has the query authority to query all digital objects with a digital object identifier prefix of "86.100".
[0084] Step 206: Send the digital object.
[0085] 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.
[0086] Step 208: Receive and store the digital object.
[0087] The digital object management system receives the digital objects sent by the background management system and stores them.
[0088] In one embodiment, when executing step 208, the digital object management system may also pre-set permission information for the digital object, where the permission information represents a set of users who have query permissions for the digital object.
[0089] Continuing with the above example, the background management system 12 sends the digital objects shown in Tables 4 to 8 to the Handle system 13 for storage.
[0090] In this embodiment, all digital objects whose data identifiers are preset as "6118a3a6~" in the digital object identifiers can be queried by user A.
[0091] exist Figure 1 In the data query system shown, the version data of the user-specified version can be quickly queried in the digital objects stored according to the aforementioned data storage method based on the digital object identifier.
[0092] Figure 4 This is a flow chart of a data query method applied to a backend management system according to an exemplary embodiment of the present application. Figure 4 The method is applied to the background management system and may include the following steps:
[0093] Step 402: Obtain a target digital object identifier included in a data query request initiated by a client. The target digital object indicated by the target digital object identifier is related to version data of a target version.
[0094] The data query request is used to instruct the backend management system to return the version data of the target version corresponding to the data query request to the client. The data query request can be initiated by the client used by the user to the backend management system by performing a certain operation. For example, the user can trigger it by clicking an option on the client, or trigger it through language, etc. This manual does not limit this.
[0095] The data query request includes a digital object identifier, which can be used to indicate a digital object that records the version data of a user-specified version. When the backend management system receives the data query request initiated by the client, it obtains the target digital object identifier included in the data query request to obtain the target digital object that records the version data of the target version based on the target digital object identifier.
[0096] In one embodiment, the target digital object identifier includes the version number of the target version and a data identifier for the version data, to facilitate identification of the user-specified target version and management. The data identifier for the version data uses a UUID (universally unique identifier) to ensure the uniqueness of the target digital object identifier. Of course, the target digital object identifier can also be expanded to a more complex format, for example, by adding one or more of a project name, a database name, or a database table name, and this specification is not limited thereto.
[0097] For example, if user A specifies to query V2 version data, user A triggers client 11 to initiate a data query request containing the target digital object identifier, that is, the data query request contains the digital object identifier "86.100 / 6118a3a6~.v2" corresponding to the digital object that records V2 version data.
[0098] Step 404: Send the target digital object identifier to a digital object management system. The digital object management system stores digital objects corresponding to various versions of version data, and each digital object has a unique digital object identifier.
[0099] The digital objects that record the version data of each version are stored in the digital object management system. After obtaining the target digital object identifier, the background management system sends the target digital object identifier to the digital object management system. The digital object management system determines the target digital object from the stored digital objects based on the target digital object identifier. Because 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.
[0100] In one embodiment, before the backend management system sends the target digital object identifier to the digital object management system, it will verify the user to determine whether the user has the right to query the target digital object. If it is determined that the user has the right to query, the target digital object identifier will be sent to the digital object management system, thereby implementing user authority management and preventing illegal users from accessing data or legal users from illegally accessing data.
[0101] A specific implementation method for user rights verification may include determining a preset role corresponding to the user based on the user information at the client, further determining one or more digital objects for which the preset role has query rights based on a stored correspondence between the user role and digital objects for which query rights are granted, and sending an identifier of the target digital object to a digital object management system if the one or more digital objects for which the preset role has query rights include the target digital object. If the one or more digital objects for which the preset role has query rights include the target digital object, it indicates that the user has query rights for the target digital object, and thus the identifier of the target digital object may be sent to the digital object management system.
[0102] Among them, the preset role corresponding to the user is determined based on the user information at the client. The preset role corresponding to the user can be determined based on the user information and the user role correspondence maintained by the background management system, or the user set corresponding to each preset role can be traversed to find the preset role containing the user. This manual does not limit this.
[0103] Regarding the method for determining whether the target digital object is included in one or more digital objects for which a preset role has query authority, it can be determined whether the target digital object matches the one or more digital objects for which the preset role has query authority. If they match, it is determined that the target digital object is included in the one or more digital objects for which the preset role has query authority, that is, it is determined that the preset role has query authority over the target digital object, and the target digital object identifier is sent to the digital object management system. If they do not match, it is determined that the target digital object is not included in the one or more digital objects for which the preset role has query authority, that is, it is determined that the preset role does not have query authority over the target digital object, and processing of the received data query request is stopped to avoid data leakage or data tampering.
[0104] Continuing with the above example, after the backend management system 12 receives the data query request sent by the client 11, it determines that the preset role of user A at the client 11 is supervisor based on the maintained user role relationship, and further determines that user A has the authority to query the digital object with the digital object identifier "86.100 / 6118a3a6~.v2", and sends "86.100 / 6118a3a6~.v2" (target digital object identifier) to the Handle system 13.
[0105] In one embodiment, after the backend 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:
[0106] The digital object management system receives a target digital object identifier sent by the backend management system based on a data query request initiated by the client, wherein the target digital object indicated by the target digital object identifier is related to version data of a target version;
[0107] Then, the digital object management system determines the target digital object from the stored digital objects according to the target digital object identifier; wherein the digital object management system stores digital objects corresponding to the version data of each version, and each digital object has a unique digital object identifier.
[0108] Finally, the digital object management system returns the target digital object to the background management system, so that the background management system obtains the version data of the target version according to the content of the target digital object and returns it to the client.
[0109] After receiving the target digital object identifier, the digital object management system parses the target digital object identifier. After the parsing is completed, the target digital object is determined from the stored digital objects and the target digital object is returned to the background management system, so that the background management system obtains the version data of the target version based on the content of the target digital object and returns it to the client.
[0110] In one embodiment, to ensure data security, the digital object management system verifies the query authority of the user at the client before querying the target digital object corresponding to the target digital object identifier. If it is determined that the user has query authority for the target digital object, the target digital object is determined from the stored digital objects based on the target digital object identifier, thereby achieving refined authority control for each digital object.
[0111] Regarding the specific method of determining whether the user has the query permission for the target digital object, the method may be to obtain the user information of the user at the client, determine whether the target digital object identifier matches the pre-set user permission information, and if so, determine that the user has the query permission. Alternatively, the method may be to obtain the user information of the user at the client, determine whether the user information matches the permission information pre-set for the target digital object, and if so, determine that the user has the query permission. This specification does not limit this.
[0112] For example, after the Handle system 13 receives the target digital object identifier "86.100 / 6118a3a6~.v2", it determines that user A at the client 11 has the authority to query the target digital object based on the preset digital object permission information, queries the target digital object based on the target digital object identifier, and returns the target digital object to the background management system 12.
[0113] Step 406: Receive the 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.
[0114] After receiving the target digital object returned by the digital object management system, the background management system performs operations such as parsing, assembling, and decompressing on the target digital object to obtain version data of the target version recorded in the target digital object.
[0115] In one embodiment, to reduce the storage space occupied by data, for two adjacent versions of version data, if the current version has a small change compared to the previous version, only the incremental data is stored, that is, only the changed data is stored.
[0116] In this embodiment, the content of the target digital object includes a data type identifier, which is used to indicate whether the content recorded by the target digital object is the 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 also includes an upper version identifier and / or a lower version identifier, the upper version identifier is used to indicate a digital object that records the version data of the previous version of the target version, and the lower version identifier is used to indicate a digital object that records the version data of the next version of the target version.
[0117] In this embodiment, to ensure that the full data is obtained, it is necessary to determine whether the version data recorded by the target digital object is full data based on the data type identifier. In the case that the target digital object records incremental data, the digital object corresponding to the previous version's version data is obtained based on the previous version identifier or the next version identifier, and the full data of the previous version's version data recorded by the digital object is obtained. Based on the obtained incremental data and full data, the version data of the target version is generated.
[0118] After receiving the target digital object, the background management system determines whether the version data recorded therein is full data based on the data type identifier included therein. If the recorded data is full data, the full data is returned to the client. If the recorded data is not full data, that is, incremental data is recorded, it is necessary to obtain the digital object recording the full data from the digital object management system.
[0119] If the target digital object includes a previous version identifier, the backend management system will send the previous version identifier to the digital object management system to obtain a digital object that records the version data of the previous version of the target version. The specific method for obtaining this digital object is the same as the method for obtaining the target digital object and will not be repeated here. Of course, if the full data is not obtained after obtaining the version data of the previous version of the target version, the above operation can be performed multiple times until the full data is obtained. The previous version identifier can more efficiently obtain the version data of the previous version of the current version.
[0120] If the target digital object includes a next version identifier, the backend management system can request the digital object management system to identify a digital object whose next version identifier is the target digital object identifier. Specifically, this can be done by traversing each digital object until a digital object whose next version identifier is the target digital object identifier is found. Of course, if the full data is still not obtained after obtaining the version data of the previous version of the target version, the above operation can be performed multiple times until the full data is obtained. The obtained data can be verified using the next version identifier to ensure that the full data is obtained accurately.
[0121] If the target digital object includes an upper version identifier and a lower version identifier, the background management system can obtain the full data based on the upper version identifier or the lower version identifier, and this specification does not limit this.
[0122] If only incremental data of one version is obtained, the obtained incremental data is used to overwrite the data corresponding to the incremental data in the obtained full data, thereby generating version data of the target version.
[0123] If multiple versions of incremental data are obtained, the obtained incremental data will be used in sequence from back to front in the order of acquisition to overwrite the data corresponding to the incremental data in the obtained full data. That is, the last obtained incremental data will first overwrite the data corresponding to the incremental data in the obtained full data, and the first obtained incremental data will last overwrite the data corresponding to the incremental data in the obtained full data, so as to correctly generate the version data of the target version.
[0124] For example, digital object A records the version data of the first version, digital object B records the incremental data of the second version compared to the version data of the first version, and digital object C records the incremental data of the third version compared to the version data of the second version. If the user specifies to obtain the version data of the third version, after obtaining digital object C, it is determined that digital object C records the incremental data. Then, digital object B recording the second version data is further obtained, and it is determined that digital object B still records the incremental data. Then, digital object A recording the first version data is further obtained, and it is determined that digital object A records the full data. To obtain the version data of the third version, it is necessary to adapt the incremental data obtained from digital object B to overwrite the corresponding data in the full data, and then use the incremental data obtained from digital object C to overwrite the corresponding data in the full data, thereby generating the version data of the third version.
[0125] Step 408: Return the version data of the target version to the client.
[0126] The backend management system obtains the target version's version data based on the target digital object, which is the version data of the specified version requested by the user, and returns the target version's version data to the client.
[0127] 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 the digital object only records incremental data based on the value of the data type identifier of the digital object being "N", and obtains the digital object corresponding to the upper version identifier from the Handle system 13 through its upper version identifier "86.100 / 6118a3a6~.v1", and determines that the digital object records the full data based on the value of the data type identifier of the digital object being "Y", overwrites the obtained incremental data with the obtained full data, generates version data of the target version (V2 version), and returns the version data of the target version to the client 11.
[0128] In one embodiment, the user can also trigger a version change tracing request, which instructs the background management system to count the changes in version data in different versions. The specific statistical process can be that after the background management system obtains the digital object that records the version data of any version, it obtains the version data before the version through the "previous version identifier" and obtains the version data after the version through the "next version identifier", and then integrates and compares all the obtained version data to obtain the changes in the table structure of the version data and the data itself in different versions, and finally obtains the changes in the version data in different versions.
[0129] For example, after the background management system 12 obtains the digital object recording the version data of version V2, it obtains the digital object recording the version data of version V1 and the digital object recording the version data of version V3 through the upper version identifier and the lower version identifier of the digital object. It further obtains the digital object recording the version data of version V4 through the lower version identifier in the digital object recording the version data of version V3. It further obtains the digital object recording the version data of version V5 through the lower version identifier in the digital object recording the version data of version V4. Finally, the background management system 12 integrates and compares the version data of these five versions, obtains the changes in the table structure of the version data and the data itself in different versions, and finally concludes the changes in the version data in different versions.
[0130] It can be seen from the above embodiments that the digital objects stored in the digital management system in this application respectively record the version data of each version, and each digital object has a unique digital object identifier. After the background management system receives the data query request initiated by the client, it obtains the target digital object identifier contained in the data query request, and can quickly obtain the corresponding target digital object based on the target digital object identifier. Further, it can obtain the version data of the target version based on the content of the target digital object and return it to the client. There is no need to query in multiple different tables, nor is there any need to parse the change information one by one from the current latest version to obtain the version data of the target version, thereby achieving efficient indexing of the version data of the target version.
[0131] exist Figure 2 Based on the embodiment shown, the Handle system has been Figure 3The digital object format shown stores version data of five versions: V1, V2, V3, V4, and V5. In the background management system 12, the preset role corresponding to user A is a supervisor. The supervisor has the query authority to query all digital objects with a digital object identifier prefix of "86.100". In the Handle system, all digital objects with a data identifier of "6118a3a6~" in the digital object identifier can be queried by user A. Taking user A specifying to query version data of version V2 as an example, the following is combined with Figure 5 A detailed introduction to the data query. Figure 5 This is a multi-party interaction flow chart of a data query according to an exemplary embodiment of the present application. Figure 5 The interaction process between the client 11, the background management system 12 and the Handle system 13 includes the following steps:
[0132] Step 502: Send a data query request.
[0133] After user A triggers a data query request for version data of version V2, the client 11 initiates a data query request including a target digital object identifier to the background management system 12 .
[0134] Step 504: Obtain the target digital object identifier contained in the data query request.
[0135] Step 506: Determine the preset role corresponding to the user.
[0136] Step 508: Determine whether the preset role has query authority for the target digital object.
[0137] After receiving the data query request initiated by the client, the backend management system 12 obtains the user information corresponding to the user at the client 11 and the target digital object identifier contained in the data query request, determines the preset role corresponding to the user based on the user information and the user role correspondence maintained by the backend management system 12, and further determines whether the target digital object matches one or more digital objects for which the preset role has query authority. If they match, it is determined that the preset role has query authority for the target digital object, and step 510 is executed to send the target digital object identifier. If they do not match, it is determined that the preset role does not have query authority for the target digital object, and the data query process is stopped.
[0138] The backend management system 12 obtains the user information of user A and the target digital object identifier "86.100 / 6118a3a6~.v2", and determines that the preset role corresponding to user A is supervisor based on the user information of user A, and determines that the supervisor has query authority for the digital object of the version data of record version V2.
[0139] Step 510: Send the target digital object identifier.
[0140] The backend management system 12 sends the target digital object identifier to the Handle system 13 .
[0141] Step 512: Receive a target digital object identifier.
[0142] Step 514: Determine whether the user at the client has query authority for the target digital object.
[0143] The Handle system 13 obtains the user information of the user at the client 11 and determines whether the user information matches the permission information pre-set for the target digital object. If so, it is determined that the user has the query permission, and step 516 is executed to return the target digital object. If not, it is determined that the user does not have the query permission and the data query process is stopped.
[0144] The Handle system 13 receives the target digital object identifier “86.100 / 6118a3a6~.v2”, obtains the user information of user A, determines that user A can access the digital object with the digital object identifier “86.100 / 6118a3a6~.v2”, and executes step 516.
[0145] Step 516: Return the target digital object.
[0146] The Handle system 13 returns the target digital object to the background management system 12 .
[0147] Step 518: Obtain version data of the target version according to the content of the target digital object.
[0148] Step 520: Determine whether the version data of the target version is full data.
[0149] After receiving the target digital object, the background management system 12 determines whether the version data recorded therein is the full quantity based on the data type identifier included therein. If the recorded data is the full quantity, step 526 is executed to return the version data of the target version. If the recorded data is incremental data, step 522 is executed to obtain the digital object that records the version data of the previous version of the target version.
[0150] After receiving the digital object with the digital object identifier “86.100 / 6118a3a6~.v2”, the backend management system 12 determines that the digital object record is incremental data based on the data type identifier of the digital object, and executes step 522 .
[0151] Step 522: Obtain a digital object that records the version data of the previous version of the target version.
[0152] Step 524: Generate version data of the target version.
[0153] The background management system 12 obtains the digital object corresponding to the version data of the previous version from the Handle system 13 according to the previous version identifier, and obtains the full data of the version data of the previous version recorded in the digital object.
[0154] The backend management system 12 obtains the digital object with the digital object identifier "86.100 / 6118a3a6~.v1" from the Handle system 13, and obtains the full data of the version data of version V1 recorded by the digital object, and uses the obtained incremental data of the V2 version to overwrite the data corresponding to the incremental data in the obtained full data of the V1 version, and executes step 526.
[0155] Step 526: Return the version data of the target version.
[0156] The backend management system 12 returns the acquired full data of the target version to the client 11 .
[0157] The backend management system 12 returns the full amount of data shown in Table 9 to the client 11 where user A is located.
[0158]
[0159] Table 9
[0160] In this step, since the backend management system 12 is deployed within a secure environment, while the client 11 is deployed outside of the secure environment, to prevent the processing results from being leaked, the backend management system 12 can asymmetrically encrypt the processing results using the client 11's public key. After receiving the encrypted processing results, the client 11 decrypts them using its private key. Of course, the above encryption and decryption methods are merely examples in this application; other applicable encryption and decryption methods are also applicable to this application.
[0161] Corresponding to the aforementioned embodiment of a data query method, the present application also provides an embodiment of a data query device.
[0162] Figure 6 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present application. Figure 6At 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. Of course, it may also include hardware required for other services. The processor 602 reads the corresponding computer program from the non-volatile memory 610 into the memory 608 and then runs it, forming a data processing device at the logical level. Of course, in addition to software implementation, this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0163] Figure 7 This is a block diagram of a data query device according to an exemplary embodiment of the present application. Figure 7 , the device is applied to the background management system, and the device may include:
[0164] The identifier obtaining unit 702 is configured to obtain a target digital object identifier included 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.
[0165] Optionally, the target digital object identifier includes: a version number of the target version and a data identifier of the version data.
[0166] The identifier sending unit 704 is configured to send the target digital object identifier to a digital object management system. The digital object management system stores digital objects corresponding to various versions of version data, and each digital object has a unique digital object identifier.
[0167] Optionally, the identifier sending unit 704 is specifically configured to:
[0168] Determining a preset role corresponding to a user at the client, wherein the preset role is used to represent a set of users having query rights for one or more digital objects managed by the digital object management system;
[0169] In the case where it is determined that the preset role has query authority for the target digital object, the target digital object identifier is sent to a digital object management system.
[0170] Optionally, after sending the target digital object identifier to the digital object management system, the device further includes:
[0171] The identifier receiving unit 710 is used for the digital object management system to receive a target digital object identifier sent by the background management system based on a 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.
[0172] The digital object determination unit 712 is used for the digital object management system to determine the target digital object from the stored digital objects according to the target digital object identifier; wherein the digital object management system stores digital objects corresponding to each version of the version data, and each digital object has a unique digital object identifier.
[0173] Optionally, the digital object determining unit 712 is specifically configured to:
[0174] When it is determined that the user at the client has query authority for the target digital object, the target digital object is determined from the stored digital objects according to the target digital object identifier.
[0175] The digital object returning unit 714 is used for the digital object management system to return the target digital object to the background management system, so that the background management system obtains the version data of the target version according to the content of the target digital object and returns it to the client.
[0176] The data acquisition unit 706 is configured to receive the target digital object returned by the digital object management system according to the target digital object identifier, and acquire version data of the target version according to the content of the target digital object.
[0177] Optionally, the content of the target digital object includes a data type identifier, the data type identifier is used to indicate whether the content recorded by the target digital object is the 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 also includes a previous version identifier and / or a next version identifier, the previous version identifier is used to indicate a digital object recording the version data of the previous version of the target version, and the next 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:
[0178] The data quantity determination unit 716 is configured to determine whether the version data recorded in the target digital object is full data according to the data type identifier.
[0179] The full data acquisition unit 718 is used to obtain the digital object corresponding to the previous version data according to the previous version identifier or the next version identifier when the target digital object records incremental data, and obtain the full data of the previous version data recorded by the digital object.
[0180] The target data generation unit 720 is configured to generate version data of the target version based on the acquired incremental data and full data.
[0181] The data returning unit 708 is configured to return the version data of the target version to the client.
[0182] Optionally, the device further includes:
[0183] The digital object conversion unit 722 is configured to respond to a digital object storage request initiated by a user and convert the version data corresponding to the digital object storage request into a digital object, where the digital object has a unique digital object identifier.
[0184] The digital object sending unit 724 is configured to send the digital object to a digital object management system.
[0185] The digital object storage unit 726 is used for the digital object management system to receive and store the digital object.
[0186] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0187] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0188] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is further provided, such as a memory including instructions. The instructions may be executed by a processor of a data processing device to implement any of the methods described in the above embodiments. For example, the method may include:
[0189] Obtaining a permission request for a target digital object and a structured query request in the form of the target digital object sent by a client; approving the permission request, and if the permission request is approved, causing a parsing system to parse the structured query request; returning a processing result to the client, the processing result being obtained by executing the parsed structured query request on a database.
[0190] The non-temporary 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, etc., and this application does not limit this.
[0191] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A data query method, characterized in that: Applied to a background management system, the method includes: 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 the version data of a target version; the content of the target digital object includes a data type identifier, wherein the data type identifier is used to indicate whether the content recorded by the target digital object is the full data of the version data of the target version or incremental data relative to the version data of a previous version; and the content of the target digital object further includes a previous version identifier and / or a next version identifier, wherein the previous version identifier is used to indicate a digital object recording the version data of a previous version of the target version, and the next version identifier is used to indicate a digital object recording the version data of a next version of the 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 respective versions of the version data, 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 obtaining version data of the target version according to the content of the target digital object; obtaining the version data of the target version according to the content of the target digital object includes: determining whether the version data recorded by the target digital object is full data according to the data type identifier; if the target digital object records incremental data, obtaining a digital object corresponding to the version data of the previous version according to the previous version identifier or the next version identifier, and obtaining full data of the version data of the previous version recorded by the digital object; generating the version data of the target version according to the obtained incremental data and full data; The version data of the target version is returned to the client.
2. The method according to claim 1, characterized in that The target digital object identifier includes: the version number of the target version and the data identifier of the version data.
3. The method according to claim 1, characterized in that The method further comprises: In response 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 and stores the digital object.
4. The method according to claim 1, wherein The step of 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 for which the preset role has query permission based on a stored correspondence between the user role and the digital objects for which the preset role has query permission; In a case where the one or more digital objects that the predetermined role has query authority for include the target digital object, the target digital object identifier is sent to a digital object management system.
5. The method according to claim 1, wherein After sending the target digital object identifier to the digital object management system, the method further includes: The digital object management system receives a target digital object identifier sent by the backend management system based on a data query request initiated by the client, wherein the target digital object indicated by the target digital object identifier is related to version data of the target version; The digital object management system determines the target digital object from the stored digital objects according to the target digital object identifier; wherein the digital object management system stores digital objects corresponding to respective versions of the version data, and each digital object has a unique digital object identifier; The digital object management system returns the target digital object to the background management system, so that the background management system obtains the version data of the target version according to the content of the target digital object and returns it to the client.
6. The method according to claim 5, characterized in that Determining the target digital object from the stored digital objects according to the target digital object identifier includes: When it is determined that the user at the client has query authority for the target digital object, the target digital object is determined from the stored digital objects according to the target digital object identifier.
7. A data query device, characterized in that: Applied to the background management system, the device includes: an identifier acquisition unit, configured to acquire 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 the version data of a target version; the content of the target digital object includes a data type identifier, wherein the data type identifier is used to indicate whether the content recorded by the target digital object is the full data of the version data of the target version or incremental data relative to the version data of a previous version; and the content of the target digital object further includes a previous version identifier and / or a next version identifier, wherein the previous version identifier is used to indicate a digital object recording the version data of a previous version of the target version, and the next version identifier is used to indicate a digital object recording the version data of a next version of the target version; an identifier sending unit, configured to send the target digital object identifier to a digital object management system, wherein the digital object management system stores digital objects corresponding to respective versions of the version data, and each digital object has a unique digital object identifier; a data acquisition unit, configured to receive the target digital object returned by the digital object management system according to the target digital object identifier, and acquire version data of the target version according to the content of the target digital object; the acquiring of the version data of the target version according to the content of the target digital object comprises: determining, according to the data type identifier, whether the version data recorded by the target digital object is full data; if the target digital object records incremental data, acquiring, according to the previous version identifier or the next version identifier, the digital object corresponding to the version data of the previous version, and acquiring the full data of the version data of the previous version recorded by the digital object; and generating the version data of the target version according to the acquired incremental data and full data; A data returning unit is configured to return the version data of the target version to the client.
8. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 6 by running the executable instructions.
9. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Data management method and device
CN114328746A