Method and system for generating query form and method and system for generating data model
By generating query forms and encapsulating the reference relationships between data models, the complexity and performance bottlenecks of traditional data tracing and querying methods are solved, enabling efficient data querying and intuitive viewing across data models.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-21
AI Technical Summary
Traditional data tracing and querying methods are difficult to use in fields such as biomedicine, chemical experiments, and materials research and development, and have obvious performance bottlenecks. Users find it difficult to intuitively and efficiently trace the lineage of data scattered across different data models.
By creating query paths, the starting model is connected to multiple target models and target fields to generate a query form. The query items encapsulate the reference relationships between data models, allowing users to perform cross-data model data queries on the query form.
It simplifies the user's query process, improves the flexibility and efficiency of queries, and allows users to intuitively view data based on different query paths, reducing the difficulty of operation.
Smart Images

Figure CN121901245A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information management, specifically to a method and system for generating query forms, a method and system for generating data models, an electronic device, and a storage medium. Background Technology
[0002] In information management systems, especially in scientific research and production fields such as biomedicine, chemical experiments, and materials development, Electronic Lab Notebooks (ELNs) or Laboratory Information Management Systems (LIMS) are commonly used to manage experimental processes and data. The core of these systems is data modeling, which abstracts entities in the experiment (such as samples, reagents, consumables, equipment, projects, and experimental operations) into different data models. Each data model can establish reference relationships with other data models through specific association fields (such as foreign keys) to perform data traceability queries or lineage analysis, i.e., to view all related data (such as the reagents, equipment, and consumables used) for a specific entity (such as an experimental sample).
[0003] Traditional data tracing and querying methods suffer from high query difficulty and performance bottlenecks. Typically, tracing queries require repeated jumping and navigation between multiple data models. Even if data with a reference relationship to the data being queried is finally found, the query results are usually scattered across different pages, making it difficult for users to intuitively and efficiently trace the data lineage relationships scattered across different data models (such as samples, reagents, equipment, projects, etc.). Summary of the Invention
[0004] This invention addresses the aforementioned problems. It provides a method and system for generating query forms, a method and system for generating data models, and a storage medium. This approach abstracts and encapsulates the reference relationships between data models into a query form through query items, allowing users to perform cross-data model data queries, which greatly simplifies the user's query operation.
[0005] According to one aspect of the present invention, a method for generating a query form is provided, for creating a query form for a starting model, the method comprising: creating at least one query path, the query path comprising a starting model and at least one target model and a target field of a last target model connected in sequence, wherein the starting model and at least one target model are at least some of a plurality of preset data models, each two adjacent data models in the query path have a preset reference relationship, and each of the at least one query path contains at least partially different target models and / or different target fields; generating a target query item corresponding to the query path on the query form based on each of the at least one query path, so as to obtain a query form containing the target query item.
[0006] Optionally, creating at least one query path includes: in response to a first model selection instruction input by the user, determining a starting model among multiple data models; in response to a second model selection instruction input by the user, determining a next target model among at least a subset of data models that have a preset reference relationship with the most recently determined data model in the query path, until the last target model of the query path is determined; in response to a field selection instruction input by the user, determining a target field of the last target model among at least a subset of fields of the last target model; and determining the query path based on the starting model, at least one target model, and the target field of the last target model.
[0007] Optionally, the method further includes: controlling the display window to output and display the identification information of the most recently determined data model in the query path, the identification information of at least some data models that have a preset reference relationship with the most recently determined data model, and at least some fields of the last target model in a hierarchical menu; in the hierarchical menu, the identification information of the most recently determined data model in the query path is the parent menu of the identification information of at least some data models that have a preset reference relationship with the most recently determined data model, and the identification information of the last target model is the parent menu of at least some fields of the last target model; the first model selection instruction, the second model selection instruction, and the field selection instruction are selection instructions for menu input in the hierarchical menu.
[0008] Optionally, at least some of the data model identification information is a second-level submenu of the identification information of the most recently determined data model. The first-level submenu of the identification information of the most recently determined data model includes forward reference selection information and / or reverse reference selection information. The first-level submenu of the forward reference selection information includes data models that can be referenced unidirectionally by the most recently determined data model, and the first-level submenu of the reverse reference selection information includes data models that can be referenced unidirectionally by the most recently determined data model.
[0009] Optionally, in response to a second model selection instruction input by the user, the next target model is determined from at least a subset of data models that have a preset reference relationship with the most recently determined data model in the query path, until the last target model of the query path is determined, at least one query path is created, further comprising: in response to a model filtering operation, determining a first data model category to be filtered out or a second data model category to be retained when creating the query path, wherein at least a subset of data models are data models of other data model categories besides the first data model category, or are data models of the second data model category.
[0010] Optionally, the preset referencing relationships include forward referencing relationships and / or reverse referencing relationships. A forward referencing relationship indicates that the current data model can unidirectionally refer to other data models, while a reverse referencing relationship indicates that the current data model can be unidirectionally referenced by other data models.
[0011] Optionally, after generating the target query item corresponding to each query path on the query form based on at least one query path, the method further includes: determining the query instance in the initial model; and determining the query result of the target query item of the query instance under the query path based on the query path corresponding to each target query item.
[0012] Optionally, determining the query instances in the initial model includes: in response to a user's batch add operation on the query form, importing multiple query instances with the batch add operation instruction into the query form.
[0013] Optionally, each of the multiple data models belongs to a preset model category, and at least some of the data models in the query path have different model categories.
[0014] According to another aspect of the present invention, a query form generation system is also provided for creating a query form for a starting model. The system includes: a creation module for creating at least one query path, the query path including a starting model and at least one target model and a target field of the last target model connected in sequence, the starting model and at least one target model being at least some of a plurality of preset data models, each two adjacent data models in the query path having a preset reference relationship, and each of the at least one query path containing at least partially different target models and / or different target fields; and a generation module for generating target query items corresponding to the query path on the query form based on each query path of the at least one query path, so as to obtain a query form containing target query items.
[0015] According to another aspect of the present invention, a data model generation method is also provided for creating a data model as described above. The method includes: creating a plurality of data models, each of the plurality of data models including at least one instance, each instance of the at least one instance representing experimental data; for each of the plurality of data models, creating a first preset reference relationship between the data model and one or more other data models; for every two data models having the first preset reference relationship, creating a second preset reference relationship between each instance of at least a portion of the instances of one data model and at least a portion of the instances of the other data model, wherein the data models in the query path are at least a portion of the plurality of data models.
[0016] According to another aspect of the present invention, a data model generation system is also provided for creating data models as described above. The system includes: a first creation module for creating a plurality of data models, each of the plurality of data models including at least one instance, each instance of the at least one instance representing experimental data; a second creation module for creating a first preset reference relationship between each of the plurality of data models and one or more other data models; and a third creation module for creating a second preset reference relationship between each instance of at least a portion of the instances of one data model and at least a portion of the instances of the other data model for every two data models having the first preset reference relationship, wherein the data models in the query path are at least a portion of the plurality of data models.
[0017] According to another aspect of the present invention, an electronic device is also provided, including a processor and a memory, characterized in that the memory stores computer program instructions, which are executed by the processor to perform a query form generation method and / or a data model generation method as described above.
[0018] According to another aspect of the present invention, a storage medium is also provided, on which program instructions are stored, which, when executed, are used to perform the above-described query form generation method and / or data model generation method.
[0019] The aforementioned technical solution encapsulates complex data lineage relationships into target query items by creating a query path that includes a starting model, at least one target model, and a target field, and by creating target query items based on the query items. This allows for the separation of user data query needs from complex underlying database query logic, thereby reducing the operational difficulty for users. Furthermore, this solution supports the creation of at least one query path on the query form, with each query path having at least partially different data models and / or different target fields. This allows for the construction of multiple different query paths based on the same query starting point, resulting in high query flexibility. In particular, the ability to create multiple target query items on the query form facilitates users' intuitive and efficient viewing of data retrieved based on different query paths.
[0020] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0021] The above and other objects, features, and advantages of the present invention will become more apparent from the more detailed description of the embodiments of the invention in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same parts or steps.
[0022] Figure 1 A schematic flowchart illustrating a method for generating a query form according to an embodiment of the present invention is shown;
[0023] Figure 2 A schematic diagram of a hierarchical menu according to an embodiment of the present invention is shown;
[0024] Figure 3 A schematic diagram of a menu for selecting a target field in a hierarchical menu according to an embodiment of the present invention is shown;
[0025] Figure 4 A schematic flowchart of a query form generation system according to an embodiment of the present invention is shown;
[0026] Figure 5 A schematic block diagram of a data model generation method according to an embodiment of the present invention is shown;
[0027] Figure 6 A schematic block diagram of an electronic device according to an embodiment of the present invention is shown. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the present invention more apparent, exemplary embodiments according to the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely a part of the embodiments of the present invention, and not all of the embodiments of the present invention. It should be understood that the present invention is not limited to the exemplary embodiments described herein. Based on the embodiments of the present invention described herein, all other embodiments obtained by those skilled in the art without inventive effort should fall within the protection scope of the present invention.
[0029] To at least partially solve the aforementioned technical problems, embodiments of the present invention provide a method and system for generating query forms, a method and system for generating data models, and a storage medium. This solution abstracts and encapsulates the reference relationships between data models into a query form through query items, allowing users to perform cross-data model data queries using the query form, which greatly simplifies the user's query operation.
[0030] Please see Figure 1The diagram shown is a schematic flowchart of a query form generation method according to an embodiment of the present invention. According to one aspect of the present invention, a query form generation method is provided for creating a query form for a starting model, the method comprising steps S110 and S120.
[0031] For example, the query form in this embodiment of the invention is used to query experimental data. Experimental data may include, but is not limited to, sample data, reagent data, consumable data, equipment data, project data, experimental record data, and catalog data. This embodiment of the invention does not specifically limit the type of experimental data; any experimental data that can be represented by a data model can be queried using the query items in the query form of this embodiment. Before executing step S110, one or more data models have been constructed, and the reference relationships between data models have been set according to the actual situation. Those skilled in the art will understand that the reference relationships between data models and between instances can be established by setting primary keys and foreign keys.
[0032] In step S110, at least one query path is created. The query path includes a starting model and at least one target model connected in sequence, as well as the target field of the last target model. The starting model and at least one target model are at least some of the preset data models. There is a preset reference relationship between each two adjacent data models in the query path. Each of the at least one query path contains at least partially different target models and / or different target fields.
[0033] For example, the starting model can be a data model selected by the user from multiple pre-built data models based on their query requirements. For each query path, the query path includes a starting model and one or more target models corresponding to that starting model, each target model also being a data model among the pre-built data models. The first data model on the query path is the starting model, and the starting model is sequentially connected to each target model. For every two adjacent data models on the query path, there is a pre-defined reference relationship between them. For example, each data model can include one or more instances, which can represent experimental data. Furthermore, each data model can have one or more fields, and the fields can define data types. Taking a sample data model as an example, it can include fields such as "sample ID," "colony count," and "creation time." Each sample instance can have specific values under each field of its respective data model, and these specific values can represent the experimental data of the corresponding sample. For example, a sample instance with a specific value of 47 under the "colony count" field can indicate that the colony count of the corresponding sample is 47. It can be understood that the target fields are fields selected by the user from the fields of the last data model in the query path. For example, the data models contained in each query path can be exactly the same, in which case the target fields of each query path are different from each other. Alternatively, the data models contained in each query path can be at least partially different, in which case the target fields of each query path can be the same or different.
[0034] In step S120, a target query item corresponding to the query path is generated on the query form based on each query path of at least one query path, so as to obtain a query form containing the target query item.
[0035] For example, the query form has a pre-defined standardized framework, within which corresponding target query items can be generated based on each query path. The target query item is used to determine the specific value corresponding to the target field of the target instance in the last data model based on the query instance of the starting model. The target instance is an instance in the last target model that has a reference relationship with the query instance.
[0036] The aforementioned technical solution encapsulates complex data lineage relationships into target query items by creating a query path that includes a starting model, at least one target model, and a target field, and by creating target query items based on the query items. This allows for the separation of user data query needs from complex underlying database query logic, thereby reducing the operational difficulty for users. Furthermore, this solution supports the creation of at least one query path on the query form, with each query path having at least partially different data models and / or different target fields. This allows for the construction of multiple different query paths based on the same query starting point, resulting in high query flexibility. In particular, the ability to create multiple target query items on the query form facilitates users' intuitive and efficient viewing of data retrieved based on different query paths.
[0037] Optionally, creating at least one query path includes: in response to a first model selection instruction input by the user, determining a starting model among multiple data models; in response to a second model selection instruction input by the user, determining a next target model among at least a subset of data models that have a preset reference relationship with the most recently determined data model in the query path, until the last target model of the query path is determined; in response to a field selection instruction input by the user, determining a target field of the last target model among at least a subset of fields of the last target model; and determining the query path based on the starting model, at least one target model, and the target field of the last target model.
[0038] For example, in step S110, the user can input a first model selection instruction for a plurality of preset data models to determine the starting model. For each newly determined data model in the query path, there may be one or more data models with a preset reference relationship with the preset data model. The user can input a second model selection instruction for at least some of the data models in the one or more data models. The second model selection instruction is used to indicate the next target model in the query path. The next target model can be determined for the starting model and each target model until the last target model of the query path is determined. The user can also input a field selection instruction for at least some fields of the last data model. The field selection instruction is used to indicate the target fields. The query path can be constructed using the starting model, each target model, and the target fields of the last target model. It should be noted that in the process of creating any query path, the first determined data model can be used as the starting model on the query path, and the data models not determined for the first time can be used as target models on the query path. Therefore, the "newly determined data model" can refer to either the first determined starting model or the target model determined for each time except the last one.
[0039] In one specific embodiment, the user first selects a data model from multiple created data models by inputting a first model selection command. This data model is denoted as data model A, and it is the starting model on the query path. At this point, data model A is the most recently selected data model in the query path. The user can then input a second model selection command for data model A to select the next target model from among the data models that have a preset reference relationship with data model A. This target model is denoted as data model B, and it is the second data model in the query path. If the user selects data model B as the last target model in the query path, the user does not need to input a second model selection command for data model B again. If the user still needs to select the next target model for data model B, then data model B is the most recently selected data model in the query path. The user can continue to input a second model selection command for data model B to select the next target model from among the data models that have a preset reference relationship with data model B, and so on, until the last target model is selected. It is understandable that during the creation of a query path, each time a data model is determined in the query path, if the data model determined in this instance is not the last data model in the query path, then the data model determined in this instance is taken as the latest determined data model.
[0040] It can be understood that on each query path, there is a pre-defined reference relationship between the starting model and the next target model of the starting model, and a pre-defined reference relationship between the last target model and the previous target model of the last target model; for each target model on the query path other than the starting model and the last target model, there is a pre-defined reference relationship between the target model and the previous data model (which may be the starting model or the target model) of the target model in the query path, and there is a pre-defined reference relationship between the target model and the next target model of the target model in the query path.
[0041] For example, a predefined reference relationship refers to a predefined association established between different data models. For instance, in an experimental process, multiple initial samples become multiple intermediate samples after a certain experimental operation; therefore, the initial samples and intermediate samples can be considered to have an association relationship. The sample data of multiple initial samples is abstracted into an initial sample data model, and the sample data models of multiple intermediate samples are abstracted into an intermediate sample data model. Since the initial samples and intermediate samples have an association relationship, to represent this association relationship at the data modeling level, a predefined reference relationship can be established between the initial sample data model and the intermediate sample data model through primary and foreign keys. For example, the predefined reference relationship can have a direction. It can be understood that since intermediate samples can be obtained based on initial samples, the direction of the association relationship is initial sample to intermediate sample. Accordingly, the direction of the predefined reference relationship between the initial sample data model and the intermediate sample data model should be initial sample data model to intermediate sample data model. Therefore, the established predefined reference relationship satisfies the following condition: the initial sample data model can unidirectionally reference the intermediate sample data model; in other words, the intermediate sample data model can be unidirectionally referenced by the initial sample data model. The predefined reference relationship will be further described in the following embodiments and will not be repeated here.
[0042] This approach allows users to select the next target model for each newly determined data model. Users can flexibly configure the query path according to their query needs, and it ensures that there is a reference relationship between every two adjacent data models in the user's configured query path. This ensures that the reference logic of the data models connected sequentially in the query path will not be interrupted.
[0043] Optionally, the method further includes: controlling the display window to output and display the identification information of the most recently determined data model in the query path, the identification information of at least some data models that have a preset reference relationship with the most recently determined data model, and at least some fields of the last target model in a hierarchical menu; in the hierarchical menu, the identification information of the most recently determined data model in the query path is the parent menu of the identification information of at least some data models that have a preset reference relationship with the most recently determined data model, and the identification information of the last target model is the parent menu of at least some fields of the last target model; the first model selection instruction, the second model selection instruction, and the field selection instruction are selection instructions for menu input in the hierarchical menu.
[0044] For example, each data model has unique identification information, such as the data model's name, ID, or code. For each newly determined data model, the hierarchical menu can display its identification information, as well as the identification information of at least some data models (which the user may be filtering) that have a pre-defined reference relationship with it. The hierarchical menu has a parent-child structure. When the identification information of the newly determined data model is the parent menu (i.e., the supervising menu), the identification information of data models with a pre-defined reference relationship can be used as sub-menus. When the identification information of the last target model is the parent menu, at least some fields of the last target model can be used as sub-menus. Users can input first model selection commands, second model selection commands, and field selection commands within the hierarchical menu. This approach presents the abstract reference relationships between data models to the user through a visual hierarchical structure. Users can quickly select the next target model simply by selecting the identification information of the data models presented in the menu, reducing the user's operational threshold and intuitively demonstrating the hierarchical reference relationships between data models.
[0045] Optionally, at least some of the data model identification information is a second-level submenu of the identification information of the most recently determined data model. The first-level submenu of the identification information of the most recently determined data model includes forward reference selection information and / or reverse reference selection information. The first-level submenu of the forward reference selection information includes data models that can be referenced unidirectionally by the most recently determined data model, and the first-level submenu of the reverse reference selection information includes data models that can be referenced unidirectionally by the most recently determined data model.
[0046] Please see Figure 2 The diagram shown is a schematic representation of a hierarchical menu according to an embodiment of the present invention. Figure 2 In the illustrated embodiment, the identifier of the starting model is "sample_test_one". The first-level submenu of the identifier "sample_test_one" includes a "Forward Lookup" option (i.e., selection information for forward references) and a "Reverse Lookup" option (i.e., selection information for reverse references). Clicking "Forward Lookup" will display the identifier information of the data models that the starting model can unidirectionally reference. Figure 2 In the illustrated embodiment, the initial model can unidirectionally reference two data models, each with the identifiers "associated sample sample02" and "associated current sample". Figure 2As can be seen, the identifier information of the data model that can be referenced unidirectionally by the initial model is a first-level submenu of the "Forward Query" option for the identifier information "sample_test_one," which is also a second-level submenu of the initial model's identifier information "sample_test_one." Similarly, when the user clicks "Reverse Query," the identifier information of the data model that can be referenced unidirectionally by the initial model will be displayed. The identifier information of the data model that can be referenced unidirectionally by the initial model is a first-level submenu of the "Reverse Query" option for the identifier information "sample_test_one," which is also a second-level submenu of the initial model's identifier information "sample_test_one." Figure 2 In the illustrated embodiment, the first target model of the query path selected by the user is the data model with the identifier "related sample sample02". The first-level submenu of the identifier of the first target model also includes "forward query" and "reverse query" options. After clicking "reverse query", the second-level submenu displaying the identifier of the first target model under the "reverse query" option expands, showing three data models that can unidirectionally reference the starting model, each with the second identifier "testyan1", "sample_test_one", and "sample_test_three" respectively. It should be noted that, denoted as data model A and the first target model B, data model A can unidirectionally reference data model B. When data model A is the latest data model, data model B is a data model that data model A can unidirectionally reference; when data model B is the latest data model, data model A is a data model that can unidirectionally reference data model B. Therefore, the data models that can unidirectionally reference the first target model include the data model with the identifier "sample_test_one". Figure 2 In the illustrated embodiment, the data model identified as "sample_test_one" also serves as the second target model. The first-level submenu of the second target model's identification information also includes "Forward Query" and "Reverse Query" options. Clicking "Forward Query" expands to display the second-level submenu of the second target model's identification information under the "Forward Query" option. The identification information of the data models that the second target model can reference unidirectionally is "Associated with sample02" and "Associated with current sample," respectively. The third target model selected by the user (i.e., the last target model) is the data model with the identification information "Associated with sample02." It can be understood that in... Figure 2In the illustrated embodiment, the data models of the query path are arranged in the following order: the data model with the identifier "sample_test_one", the data model with the identifier "related sample sample02", the data model with the identifier "sample_test_one", and the data model with the identifier "related sample sample02".
[0047] Please see Figure 3 As shown, this is a schematic diagram of a menu for selecting a target field in a hierarchical menu according to an embodiment of the present invention. Figure 2 In the illustrated embodiment, after determining the last target model, one can click "Next," and in response to clicking "Next," the process will jump to... Figure 3 The menu shown, with the data model identified as "Associated Sample 02", includes the following fields: Entity ID, Data Volume, Associated Sample 01, Associated Sample 03, Board ID, Hole ID, OD Value, Transfer Date, and Whether it is Abnormal. Users can select one of these fields as the target field.
[0048] The above technical solution uses reference types as the first-level sub-menu of the newly determined data model, and data models with preset reference relationships to the newly determined data model as the second-level sub-menu. This intuitively distinguishes between forward and reverse reference relationships, allowing users to accurately locate the next target model and simplifying the model selection process. Furthermore, by using reference types as the first-level sub-menu and data models with preset reference relationships to the newly determined data model as the second-level sub-menu, the referencing logic of the data models is clearly displayed, helping to reduce invalid operations and enabling users to quickly filter data models with the desired referencing direction, thereby improving interaction accuracy and query efficiency.
[0049] Optionally, in response to a second model selection instruction input by the user, the next target model is determined from at least a subset of data models that have a preset reference relationship with the most recently determined data model in the query path, until the last target model of the query path is determined, at least one query path is created, further comprising: in response to a model filtering operation, determining a first data model category to be filtered out or a second data model category to be retained when creating the query path, wherein at least a subset of data models are data models of other data model categories besides the first data model category, or are data models of the second data model category.
[0050] For example, data models can be categorized, such as sample data models, reagent data models, consumable data models, equipment data models, project data models, experimental record data models, catalog data models, etc. Users can choose either a first or second data model category based on their actual query needs. After performing model filtering, when creating a query path, the data models provided for selecting the next target model for each newly determined data model will either not include data models belonging to the first data model category, or only include data models belonging to the second data model category. This approach allows for flexible narrowing of the range of selectable data models for the next target model based on the user's actual query needs, making it easier for users to find data models belonging to their desired category.
[0051] Optionally, the preset referencing relationships include forward referencing relationships and / or reverse referencing relationships. A forward referencing relationship indicates that the current data model can unidirectionally refer to other data models, while a reverse referencing relationship indicates that the current data model can be unidirectionally referenced by other data models.
[0052] For example, the pre-defined reference relationships between data models are directional, and unidirectional reference relationships can be established through primary and foreign keys. A forward reference refers to starting with a data model that has a foreign key and moving along the direction of the foreign key's reference to the primary key (i.e., from foreign key to primary key) to reference a data model that has the referenced primary key. A reverse reference refers to starting with a data model that has the referenced primary key and moving against the direction of the foreign key's definition (i.e., from the referenced primary key to the foreign key) to reference all other data models that reference that primary key through foreign keys. If the current data model has a valid foreign key, and that foreign key can point to the corresponding primary key data model, then the current data model can unidirectionally reference that primary key data model. If the current data model has a primary key, and that primary key is referenced by other data models through foreign keys, then the current data model can be unidirectionally referenced by those other data models.
[0053] In the query path of this invention, the next target model for each newly determined data model can be a data model with a positive reference relationship to the newly determined data model, or it can be a data model with a negative reference relationship to the newly determined data model. Users can flexibly choose the query direction according to their actual query needs without being limited to a single reference path, which can simplify the query operation, improve query efficiency and scenario adaptability, and better meet diverse actual query needs.
[0054] Optionally, after generating the target query item corresponding to each query path on the query form based on at least one query path, the method further includes: determining the query instance in the initial model; and determining the query result of the target query item of the query instance under the query path based on the query path corresponding to each target query item.
[0055] For example, a user can select one or more instances from the instances of the starting model as the instances to be queried. Since there are pre-defined reference relationships between every two adjacent data models on the query path, for any instance of any data model among every two adjacent data models, that instance may be pre-established to have a reference relationship with one or more instances in another data model. For example, if a sample is obtained through a certain device, the user can establish a reference relationship between the sample instance corresponding to that sample and the device instance corresponding to that device. For example, the starting model can be used as the first current data model on the query path. For the instance to be queried in the current data model, it can have a reference relationship with one or more instances in the next data model on the query path. The next data model can be used as the new current data model on the query path. Similarly, instances previously determined to have a reference relationship with the instance to be queried can also have a reference relationship with one or more instances in the next data model on the query path. This process continues, and the reference relationships between instances can be passed along the query path until the last data model is reached, where an instance with a reference relationship to the instance to be queried can be obtained, denoted as the target instance. The target instance has a specific value corresponding to the target field, which can be used as the query result of the target query item.
[0056] In one specific embodiment, each data model has a preset field, and each instance of the data model has a unique specific value corresponding to the preset field. The unique specific value corresponding to the preset field is used to indicate the corresponding instance. The preset field may be, for example, entity ID, name, etc. A query path includes data model A, data model B, and data model C, where the target field of data model C is "entity ID". If the user inputs a specific value of 0011 for the preset field, then the instance to be queried is the instance in data model A whose specific value corresponding to the preset field is 0011. After determining the instance to be queried, instances with a reference relationship to the instance to be queried can be determined in data model B. In this embodiment, the number of instances determined in data model B is two, with their respective specific values corresponding to the preset field being 0023 and 0025, respectively denoted as instance 0023 and instance 0025. Then, instances with a reference relationship to instance 0023 of data model B and instances with a reference relationship to instance 0025 of data model B can be determined in data model C. In this embodiment, the number of instances with a reference relationship to instance 0023 determined in data model C is two, and their specific values corresponding to the preset field are 0031 and 0032, respectively, denoted as instance 0031 and instance 0032. The number of instances with a reference relationship to instance 0025 determined in data model C is one, and its specific value corresponding to the preset field is 0037, denoted as instance 0037. If the target field is the colony count, the specific values corresponding to the colony count for instances 0031, 0032, and 0037 can be determined. It should be noted that there is a situation where there is no instance with a reference relationship to the instance to be queried in data model B, or there is no instance with a reference relationship to the instance determined in data model B in data model C. In this case, the determined target instance is empty, and correspondingly, the specific value of the determined target instance corresponding to the target field is also empty, that is, the query result of the target query item corresponding to the query path is empty.
[0057] The above technical solution utilizes the reference relationship between instances of adjacent data models on the query path of the target query item to determine the query results for the instance to be queried. It can automatically and efficiently determine the data that the user wants to query. Especially when there are multiple data models on the query path, this solution can automatically find the target instance that has a reference relationship with the instance to be queried across multiple data models along the query path, and can automatically determine the specific value corresponding to the target field of the target instance. This can greatly simplify the user's query operation and eliminate the need for the user to repeatedly jump and navigate between multiple data models.
[0058] Optionally, determining the query instances in the initial model includes: in response to a user's batch add operation on the query form, importing multiple query instances with the batch add operation instruction into the query form.
[0059] For example, when a user selects instances to be queried, the display window can show all instances of the initial model. The user can select one or more instances, which can then be added as instances. When the user performs a batch add operation to determine the final number of instances to be added (i.e., multiple instances to be queried), the multiple instances indicated by the batch add operation can be imported into the query form. This approach allows users to add instances to be queried in batches, eliminating the need for users to perform the operation of selecting individual instances multiple times, thus saving time and increasing efficiency.
[0060] Optionally, each of the multiple data models belongs to a preset model category, and at least some of the data models in the query path have different model categories.
[0061] For example, in experimental operations, entities such as equipment, samples, consumables, and experimental records can all have relationships. After abstracting entities into data models, the relationships between entities can be abstracted into reference relationships between data models. To query the relationships between different types of entities, query paths can be created with different model categories for the included data models. This improves the flexibility of querying heterogeneous entities.
[0062] Please see Figure 4 The diagram shown is a schematic block diagram of a query form generation system 400 according to an embodiment of the present invention. According to another aspect of the present invention, a query form generation system is also provided for creating query forms for an initial model. The system 400 includes:
[0063] The creation module 410 is used to create at least one query path. The query path includes a starting model and at least one target model connected in sequence, as well as the target field of the last target model. The starting model and at least one target model are at least some of the data models among a plurality of preset data models. There is a preset reference relationship between each two adjacent data models in the query path. Each of the at least one query path contains at least partially different target models and / or different target fields.
[0064] The generation module 420 is used to generate target query items corresponding to each query path on the query form based on at least one query path, so as to obtain a query form containing the target query items.
[0065] Please see Figure 5As shown, it is a schematic flowchart of a data model generation method 500 according to an embodiment of the present invention. According to another aspect of the present invention, a data model generation method is also provided for creating a data model as described above, the method including: steps S510 to S530.
[0066] In step S510, multiple data models are created, each of the multiple data models including at least one instance, each instance of the at least one instance being used to represent experimental data.
[0067] For example, the data model has a predefined data structure, such as a table consisting of rows and columns, where each table can have a name and each column has fields (fields are also the identification information of attributes). By responding to user operations such as inserting, deleting, and updating data, a data model with one or more instances can be created.
[0068] In step S520, for each of the plurality of data models, a first preset reference relationship is created between the data model and one or more other data models.
[0069] For example, a data model can establish a first preset reference relationship through primary and foreign keys. For a data model that needs to establish a first preset reference relationship, a preset field (such as sample ID, device ID, etc.) can be defined as the primary key in one data model, and a foreign key field pointing to the primary key (foreign key fields such as "associated sample ID", "associated device ID", etc.) can be defined in another data model.
[0070] In step S530, for every two data models with a first preset reference relationship, a second preset reference relationship is created between each instance of at least a partial instance of one data model and at least a partial instance of the other data model, wherein the data models in the query path are at least a partial data models among the plurality of data models.
[0071] For example, for every two data models that have established a first preset reference relationship, if it is necessary to establish a second preset reference relationship between the instances contained in each of the two data models, then in the data model with the foreign key, the foreign key field corresponding to the instance for which the second preset reference relationship needs to be established can be filled into the primary key value of the corresponding instance of the other data model (such as the specific value of the sample ID or the specific value of the device ID).
[0072] According to another aspect of the present invention, a data model generation system is also provided for creating a data model as described above, the system comprising:
[0073] The first creation module is used to create multiple data models. Each data model includes at least one instance, and each instance of the at least one instance is used to represent experimental data.
[0074] The second creation module is used to create a first preset reference relationship between each data model and one or more other data models, for each of the multiple data models;
[0075] The third creation module is used to create a second preset reference relationship between each instance of at least a partial instance of one data model and at least a partial instance of the other data model for every two data models with a first preset reference relationship, wherein the data models in the query path are at least a partial data model among multiple data models.
[0076] Please see Figure 6 As shown, it is a schematic block diagram of an electronic device 600 according to an embodiment of the present invention. According to another aspect of the present invention, an electronic device is also provided, including: a processor 610 and a memory 620, wherein the memory 620 stores computer program instructions, which are executed by the processor 610 to perform the above-mentioned query form generation method and / or data model generation method.
[0077] According to another aspect of the present invention, a storage medium is also provided, on which program instructions are stored. When the program instructions are executed by a computer or processor, the computer or processor performs corresponding steps of the query form generation method and / or data model generation method described in the embodiments of the present invention, and is used to implement corresponding modules in the query form generation system and / or data model generation system described in the embodiments of the present invention, or corresponding modules in the query form generation system and / or data model generation system described above. The storage medium may, for example, include a memory card of a smartphone, a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disc read-only memory (CD-ROM), a USB memory, or any combination of the above storage media. A computer-readable storage medium may be any combination of one or more computer-readable storage media.
[0078] According to another aspect of the present invention, a computer program product is also provided, including computer program instructions, which, when executed, are used to perform the query form generation method and / or data model generation method as described above.
[0079] Those skilled in the art can understand the specific implementation and beneficial effects of the above-described query form generation system, data model generation method and system, electronic device, storage medium and computer program product by reading the detailed description of the query form generation method above. For the sake of brevity, they will not be described in detail here.
[0080] Although exemplary embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above exemplary embodiments are merely illustrative and are not intended to limit the scope of the invention. Various changes and modifications can be made therein by those skilled in the art without departing from the scope and spirit of the invention. All such changes and modifications are intended to be included within the scope of the invention as claimed in the appended claims.
[0081] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0082] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed.
[0083] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0084] Similarly, it should be understood that, in order to streamline the invention and aid in understanding one or more of the various aspects of the invention, features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the description of exemplary embodiments of the invention. However, this approach should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the corresponding claims, its inventive point lies in solving the corresponding technical problem with fewer features than all of those in a single disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of the invention.
[0085] Those skilled in the art will understand that, apart from the mutual exclusion of features, all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or apparatus so disclosed can be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0086] Furthermore, those skilled in the art will understand that although some embodiments herein include certain features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments can be used in any combination.
[0087] The various component embodiments of the present invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some modules in the query form generation system and / or data model generation system according to embodiments of the present invention. The present invention can also be implemented as an apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such programs implementing the present invention can be stored on a computer-readable medium or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0088] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0089] The above are merely specific embodiments or descriptions of the present invention, and the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. The scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for generating a query form, characterized in that, The method for creating a query form for an initial model includes: Create at least one query path, the query path including the starting model and at least one target model and the target field of the last target model connected in sequence, the starting model and the at least one target model being at least some of the preset data models, each two adjacent data models in the query path having a preset reference relationship, and each of the at least one query path containing at least partially different target models and / or different target fields; Based on each of the at least one query path, a target query item corresponding to that query path is generated on the query form to obtain the query form containing the target query item.
2. The method according to claim 1, characterized in that, Creating at least one query path includes: In response to a first model selection instruction input by the user, the starting model is determined from the plurality of data models; In response to a second model selection instruction input by the user, the next target model is determined from at least a portion of the data models that have a preset reference relationship with the most recently determined data model in the query path, until the last target model of the query path is determined; In response to a field selection instruction input by the user, the target field of the last target model is determined from at least a portion of the fields of the last target model; The query path is determined based on the starting model, the at least one target model, and the target field of the last target model.
3. The method according to claim 2, characterized in that, The method further includes: The control display window displays the identification information of the latest determined data model in the query path, the identification information of at least some data models that have a preset reference relationship with the latest determined data model, and at least some fields of the last target model in a hierarchical menu output; In the hierarchical menu, the identification information of the most recently determined data model in the query path is the parent menu of the identification information of at least some data models that have a preset reference relationship with the most recently determined data model, and the identification information of the last target model is the parent menu of at least some fields of the last target model; The first model selection instruction, the second model selection instruction, and the field selection instruction are selection instructions for menu input in the hierarchical menu.
4. The method according to claim 3, characterized in that, The identification information of at least some data models is a second-level submenu of the identification information of the latest determined data model. The first-level submenu of the identification information of the latest determined data model includes selection information for forward references and / or selection information for reverse references. The first-level submenu of the selection information for forward references includes data models that can be referenced unidirectionally by the latest determined data model. The first-level submenu of the selection information for reverse references includes data models that can be referenced unidirectionally by the latest determined data model.
5. The method according to claim 2, characterized in that, In response to a second model selection instruction input by the user, determining the next target model from at least a subset of data models that have a preset reference relationship with the most recently determined data model in the query path, until the last target model of the query path is determined, the creation of at least one query path further includes: In response to a model filtering operation, a first data model category that needs to be filtered out or a second data model category that needs to be retained when creating the query path is determined, wherein at least some of the data models are data models of other data model categories besides the first data model category, or are data models of the second data model category.
6. The method according to any one of claims 1-5, characterized in that, The preset reference relationships include forward reference relationships and / or reverse reference relationships. The positive reference relationship indicates that the current data model can unidirectionally reference other data models, and the negative reference relationship indicates that the current data model can be unidirectionally referenced by other data models.
7. The method according to any one of claims 1-5, characterized in that, After generating a target query item corresponding to each query path on the query form based on the at least one query path, the method further includes: Identify the query instance in the initial model; The query results for the target query items of the instance to be queried under the query path are determined based on the query path corresponding to each target query item.
8. The method according to claim 7, characterized in that, Determining the query instance in the initial model includes: In response to a user's batch add operation on the query form, multiple query instances corresponding to the batch add operation are imported into the query form.
9. The method according to any one of claims 1-5, characterized in that, Each of the multiple data models belongs to a preset model category, and at least some of the data models in the query path have different model categories.
10. A query form generation system, characterized in that, The system is used to create query forms for an initial model. A creation module is used to create at least one query path, wherein the query path includes a starting model and at least one target model and a target field of the last target model connected in sequence, wherein the starting model and the at least one target model are at least some of a plurality of preset data models, and there is a preset reference relationship between each two adjacent data models in the query path, and each of the at least one query path contains at least partially different target models and / or different target fields; A generation module is used to generate a target query item corresponding to each query path on the query form based on each of the at least one query path, so as to obtain the query form containing the target query item.
11. A data model generation method, characterized in that, The method for creating a data model as described in any one of claims 1-9 includes: Create multiple data models, each of which includes at least one instance, and each instance of the at least one instance is used to represent experimental data; For each of the plurality of data models, a first preset reference relationship is created between that data model and one or more other data models besides that data model; For every two data models with a first preset reference relationship, a second preset reference relationship is created between each instance of at least a portion of the data models and at least a portion of the other data model, wherein the data models in the query path are at least a portion of the multiple data models.
12. A data model generation system, characterized in that, The system for creating a data model as described in any one of claims 1-9 includes: The first creation module is used to create multiple data models, each of which includes at least one instance, and each instance of the at least one instance is used to represent experimental data. The second creation module is used to create a first preset reference relationship between each of the multiple data models and one or more other data models besides that data model; The third creation module is used to create a second preset reference relationship between each instance of at least a portion of the data models and at least a portion of the other data model for every two data models with a first preset reference relationship, wherein the data models in the query path are at least a portion of the multiple data models.
13. An electronic device comprising a processor and a memory, characterized in that, The memory stores computer program instructions, which, when executed by the processor, are used to perform the query form generation method as described in any one of claims 1-11 and / or the data model generation method as described in claim 11.
14. A storage medium on which program instructions are stored, characterized in that, The program instructions, when executed, are used to perform the query form generation method as described in any one of claims 1-11 and / or the data model generation method as described in claim 11.