A method and device for processing compound data element access interface
By constructing a compound storage relationship mapping table and defining field data format rules, the problems of incomplete data element creation and insufficient format checking in the compound database are solved, and efficient data element creation and query accuracy are achieved.
Patent Information
- Application Number
- CN202411650108.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-11-19
AI Technical Summary
The existing compound database data element access interface requires complete attribute information when creating compound data elements, cannot process incomplete data, and lacks standardized processing and data format checking, resulting in resource waste and low query accuracy.
Build a compound storage relationship mapping table and define field data format rules, update the rule set in real time, provide mapping table export, data element creation, attribute calculation, review and batch deletion interfaces, support the creation and standardization of incomplete data, automatically complete and update data, and perform data format checks.
It reduces the workload of creators, improves the efficiency of data element creation, reduces resource waste, improves the accuracy of data queries, and reduces database error rates.
Smart Images

Figure CN119646072B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method and device for processing a compound data element access interface. Background Art
[0002] In many scientific and technological fields (such as semiconductors, new energy, and nanotechnology), it is necessary to build compound databases for scientific and technological workers to improve R&D efficiency. The compounds mentioned here include compounds such as solvents, solutions, and electrolytes in battery electrolytes, compounds of positive / negative electrode materials in batteries, and compounds of crystalline materials. Such compound databases generally use individual compounds as the basic data unit (referred to as compound data elements) and store all the corresponding compound attributes based on each compound data element. The compound attributes mentioned here should at least include the compound's simplified molecular input line entry system (SMILES) sequence, the compound's molecular chemical formula, all the compound's physical / chemical properties (such as melting point, boiling point, mass, number of atoms, effective charge, volume, density, oxidation-reduction energy, etc.), and the compound's molecular fingerprint (such as the compound molecular fingerprint calculated based on the TorsionBV algorithm, the compound molecular fingerprint calculated based on the MFP2 algorithm, and the compound molecular fingerprint calculated based on the FFP2 algorithm).
[0003] Currently, all compound databases provide some common data element access interfaces: such as data element creation interface and data element query interface. However, in actual applications, we found that these conventional access interfaces still have some shortcomings: 1) Conventional data element creation interfaces can only accept compound data element information without missing items. That is, when creating a compound data element, users need to prepare all its corresponding attributes in advance to complete the data element creation. This will undoubtedly increase the creator's attribute calculation workload and reduce the efficiency of data element creation; 2) Conventional data element creation interfaces do not standardize SMILES sequences when creating compound data elements. We know that the SMILES sequence of the same compound may produce different sequence expressions based on different processing methods. If the current input SMILES sequence is not standardized when creating a data element, it is possible that the database will create two data elements for the same compound, which will not only waste data storage resources but also reduce the accuracy of data queries; 3) Although conventional data element creation interfaces will perform data format compliance checks on all field data of the current data element based on a set of preset data element field data format requirements when creating a data element, conventional compound databases do not provide data element access interfaces to review the data format of stored compound data elements after the data format requirements of any type of field data change, which will also increase the data error rate of the database. Summary of the Invention
[0004] The purpose of the present invention is to provide a method, device, electronic device and computer-readable storage medium for processing a compound data element access interface in response to the defects of the prior art. The present invention pre-constructs a compound storage relationship mapping table based on the database design scheme of any compound database, which is recorded as the first mapping table; and customizes a corresponding field data format rule for each type of data element field in the first mapping table; and all the obtained field data format rules form a first data rule set; and when the field data format requirements of any type of data element field change, the corresponding field data format rules in the first data rule set are updated in real time; and after receiving the first access application input by the user, the corresponding first access interface type (mapping table export interface, data element creation interface, data element attribute calculation interface, data element review interface, mapping table review interface and data element batch deletion interface) and first interface parameters are extracted from it; and when the first access interface type is a mapping table export interface, the first interface parameter is extracted based on the first access interface type. Perform mapping table export processing according to the first interface parameters and the first mapping table; when the first access interface type is a data element creation interface, perform data element addition or update processing according to the first interface parameters, the first mapping table and the first data rule set; when the first access interface type is a data element attribute calculation interface, perform data element attribute calculation processing according to the first interface parameters and the first mapping table; when the first access interface type is a data element review interface, perform data element review processing according to the first interface parameters, the first mapping table and the first data rule set; when the first access interface type is a mapping table review interface, perform mapping table review processing according to the first interface parameters, the first mapping table and the first data rule set; when the first access interface type is a data element batch deletion interface, perform data element batch deletion processing according to the first interface parameters and the first mapping table. The present invention, on the one hand, transforms the functionality of a data element creation interface so that it can complete compound data element creation based on incomplete compound data element information and perform standardization on SMILES sequences when creating compound data elements; on the other hand, it adds a data element attribute calculation interface to automatically complete compound data elements that are missing during creation and automatically update compound data elements with aged field data; on the other hand, it adds a data element review interface and a mapping table review interface to review the data format of a single, multiple, or even all compound data elements; in addition, it adds a mapping table export interface to obtain complete information of a single, multiple, or even all compound data elements, and adds a data element batch deletion interface to centrally delete a single or multiple compound data elements that have been reviewed for errors. Combining the present invention with a conventional data element access interface can not only reduce the attribute calculation workload of the creator and improve the efficiency of data element creation, but also reduce the waste of data storage resources, improve the accuracy of data query, and reduce the data error rate of the database.
[0005] To achieve the above-mentioned object, a first aspect of an embodiment of the present invention provides a method for processing a compound data element access interface, the method comprising:
[0006] A compound storage relationship mapping table is constructed in advance based on the database design scheme of the compound database, which is recorded as the corresponding first mapping table; and a corresponding field data format rule is customized for each type of data element field in the first mapping table; and a corresponding first data rule set is composed of all the obtained field data format rules; and the corresponding field data format rule in the first data rule set is updated in real time when the field data format requirement of any type of data element field changes; each row of the first mapping table corresponds to a compound data element, and each column corresponds to a type of data element field, and each mapping table unit of the first mapping table corresponds to a set of database read / write interfaces in the compound database for field data corresponding to a data element field of a compound data element; the data element field includes at least a SMILES sequence field, a molecular chemical formula field, a type I molecular fingerprint field, a type II molecular fingerprint field, a type III molecular fingerprint field, multiple types of physical property fields, and multiple types of chemical property fields;
[0007] Receive a first access request input by a user; extract a corresponding first access interface type and first interface parameters from the first access request; the first access request includes the first access interface type and the first interface parameters; the first access interface type includes at least a mapping table export interface, a data element creation interface, a data element attribute calculation interface, a data element review interface, a mapping table review interface, and a data element batch deletion interface;
[0008] If the first access interface type is a mapping table export interface, performing corresponding mapping table export processing according to the first interface parameters and the first mapping table;
[0009] If the first access interface type is a data element creation interface, performing corresponding data element addition or update processing according to the first interface parameters, the first mapping table and the first data rule set;
[0010] If the first access interface type is a data element attribute calculation interface, performing corresponding data element attribute calculation processing according to the first interface parameters and the first mapping table;
[0011] If the first access interface type is a data element review interface, performing corresponding data element review processing according to the first interface parameters, the first mapping table and the first data rule set;
[0012] If the first access interface type is a mapping table review interface, performing corresponding mapping table review processing according to the first interface parameters, the first mapping table and the first data rule set;
[0013] If the first access interface type is a data element batch deletion interface, corresponding data element batch deletion processing is performed according to the first interface parameters and the first mapping table.
[0014] Preferably, when the first access interface type is a mapping table export interface, the first interface parameters include a first export mode and a first row identifier sequence; the first export mode includes a full table export mode and a partial export mode; when the first export mode is the full table export mode, the first row identifier sequence is empty; when the first export mode is the partial export mode, the first row identifier sequence consists of one or more first row identifiers;
[0015] When the first access interface type is a data element creation interface, the first interface parameters include multiple first field items; among all the first field items, only the first field data of the first field item whose first field name is SMILES sequence cannot be empty; the first field item includes the first field name and the first field data; the first field name includes SMILES sequence, molecular chemical formula, class I molecular fingerprint, class II molecular fingerprint, class III molecular fingerprint, multiple physical property names and multiple chemical property names; the class I molecular fingerprint corresponds to the compound molecular fingerprint type calculated based on the torsionbv algorithm; the class II molecular fingerprint corresponds to the compound molecular fingerprint type calculated based on the mfp2 algorithm; the class III molecular fingerprint corresponds to the compound molecular fingerprint type calculated based on the ffp2 algorithm;
[0016] When the first access interface type is a data element attribute calculation interface, the first interface parameters include a first SMILES sequence and a second field name sequence; the second field name sequence consists of one or more second field names; the second field names include molecular chemical formulas, first-class molecular fingerprints, second-class molecular fingerprints, third-class molecular fingerprints, multiple physical property names, and multiple chemical property names;
[0017] When the first access interface type is a data element review interface, the first interface parameter includes a second SMILES sequence;
[0018] When the first access interface type is a mapping table review interface, the first interface parameters include a first review mode and a second row identifier sequence; the first review mode includes a full table review mode and a partial review mode; when the first review mode is the full table review mode, the second row identifier sequence is empty; when the first review mode is the partial review mode, the second row identifier sequence consists of one or more second row identifiers;
[0019] When the first access interface type is a data element batch deletion interface, the first interface parameter includes a third row identifier sequence; the third row identifier sequence consists of one or more third row identifiers.
[0020] Preferably, the performing corresponding mapping table export processing according to the first interface parameter and the first mapping table specifically includes:
[0021] Step 31: extracting the corresponding first export mode and first row identification sequence from the first interface parameters;
[0022] Step 32: Identify the first export mode; if the first export mode is a full-table export mode, then all rows of the first mapping table constitute a corresponding first target row set; if the first export mode is a partial export mode, then all rows corresponding to the first row identifiers of the first row identifier sequence in the first mapping table constitute a corresponding first target row set;
[0023] Step 33: Perform a round of traversal on all rows of the first target row set; during this round of traversal, use the currently traversed row as the corresponding current mapping row; use each mapping table unit of the currently traversed row as the corresponding current mapping table unit, and read the database data corresponding to the current mapping table unit in the compound database through the database read interface corresponding to the current mapping table unit as the corresponding current field data, and form a corresponding derived field item from the data element field corresponding to the current mapping table unit and the current field data; and form a corresponding derived compound data element from all the derived field items corresponding to the current mapping row; and at the end of this round of traversal, form a corresponding first processing result from all the derived compound data elements obtained;
[0024] Step 34: Feedback the obtained first processing result to the current user.
[0025] Preferably, performing the corresponding data element addition or update processing according to the first interface parameter, the first mapping table and the first data rule set specifically includes:
[0026] Step 41: Identify whether the first field data of the first field item whose first field name is a SMILES sequence in the first interface parameter is empty; if so, set the corresponding second processing result to failure and go to step 47; if not, go to step 42;
[0027] Step 42: Record each first field item in the first interface parameter whose first field data is not empty as the corresponding current field item; perform a field data compliance check on the first field data of the current field item based on the field data format rule corresponding to the current field item in the first data rule set to obtain a corresponding first check result; and identify whether all the obtained first check results are compliant; if so, proceed to step 43; if not, set the corresponding second processing result to failure, and proceed to step 47;
[0028] Wherein, the first inspection result includes compliance and non-compliance;
[0029] Step 43: Use the first field data of the first field item whose first field name is SMILES sequence in the first interface parameter as the corresponding current SMILES sequence; input the current SMILES sequence into a preset SMILES sequence standardization processing interface for processing to obtain the corresponding current standard sequence; record the corresponding column of the SMILES sequence field in the first mapping table as the corresponding current mapping column; use each mapping table unit of the current mapping column as the corresponding current mapping table unit, and read the database data corresponding to the current mapping table unit from the compound database through the database reading interface corresponding to the current mapping table unit as the corresponding first inventory SMILES sequence, and form a corresponding first inventory sequence set from all the obtained first inventory SMILES sequences; record the first inventory SMILES sequence in the first inventory sequence set that matches the current standard sequence as the corresponding first matching inventory sequence; and identify whether the first matching inventory sequence is empty; if so, go to step 44; if not, go to step 45;
[0030] Wherein, the SMILES sequence standardization processing interface at least includes a standardized SMILES sequence processing interface provided by the RDKit tool;
[0031] Step 44: Adding the corresponding compound data element to the compound database according to the first interface parameters based on the database design scheme of the compound database; if the addition is successful, obtaining the database read / write interfaces corresponding to all the data element fields of the compound data element added this time; adding a new row to the first mapping table as the corresponding current added row; and creating a correspondence between each mapping table cell of the current added row and a set of database read / write interfaces for the corresponding data element fields; and if the correspondence is successfully created, setting the corresponding second processing result to success, and proceeding to step 47;
[0032] Step 45: extract all the first field items in the first interface parameter whose first field names are not SMILES sequences and whose first field data are not empty to form a corresponding first field item set; and identify whether the first field item set is empty; if so, set the corresponding second processing result to failure and go to step 47; if not, go to step 46;
[0033] Step 46: Use the row corresponding to the first matching inventory sequence in the first mapping table as the corresponding current mapping row; use each first field item in the first field item set as the corresponding current field item; use the mapping table unit corresponding to the data element field in the current mapping row and the first field name of the current field item as the corresponding current mapping table unit; and update the database data corresponding to the current mapping table unit in the compound database to the first field data of the current field item through the database write interface corresponding to the current mapping table unit; and after the database data corresponding to all the first field items in the first field item set are successfully updated, set the corresponding second processing result to success;
[0034] Step 47: Feedback the obtained second processing result to the current user.
[0035] Preferably, the performing corresponding data element attribute calculation processing according to the first interface parameter and the first mapping table specifically includes:
[0036] Step 51: extract the corresponding first SMILES sequence and second field name sequence from the first interface parameters;
[0037] Step 52: Input the first SMILES sequence into a preset SMILES sequence standardization processing interface for processing to obtain a corresponding current standard sequence; record the corresponding column of the SMILES sequence field in the first mapping table as the corresponding current mapping column; and use each mapping table unit of the current mapping column as the corresponding current mapping table unit. Then, read the database data corresponding to the current mapping table unit in the compound database through the database reading interface corresponding to the current mapping table unit as the corresponding second inventory SMILES sequence, and form a corresponding second inventory sequence set from all the obtained second inventory SMILES sequences; and record the second inventory SMILES sequence in the second inventory sequence set that matches the current standard sequence as the corresponding second matching inventory sequence; and identify whether the second matching inventory sequence is empty; if so, set the corresponding third processing result to failure, and go to step 54; if not, set the corresponding row of the second matching inventory sequence in the first mapping table as the corresponding current mapping row, and go to step 53;
[0038] Step 53: use each second field name in the second field name sequence as the corresponding current field name; use the processing interface corresponding to the current field name provided by the preset attribute calculation tool as the corresponding current processing interface; input the first SMILES sequence into the current processing interface for processing and use the processed data returned by the interface as the corresponding current field data; use the mapping table unit corresponding to the data element field in the current mapping row and the current field name as the corresponding current mapping table unit; and update the database data corresponding to the current mapping table unit in the compound database to the corresponding current field data through the database write interface corresponding to the current mapping table unit; and after the database data corresponding to all the second field names in the second field name sequence are successfully updated, set the corresponding third processing result to success;
[0039] Wherein, the attribute calculation tool at least includes RDKit tool;
[0040] Step 54: Feedback the third processing result to the current user.
[0041] Preferably, performing corresponding data element review processing according to the first interface parameter, the first mapping table and the first data rule set specifically includes:
[0042] Step 61: extract the corresponding second SMILES sequence from the first interface parameters;
[0043] Step 62: Input the second SMILES sequence into a preset SMILES sequence standardization processing interface for processing to obtain a corresponding current standard sequence; record the corresponding column of the SMILES sequence field in the first mapping table as the corresponding current mapping column; use each mapping table unit of the current mapping column as the corresponding current mapping table unit, and read the database data corresponding to the current mapping table unit from the compound database through the database reading interface corresponding to the current mapping table unit as the corresponding third inventory SMILES sequence, and form a corresponding third inventory sequence set from all the obtained third inventory SMILES sequences; record the third inventory SMILES sequence in the third inventory sequence set that matches the current standard sequence as the corresponding third matching inventory sequence; and identify whether the third matching inventory sequence is empty; if so, set the corresponding fourth processing result to failure, and go to step 65; if not, set the corresponding row of the third matching inventory sequence in the first mapping table as the corresponding current mapping row, and go to step 63;
[0044] Step 63: Use each mapping table unit of the current mapping row as a corresponding current mapping table unit; read the database data corresponding to the current mapping table unit in the compound database through the database read interface corresponding to the current mapping table unit as the corresponding current field data; use the field data format rule corresponding to the data element field corresponding to the current mapping table unit in the first data rule set as the corresponding current field data format rule; and perform a field data compliance check on the current field data based on the current field data format rule to obtain a corresponding second check result;
[0045] Wherein, the second inspection result includes compliance and non-compliance;
[0046] Step 64: Identify whether all the obtained second check results are compliant; if so, set the corresponding fourth processing result to no exception; if not, use the row identifier corresponding to the current mapping row in the first mapping table as the corresponding first error row identifier, and use the column identifier corresponding to each data element field corresponding to the second check result that is specifically non-compliant in the first mapping table as the corresponding first error column identifier, and form a corresponding first error column identifier sequence from all the obtained first error column identifiers, and form the corresponding fourth processing result from the first error row identifier and the first error column identifier sequence.
[0047] Step 65: Feedback the fourth processing result to the current user.
[0048] Preferably, the performing corresponding mapping table review processing according to the first interface parameter, the first mapping table and the first data rule set specifically includes:
[0049] Step 71: extract the corresponding first review mode and second row identification sequence from the first interface parameters;
[0050] Step 72: Identify the first review mode. If the first review mode is a full-table review mode, then all rows of the first mapping table constitute the corresponding second target row set. If the first review mode is a partial review mode, then all rows corresponding to the second row identifiers of the second row identifier sequence in the first mapping table constitute the corresponding second target row set.
[0051] Step 73, perform a round of traversal on all rows of the second target row set; and in this round of traversal, use the current traversal row as the corresponding current mapping row; and use each of the mapping table units of the current mapping row as the corresponding current mapping table unit, and read the database data corresponding to the current mapping table unit in the compound database through the database read interface corresponding to the current mapping table unit as the corresponding current field data, and use the field data format rule corresponding to the data element field corresponding to the current mapping table unit in the first data rule set as the corresponding current field data format rule, and perform a field data compliance check on the current field data based on the current field data format rule to obtain a corresponding third check result; and use the current mapping row in the first mapping table corresponding to as the corresponding current row identifier; and identify whether all the third check results corresponding to the current mapping row are compliant; if so, set the corresponding current row review result to no exception, and form a corresponding first row review result by the current row identifier and the current row review result; if not, use the column identifier corresponding to the data element field corresponding to each of the third check results that are specifically non-compliant corresponding to the current mapping row in the first mapping table as the corresponding second error column identifier, and form a corresponding second error column identifier sequence by all the obtained second error column identifiers, and form a corresponding first row review result by the current row identifier and the second error column identifier sequence; and at the end of this round of traversal, form a corresponding fifth processing result by all the obtained first row review results;
[0052] Step 74: Feedback the fifth processing result to the current user.
[0053] Preferably, the performing of the corresponding batch deletion processing of the data elements according to the first interface parameter and the first mapping table specifically includes:
[0054] Step 81: extract the corresponding third row identification sequence from the first interface parameter;
[0055] Step 82: Form a corresponding third target row set from the rows corresponding to all the third row identifiers of the third row identifier sequence in the first mapping table;
[0056] Step 83: perform a round of traversal on all rows of the third target row set; and during this round of traversal, use the currently traversed row as the corresponding current mapping row; and use the mapping table unit corresponding to the SMILES sequence field in the currently mapped row as the corresponding current SMILES sequence unit, and read the database data corresponding to the current SMILES sequence unit in the compound database through the database read interface corresponding to the current SMILES sequence unit as the corresponding current SMILES sequence; and perform corresponding compound data element deletion processing in the compound database according to the current SMILES sequence based on the database design scheme of the compound database; and when the deletion processing is successful, invalidate the database read / write interface corresponding to the mapping table unit of the currently mapped row, and record the currently mapped row as the corresponding row to be deleted; and at the end of this round of traversal, perform batch deletion processing on all the rows to be deleted in the first mapping table; and when the batch deletion is successful, set the corresponding sixth processing result to success;
[0057] Step 84: Feedback the obtained sixth processing result to the current user.
[0058] A second aspect of an embodiment of the present invention provides an apparatus for implementing the method for processing a compound data element access interface as described in the first aspect, the apparatus comprising: a preprocessing module, an access application receiving module, a mapping table exporting module, a data element creating module, a data element attribute calculating module, a data element reviewing module, a mapping table reviewing module, and a data element batch deleting module;
[0059] The preprocessing module is used to construct a compound storage relationship mapping table based on the database design scheme of the compound database in advance, which is recorded as the corresponding first mapping table; and customize a corresponding field data format rule for each type of data element field in the first mapping table; and form a corresponding first data rule set by all the obtained field data format rules; and update the corresponding field data format rule in the first data rule set in real time when the field data format requirement of any type of data element field changes; each row of the first mapping table corresponds to a compound data element, and each column corresponds to a type of data element field, and each mapping table unit of the first mapping table corresponds to a set of database read / write interfaces in the compound database for field data corresponding to a data element field of a compound data element; the data element field includes at least a SMILES sequence field, a molecular formula field, a type I molecular fingerprint field, a type II molecular fingerprint field, a type III molecular fingerprint field, multiple types of physical property fields, and multiple types of chemical property fields;
[0060] The access application receiving module is used to receive a first access application input by a user; and extract the corresponding first access interface type and first interface parameters from the first access application; the first access application includes the first access interface type and the first interface parameters; the first access interface type includes at least a mapping table export interface, a data element creation interface, a data element attribute calculation interface, a data element review interface, a mapping table review interface, and a data element batch deletion interface;
[0061] The mapping table export module is configured to perform corresponding mapping table export processing according to the first interface parameters and the first mapping table when the first access interface type is a mapping table export interface;
[0062] The data element creation module is configured to perform corresponding data element addition or update processing according to the first interface parameters, the first mapping table, and the first data rule set when the first access interface type is a data element creation interface;
[0063] The data element attribute calculation module is configured to perform corresponding data element attribute calculation processing according to the first interface parameters and the first mapping table when the first access interface type is a data element attribute calculation interface;
[0064] The data element review module is configured to perform corresponding data element review processing according to the first interface parameters, the first mapping table and the first data rule set when the first access interface type is a data element review interface;
[0065] The mapping table review module is configured to perform corresponding mapping table review processing according to the first interface parameters, the first mapping table and the first data rule set when the first access interface type is a mapping table review interface;
[0066] The data element batch deletion module is used to perform corresponding data element batch deletion processing according to the first interface parameters and the first mapping table when the first access interface type is a data element batch deletion interface.
[0067] A third aspect of an embodiment of the present invention provides an electronic device, including: a memory, a processor, and a transceiver;
[0068] The processor is configured to be coupled to the memory, read and execute instructions in the memory, so as to implement the method steps described in the first aspect above;
[0069] The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
[0070] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a computer, the computer executes the instructions of the method described in the first aspect above.
[0071] The embodiment of the present invention provides a method, device, electronic device and computer-readable storage medium for processing a compound data element access interface. As can be seen from the above content, the embodiment of the present invention pre-constructs a compound storage relationship mapping table based on the database design scheme of any compound database, which is recorded as the first mapping table; and customizes a corresponding field data format rule for each type of data element field of the first mapping table; and all the obtained field data format rules form a first data rule set; and when the field data format requirements of any type of data element field change, the corresponding field data format rules in the first data rule set are updated in real time; and after receiving the first access application input by the receiving user, the corresponding first access interface type (mapping table export interface, data element creation interface, data element attribute calculation interface, data element review interface, mapping table review interface and data element batch deletion interface) and first interface parameters are extracted from it; and when the first access interface type is a mapping table When exporting the interface, the mapping table export processing is performed according to the first interface parameters and the first mapping table; when the first access interface type is the data element creation interface, the data element addition or update processing is performed according to the first interface parameters, the first mapping table and the first data rule set; when the first access interface type is the data element attribute calculation interface, the data element attribute calculation processing is performed according to the first interface parameters and the first mapping table; when the first access interface type is the data element review interface, the data element review processing is performed according to the first interface parameters, the first mapping table and the first data rule set; when the first access interface type is the mapping table review interface, the mapping table review processing is performed according to the first interface parameters, the first mapping table and the first data rule set; when the first access interface type is the data element batch deletion interface, the data element batch deletion processing is performed according to the first interface parameters and the first mapping table. The embodiment of the present invention, on the one hand, has functionally modified the data element creation interface so that it can complete compound data element creation based on incomplete compound data element information and can standardize the SMILES sequence when creating compound data elements; on the other hand, it has added a data element attribute calculation interface to automatically complete compound data elements that are missing during creation and automatically update compound data elements with outdated field data; on the other hand, it has added a data element review interface and a mapping table review interface to review the data format of a single, multiple, or even all compound data elements; in addition, it has added a mapping table export interface to obtain the complete information of a single, multiple, or even all compound data elements, and added a data element batch deletion interface to centrally delete a single or multiple compound data elements that have been reviewed for errors. Combining the embodiment of the present invention with a conventional data element access interface not only reduces the attribute calculation workload of the creator and improves the efficiency of data element creation, but also reduces the waste of data storage resources, reduces the data error rate of the database, and improves the accuracy of data queries. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1A schematic diagram of a method for processing a compound data element access interface provided in Example 1 of the present invention;
[0073] Figure 2 A module structure diagram of a processing device for a compound data element access interface provided in Example 2 of the present invention;
[0074] Figure 3 This is a structural diagram of an electronic device provided in Example 3 of the present invention. DETAILED DESCRIPTION
[0075] To make the objectives, technical solutions, and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings. It should be understood that the embodiments described herein are merely some, rather than all, of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are intended to fall within the scope of protection of the present invention.
[0076] The first embodiment of the present invention provides a method for processing a compound data element access interface, such as Figure 1 The schematic diagram of a processing method for a compound data element access interface provided in Example 1 of the present invention is shown. This method mainly includes the following steps:
[0077] Step 1: construct a compound storage relationship mapping table based on the database design plan of the compound database in advance, which is recorded as the corresponding first mapping table; customize a corresponding field data format rule for each type of data element field in the first mapping table; and form a corresponding first data rule set from all the obtained field data format rules; and update the corresponding field data format rule in the first data rule set in real time when the field data format requirement of any type of data element field changes.
[0078] Here, the compound database in the embodiment of the present invention is any type of compound database, and the database design scheme of the compound database is known by default, that is, a series of data management methods such as data creation, update, and deletion corresponding to each compound data element within the database are known by default. The present invention does not impose specific technical limitations on the database design scheme of the compound database.
[0079] The first mapping table in an embodiment of the present invention is a logical relationship mapping table. Each row of the first mapping table corresponds to a compound data element, and each column corresponds to a data element field of a type. Each mapping table cell of the first mapping table corresponds to a set of database read / write interfaces in a compound database corresponding to field data corresponding to a data element field of a compound data element. Here, the data element fields of the first mapping table include at least a SMILES sequence field, a molecular formula field, a type I molecular fingerprint field, a type II molecular fingerprint field, a type III molecular fingerprint field, multiple types of physical property fields, and multiple types of chemical property fields.
[0080] The first data rule set of an embodiment of the present invention is composed of multiple field data format rules. The field data format rules of the first data rule set correspond one-to-one to the data element fields of the first mapping table. Each field data format rule will be used to perform compliance checks on the field data of the corresponding data element field; and the specific rule content of each field data format rule can be customized based on the application requirements of the corresponding field data. The present invention does not make specific technical limitations on the field data format rules.
[0081] Step 2: Receive a first access request input by a user; and extract a corresponding first access interface type and first interface parameters from the first access request.
[0082] Here, the first access application of an embodiment of the present invention includes a first access interface type and a first interface parameter; wherein, the first access interface type includes at least a mapping table export interface, a data element creation interface, a data element attribute calculation interface, a data element review interface, a mapping table review interface and a data element batch deletion interface; the specific content of the first interface parameter corresponds to the first access interface type.
[0083] When the first access interface type is a mapping table export interface, the first interface parameters include a first export mode and a first row identifier sequence; wherein, the first export mode includes a full table export mode and a partial export mode; when the first export mode is the full table export mode, the first row identifier sequence is empty; when the first export mode is the partial export mode, the first row identifier sequence consists of one or more first row identifiers.
[0084] When the first access interface type is a data element creation interface, the first interface parameters include multiple first field items; among all the first field items, only the first field item whose first field name is a SMILES sequence cannot have its first field data empty; the first field item includes a first field name and first field data; the first field names include SMILES sequence, molecular chemical formula, first-class molecular fingerprint, second-class molecular fingerprint, third-class molecular fingerprint, multiple-class physical property names, and multiple-class chemical property names; the first-class molecular fingerprint corresponds to the compound molecular fingerprint type calculated based on the torsionbv (Topological-Torsion Bit Fingerprint) algorithm; the second-class molecular fingerprint corresponds to the compound molecular fingerprint type calculated based on the mfp2 (Morgan Bit Fingerprint with Default Radius 2) algorithm; the third-class molecular fingerprint corresponds to the compound molecular fingerprint type calculated based on the ffp2 (Morgan FCFP Bit Fingerprint with Default Radius 2) algorithm.
[0085] When the first access interface type is a data element attribute calculation interface, the first interface parameters include a first SMILES sequence and a second field name sequence; wherein the second field name sequence is composed of one or more second field names; the second field names include molecular chemical formulas, first-class molecular fingerprints, second-class molecular fingerprints, third-class molecular fingerprints, multiple types of physical property names, and multiple types of chemical property names.
[0086] When the first access interface type is a data element review interface, the first interface parameter includes a second SMILES sequence.
[0087] When the first access interface type is a mapping table review interface, the first interface parameters include a first review mode and a second row identification sequence; wherein, the first review mode includes a full table review mode and a partial review mode; when the first review mode is the full table review mode, the second row identification sequence is empty; when the first review mode is the partial review mode, the second row identification sequence consists of one or more second row identifications.
[0088] When the first access interface type is a data element batch deletion interface, the first interface parameter includes a third row identifier sequence; wherein the third row identifier sequence is composed of one or more third row identifiers.
[0089] Step 3: If the first access interface type is a mapping table export interface, then corresponding mapping table export processing is performed according to the first interface parameters and the first mapping table;
[0090] Specifically comprising: step 31, extracting the corresponding first export mode and first row identification sequence from the first interface parameter;
[0091] Step 32: Identify the first export mode; if the first export mode is the full-table export mode, then all rows of the first mapping table constitute the corresponding first target row set; if the first export mode is the partial export mode, then all rows corresponding to the first row identifiers of the first row identifier sequence in the first mapping table constitute the corresponding first target row set;
[0092] Step 33: Perform a round of traversal on all rows of the first target row set; during this round of traversal, use the currently traversed row as the corresponding current mapping row; use each mapping table unit of the currently mapped row as the corresponding current mapping table unit, and read the database data corresponding to the current mapping table unit in the compound database through the database read interface corresponding to the current mapping table unit as the corresponding current field data, and form a corresponding derived field item from the data element field corresponding to the current mapping table unit and the current field data; and form a corresponding derived compound data element from all the derived field items corresponding to the currently mapped row; and at the end of this round of traversal, form a corresponding first processing result from all the derived compound data elements obtained;
[0093] Step 34: Feedback the obtained first processing result to the current user.
[0094] Step 4: If the first access interface type is a data element creation interface, then performing corresponding data element addition or update processing according to the first interface parameters, the first mapping table, and the first data rule set;
[0095] Specifically, the method includes: step 41, identifying whether the first field data of the first field item of the first field name of the SMILES sequence in the first interface parameter is empty; if so, setting the corresponding second processing result to failure and going to step 47; if not, going to step 42;
[0096] Step 42: Record each first field item in the first interface parameter whose first field data is not empty as the corresponding current field item; perform a field data compliance check on the first field data of the current field item based on the field data format rule corresponding to the current field item in the first data rule set to obtain a corresponding first check result; and determine whether all the obtained first check results are compliant; if so, proceed to step 43; if not, set the corresponding second processing result to failure, and proceed to step 47;
[0097] Among them, the first inspection results include compliance and non-compliance;
[0098] Step 43: The first field data of the first field item of the first field name of the SMILES sequence in the first interface parameter is used as the corresponding current SMILES sequence; the current SMILES sequence is input into a preset SMILES sequence standardization processing interface for processing to obtain the corresponding current standard sequence; the corresponding column of the SMILES sequence field in the first mapping table is recorded as the corresponding current mapping column; each mapping table unit of the current mapping column is used as the corresponding current mapping table unit, and the database data corresponding to the current mapping table unit in the compound database is read out through the database reading interface corresponding to the current mapping table unit as the corresponding first inventory SMILES sequence, and a corresponding first inventory sequence set is formed from all the obtained first inventory SMILES sequences; the first inventory SMILES sequence in the first inventory sequence set that matches the current standard sequence is recorded as the corresponding first matching inventory sequence; and whether the first matching inventory sequence is empty is identified; if so, the process proceeds to step 44; if not, the process proceeds to step 45;
[0099] The SMILES sequence standardization processing interface at least includes a standardized SMILES sequence processing interface provided by the RDKit tool;
[0100] Step 44: Based on the database design scheme for the compound database, a corresponding compound data element is added to the compound database according to the first interface parameters. If the addition is successful, the database read / write interfaces corresponding to all data element fields of the compound data element added are obtained. A new row is added to the first mapping table as the corresponding current added row. A correspondence between each mapping table cell of the current added row and a set of database read / write interfaces for the corresponding data element fields is created. If the correspondence is successfully created, the corresponding second processing result is set to success, and the process proceeds to step 47.
[0101] Step 45: extract all first field items in the first interface parameter whose first field names are not SMILES sequences and whose first field data are not empty to form a corresponding first field item set; and identify whether the first field item set is empty; if so, set the corresponding second processing result to failure and go to step 47; if not, go to step 46;
[0102] Step 46: Use the row corresponding to the first matching inventory sequence in the first mapping table as the corresponding current mapping row; use each first field item in the first field item set as the corresponding current field item; use the mapping table unit corresponding to the data element field in the current mapping row and the first field name of the current field item as the corresponding current mapping table unit; and update the database data corresponding to the current mapping table unit in the compound database to the first field data of the current field item through the database write interface corresponding to the current mapping table unit; and set the corresponding second processing result to success after the database data corresponding to all first field items in the first field item set are successfully updated.
[0103] Step 47: Feedback the obtained second processing result to the current user.
[0104] Step 5: If the first access interface type is a data element attribute calculation interface, then corresponding data element attribute calculation processing is performed according to the first interface parameters and the first mapping table;
[0105] Specifically comprising: step 51, extracting the corresponding first SMILES sequence and second field name sequence from the first interface parameter;
[0106] Step 52: Input the first SMILES sequence into the SMILES sequence standardization processing interface for processing to obtain a corresponding current standard sequence; record the corresponding column of the SMILES sequence field in the first mapping table as the corresponding current mapping column; use each mapping table unit of the current mapping column as the corresponding current mapping table unit, and read the database data corresponding to the current mapping table unit from the compound database through the database reading interface corresponding to the current mapping table unit as the corresponding second inventory SMILES sequence, and form a corresponding second inventory sequence set from all the obtained second inventory SMILES sequences; record the second inventory SMILES sequence in the second inventory sequence set that matches the current standard sequence as the corresponding second matching inventory sequence; and identify whether the second matching inventory sequence is empty; if so, set the corresponding third processing result to failure, and go to step 54; if not, set the corresponding row of the second matching inventory sequence in the first mapping table as the corresponding current mapping row, and go to step 53;
[0107] Step 53: Use each second field name in the second field name sequence as the corresponding current field name; use the processing interface corresponding to the current field name provided by the preset attribute calculation tool as the corresponding current processing interface; input the first SMILES sequence into the current processing interface for processing and use the processed data returned by the interface as the corresponding current field data; use the mapping table unit corresponding to the data element field in the current mapping row and the current field name as the corresponding current mapping table unit; and update the database data corresponding to the current mapping table unit in the compound database to the corresponding current field data through the database write interface corresponding to the current mapping table unit; and after the database data corresponding to all second field names in the second field name sequence are successfully updated, set the corresponding third processing result to success;
[0108] Among them, the attribute calculation tool includes at least the RDKit tool;
[0109] Step 54: Feedback the obtained third processing result to the current user.
[0110] Step 6: If the first access interface type is a data element review interface, perform corresponding data element review processing according to the first interface parameters, the first mapping table, and the first data rule set;
[0111] Specifically comprising: step 61, extracting a corresponding second SMILES sequence from the first interface parameter;
[0112] Step 62: Input the second SMILES sequence into the SMILES sequence standardization processing interface for processing to obtain a corresponding current standard sequence; record the corresponding column of the SMILES sequence field in the first mapping table as the corresponding current mapping column; use each mapping table unit of the current mapping column as the corresponding current mapping table unit, and read the database data corresponding to the current mapping table unit from the compound database through the database reading interface corresponding to the current mapping table unit as the corresponding third inventory SMILES sequence, and form a corresponding third inventory sequence set from all the obtained third inventory SMILES sequences; record the third inventory SMILES sequence in the third inventory sequence set that matches the current standard sequence as the corresponding third matching inventory sequence; and identify whether the third matching inventory sequence is empty; if so, set the corresponding fourth processing result to failure, and go to step 65; if not, set the corresponding row of the third matching inventory sequence in the first mapping table as the corresponding current mapping row, and go to step 63;
[0113] Step 63: Each mapping table unit of the current mapping row is used as a corresponding current mapping table unit; database data corresponding to the current mapping table unit in the compound database is read through a database read interface corresponding to the current mapping table unit as corresponding current field data; the field data format rule corresponding to the data element field corresponding to the current mapping table unit in the first data rule set is used as the corresponding current field data format rule; and a field data compliance check is performed on the current field data based on the current field data format rule to obtain a corresponding second check result;
[0114] Among them, the second inspection results include compliance and non-compliance;
[0115] Step 64: Identify whether all the obtained second check results are compliant; if so, set the corresponding fourth processing result to no exception; if not, use the row identifier corresponding to the current mapping row in the first mapping table as the corresponding first error row identifier, and use the column identifier corresponding to each data element field corresponding to the non-compliant second check result in the first mapping table as the corresponding first error column identifier, and form a corresponding first error column identifier sequence from all the obtained first error column identifiers, and form a corresponding fourth processing result from the first error row identifier and the first error column identifier sequence.
[0116] Step 65: Feedback the fourth processing result to the current user.
[0117] Step 7: If the first access interface type is a mapping table review interface, performing corresponding mapping table review processing according to the first interface parameters, the first mapping table, and the first data rule set;
[0118] Specifically comprising: step 71, extracting the corresponding first review mode and second row identification sequence from the first interface parameter;
[0119] Step 72: Identify the first review mode. If the first review mode is a full-table review mode, then all rows in the first mapping table form a corresponding second target row set. If the first review mode is a partial review mode, then all rows corresponding to the second row identifiers of the second row identifier sequence in the first mapping table form a corresponding second target row set.
[0120] Step 73, perform a round of traversal on all rows of the second target row set; and in this round of traversal, use the current traversal row as the corresponding current mapping row; and use each mapping table unit of the current mapping row as the corresponding current mapping table unit, and read the database data corresponding to the current mapping table unit in the compound database through the database read interface corresponding to the current mapping table unit as the corresponding current field data, and use the field data format rule corresponding to the data element field corresponding to the current mapping table unit in the first data rule set as the corresponding current field data format rule, and perform a field data compliance check on the current field data based on the current field data format rule to obtain the corresponding third check result; and use the corresponding third check result of the current mapping row in the first mapping table. The row identifier is used as the corresponding current row identifier; and whether all the third check results corresponding to the current mapping row are compliant are identified; if so, the corresponding current row review result is set to no exception, and the current row identifier and the current row review result form a corresponding first row review result; if not, the column identifiers corresponding to the data element fields corresponding to the third check results that are specifically non-compliant corresponding to the current mapping row in the first mapping table are used as the corresponding second error column identifiers, and all the obtained second error column identifiers form a corresponding second error column identifier sequence, and the current row identifier and the second error column identifier sequence form a corresponding first row review result; and at the end of this round of traversal, all the obtained first row review results form a corresponding fifth processing result;
[0121] Step 74: Feedback the fifth processing result to the current user.
[0122] Step 8: If the first access interface type is a data element batch deletion interface, perform corresponding data element batch deletion processing according to the first interface parameters and the first mapping table;
[0123] Specifically comprising: step 81, extracting the corresponding third row identification sequence from the first interface parameter;
[0124] Step 82: Form a corresponding third target row set from the corresponding rows of all third row identifiers of the third row identifier sequence in the first mapping table;
[0125] Step 83: Perform a round of traversal on all rows of the third target row set; and during this round of traversal, use the currently traversed row as the corresponding current mapping row; and use the mapping table unit corresponding to the SMILES sequence field in the currently mapped row as the corresponding current SMILES sequence unit, and read the database data corresponding to the current SMILES sequence unit in the compound database through the database read interface corresponding to the current SMILES sequence unit as the corresponding current SMILES sequence; and perform corresponding compound data element deletion processing in the compound database according to the current SMILES sequence based on the database design scheme of the compound database; and when the deletion processing is successful, invalidate the database read / write interface corresponding to the mapping table unit of the currently mapped row, and record the currently mapped row as the corresponding row to be deleted; and at the end of this round of traversal, perform batch deletion processing on all rows to be deleted in the first mapping table; and when the batch deletion is successful, set the corresponding sixth processing result to success;
[0126] Step 84: Feedback the obtained sixth processing result to the current user.
[0127] Figure 2 This is a module structure diagram of a processing device for a compound data element access interface provided in the second embodiment of the present invention. The device is a terminal device or server that implements the aforementioned method embodiment, or can be a device that enables the aforementioned terminal device or server to implement the aforementioned method embodiment. For example, the device can be a device or chip system of the aforementioned terminal device or server. Figure 2 As shown, the device includes: a preprocessing module 201, an access application receiving module 202, a mapping table exporting module 203, a data element creating module 204, a data element attribute calculating module 205, a data element reviewing module 206, a mapping table reviewing module 207 and a data element batch deleting module 208.
[0128] The preprocessing module 201 is used to pre-construct a compound storage relationship mapping table based on the database design scheme of the compound database, which is recorded as the corresponding first mapping table; and customize a corresponding field data format rule for each type of data element field in the first mapping table; and form a corresponding first data rule set by all the obtained field data format rules; and update the corresponding field data format rules in the first data rule set in real time when the field data format requirements of any type of data element field change; each row of the first mapping table corresponds to a compound data element, and each column corresponds to a type of data element field. Each mapping table unit of the first mapping table corresponds to a set of database read / write interfaces in the compound database corresponding to the field data corresponding to a data element field of a compound data element; the data element field includes at least a SMILES sequence field, a molecular chemical formula field, a type I molecular fingerprint field, a type II molecular fingerprint field, a type III molecular fingerprint field, multiple types of physical property fields, and multiple types of chemical property fields.
[0129] The access application receiving module 202 is used to receive a first access application input by a user; and extract the corresponding first access interface type and first interface parameters from the first access application; the first access application includes the first access interface type and the first interface parameters; the first access interface type includes at least a mapping table export interface, a data element creation interface, a data element attribute calculation interface, a data element review interface, a mapping table review interface and a data element batch deletion interface.
[0130] The mapping table export module 203 is configured to perform corresponding mapping table export processing according to the first interface parameters and the first mapping table when the first access interface type is a mapping table export interface.
[0131] The data element creation module 204 is configured to perform corresponding data element addition or update processing according to the first interface parameters, the first mapping table and the first data rule set when the first access interface type is a data element creation interface.
[0132] The data element attribute calculation module 205 is configured to perform corresponding data element attribute calculation processing according to the first interface parameters and the first mapping table when the first access interface type is a data element attribute calculation interface.
[0133] The data element review module 206 is configured to perform corresponding data element review processing according to the first interface parameters, the first mapping table and the first data rule set when the first access interface type is a data element review interface.
[0134] The mapping table review module 207 is configured to perform corresponding mapping table review processing according to the first interface parameter, the first mapping table and the first data rule set when the first access interface type is a mapping table review interface.
[0135] The data element batch deletion module 208 is configured to perform corresponding data element batch deletion processing according to the first interface parameters and the first mapping table when the first access interface type is a data element batch deletion interface.
[0136] An embodiment of the present invention provides a processing device for a compound data element access interface, which can execute the method steps in the above method embodiment. Its implementation principles and technical effects are similar and will not be repeated here.
[0137] It should be noted that it should be understood that the division of the various modules of the above device is merely a division of logical functions. In actual implementation, they can be fully or partially integrated into a physical entity, or they can be physically separated. Moreover, these modules can all be implemented in the form of software called by a processing element; or they can all be implemented in the form of hardware; or some modules can be implemented in the form of software called by a processing element, and some modules can be implemented in the form of hardware. For example, the preprocessing module can be a separately established processing element, or it can be integrated into a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called by a processing element of the above device to perform the functions of the above-mentioned module. The implementation of other modules is similar. In addition, these modules can all or partly be integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed by hardware integrated logic circuits in the processor element or instructions in the form of software.
[0138] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented by scheduling program code through a processing element, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0139] In the above embodiments, all or part of the embodiments may be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the above method embodiments are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The above-mentioned computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the above-mentioned computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, Bluetooth, microwave, etc.) means. The above-mentioned computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The above-mentioned available medium can be a magnetic medium (such as a floppy disk, hard disk, tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
[0140] Figure 3 This is a schematic diagram of the structure of an electronic device provided in the third embodiment of the present invention. The electronic device can be a terminal device or server that implements the method of the aforementioned embodiment, or it can be a terminal device or server that implements the method of the aforementioned embodiment connected to the aforementioned terminal device or server. Figure 3 As shown, the electronic device may include: a processor 301 (such as a CPU), a memory 302, and a transceiver 303; the transceiver 303 is coupled to the processor 301, and the processor 301 controls the transceiver 303's transceiver actions. Various instructions may be stored in the memory 302 for completing various processing functions and implementing the processing steps described in the aforementioned embodiment method. Preferably, the electronic device involved in the embodiment of the present invention further includes: a power supply 304, a system bus 305, and a communication port 306. The system bus 305 is used to realize communication connections between components. The above-mentioned communication port 306 is used for connecting and communicating between the electronic device and other peripherals.
[0141] exist Figure 3The system bus 305 mentioned in the figure can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to realize communication between the database access device and other devices (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory (Non-Volatile Memory), such as at least one disk storage.
[0142] The above-mentioned processors can be general-purpose processors, including central processing units (CPUs), network processors (NPs), graphics processing units (GPUs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0143] It should be noted that an embodiment of the present invention further provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is run on a computer, it enables the computer to execute the methods and processing procedures provided in the above embodiments.
[0144] The embodiment of the present invention provides a method, device, electronic device and computer-readable storage medium for processing a compound data element access interface. As can be seen from the above content, the embodiment of the present invention pre-constructs a compound storage relationship mapping table based on the database design scheme of any compound database, which is recorded as the first mapping table; and customizes a corresponding field data format rule for each type of data element field of the first mapping table; and all the obtained field data format rules form a first data rule set; and when the field data format requirements of any type of data element field change, the corresponding field data format rules in the first data rule set are updated in real time; and after receiving the first access application input by the receiving user, the corresponding first access interface type (mapping table export interface, data element creation interface, data element attribute calculation interface, data element review interface, mapping table review interface and data element batch deletion interface) and first interface parameters are extracted from it; and when the first access interface type is a mapping table When exporting the interface, the mapping table export processing is performed according to the first interface parameters and the first mapping table; when the first access interface type is the data element creation interface, the data element addition or update processing is performed according to the first interface parameters, the first mapping table and the first data rule set; when the first access interface type is the data element attribute calculation interface, the data element attribute calculation processing is performed according to the first interface parameters and the first mapping table; when the first access interface type is the data element review interface, the data element review processing is performed according to the first interface parameters, the first mapping table and the first data rule set; when the first access interface type is the mapping table review interface, the mapping table review processing is performed according to the first interface parameters, the first mapping table and the first data rule set; when the first access interface type is the data element batch deletion interface, the data element batch deletion processing is performed according to the first interface parameters and the first mapping table. The embodiment of the present invention, on the one hand, has functionally modified the data element creation interface so that it can complete compound data element creation based on incomplete compound data element information and can standardize the SMILES sequence when creating compound data elements; on the other hand, it has added a data element attribute calculation interface to automatically complete compound data elements that are missing during creation and automatically update compound data elements with outdated field data; on the other hand, it has added a data element review interface and a mapping table review interface to review the data format of a single, multiple, or even all compound data elements; in addition, it has added a mapping table export interface to obtain the complete information of a single, multiple, or even all compound data elements, and added a data element batch deletion interface to centrally delete a single or multiple compound data elements that have been reviewed for errors. Combining the embodiment of the present invention with a conventional data element access interface not only reduces the attribute calculation workload of the creator and improves the efficiency of data element creation, but also reduces the waste of data storage resources, reduces the data error rate of the database, and improves the accuracy of data queries.
[0145] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0146] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for processing a compound data element access interface, characterized in that: The method comprises: A compound storage relationship mapping table is constructed in advance based on the database design scheme of the compound database, which is recorded as the corresponding first mapping table; and a corresponding field data format rule is customized for each type of data element field in the first mapping table; and a corresponding first data rule set is composed of all the obtained field data format rules; and the corresponding field data format rule in the first data rule set is updated in real time when the field data format requirement of any type of data element field changes; each row of the first mapping table corresponds to a compound data element, and each column corresponds to a type of data element field, and each mapping table unit of the first mapping table corresponds to a set of database read / write interfaces in the compound database for field data corresponding to a data element field of a compound data element; the data element field includes at least a SMILES sequence field, a molecular chemical formula field, a type I molecular fingerprint field, a type II molecular fingerprint field, a type III molecular fingerprint field, multiple types of physical property fields, and multiple types of chemical property fields; Receive a first access request input by a user; extract a corresponding first access interface type and first interface parameters from the first access request; the first access request includes the first access interface type and the first interface parameters; the first access interface type includes at least a mapping table export interface, a data element creation interface, a data element attribute calculation interface, a data element review interface, a mapping table review interface, and a data element batch deletion interface; If the first access interface type is a mapping table export interface, performing corresponding mapping table export processing according to the first interface parameters and the first mapping table; If the first access interface type is a data element creation interface, performing corresponding data element addition or update processing according to the first interface parameters, the first mapping table and the first data rule set; If the first access interface type is a data element attribute calculation interface, performing corresponding data element attribute calculation processing according to the first interface parameters and the first mapping table; If the first access interface type is a data element review interface, performing corresponding data element review processing according to the first interface parameters, the first mapping table and the first data rule set; If the first access interface type is a mapping table review interface, performing corresponding mapping table review processing according to the first interface parameters, the first mapping table and the first data rule set; If the first access interface type is a data element batch deletion interface, corresponding data element batch deletion processing is performed according to the first interface parameters and the first mapping table.
2. The method for processing a compound data element access interface according to claim 1, characterized in that: When the first access interface type is a mapping table export interface, the first interface parameters include a first export mode and a first row identifier sequence; the first export mode includes a full table export mode and a partial export mode; when the first export mode is the full table export mode, the first row identifier sequence is empty; when the first export mode is the partial export mode, the first row identifier sequence consists of one or more first row identifiers; When the first access interface type is a data element creation interface, the first interface parameters include multiple first field items; among all the first field items, only the first field data of the first field item whose first field name is SMILES sequence cannot be empty; the first field item includes the first field name and the first field data; the first field name includes SMILES sequence, molecular chemical formula, class I molecular fingerprint, class II molecular fingerprint, class III molecular fingerprint, multiple physical property names and multiple chemical property names; the class I molecular fingerprint corresponds to the compound molecular fingerprint type calculated based on the torsionbv algorithm; the class II molecular fingerprint corresponds to the compound molecular fingerprint type calculated based on the mfp2 algorithm; the class III molecular fingerprint corresponds to the compound molecular fingerprint type calculated based on the ffp2 algorithm; When the first access interface type is a data element attribute calculation interface, the first interface parameters include a first SMILES sequence and a second field name sequence; the second field name sequence consists of one or more second field names; the second field names include molecular chemical formulas, first-class molecular fingerprints, second-class molecular fingerprints, third-class molecular fingerprints, multiple physical property names, and multiple chemical property names; When the first access interface type is a data element review interface, the first interface parameter includes a second SMILES sequence; When the first access interface type is a mapping table review interface, the first interface parameters include a first review mode and a second row identifier sequence; the first review mode includes a full table review mode and a partial review mode; when the first review mode is the full table review mode, the second row identifier sequence is empty; when the first review mode is the partial review mode, the second row identifier sequence consists of one or more second row identifiers; When the first access interface type is a data element batch deletion interface, the first interface parameter includes a third row identifier sequence; the third row identifier sequence consists of one or more third row identifiers.
3. The method for processing a compound data element access interface according to claim 2, characterized in that: The performing corresponding mapping table export processing according to the first interface parameter and the first mapping table specifically includes: Step 31: extracting the corresponding first export mode and first row identification sequence from the first interface parameters; Step 32: Identify the first export mode; if the first export mode is a full-table export mode, then all rows of the first mapping table constitute a corresponding first target row set; if the first export mode is a partial export mode, then all rows corresponding to the first row identifiers of the first row identifier sequence in the first mapping table constitute a corresponding first target row set; Step 33: Perform a round of traversal on all rows of the first target row set; during this round of traversal, use the currently traversed row as the corresponding current mapping row; use each mapping table unit of the currently traversed row as the corresponding current mapping table unit, and read the database data corresponding to the current mapping table unit in the compound database through the database read interface corresponding to the current mapping table unit as the corresponding current field data, and form a corresponding derived field item from the data element field corresponding to the current mapping table unit and the current field data; and form a corresponding derived compound data element from all the derived field items corresponding to the current mapping row; and at the end of this round of traversal, form a corresponding first processing result from all the derived compound data elements obtained; Step 34: Feedback the obtained first processing result to the current user.
4. The method for processing a compound data element access interface according to claim 2, characterized in that: The performing corresponding data element addition or update processing according to the first interface parameter, the first mapping table and the first data rule set specifically includes: Step 41: Identify whether the first field data of the first field item whose first field name is a SMILES sequence in the first interface parameter is empty; if so, set the corresponding second processing result to failure and go to step 47; if not, go to step 42; Step 42: Record each first field item in the first interface parameter whose first field data is not empty as the corresponding current field item; perform a field data compliance check on the first field data of the current field item based on the field data format rule corresponding to the current field item in the first data rule set to obtain a corresponding first check result; and identify whether all the obtained first check results are compliant; if so, proceed to step 43; if not, set the corresponding second processing result to failure, and proceed to step 47; Wherein, the first inspection result includes compliance and non-compliance; Step 43: Use the first field data of the first field item whose first field name is SMILES sequence in the first interface parameter as the corresponding current SMILES sequence; input the current SMILES sequence into a preset SMILES sequence standardization processing interface for processing to obtain the corresponding current standard sequence; record the corresponding column of the SMILES sequence field in the first mapping table as the corresponding current mapping column; use each mapping table unit of the current mapping column as the corresponding current mapping table unit, and read the database data corresponding to the current mapping table unit from the compound database through the database reading interface corresponding to the current mapping table unit as the corresponding first inventory SMILES sequence, and form a corresponding first inventory sequence set from all the obtained first inventory SMILES sequences; record the first inventory SMILES sequence in the first inventory sequence set that matches the current standard sequence as the corresponding first matching inventory sequence; and identify whether the first matching inventory sequence is empty; if so, go to step 44; if not, go to step 45; Wherein, the SMILES sequence standardization processing interface at least includes a standardized SMILES sequence processing interface provided by the RDKit tool; Step 44: Adding the corresponding compound data element to the compound database according to the first interface parameters based on the database design scheme of the compound database; if the addition is successful, obtaining the database read / write interfaces corresponding to all the data element fields of the compound data element added this time; adding a new row to the first mapping table as the corresponding current added row; and creating a correspondence between each mapping table cell of the current added row and a set of database read / write interfaces for the corresponding data element fields; and if the correspondence is successfully created, setting the corresponding second processing result to success, and proceeding to step 47; Step 45: extract all the first field items in the first interface parameter whose first field names are not SMILES sequences and whose first field data are not empty to form a corresponding first field item set; and identify whether the first field item set is empty; if so, set the corresponding second processing result to failure and go to step 47; if not, go to step 46; Step 46: Use the row corresponding to the first matching inventory sequence in the first mapping table as the corresponding current mapping row; use each first field item in the first field item set as the corresponding current field item; use the mapping table unit corresponding to the data element field in the current mapping row and the first field name of the current field item as the corresponding current mapping table unit; and update the database data corresponding to the current mapping table unit in the compound database to the first field data of the current field item through the database write interface corresponding to the current mapping table unit; and after the database data corresponding to all the first field items in the first field item set are successfully updated, set the corresponding second processing result to success; Step 47: Feedback the obtained second processing result to the current user.
5. The method for processing a compound data element access interface according to claim 2, characterized in that: The performing corresponding data element attribute calculation processing according to the first interface parameter and the first mapping table specifically includes: Step 51: extract the corresponding first SMILES sequence and second field name sequence from the first interface parameters; Step 52: Input the first SMILES sequence into a preset SMILES sequence standardization processing interface for processing to obtain a corresponding current standard sequence; record the corresponding column of the SMILES sequence field in the first mapping table as the corresponding current mapping column; and use each mapping table unit of the current mapping column as the corresponding current mapping table unit. Then, read the database data corresponding to the current mapping table unit in the compound database through the database reading interface corresponding to the current mapping table unit as the corresponding second inventory SMILES sequence, and form a corresponding second inventory sequence set from all the obtained second inventory SMILES sequences; and record the second inventory SMILES sequence in the second inventory sequence set that matches the current standard sequence as the corresponding second matching inventory sequence; and identify whether the second matching inventory sequence is empty; if so, set the corresponding third processing result to failure, and go to step 54; if not, set the corresponding row of the second matching inventory sequence in the first mapping table as the corresponding current mapping row, and go to step 53; Step 53: use each second field name in the second field name sequence as the corresponding current field name; use the processing interface corresponding to the current field name provided by the preset attribute calculation tool as the corresponding current processing interface; input the first SMILES sequence into the current processing interface for processing and use the processed data returned by the interface as the corresponding current field data; use the mapping table unit corresponding to the data element field in the current mapping row and the current field name as the corresponding current mapping table unit; and update the database data corresponding to the current mapping table unit in the compound database to the corresponding current field data through the database write interface corresponding to the current mapping table unit; and after the database data corresponding to all the second field names in the second field name sequence are successfully updated, set the corresponding third processing result to success; Wherein, the attribute calculation tool at least includes RDKit tool; Step 54: Feedback the third processing result to the current user.
6. The method for processing a compound data element access interface according to claim 2, characterized in that: The performing corresponding data element review processing according to the first interface parameter, the first mapping table and the first data rule set specifically includes: Step 61: extract the corresponding second SMILES sequence from the first interface parameters; Step 62: Input the second SMILES sequence into a preset SMILES sequence standardization processing interface for processing to obtain a corresponding current standard sequence; record the corresponding column of the SMILES sequence field in the first mapping table as the corresponding current mapping column; use each mapping table unit of the current mapping column as the corresponding current mapping table unit, and read the database data corresponding to the current mapping table unit from the compound database through the database reading interface corresponding to the current mapping table unit as the corresponding third inventory SMILES sequence, and form a corresponding third inventory sequence set from all the obtained third inventory SMILES sequences; record the third inventory SMILES sequence in the third inventory sequence set that matches the current standard sequence as the corresponding third matching inventory sequence; and identify whether the third matching inventory sequence is empty; if so, set the corresponding fourth processing result to failure, and go to step 65; if not, set the corresponding row of the third matching inventory sequence in the first mapping table as the corresponding current mapping row, and go to step 63; Step 63: Use each mapping table unit of the current mapping row as a corresponding current mapping table unit; read the database data corresponding to the current mapping table unit in the compound database through the database read interface corresponding to the current mapping table unit as the corresponding current field data; use the field data format rule corresponding to the data element field corresponding to the current mapping table unit in the first data rule set as the corresponding current field data format rule; and perform a field data compliance check on the current field data based on the current field data format rule to obtain a corresponding second check result; Wherein, the second inspection result includes compliance and non-compliance; Step 64: Identify whether all the obtained second check results are compliant; if so, set the corresponding fourth processing result to no exception; if not, use the row identifier corresponding to the current mapping row in the first mapping table as the corresponding first error row identifier, and use the column identifier corresponding to each data element field corresponding to the second check result that is specifically non-compliant in the first mapping table as the corresponding first error column identifier, and form a corresponding first error column identifier sequence from all the obtained first error column identifiers, and form the corresponding fourth processing result from the first error row identifier and the first error column identifier sequence. Step 65: Feedback the fourth processing result to the current user.
7. The method for processing a compound data element access interface according to claim 2, characterized in that: The performing corresponding mapping table review processing according to the first interface parameter, the first mapping table, and the first data rule set specifically includes: Step 71: extract the corresponding first review mode and second row identification sequence from the first interface parameters; Step 72: Identify the first review mode. If the first review mode is a full-table review mode, then all rows of the first mapping table constitute the corresponding second target row set. If the first review mode is a partial review mode, then all rows corresponding to the second row identifiers of the second row identifier sequence in the first mapping table constitute the corresponding second target row set. Step 73, perform a round of traversal on all rows of the second target row set; and in this round of traversal, use the current traversal row as the corresponding current mapping row; and use each of the mapping table units of the current mapping row as the corresponding current mapping table unit, and read the database data corresponding to the current mapping table unit in the compound database through the database read interface corresponding to the current mapping table unit as the corresponding current field data, and use the field data format rule corresponding to the data element field corresponding to the current mapping table unit in the first data rule set as the corresponding current field data format rule, and perform a field data compliance check on the current field data based on the current field data format rule to obtain a corresponding third check result; and use the current mapping row in the first mapping table corresponding to as the corresponding current row identifier; and identify whether all the third check results corresponding to the current mapping row are compliant; if so, set the corresponding current row review result to no exception, and form a corresponding first row review result by the current row identifier and the current row review result; if not, use the column identifier corresponding to the data element field corresponding to each of the third check results that are specifically non-compliant corresponding to the current mapping row in the first mapping table as the corresponding second error column identifier, and form a corresponding second error column identifier sequence by all the obtained second error column identifiers, and form a corresponding first row review result by the current row identifier and the second error column identifier sequence; and at the end of this round of traversal, form a corresponding fifth processing result by all the obtained first row review results; Step 74: Feedback the fifth processing result to the current user.
8. The method for processing a compound data element access interface according to claim 2, characterized in that: The performing corresponding batch deletion of data elements according to the first interface parameter and the first mapping table specifically includes: Step 81: extract the corresponding third row identification sequence from the first interface parameter; Step 82: Form a corresponding third target row set from the rows corresponding to all the third row identifiers of the third row identifier sequence in the first mapping table; Step 83: perform a round of traversal on all rows of the third target row set; and during this round of traversal, use the currently traversed row as the corresponding current mapping row; and use the mapping table unit corresponding to the SMILES sequence field in the currently mapped row as the corresponding current SMILES sequence unit, and read the database data corresponding to the current SMILES sequence unit in the compound database through the database read interface corresponding to the current SMILES sequence unit as the corresponding current SMILES sequence; and perform corresponding compound data element deletion processing in the compound database according to the current SMILES sequence based on the database design scheme of the compound database; and when the deletion processing is successful, invalidate the database read / write interface corresponding to the mapping table unit of the currently mapped row, and record the currently mapped row as the corresponding row to be deleted; and at the end of this round of traversal, perform batch deletion processing on all the rows to be deleted in the first mapping table; and when the batch deletion is successful, set the corresponding sixth processing result to success; Step 84: Feedback the obtained sixth processing result to the current user.
9. A device for executing the method for processing the compound data element access interface according to any one of claims 1 to 8, characterized in that: The device comprises: a pre-processing module, an access application receiving module, a mapping table exporting module, a data element creating module, a data element attribute calculating module, a data element reviewing module, a mapping table reviewing module and a data element batch deleting module; The preprocessing module is used to construct a compound storage relationship mapping table based on the database design scheme of the compound database in advance, which is recorded as the corresponding first mapping table; and customize a corresponding field data format rule for each type of data element field in the first mapping table; and form a corresponding first data rule set by all the obtained field data format rules; and update the corresponding field data format rule in the first data rule set in real time when the field data format requirement of any type of data element field changes; each row of the first mapping table corresponds to a compound data element, and each column corresponds to a type of data element field, and each mapping table unit of the first mapping table corresponds to a set of database read / write interfaces in the compound database for field data corresponding to a data element field of a compound data element; the data element field includes at least a SMILES sequence field, a molecular formula field, a type I molecular fingerprint field, a type II molecular fingerprint field, a type III molecular fingerprint field, multiple types of physical property fields, and multiple types of chemical property fields; The access application receiving module is used to receive a first access application input by a user; and extract the corresponding first access interface type and first interface parameters from the first access application; the first access application includes the first access interface type and the first interface parameters; the first access interface type includes at least a mapping table export interface, a data element creation interface, a data element attribute calculation interface, a data element review interface, a mapping table review interface, and a data element batch deletion interface; The mapping table export module is configured to perform corresponding mapping table export processing according to the first interface parameters and the first mapping table when the first access interface type is a mapping table export interface; The data element creation module is configured to perform corresponding data element addition or update processing according to the first interface parameters, the first mapping table, and the first data rule set when the first access interface type is a data element creation interface; The data element attribute calculation module is configured to perform corresponding data element attribute calculation processing according to the first interface parameters and the first mapping table when the first access interface type is a data element attribute calculation interface; The data element review module is configured to perform corresponding data element review processing according to the first interface parameters, the first mapping table and the first data rule set when the first access interface type is a data element review interface; The mapping table review module is configured to perform corresponding mapping table review processing according to the first interface parameters, the first mapping table and the first data rule set when the first access interface type is a mapping table review interface; The data element batch deletion module is used to perform corresponding data element batch deletion processing according to the first interface parameters and the first mapping table when the first access interface type is a data element batch deletion interface.
10. An electronic device, characterized in that: include: memory, processors, and transceivers; The processor is configured to be coupled to the memory, read and execute instructions in the memory, so as to implement the method according to any one of claims 1 to 8; The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer is caused to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Data processing method and system for drug research and development
CN112164430A
Interface generation method, database, electronic equipment and storage medium
CN116048496A