CN117112652A - Data query method, device, equipment and storage medium - Google Patents

Data query method, device, equipment and storage medium Download PDF

Info

Publication number
CN117112652A
CN117112652A CN202311235399.7A CN202311235399A CN117112652A CN 117112652 A CN117112652 A CN 117112652A CN 202311235399 A CN202311235399 A CN 202311235399A CN 117112652 A CN117112652 A CN 117112652A
Authority
CN
China
Prior art keywords
metadata
content
target
version
data
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
CN202311235399.7A
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.)
Renlijia Network Technology Hangzhou Co ltd
Original Assignee
Renlijia Network Technology Hangzhou 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 Renlijia Network Technology Hangzhou Co ltd filed Critical Renlijia Network Technology Hangzhou Co ltd
Priority to CN202311235399.7A priority Critical patent/CN117112652A/en
Publication of CN117112652A publication Critical patent/CN117112652A/en
Pending legal-status Critical Current

Links

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/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2474Sequence data queries, e.g. querying versioned data
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Fuzzy Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The specification provides a data query method, a device, equipment and a storage medium, wherein the method comprises the following steps: receiving a data query request aiming at a storage space, wherein the storage space stores metadata of a plurality of metadata versions and contents of a plurality of content versions corresponding to at least one object; wherein the metadata of the metadata versions respectively correspond to different metadata effective dates, and the content of the content versions respectively correspond to different content effective dates; inquiring metadata of a target metadata version and contents of a target content version matched with the inquiry conditions from the storage space according to the inquiry conditions indicated by the data inquiry request; and combining the metadata of the target metadata version and the content of the target content version and returning.

Description

Data query method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data query method, apparatus, device, and storage medium.
Background
Metadata (Metadata) generally refers to data describing a content, and when the content is manipulated, changed or updated, the corresponding Metadata is changed, so that a plurality of different versions of the content and Metadata are formed, that is, the Metadata and different versions of the content have modification histories recorded therein, and different content and Metadata exist. If the content has no version concept, the changing process of the content cannot be traced; if the metadata has no version concept, the content can be changed directly at the presentation layer along with the metadata change under the condition that the content is not changed after the metadata is changed.
At present, when metadata and contents are stored, many low-code platforms can log the change of the contents, but the changed contents data can cover the data before the change, and the storage of the contents of multiple versions cannot be realized. And the low-code platform cannot record the change of metadata generated along with the change of the content, and cannot realize the storage of metadata of multiple versions, so that the previous metadata of multiple versions and the content of multiple versions cannot be queried.
Disclosure of Invention
In order to overcome the problems in the related art, the present specification provides a data query method, apparatus, device, and storage medium.
According to a first aspect of embodiments of the present specification, there is provided a data query method, the method comprising:
receiving a data query request aiming at a storage space, wherein the storage space stores metadata of a plurality of metadata versions and contents of a plurality of content versions corresponding to at least one object; wherein the metadata of the metadata versions respectively correspond to different metadata effective dates, and the content of the content versions respectively correspond to different content effective dates;
inquiring metadata of a target metadata version and contents of a target content version matched with the inquiry conditions from the storage space according to the inquiry conditions indicated by the data inquiry request;
And combining the metadata of the target metadata version and the content of the target content version and returning.
According to a second aspect of embodiments of the present specification, there is provided a data querying device, the device comprising:
the query unit is used for receiving a data query request aiming at a storage space, wherein metadata of a plurality of metadata versions and contents of a plurality of content versions corresponding to at least one object are stored in the storage space; wherein the metadata of the metadata versions respectively correspond to different metadata effective dates, and the content of the content versions respectively correspond to different content effective dates;
a matching unit, configured to query, according to a query condition indicated by the data query request, metadata of a target metadata version and contents of a target content version that match the query condition from the storage space;
and the combining unit is used for combining the metadata of the target metadata version and the content of the target content version and returning the metadata of the target metadata version and the content of the target content version.
According to a third aspect of embodiments of the present specification, there is provided an electronic device comprising:
a processor;
a memory for storing processor-executable instructions;
Wherein the processor is configured to implement the method as described in the embodiments of the first aspect described above by executing the executable instructions.
According to a fourth aspect of embodiments of the present description, there is provided a machine-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.
The technical scheme provided by the embodiment of the specification can comprise the following beneficial effects:
in the embodiment of the specification, metadata of a plurality of metadata versions corresponding to at least one object and contents of a plurality of content versions are stored in a storage space, the metadata of the plurality of metadata versions respectively correspond to different metadata effective dates, the contents of the plurality of content versions respectively correspond to different content effective dates, a data query request aiming at the storage space is received, the metadata of a target metadata version and the contents of the target content version matched with the query condition are queried in the storage space, a query result is returned after the combination, the versioning of the metadata and the contents is accurate to the effective date, and the coexistence of historical versions of the metadata and the contents and the accurate query of the metadata of the target metadata version and the contents of the target content version are realized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and together with the description, serve to explain the principles of the specification.
FIG. 1 is a flow chart illustrating a method of querying data according to an exemplary embodiment of the present description.
FIG. 2 is a diagram illustrating the storage of metadata and content according to an exemplary embodiment of the present description.
FIG. 3A is a schematic diagram of a metadata version shown in accordance with an exemplary embodiment of the present description.
Fig. 3B is a schematic diagram of a content version shown in accordance with an exemplary embodiment of the present description.
Fig. 4 is a schematic diagram of combined data shown in this specification according to an exemplary embodiment.
Fig. 5 is a schematic diagram of a secondary content presentation shown in accordance with an exemplary embodiment of the present description.
Fig. 6 is a block diagram of a data querying device shown in accordance with an exemplary embodiment of the present description.
Fig. 7 is a schematic structural view of an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present description as detailed in the accompanying claims.
The terminology used in the description presented herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification 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 or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
First, terms related to one or more embodiments of the present specification will be specifically explained.
Metadata: refers to data describing the content.
The object is: data of any format class (e.g., documents, applications, audio, video or image files, etc.).
Multi-version metadata and multi-version content refer to metadata and content that, upon manipulation, modification or update, exist in a plurality of different versions of metadata and content.
For example, assume that an image exists, if the size of the image is 100×200, then "100×200" is the content of the image, and "size of the image" is metadata describing the content "100×200", and the image itself is the object.
If the size of the image is changed from "100×200" to "10×20", there are two versions of the content of the image, the first version of the content is "100×200" before the change, and the second version of the content is "10×20" after the change, and the change time is called the effective time. If the content has no version concept, the changing process of the content cannot be traced, namely after the content is modified, the content data after the change can cover the data before the change, and the data before the change can not be restored.
Similarly, when metadata of an image is changed, for example, metadata of "pixels of the image" is added, and content described by the metadata is added correspondingly, there are two versions of the metadata of the image, wherein the content of the first version is "size of the image" before the change, and the content of the second version is "size of the image" after the change and "pixels of the image". If the metadata has no version concept, the content can be changed directly at the presentation layer along with the metadata change under the condition that the content is not changed after the metadata is changed.
Along the above example, for metadata and content of an object of the first version, there are metadata "size of image" and "pixel of image", where the metadata of "size of image" has content, but the metadata of "pixel of image" has no described content. That is, when the metadata and content of the first version of the object are restored, only the content is traced back, and after the metadata changes, the changes remain in the data of each version of the object.
Currently, many low code platforms can store metadata and content, but only log changes to content, such as "100×200' to '10×20', for example. "the content before the change cannot be traced back, and the change of the metadata generated together with the change of the content is not recorded, the simultaneous storage of the content of a plurality of versions and the metadata of a plurality of versions cannot be realized, and thus the previous metadata of a plurality of versions and the content of a plurality of versions cannot be queried.
Therefore, the present specification provides a data query method, which can solve the technical problems existing in the related art.
Next, embodiments of the present specification will be described in detail.
As shown in fig. 1, fig. 1 is a flowchart of a data query method according to an exemplary embodiment of the present disclosure, and specifically includes the following steps:
s101, receiving a data query request aiming at a storage space, wherein metadata of a plurality of metadata versions and contents of a plurality of content versions corresponding to at least one object are stored in the storage space; wherein the metadata of the plurality of metadata versions respectively correspond to different metadata effective dates, and the content of the plurality of content versions respectively correspond to different content effective dates.
In an exemplary embodiment, the storage space includes a metadata storage space for storing metadata of respective versions and a content storage space for storing content of respective versions, which are independent of each other. Specifically, metadata of each version and content of each version may be stored separately in two databases, respectively. By updating and storing the metadata of each version and the content of each version independently, version changes are recorded accurately,
In the embodiment of the present specification, at least one object is stored in the storage space, where the object is used to represent a certain concept without specific actual data, such as "employee", "department", and the like. In contrast, the embodiment of the present specification also proposes the concept of an object instance, which is an instance having specific individual data under a certain object, such as "employee a", "employee B", or "department 1", "department 2", and so on.
In the storage space, metadata of each new version and content of each new version generated after the metadata or content of each object is changed are recorded respectively, wherein the metadata and the content are not stored in an associated manner, but are stored as metadata versions and content versions respectively.
Wherein, metadata of each version and content of each version are associated with effective dates when respective changes are effective, specifically, metadata of each version is stored corresponding to the effective dates of the metadata, and metadata of a plurality of metadata versions are respectively corresponding to different effective dates of the metadata; the content of each content version is stored corresponding to the content effective date, and the content of a plurality of content versions respectively corresponds to different content effective dates.
Fig. 2 is a schematic diagram illustrating metadata and content storage according to an exemplary embodiment of the present disclosure, in which metadata of different object instances under the same object are identical in the case that metadata take effect dates are identical, so that metadata of the same metadata version can be regarded as metadata to save storage space. As shown in the metadata storage space portion of fig. 2, metadata of a plurality of metadata versions corresponding to the object a and the object B at different metadata effective dates is stored in the storage space instead of metadata of a plurality of metadata versions corresponding to specific different object instances.
In this embodiment of the present disclosure, independent storage records are performed on contents included in different objects, where the content records corresponding to the different objects may be recorded specifically by means of a memory table, etc., and are used to store contents of all content versions of all object instances corresponding to the objects. As shown in the content storage space part in fig. 2, independent content storage is performed on an object a and an object B in the storage space, wherein content versions corresponding to object instances A1, A2 and B1, B2 are stored in the object a content record and the object B content record respectively. The object a content record and the object B content record may be a table, a folder, or the like, which may collectively store a plurality of content versions, which is not limited in this specification.
Fig. 3A is a schematic diagram of metadata versions according to an exemplary embodiment of the present disclosure, where one metadata version stores data description information of an object under a certain validation date and attribute information, a content restoration formula, and type information corresponding to the data description information, where each metadata version stores the validation date corresponding to the metadata version. For example, as shown in fig. 3A, the metadata version is specifically employee metadata version 1 with an object being employee and an effective date being 2023-07-07, and as can be seen from fig. 3A, the object "employee" has six items of data description information corresponding to different attribute information, content restoration formula and type information. The data description information is used for describing the data value in the content of the target content version, the attribute information is used for correspondingly combining the metadata of the target metadata version and the content of the target content version, the content restoration formula is used for calculating the final data value, and the type information is used for distinguishing the data value types and converting the data format.
Fig. 3B is a schematic diagram of content versions shown in the present specification according to an exemplary embodiment, in the embodiment of the present specification, a same object corresponds to a plurality of different object instances, and different content versions corresponding to the object instances are all centrally stored in a content record corresponding to the object. A content version stores a data value of an object instance under a certain effective date and attribute information corresponding to the data value, wherein each object instance corresponds to a unique Identifier (ID). Meanwhile, each content version stores the content effective date corresponding to the content version. For example, as shown in fig. 3B, three different content versions are stored in fig. 3B, specifically, including two object instances corresponding to the object "employee": and (3) staff A and staff B, wherein staff A stores two versions of content data, and the two versions correspond to different effective dates respectively. The object instances 'employee A' and 'employee B' are respectively corresponding to unique identifiers 'employee_AAA' and 'employee_BBB', and prefixes in the unique identifiers are used for pointing to the object corresponding to the object instance. In the embodiment of the present disclosure, the partial data values are obtained by calculating the content restoration formula after being combined, so that the partial data values are not displayed in the content version, for example, the attribute B is not displayed due to the fact that the data is to be calculated; and a case where only the initial data value is displayed, for example, the attribute F displays the original object instance ID corresponding to the data value because the content is not restored.
As can be seen from the foregoing, the storage space stores metadata of a plurality of metadata versions and content of a plurality of content versions corresponding to different expiration dates, specifically, when a user modifies the metadata of a certain metadata version or content of an original object, when the modification is effective, metadata or content of a version corresponding to the effective date is correspondingly newly added in the storage space, and each modification of metadata or content is recorded in the storage space, thereby realizing coexistence of metadata of a plurality of metadata versions and content of a plurality of content versions.
In an exemplary embodiment, the granularity of the effective date corresponding to the metadata version and the content version may be accurate to a certain day, if the user continuously modifies the metadata of a certain metadata version or the content of a content version twice on the same day, the metadata of a new metadata version or the content version corresponding to the newly added twice modification is stored in the storage space, and the effective date is recorded as the same day, that is, the same object may also store metadata or content of multiple versions under the same effective date.
In an exemplary embodiment, taking a new metadata version as an example, before editing by a user, copying metadata in the metadata version which is selected by the user and is wanted to be edited, then modifying the metadata of the metadata version obtained by copying by the user to obtain metadata of the new metadata version, setting an effective date of the metadata of the new metadata version by the user, and storing the metadata stored in the new metadata version into a storage space when the effective date is reached, wherein the effective date can be set according to the user requirement.
When a user modifies a content version, as shown in fig. 3B, it is assumed that the user changes the data value of attribute D in employee a content version 1 from "2000" to "2001" on the date 2023-07-08, then in the content record of the object, employee a content version 2 after the data value modification is newly added, and the specific process of adding the content version is the same as the step of the metadata version adding process, so that description will not be repeated here.
It should be noted that, in the embodiment of the present specification, since metadata and content are not stored in association, metadata and content do not affect each other when the version is newly added after editing, that is, if only metadata is edited, the new version is added to metadata, and the version of content does not change.
Through the scheme, the embodiment of the specification realizes coexistence of metadata of multiple versions and content of multiple versions, wherein the data obtained after versioning can be accurate to a specific effective date, so that the stored metadata and content are more comprehensive.
S102, inquiring the metadata of the target metadata version and the content of the target content version matched with the inquiry conditions from the storage space according to the inquiry conditions indicated by the data inquiry request.
In an exemplary embodiment, the query conditions include at least one of: information of the target object instance and target time. In the storage space, the metadata of the metadata versions and the content of the content versions can be associated by the object corresponding to each metadata or content version or the effective date when the metadata or content version changes. Wherein, the query processes corresponding to different query conditions are not the same.
If the query condition includes information of a target object instance, metadata of the target metadata version includes metadata of metadata versions corresponding to all effective dates corresponding to the target object instance, and contents of the target content version include contents of all versions of the target object instance. The query of the target object instance is divided into two cases, namely:
(1) And querying the target object instance as all object instances corresponding to the target object to which the target object instance belongs.
For example, when the information of the target object instance is the information of the object "staff", the metadata of the target metadata version and the content of the target content version of all object instances under the object "staff" need to be queried.
Specifically, in an exemplary embodiment, a user may specify a target object at a query interface, and send a data query request is implemented by specifying the target object. For example, the selection pool containing all objects is set in the query interface, the target object is selected by scrolling the query, or the target object is directly selected by setting the menu bar containing all objects in the main interface, which is not limited in this specification.
After a user designates a target object, the server acquires information of the target object, queries the target object from a metadata storage space, acquires metadata of metadata versions under all effective dates of the target object, and selects metadata of the metadata version with the latest effective date from the metadata version as metadata of the target metadata version.
And querying content versions of all object instances corresponding to the target object in the content storage space according to different expiration dates to acquire the content of all content versions stored in the content record of the target object in the content storage space. If a certain object instance has a plurality of content versions on the same effective date, the content of the latest content version is selected from the plurality of content versions as the content of the target content version of the object instance on the current effective date.
Taking fig. 2 as an example, assuming that the target object is the object a, querying to obtain metadata of a target metadata version of the object a as metadata of a metadata version with the latest effective date in metadata versions 1 to 4 of the object a in the metadata storage space; and inquiring to obtain the target content version of the object A as the content version 1-2 of the object instance A1 and the content version 1-2 of the object instance A2 in the content record of the object A.
(2) And querying one or more object instances corresponding to a target object, wherein the plurality of object instances are smaller than the total number of object instances corresponding to the target object.
For example, when the information of the target object instance is the information of the object instance of "employee a", the metadata of the target metadata version of the object instance of "employee a" and the content of the target content version need to be queried.
Specifically, in an exemplary embodiment, a user may send a data query request by entering unique identification information of an object instance, where a prefix in the unique identification information may be used to point to an object corresponding to the object instance.
After the unique identification information of the object instance is input by the user, the server acquires the information of the target object corresponding to the target object instance, queries the target object from the metadata storage space, acquires metadata of metadata versions of the target object under all effective dates, and selects metadata of the metadata version with the latest effective date from the metadata version as metadata of the target metadata version.
And querying content versions of different dates of validity corresponding to the target object instance from a content storage space, acquiring the content of the content version of the target object instance corresponding to the different dates of validity, and taking the content as the content of the target content version. And if the content version corresponding to a certain effective date is more than one, selecting the content of the content version with the latest modification time as the content of the target content version under the effective date.
Taking fig. 2 as an example, assuming that the target object instance is the object instance A1, querying to obtain metadata of a target metadata version of the object instance A1 as metadata of a metadata version with the latest effective date in metadata versions 1 to 4 of the object a in the metadata storage space; and inquiring to obtain the target content version of the object instance A1 as the content version 1-2 of the object instance A1 in the content record of the object A.
If the query condition includes a target time, metadata of the target metadata version includes metadata having a corresponding effective date closest to the target time but not later than the target time, and content of the target content version includes content having a corresponding effective date not later than the target time.
For example, when the query condition includes time information, such as "2023-07-09", the metadata of the metadata version of all objects and the content of the content version of all object instances with the validation date "2023-07-09" need to be queried, and if the metadata version or the content version corresponding to the validation date does not exist in the storage space, the metadata of the metadata version closest to the target time but not later than the target time and the content of the content version are regarded as the metadata of the target metadata version and the content of the target content version. For example, if the query obtains that the metadata version corresponding to the target time "2023-07-09" does not exist in the metadata storage space, the target time is pushed forward to "2023-07-08" to perform the query until the query obtains the metadata of the corresponding metadata version with the same effective date as the target time.
Specifically, in an exemplary embodiment, the user may select a target time to specify by selecting the target time in the query interface, for example, in a search field containing a year, month, and day option, the time being accurate to a particular day. Sending the data query request is accomplished by specifying a target time.
After a user designates a target time, inquiring the target time from a metadata storage space, acquiring metadata of a metadata version with the same effective date as the target time, and taking the metadata as metadata of a target metadata version.
And inquiring the target time from the content storage space to acquire the content of the content version with the corresponding effective date being the same as the target time. And splitting the content of all the content versions obtained by the query into a plurality of content records corresponding to the objects according to the objects corresponding to the content versions, and taking the content records as the content of the target content version.
Assuming that only the metadata version and the content version as shown in fig. 3A and 3B are stored in the storage space, and the target time is 2023-07-07", querying to obtain the metadata of the target metadata version is employee metadata version 1; and querying to obtain contents of the target content version as employee A content version 1 and employee B content version 1.
In an exemplary embodiment, the data query request may include both the information of the target object instance and the target time, so as to implement query on metadata and content corresponding to the target object instance at any time. Specifically, firstly, metadata of a plurality of metadata versions and contents of a plurality of content versions corresponding to a target object instance are queried, and the metadata of the target metadata version and the contents of the target content version, which have the same effective date as the target time, corresponding to the secondary query are obtained from the query result. Specifically, the process of querying according to the target object instance and querying according to the target time is detailed in the foregoing method, which is not described herein.
In an exemplary embodiment, the metadata of the target metadata version and the content of the target content version can be searched in a correlated manner through the connector, so that backtracking of the historical metadata version and the content version is realized, and the metadata in the historical metadata version and the content in the historical content version can be searched quickly.
In an exemplary embodiment, if the query condition includes information of a target object instance, the data query request further includes target data description information and a target data value condition, where the target data description information is any one of metadata of a target metadata version corresponding to the target object instance;
and screening the content of the content version, the data value of which is matched with the target data value condition, as the content of the target content version according to the target data description information, wherein the target data value condition is the same as the attribute information corresponding to the target data description information.
In the embodiment of the present disclosure, when data satisfying the data value condition of the content corresponding to a certain data description information needs to be queried, for example, data of an employee with an age of 18 needs to be queried, the content needs to be queried through a search engine, and the query condition can be overlapped according to the user requirement. When the contents of a plurality of content versions are stored in the database, one copy is redundant to the search engine, so that the search engine stores the contents of all the content versions, and each object is provided with a corresponding content record.
Specifically, assuming that the query satisfies the data of data description information "age" corresponding to the data with the data value "=18", firstly, the user designates a target object of "staff", when the search engine receives the query condition, metadata of a target metadata version is obtained from the metadata storage space, attribute information, a content restoration formula and type information related to the data description information to be queried are obtained therefrom, and the obtained information is respectively "attribute B", "attribute E-attribute D" and "number" type. The search engine determines the data value of each content version corresponding to the attribute B from the content records corresponding to the staff according to the attribute information, performs content formula operation to obtain field values, compares the field values of the attribute B corresponding to the obtained content versions with the condition '18', screens and records the content version ID conforming to the condition, and the content version ID is used for searching the content of the target content version.
In an exemplary embodiment, the search engine may be a platform for implementing search queries, such as elasticsearch, solr, which is not limited in this specification.
S103, combining the metadata of the target metadata version and the content of the target content version and returning.
And after the metadata of the target metadata version and the content of the target content version which are matched with the query conditions are obtained, combining the metadata of the target metadata version and the content of the target content version, and feeding back the combined data to a user.
In an exemplary embodiment, as shown in fig. 3A, in the metadata version, the data description information and the attribute information are corresponding, and thus metadata of the target metadata version can be deduced to include the data description information and the attribute information corresponding to the data description information. As shown in fig. 3B, in the content version, the data value corresponds to the attribute information, so it can be deduced that the content of the target content version includes the data value and the attribute information corresponding to the data value.
Because the data description information corresponds to the attribute information in the metadata of the target metadata version, the data value corresponds to the attribute information in the content of the target content version, and the metadata of the target metadata version and the content of the target content version are grouped according to the attribute information, wherein each group of data comprises the data description information and the data value corresponding to the same attribute.
For example, as shown in fig. 3A, the employee metadata version 1 includes attribute information, which is attribute a to attribute F, respectively, and each attribute corresponds to different data description information; as shown in fig. 3B, each content version also includes attribute information, which is attribute a to attribute F, each attribute corresponds to different data values, assuming that the target metadata version is employee metadata version 1, the target content version is employee a content version 1, the data restoration information "name" corresponding to attribute a in employee metadata version 1 and employee a content version 1 is respectively combined with the data value "Zhang three", and so on, the data restoration information corresponding to the rest of attribute information is combined with the data value to obtain combined data as shown in fig. 4, fig. 4 is a schematic diagram of the combined data shown in this specification according to an exemplary embodiment, and it should be noted that, in fig. 4, the combined data of employee B content version 1 and employee a content version 2 in fig. 3B is omitted, and in an actual display interface, the data values in the contents of multiple target content versions after formula restoration are unified, corresponding and concentrated and displayed.
Specifically, in an exemplary embodiment, when any one set of data, that is, the data restoration information and the data value are combined, the following two cases may be classified:
(1) And if the data description information in any group of data does not contain the content restoration formula, combining the data description information in any group of data as a field and the data value in any group of data as a field value.
(2) If the data description information in any group of data contains a content restoration formula, determining the related data value from the content of the target content version according to the content restoration formula, calculating, and combining the data description information in any group of data as a field and the calculation result as a field value.
The content restoration formula is used for calculating a final display result of the data value during combination. Specifically, assuming that the target metadata version is employee metadata version 1 and the target content version is employee a content version 1, as can be seen from fig. 3A, the data description information corresponding to the attribute a, the attribute C and the attribute D does not include a content restoration formula, so as shown in fig. 4, the values of the fields corresponding to the attribute a, the attribute C and the attribute D are the same as the data values in fig. 3B.
In contrast, in fig. 3A, if the data description information corresponding to the attribute B, the attribute E, and the attribute F includes a content restoration formula, it is necessary to calculate the value of the field through the content restoration formula, and then combine the values. For example, setting the data description information of the "supervisor", because the restored data description information is the object type, and the unique identifier corresponding to the object instance is stored in the data value, the data value of the attribute a of the object instance needs to be restored, that is, the data value corresponding to the attribute a of the employee B is displayed, and the final field value is "litu". And then calculating the data values corresponding to the two data description information of the current year and the age to obtain the specific field values corresponding to the attribute B, the attribute E and the attribute F shown in the figure 4. The user may set a content restoration formula according to his own requirement, which is not limited in this specification.
And the complete combined data is obtained by combining the target metadata and the target content, wherein the final field value is adjusted through a content restoration formula, and the data is accurately calculated, so that a user does not need to carry out comparison calculation, and a plurality of items of data values are manually input during storage, and the good experience of the user is greatly improved.
In an exemplary embodiment, a user may specify a presentation field at a presentation interface to mask partial fields and field values to centrally display data to be presented. In particular, the hiding may be implemented by setting a hiding option or an option pool for setting a field for each field, and selecting a field to be hidden from among them.
In an exemplary embodiment, the metadata includes type information corresponding to the data description information, where the type information includes: numbers, text, dates, options, files, objects, etc., may be selected autonomously by the user. If the type of any data description information in the metadata of the target metadata version is an object, determining a unique identifier of the object in the content of the target content version, querying under the condition that the unique identifier is used as a query condition, and taking an obtained query result as a secondary content corresponding to the group to which the any data description information belongs. And the secondary content is displayed after the field value corresponding to the packet to which any data description information belongs is triggered.
For example, fig. 5 is a schematic diagram of a secondary content presentation shown in this specification according to an exemplary embodiment. As shown in fig. 5, in the combined data of the object instance employee a (Zhang san), the field "director" corresponds to the data description information of the object type before combination, the corresponding field value stores the unique identifier of the object instance employee B before being restored to "li san", the combined data of the employee B can be obtained by carrying out the associated query of the target metadata version and the target content version of the object instance employee B, and the combined data can be specifically displayed on the data interface in the form of triggering display details, and the user can trigger the detail information interface of the employee B by clicking the detail or moving the cursor to the detail. The function of quickly inquiring the specific data of the related object instance is realized, the condition inquiry is not required to be input repeatedly, and the user experience is improved.
In an exemplary embodiment, according to the type information corresponding to the data description information, the metadata of different types and the corresponding content are respectively processed in the logic processor, the data is restored through the content restoration formula, and the corresponding type format is converted through the converter for display.
In an exemplary embodiment, when the combined data is displayed, for the combined data under each effective date corresponding to each displayed object instance, historical combined data and non-effective combined data of the object instance can be associated with the displayed combined data, specifically can be stored as secondary content in a field value of the displayed combined data, and the combined data of a certain object instance under other effective dates can be checked through triggering details, wherein each associated combined data is the combined data of metadata version of the object instance under the same effective date and content version of content. Specifically, the combined data corresponding to the effective date may be presented by specifying the effective date by the user.
In an exemplary embodiment, the user may input certain data description information and a ranking rule, so that the combined data obtained by the query is ranked according to the ranking rule. For example, assuming that the current interface displays the combined data of all object instances of the object "staff" under a certain effective date, when the user inputs the data description information "name" and sets the corresponding ordering rule as "a to Z", the combined data of all object instances displayed on the current page is rearranged according to the ordering rule for "name", so that the data is more regular and convenient for the user to browse.
It should be noted that the presentation form in the drawings in the present specification is only one of a plurality of presentation forms that can be realized by the embodiments in the present specification, and may also be presented by means of manuscripts, etc., and those skilled in the art can select an appropriate presentation form according to requirements, which is not limited in the present specification.
In the embodiment of the specification, metadata of a plurality of metadata versions corresponding to at least one object and contents of a plurality of content versions are stored in a storage space, the metadata of the plurality of metadata versions respectively correspond to different metadata effective dates, the contents of the plurality of content versions respectively correspond to different content effective dates, a data query request aiming at the storage space is received, the metadata of a target metadata version and the contents of the target content version matched with the query condition are queried in the storage space, a query result is returned after the combination, the versioning of the metadata and the contents is accurate to the effective date, and the coexistence of historical versions of the metadata and the contents and the accurate query of the metadata of the target metadata version and the contents of the target content version are realized.
Corresponding to the embodiments of the method described above, the present description also provides embodiments of the apparatus.
As shown in fig. 6, fig. 6 is a block diagram of a data query apparatus according to an exemplary embodiment of the present specification, the apparatus comprising:
a query unit 601, configured to receive a data query request for a storage space, where metadata of a plurality of metadata versions and contents of a plurality of content versions corresponding to at least one object are stored in the storage space; wherein the metadata of the metadata versions respectively correspond to different metadata effective dates, and the content of the content versions respectively correspond to different content effective dates;
a matching unit 602, configured to query, according to a query condition indicated by the data query request, metadata of a target metadata version and contents of a target content version that match the query condition from the storage space;
and a combining unit 603, configured to combine and return the metadata of the target metadata version and the content of the target content version.
In an exemplary embodiment, the storage space includes a metadata storage space for storing metadata of respective versions and a content storage space for storing content of respective versions, which are independent of each other.
In an exemplary embodiment, the query conditions include at least one of: information of target object instance and target moment; wherein:
if the query condition includes information of a target object instance, metadata of the target metadata version includes metadata of all versions belonging to the target object instance, and contents of the target content version include contents of all versions belonging to the target object instance;
if the query condition includes a target time, metadata of the target metadata version includes metadata having a corresponding effective date closest to the target time but not later than the target time, and content of the target content version includes content having a corresponding effective date not later than the target time.
In an exemplary embodiment, the metadata of the target metadata version includes data description information and attribute information corresponding to the data description information, and the content of the target content version includes a data value and attribute information corresponding to the data value;
the combining the metadata of the target metadata version with the content of the target content version includes:
grouping metadata of the target metadata version and contents of the target content version according to attribute information, wherein each group of data comprises data description information and data values corresponding to the same attribute;
The data of each group are combined separately.
In an exemplary embodiment, if the query condition includes information of a target object instance, the data query request further includes target data description information and a target data value condition, where the target data description information is any one of metadata of a target metadata version corresponding to the target object instance;
and screening the content of the content version, the data value of which is matched with the target data value condition, as the content of the target content version according to the target data description information, wherein the target data value condition is the same as the attribute information corresponding to the target data description information.
In an exemplary embodiment, combining any one set of data includes:
if the data description information in any group of data does not contain a content restoration formula, combining the data description information in any group of data as a field and the data value in any group of data as a field value;
if the data description information in any group of data contains a content restoration formula, determining the related data value from the content of the target content version according to the content restoration formula, calculating, and combining the data description information in any group of data as a field and the calculation result as a field value.
In an exemplary embodiment, the metadata includes type information corresponding to the data description information, and the method further includes:
if the type of any data description information in the metadata of the target metadata version is an object, determining a unique identifier of the object in the content of the target content version, inquiring by taking the unique identifier as an inquiry condition, and taking an obtained inquiry result as a secondary content corresponding to a group to which the any data description information belongs;
and the secondary content is displayed after the field value corresponding to the packet to which any data description information belongs is triggered.
The implementation process of the functions and roles of each module in the above device is specifically shown in the implementation process of the corresponding steps in the above method, and will not be described herein again.
Fig. 7 is a schematic structural view of an electronic device according to an exemplary embodiment of the present specification. Referring to fig. 7, at the hardware level, the electronic device includes a processor 701, an internal bus 702, a network interface 703, a memory 704, and a non-volatile storage 705, although it is possible to include hardware required for other services. The processor 701 reads a corresponding computer program from the nonvolatile memory 705 into the memory 704 and then runs. Of course, other implementations, such as logic devices or combinations of hardware and software, are not excluded from the present application, that is, the execution subject of the following processing flows is not limited to each logic unit, but may be hardware or logic devices.
The apparatus or module set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or a combination of any of these devices.
The present application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a data querying method as shown in any of the foregoing embodiments.
In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, read only compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by the computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing description of the preferred embodiments of the application is not intended to be limiting, but rather to enable any modification, equivalent replacement, improvement or the like to be made within the spirit and principles of the application.

Claims (10)

1. A method of querying data, comprising:
receiving a data query request aiming at a storage space, wherein the storage space stores metadata of a plurality of metadata versions and contents of a plurality of content versions corresponding to at least one object; wherein the metadata of the metadata versions respectively correspond to different metadata effective dates, and the content of the content versions respectively correspond to different content effective dates;
inquiring metadata of a target metadata version and contents of a target content version matched with the inquiry conditions from the storage space according to the inquiry conditions indicated by the data inquiry request;
and combining the metadata of the target metadata version and the content of the target content version and returning.
2. The method of claim 1, wherein the storage space comprises a metadata storage space and a content storage space that are independent of each other, the metadata storage space for storing respective versions of metadata, and the content storage space for storing respective versions of content.
3. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the query conditions include at least one of: information of target object instance and target moment; wherein:
if the query condition includes information of a target object instance, metadata of the target metadata version includes metadata of all versions belonging to the target object instance, and contents of the target content version include contents of all versions belonging to the target object instance;
if the query condition includes a target time, metadata of the target metadata version includes metadata having a corresponding effective date closest to the target time but not later than the target time, and content of the target content version includes content having a corresponding effective date not later than the target time.
4. The method of claim 1, wherein the metadata of the target metadata version includes data description information and attribute information corresponding to the data description information, and the content of the target content version includes a data value and attribute information corresponding to the data value;
the combining the metadata of the target metadata version with the content of the target content version includes:
Grouping metadata of the target metadata version and contents of the target content version according to attribute information, wherein each group of data comprises data description information and data values corresponding to the same attribute;
the data of each group are combined separately.
5. The method of claim 4, wherein if the query condition includes information of a target object instance, the data query request further includes target data description information and a target data value condition, the target data description information is any one of metadata of a target metadata version corresponding to the target object instance;
and screening the content of the content version, the data value of which is matched with the target data value condition, as the content of the target content version according to the target data description information, wherein the target data value condition is the same as the attribute information corresponding to the target data description information.
6. The method of claim 4, wherein combining any set of data comprises:
if the data description information in any group of data does not contain a content restoration formula, combining the data description information in any group of data as a field and the data value in any group of data as a field value;
If the data description information in any group of data contains a content restoration formula, determining the related data value from the content of the target content version according to the content restoration formula, calculating, and combining the data description information in any group of data as a field and the calculation result as a field value.
7. The method of claim 6, wherein the metadata includes type information corresponding to data description information, and the method further comprises:
if the type of any data description information in the metadata of the target metadata version is an object, determining a unique identifier of the object in the content of the target content version, inquiring by taking the unique identifier as an inquiry condition, and taking an obtained inquiry result as a secondary content corresponding to a group to which the any data description information belongs;
and the secondary content is displayed after the field value corresponding to the packet to which any data description information belongs is triggered.
8. A data query device, comprising:
the query unit is used for receiving a data query request aiming at a storage space, wherein metadata of a plurality of metadata versions and contents of a plurality of content versions corresponding to at least one object are stored in the storage space; wherein the metadata of the metadata versions respectively correspond to different metadata effective dates, and the content of the content versions respectively correspond to different content effective dates;
A matching unit, configured to query, according to a query condition indicated by the data query request, metadata of a target metadata version and contents of a target content version that match the query condition from the storage space;
and the combining unit is used for combining the metadata of the target metadata version and the content of the target content version and returning the metadata of the target metadata version and the content of the target content version.
9. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the method of any 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, implement the steps of the method of any of claims 1-7.
CN202311235399.7A 2023-09-22 2023-09-22 Data query method, device, equipment and storage medium Pending CN117112652A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311235399.7A CN117112652A (en) 2023-09-22 2023-09-22 Data query method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311235399.7A CN117112652A (en) 2023-09-22 2023-09-22 Data query method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117112652A true CN117112652A (en) 2023-11-24

Family

ID=88798431

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311235399.7A Pending CN117112652A (en) 2023-09-22 2023-09-22 Data query method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117112652A (en)

Similar Documents

Publication Publication Date Title
US9779122B2 (en) Optimizing a content index for target audience queries
CN102368252B (en) Applying search inquiry in content set
US11822560B2 (en) Rank query results for relevance utilizing external context
US20090094189A1 (en) Methods, systems, and computer program products for managing tags added by users engaged in social tagging of content
US9251130B1 (en) Tagging annotations of electronic books
US11120057B1 (en) Metadata indexing
US20100169326A1 (en) Method, apparatus and computer program product for providing analysis and visualization of content items association
US11216516B2 (en) Method and system for scalable search using microservice and cloud based search with records indexes
US10776571B2 (en) Dispatch of user input to multiple input fields in a user interface
KR20080005531A (en) Query compositi0n using autolists
US9846697B2 (en) Indexing data updates associated with an electronic catalog system
US8620946B2 (en) Storage and searching of temporal entity information
KR101475335B1 (en) Enhancing an inquiry for a search of a database
US20220253484A1 (en) Dynamically-qualified aggregate relationship system in genealogical databases
CN104182413A (en) Method and system for recommending multimedia content
EP2889788A1 (en) Accessing information content in a database platform using metadata
CN110188100A (en) Data processing method, device and computer storage medium
CN105760380A (en) Database query method, device and system
WO2019233095A1 (en) Information presenting method, and terminal device and network device thereof
US11934467B2 (en) Advanced keyword search
CN105426449A (en) Method and device for massive data query and server
CN104808995B (en) A kind of method and apparatus for across application collection application content
JP4287464B2 (en) System infrastructure configuration development support system and support method
CN107622090A (en) Acquisition methods, the apparatus and system of object
CN117112652A (en) Data query method, device, equipment 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