CN115827667A - Data information query processing method and device - Google Patents
Data information query processing method and device Download PDFInfo
- Publication number
- CN115827667A CN115827667A CN202211514988.4A CN202211514988A CN115827667A CN 115827667 A CN115827667 A CN 115827667A CN 202211514988 A CN202211514988 A CN 202211514988A CN 115827667 A CN115827667 A CN 115827667A
- Authority
- CN
- China
- Prior art keywords
- preset
- data
- unit
- corresponding relation
- determining
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a data information query processing method and device, relates to the technical field of data processing, and can be used in the financial field or other technical fields. The method comprises the following steps: acquiring a transaction element, and determining a data fragment corresponding to the transaction element information according to a first preset corresponding relation; determining a unit corresponding to the data fragment according to a second preset corresponding relation, and acquiring a unit state of the unit; and if the unit state is determined to be a normal state, determining database information corresponding to each data fragment of the unit according to a third preset corresponding relation, and taking the database information as a data query result. The device performs the above method. The data information query processing method and the device provided by the embodiment of the invention can improve the utilization rate of equipment resources and realize low-cost data information query.
Description
Technical Field
The invention relates to the technical field of data processing, in particular to a data information query processing method and device.
Background
An enterprise implements unitized architecture deployment, which is based on a distributed architecture of database shards, as shown in fig. 1, because the number of units is usually less than the number of database shards, the database shards are taken as a core, the data shards are uniformly divided, and then the data shards are divided into one unit. The intra-unit application server and the database service are generally connected in a sharded manner or a tenant manner.
Because the application servers of all the fragments in the unit are in binding relation with the database, the defects that the application servers of different fragments in the unit cannot be shared, and more devices need to be deployed exist, and the resource utilization rate is low.
Disclosure of Invention
For solving the problems in the prior art, embodiments of the present invention provide a method and an apparatus for querying and processing data information, which can at least partially solve the problems in the prior art.
In one aspect, the present invention provides a data information query processing method, including:
acquiring a transaction element, and determining a data fragment corresponding to the transaction element information according to a first preset corresponding relation;
the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments;
determining a unit corresponding to the data fragment according to a second preset corresponding relation, and acquiring a unit state of the unit;
the second preset corresponding relation comprises a corresponding relation between a preset data fragment and a preset unit;
if the unit state is determined to be a normal state, determining database information corresponding to each data fragment of the unit according to a third preset corresponding relation, and taking the database information as a data query result;
the third preset corresponding relationship comprises a corresponding relationship between the preset data fragments and preset database information.
Wherein the transaction element information includes a transaction element order of magnitude; correspondingly, the data information query processing method further comprises the following steps:
determining a data fragment matching mode according to a comparison result of the transaction element magnitude and a preset transaction element magnitude threshold;
and determining the data fragment corresponding to the transaction element information according to the data fragment matching mode.
Wherein, the determining the data fragment matching mode according to the comparison result of the order of the transaction element and the preset order of the transaction element threshold comprises:
and if the order of magnitude of the transaction element is determined to be larger than or equal to the preset order of magnitude threshold of the transaction element, determining that the data fragment matching mode is to call a plug-in to calculate the data fragment.
Wherein, the determining the data fragment matching mode according to the comparison result of the order of the transaction element and the preset order of the transaction element threshold comprises:
and if the order of magnitude of the transaction element is smaller than a preset order of magnitude threshold value of the transaction element, determining a data fragment matching mode as data fragments according to a first preset corresponding relation.
The data fragment matching mode comprises the step of calling a plug-in to calculate data fragments; correspondingly, the determining the data fragment corresponding to the transaction element information according to the data fragment matching mode includes:
responding to a mapping algorithm function selected by a user, and determining a plug-in path corresponding to the mapping algorithm function according to a fourth preset corresponding relation;
the fourth preset corresponding relation comprises a corresponding relation between a preset mapping algorithm function and a preset plug-in path;
and acquiring the mapping algorithm function according to the plug-in path, and calculating the data fragment corresponding to the transaction element information based on the mapping algorithm function.
Wherein the standby unit taking over the unit is determined according to the pre-configuration information; correspondingly, the data information query processing method further comprises the following steps:
if the unit is detected to be abnormal, the unit state of the unit is switched to an abnormal state;
and if the unit state of the standby unit is determined to be a normal state, determining database information corresponding to each data fragment of the standby unit according to a third preset corresponding relation, and taking the database information as a data query result.
The data information query processing method further comprises the following steps:
and pre-storing the first preset corresponding relation, the second preset corresponding relation, the third preset corresponding relation and the fourth preset corresponding relation in a local cache.
In one aspect, the present invention provides a data information query processing apparatus, including:
the determining unit is used for acquiring the transaction element and determining the data fragment corresponding to the transaction element information according to the first preset corresponding relation;
the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments;
the acquisition unit is used for determining a unit corresponding to the data fragment according to a second preset corresponding relation and acquiring the unit state of the unit;
the second preset corresponding relation comprises a corresponding relation between a preset data fragment and a preset unit;
the query unit is used for determining database information corresponding to each data fragment of the unit according to a third preset corresponding relation if the unit state is determined to be a normal state, and taking the database information as a data query result;
the third preset corresponding relationship comprises a corresponding relationship between the preset data fragments and preset database information.
In another aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory, and a bus, wherein,
the processor and the memory are communicated with each other through the bus;
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform a method comprising:
acquiring a transaction element, and determining a data fragment corresponding to the transaction element information according to a first preset corresponding relation;
the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments;
determining a unit corresponding to the data fragment according to a second preset corresponding relation, and acquiring a unit state of the unit;
the second preset corresponding relation comprises a corresponding relation between a preset data fragment and a preset unit;
if the unit state is determined to be a normal state, determining database information corresponding to each data fragment of the unit according to a third preset corresponding relation, and taking the database information as a data query result;
the third preset corresponding relationship comprises a corresponding relationship between the preset data fragments and preset database information.
An embodiment of the present invention provides a non-transitory computer-readable storage medium, including:
the non-transitory computer readable storage medium stores computer instructions that cause the computer to perform a method comprising:
acquiring a transaction element, and determining a data fragment corresponding to the transaction element information according to a first preset corresponding relation;
the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments;
determining a unit corresponding to the data fragment according to a second preset corresponding relation, and acquiring a unit state of the unit;
the second preset corresponding relation comprises a corresponding relation between a preset data fragment and a preset unit;
if the unit state is determined to be a normal state, determining database information corresponding to each data fragment of the unit according to a third preset corresponding relation, and taking the database information as a data query result;
the third preset corresponding relationship comprises a corresponding relationship between the preset data fragments and preset database information.
The data information query processing method and device provided by the embodiment of the invention are used for acquiring transaction elements and determining data fragments corresponding to the transaction element information according to a first preset corresponding relation; the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments; determining a unit corresponding to the data fragment according to a second preset corresponding relation, and acquiring a unit state of the unit; the second preset corresponding relation comprises a corresponding relation between a preset data fragment and a preset unit; if the unit state is determined to be a normal state, determining database information corresponding to each data fragment of the unit according to a third preset corresponding relation, and taking the database information as a data query result; the third preset corresponding relation comprises the corresponding relation between the preset data fragments and the preset database information, so that the utilization rate of equipment resources can be improved, and low-cost data information query is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
FIG. 1 is a schematic diagram of a prior art deployment unit architecture.
FIG. 2 is a schematic diagram of a deployment unit architecture according to an embodiment of the present invention.
Fig. 3 is a flowchart illustrating a data information query processing method according to an embodiment of the present invention.
Fig. 4 is a schematic structural diagram of a data routing apparatus according to an embodiment of the present invention.
Fig. 5 is a flowchart illustrating a data information query processing method according to another embodiment of the present invention.
Fig. 6 is a schematic flowchart of a data information query processing method according to another embodiment of the present invention.
Fig. 7 is a schematic structural diagram of a data information query processing apparatus according to an embodiment of the present invention.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
Description of related terms:
a unit: a self-contained collection which can satisfy the relevant operation of a business processing link divided by a certain class of business according to a certain dimension contains most key services required by the business processing link and data required to be processed by the unit.
The unit structure comprises: the unit is taken as a basic unit for deployment, and most key applications or functional modules required by guest services are deployed in the unit.
The disadvantages of the architecture shown in fig. 1 are further explained in conjunction with fig. 1 as follows:
1) Application servers among different fragments in a unit cannot be shared, special backup devices (normally idle state) of each fragment application server cluster and a database cluster need to be prepared at the same time, and high availability strategies at a fragment level and a unit level need to be prepared at the same time:
A. when a certain fragmentation application server cluster in the unit fails, the fragmentation application server cluster is switched to another corresponding fragmentation application server cluster which is prepared in advance in the backup unit and is specially used for backup by the access route;
B. and if the application server of the whole unit fails, switching all the fragmented application server clusters of the unit to all corresponding fragmented application server clusters which are prepared in advance in the backup unit and are specially used for backup.
2) Due to the high availability strategy, more devices need to be deployed correspondingly, and the cost is higher.
Taking 32 pieces of fragments in each unit as an example, the application server of each fragment needs at least 2 high available load guarantees, and then at least 64 application servers are needed in a unit, and in addition, 64 application servers need to be backed up in another unit, and in conclusion, each unit needs at least 128 application servers in total, especially for applications with not large traffic, since uniform number of fragments and units must be followed, it is more wasteful to deploy the device in this way.
The overall high availability deployment costs are high and the high availability strategy is complex.
As shown in fig. 2, the architecture shown in fig. 1 is modified as follows:
1) A new lightweight data routing device is provided:
the data routing device is deployed to the application servers in each unit, the application servers in the units are subjected to unified cluster processing, and all the fragments are commonly shared.
2) High availability policy changes:
the application servers in the unit become a unified cluster for processing, the high-availability strategy of different fragmentation application servers in the unit does not need to be considered independently, and the operation and maintenance cost is simplified.
The disaster recovery backup connection pipe among the units can directly multiplex the application server cluster of the other unit, and the disaster recovery backup server cluster does not need to be prepared in the other unit, so that the deployment cost is saved.
The beneficial effects include:
1) The traditional one-layer application server routing method based on the distributed architecture is changed into two-layer application server routing, and the inherent method that the traditional distributed deployment architecture application server and the database server are paired to form the SET is broken through.
2) The data routing is usually used in a database link or integrated in a database as a data access layer, the invention is integrated in an application server, SQL sentences are not analyzed, the complexity is greatly reduced, the lightweight class improvement efficiency is kept, and the data routing is not deployed as an independent node, so that the communication among network nodes in one layer is reduced.
Fig. 3 is a schematic flow chart of a data information query processing method according to an embodiment of the present invention, and as shown in fig. 3, the data information query processing method according to the embodiment of the present invention includes:
step S1: acquiring a transaction element, and determining a data fragment corresponding to the transaction element information according to a first preset corresponding relation;
the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments.
Step S2: determining a unit corresponding to the data fragment according to a second preset corresponding relation, and acquiring a unit state of the unit;
the second preset corresponding relation comprises a corresponding relation between a preset data fragment and a preset unit.
And step S3: if the unit state is determined to be a normal state, determining database information corresponding to each data fragment of the unit according to a third preset corresponding relation, and taking the database information as a data query result;
the third preset corresponding relationship comprises a corresponding relationship between the preset data fragments and preset database information.
In the step S1, the device acquires a transaction element, and determines a data fragment corresponding to the transaction element information according to a first preset correspondence;
the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments. The apparatus may be a computer device for executing the method, and may for example include a server, and may specifically be a server in an application server cluster as shown in fig. 2. It should be noted that the embodiments of the present invention relate to the acquisition and analysis of data being authorized by the user. The transaction element can be understood as transaction key data, including, for example, a transaction serial number, a transaction amount, transaction buyer and seller identity information, and the like.
The content in the first preset correspondence may include: field 1 (primary key) "transaction element", "shard".
In the step S2, the device determines the unit corresponding to the data fragment according to a second preset correspondence, and obtains a unit state of the unit; the cell state of the cell may include a normal state or an abnormal state.
The second preset corresponding relationship comprises a corresponding relationship between a preset data fragment and a preset unit. The content in the second preset correspondence may include:
field 1 (primary key) "shard", field 2 "element", field 3 "state".
In the step S3, if the device determines that the unit state is a normal state, the device determines database information corresponding to each data segment of the unit according to a third preset correspondence, and uses the database information as a data query result;
the third preset corresponding relationship comprises a corresponding relationship between the preset data fragments and preset database information. The content in the third preset correspondence may include:
field 1 (primary key) "shard", field 2 "connection string" (a string containing at least the target database domain name or IP, database user, password, separated by a separator).
If the cell state is determined to be an abnormal state (i.e., a disabled state), an error message may be returned.
The transaction element information comprises a transaction element order of magnitude; correspondingly, the data information query processing method further comprises the following steps:
determining a data fragment matching mode according to a comparison result of the transaction element magnitude and a preset transaction element magnitude threshold; the preset transaction element order magnitude threshold value can be set independently according to actual conditions, and can be selected to be hundreds of orders. The data fragment matching mode may include calling a plug-in to calculate the data fragment, or may include determining the data fragment according to a first preset correspondence.
And determining the data fragment corresponding to the transaction element information according to the data fragment matching mode.
The determining a data fragment matching mode according to the comparison result of the transaction element magnitude and a preset transaction element magnitude threshold value comprises the following steps:
and if the order of magnitude of the transaction element is determined to be larger than or equal to the preset order of magnitude threshold of the transaction element, determining that the data fragment matching mode is to call a plug-in to calculate the data fragment. Correspondingly, the determining the data fragment corresponding to the transaction element information according to the data fragment matching mode includes:
responding to a mapping algorithm function selected by a user, and determining a plug-in path corresponding to the mapping algorithm function according to a fourth preset corresponding relation;
the fourth preset corresponding relation comprises a corresponding relation between a preset mapping algorithm function and a preset plug-in path; the content in the fourth preset correspondence may include:
field 1 (whether a computing plug-in is used, and a preset mapping algorithm function, etc.), and field 2 (a preset plug-in path).
And acquiring the mapping algorithm function according to the plug-in path, and calculating the data fragment corresponding to the transaction element information based on the mapping algorithm function. The preset mapping algorithm function can comprise a hash mapping mode, a tail number last two-digit mode and the like, and a user can independently select one of the preset mapping algorithm functions as the mapping algorithm function.
The transaction element information may be input into a mapping algorithm function by taking a calculation result in the mapping algorithm function as a data slice corresponding to the transaction element information.
And if the order of magnitude of the transaction element is smaller than a preset order of magnitude threshold value of the transaction element, determining a data fragment matching mode as data fragments according to a first preset corresponding relation. The data fragmentation is determined according to the first preset correspondence, which can refer to the above description and is not repeated.
Determining a standby unit taking over the unit according to the pre-configuration information; correspondingly, the data information query processing method further comprises the following steps:
if the unit is detected to be abnormal, switching the unit state of the unit into an abnormal state; referring to fig. 2, the standby unit of the takeover unit 1 may be configured as a unit 2 in the pre-configuration information (not shown in fig. 2, and the unit 2 and the unit 1 are the same in structure and the like). When the cell 1 is detected to be abnormal, the cell state of the cell 1 is switched to an abnormal state.
And if the unit state of the standby unit is determined to be a normal state, determining database information corresponding to each data fragment of the standby unit according to a third preset corresponding relation, and taking the database information as a data query result. And if the cell state of the cell 2 is a normal state, determining database information corresponding to each data fragment of the cell 2 according to a third preset corresponding relation, thereby realizing switching between the main cell and the standby cell.
The data information query processing method further comprises the following steps:
and the first preset corresponding relation, the second preset corresponding relation, the third preset corresponding relation and the fourth preset corresponding relation are stored in a local cache in advance, so that data can be read quickly when the data reading device is used.
As shown in fig. 4, the data routing apparatus includes connection pool comparison, transaction element-fragment comparison, fragment-unit comparison, and plug-in state calculation.
The data information query processing method is explained, and as shown in fig. 5, the configuration center functions to configure the content.
Whether the range of the transaction elements is within the order of hundreds of data can be determined by inquiring the state of the computing plug-in, namely if the range of the transaction elements is within the order of hundreds of data, the computing plug-in is not used; if the data exceeds a hundred data magnitude, then a computing plug-in is used.
It should be noted that the final step in fig. 5 is to update the cell state, thereby ensuring that the cell state is correct.
As shown in fig. 6, the unit 1 is taken over by the unit 2 for explanation:
the access routing rules can be pre-stored in each application server cluster, and can be independently and flexibly configured according to actual conditions.
By enabling the connected state in time, it is ensured that unit 2 has access to the sharded database of unit 1.
After the unit 2 takes over the unit 1, the unit 2 can process not only the data processing task of the unit 1 but also the original data processing task of the unit 2.
The method of the invention overcomes the problems of high deployment cost and complex high availability strategy of the application server in the deployment unit of the existing unitized architecture, can be expanded and used in the scenes of disaster takeover, data fragment adjustment and migration among units and the like, has wide application scenes, almost no sense to clients, can better promote the continuity of service operation, and has better application prospect.
The data information query processing method provided by the embodiment of the invention comprises the steps of obtaining transaction elements, and determining data fragments corresponding to transaction element information according to a first preset corresponding relation; the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments; determining a unit corresponding to the data fragment according to a second preset corresponding relation, and acquiring a unit state of the unit; the second preset corresponding relation comprises a corresponding relation between a preset data fragment and a preset unit; if the unit state is determined to be a normal state, determining database information corresponding to each data fragment of the unit according to a third preset corresponding relation, and taking the database information as a data query result; the third preset corresponding relation comprises the corresponding relation between the preset data fragments and the preset database information, so that the utilization rate of equipment resources can be improved, and low-cost data information query is realized.
Further, the transaction element information includes a transaction element order; correspondingly, the data information query processing method further comprises the following steps:
determining a data fragment matching mode according to a comparison result of the transaction element magnitude and a preset transaction element magnitude threshold; reference is made to the above description and no further description is given.
And determining the data fragment corresponding to the transaction element information according to the data fragment matching mode. Reference is made to the above description and no further description is made.
The data information query processing method provided by the embodiment of the invention further improves the data information query efficiency by reasonably determining the data fragment matching mode.
Further, the determining a data fragment matching mode according to the comparison result between the transaction element magnitude and a preset transaction element magnitude threshold includes:
and if the order of magnitude of the transaction element is determined to be larger than or equal to the preset order of magnitude threshold of the transaction element, determining that the data fragment matching mode is to call a plug-in to calculate the data fragment. Reference is made to the above description and no further description is made.
The data information query processing method provided by the embodiment of the invention further improves the data information query efficiency by calling the plug-in to calculate the data fragments.
Further, the determining a data fragment matching mode according to the comparison result between the transaction element magnitude and a preset transaction element magnitude threshold includes:
and if the order of magnitude of the transaction element is smaller than a preset order of magnitude threshold value of the transaction element, determining a data fragment matching mode as data fragments according to a first preset corresponding relation. Reference is made to the above description and no further description is made.
According to the data information query processing method provided by the embodiment of the invention, the data fragments are determined according to the first preset corresponding relation, so that the data information query efficiency is further improved.
Further, the data fragment matching mode comprises calling a plug-in to calculate the data fragment; correspondingly, the determining the data fragment corresponding to the transaction element information according to the data fragment matching manner includes:
responding to a mapping algorithm function selected by a user, and determining a plug-in path corresponding to the mapping algorithm function according to a fourth preset corresponding relation; reference is made to the above description and no further description is made.
The fourth preset corresponding relation comprises a corresponding relation between a preset mapping algorithm function and a preset plug-in path; reference is made to the above description and no further description is made.
And acquiring the mapping algorithm function according to the plug-in path, and calculating the data fragment corresponding to the transaction element information based on the mapping algorithm function. Reference is made to the above description and no further description is made.
The data information query processing method provided by the embodiment of the invention can realize flexible determination of the data fragments by the user selecting the mapping algorithm function for calculating the data fragments.
Further, determining a standby unit taking over the unit according to the pre-configuration information; correspondingly, the data information query processing method further comprises the following steps:
if the unit is detected to be abnormal, switching the unit state of the unit into an abnormal state; reference is made to the above description and no further description is made.
And if the unit state of the standby unit is determined to be a normal state, determining database information corresponding to each data fragment of the standby unit according to a third preset corresponding relation, and taking the database information as a data query result. Reference is made to the above description and no further description is made.
The data information query processing method provided by the embodiment of the invention is convenient for switching the main unit and the standby unit and ensures that the data information query is available at any time.
Further, the data information query processing method further includes:
and pre-storing the first preset corresponding relation, the second preset corresponding relation, the third preset corresponding relation and the fourth preset corresponding relation in a local cache. Reference is made to the above description and no further description is made.
The data information query processing method provided by the embodiment of the invention improves the data reading efficiency.
It should be noted that the data information query processing method provided by the embodiment of the present invention may be used in the financial field, and may also be used in any technical field other than the financial field.
Fig. 7 is a schematic structural diagram of a data information query processing apparatus according to an embodiment of the present invention, and as shown in fig. 7, the data information query processing apparatus according to the embodiment of the present invention includes a determining unit 701, an obtaining unit 702, and a querying unit 703, where:
the determining unit 701 is configured to obtain a transaction element, and determine a data segment corresponding to transaction element information according to a first preset correspondence; the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments; the obtaining unit 702 is configured to determine a unit corresponding to the data segment according to a second preset corresponding relationship, and obtain a unit state of the unit; the second preset corresponding relation comprises a corresponding relation between a preset data fragment and a preset unit; the query unit 703 is configured to, if it is determined that the unit state is the normal state, determine database information corresponding to each data segment of the unit according to a third preset correspondence, and use the database information as a data query result; the third preset corresponding relationship comprises a corresponding relationship between the preset data fragments and preset database information.
Specifically, the determining unit 701 in the device is configured to obtain a transaction element, and determine a data segment corresponding to transaction element information according to a first preset correspondence; the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments; the obtaining unit 702 is configured to determine a unit corresponding to the data segment according to a second preset corresponding relationship, and obtain a unit state of the unit; the second preset corresponding relation comprises a corresponding relation between a preset data fragment and a preset unit; the query unit 703 is configured to determine, if it is determined that the unit state is a normal state, database information corresponding to each data segment of the unit according to a third preset correspondence, and use the database information as a data query result; the third preset corresponding relationship comprises a corresponding relationship between the preset data fragments and preset database information.
The data information query processing device provided by the embodiment of the invention acquires the transaction element, and determines the data fragment corresponding to the transaction element information according to the first preset corresponding relation; the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments; determining a unit corresponding to the data fragment according to a second preset corresponding relation, and acquiring a unit state of the unit; the second preset corresponding relation comprises a corresponding relation between a preset data fragment and a preset unit; if the unit state is determined to be a normal state, determining database information corresponding to each data fragment of the unit according to a third preset corresponding relation, and taking the database information as a data query result; the third preset corresponding relation comprises a corresponding relation between the preset data fragments and the preset database information, so that the utilization rate of equipment resources can be improved, and low-cost data information query is realized.
Further, the transaction element information includes a transaction element order; correspondingly, the data information query processing device is further configured to:
determining a data fragment matching mode according to a comparison result of the transaction element magnitude and a preset transaction element magnitude threshold;
and determining the data fragment corresponding to the transaction element information according to the data fragment matching mode.
The data information query processing device provided by the embodiment of the invention further improves the data information query efficiency by reasonably determining the data fragment matching mode.
Further, the data information query processing apparatus is further specifically configured to:
and if the order of magnitude of the transaction element is determined to be larger than or equal to the preset order of magnitude threshold of the transaction element, determining that the data fragment matching mode is to call a plug-in to calculate the data fragment.
The data information query processing device provided by the embodiment of the invention further improves the data information query efficiency by calling the plug-in to calculate the data fragments.
Further, the data information query processing apparatus is further specifically configured to:
and if the order of magnitude of the transaction element is smaller than a preset order of magnitude threshold value of the transaction element, determining a data fragment matching mode as data fragments according to a first preset corresponding relation.
According to the data information query processing device provided by the embodiment of the invention, the data fragmentation is determined according to the first preset corresponding relation, so that the data information query efficiency is further improved.
Further, the data fragment matching mode comprises calling a plug-in to calculate the data fragment; correspondingly, the data information query processing apparatus is further specifically configured to:
responding to a mapping algorithm function selected by a user, and determining a plug-in path corresponding to the mapping algorithm function according to a fourth preset corresponding relation;
the fourth preset corresponding relation comprises a corresponding relation between a preset mapping algorithm function and a preset plug-in path;
and acquiring the mapping algorithm function according to the plug-in path, and calculating the data fragment corresponding to the transaction element information based on the mapping algorithm function.
The data information query processing device provided by the embodiment of the invention can realize flexible determination of the data fragments by the user selecting the mapping algorithm function for calculating the data fragments.
Further, determining a standby unit taking over the unit according to the pre-configuration information; correspondingly, the data information query processing device is further configured to:
if the unit is detected to be abnormal, switching the unit state of the unit into an abnormal state;
and if the unit state of the standby unit is determined to be a normal state, determining database information corresponding to each data fragment of the standby unit according to a third preset corresponding relation, and taking the database information as a data query result.
The data information query processing device provided by the embodiment of the invention is convenient for switching the main unit and the standby unit, and ensures that the data information query is available at any time.
Further, the data information query processing device is further configured to:
and pre-storing the first preset corresponding relation, the second preset corresponding relation, the third preset corresponding relation and the fourth preset corresponding relation in a local cache.
The data information query processing device provided by the embodiment of the invention improves the data reading efficiency.
The embodiment of the apparatus for querying and processing data information provided in the embodiment of the present invention may be specifically configured to execute the processing flows of the above method embodiments, and its functions are not described herein again, and reference may be made to the detailed description of the above method embodiments.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 8, the electronic device includes: a processor (processor) 801, a memory (memory) 802, and a bus 803;
the processor 801 and the memory 802 complete communication with each other through a bus 803;
the processor 801 is configured to call program instructions in the memory 802 to perform the methods provided by the above-described method embodiments, including for example:
acquiring a transaction element, and determining a data fragment corresponding to the transaction element information according to a first preset corresponding relation;
the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments;
determining a unit corresponding to the data fragment according to a second preset corresponding relation, and acquiring a unit state of the unit;
the second preset corresponding relation comprises a corresponding relation between a preset data fragment and a preset unit;
if the unit state is determined to be a normal state, determining database information corresponding to each data fragment of the unit according to a third preset corresponding relation, and taking the database information as a data query result;
the third preset corresponding relationship comprises a corresponding relationship between the preset data fragments and preset database information.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, comprising:
acquiring a transaction element, and determining a data fragment corresponding to the transaction element information according to a first preset corresponding relation;
the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments;
determining a unit corresponding to the data fragment according to a second preset corresponding relation, and acquiring a unit state of the unit;
the second preset corresponding relation comprises a corresponding relation between a preset data fragment and a preset unit;
if the unit state is determined to be a normal state, determining database information corresponding to each data fragment of the unit according to a third preset corresponding relation, and taking the database information as a data query result;
the third preset corresponding relationship comprises a corresponding relationship between the preset data fragments and preset database information.
The present embodiment provides a computer-readable storage medium, which stores a computer program, where the computer program causes the computer to execute the method provided by the above method embodiments, for example, the method includes:
acquiring a transaction element, and determining a data fragment corresponding to the transaction element information according to a first preset corresponding relation;
the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments;
determining a unit corresponding to the data fragment according to a second preset corresponding relation, and acquiring a unit state of the unit;
the second preset corresponding relation comprises a corresponding relation between a preset data fragment and a preset unit;
if the unit state is determined to be a normal state, determining database information corresponding to each data fragment of the unit according to a third preset corresponding relation, and taking the database information as a data query result;
the third preset corresponding relationship comprises a corresponding relationship between the preset data fragments and preset database information.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In the description herein, reference to the description of the terms "one embodiment," "a particular embodiment," "some embodiments," "for example," "an example," "a particular example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (10)
1. A data information query processing method is characterized by comprising the following steps:
acquiring a transaction element, and determining a data fragment corresponding to the transaction element information according to a first preset corresponding relation;
the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments;
determining a unit corresponding to the data fragment according to a second preset corresponding relation, and acquiring a unit state of the unit;
the second preset corresponding relation comprises a corresponding relation between a preset data fragment and a preset unit;
if the unit state is determined to be a normal state, determining database information corresponding to each data fragment of the unit according to a third preset corresponding relation, and taking the database information as a data query result;
the third preset corresponding relationship comprises a corresponding relationship between the preset data fragments and preset database information.
2. The data information query processing method according to claim 1, wherein the transaction element information includes a transaction element order of magnitude; correspondingly, the data information query processing method further comprises the following steps:
determining a data fragment matching mode according to a comparison result of the transaction element magnitude and a preset transaction element magnitude threshold;
and determining the data fragment corresponding to the transaction element information according to the data fragment matching mode.
3. The data information query processing method according to claim 2, wherein the determining a data segment matching manner according to the comparison result between the transaction element magnitude and a preset transaction element magnitude threshold includes:
and if the order of magnitude of the transaction element is determined to be larger than or equal to the preset order of magnitude threshold of the transaction element, determining that the data fragment matching mode is to call a plug-in to calculate the data fragment.
4. The data information query processing method according to claim 2, wherein the determining a data segment matching manner according to the comparison result between the transaction element magnitude and a preset transaction element magnitude threshold includes:
and if the order of magnitude of the transaction element is smaller than a preset order of magnitude threshold value, determining a data fragment matching mode to be data fragments according to a first preset corresponding relation.
5. The data information query processing method according to claim 2, wherein the data fragment matching manner includes invoking a plug-in to calculate a data fragment; correspondingly, the determining the data fragment corresponding to the transaction element information according to the data fragment matching mode includes:
responding to a mapping algorithm function selected by a user, and determining a plug-in path corresponding to the mapping algorithm function according to a fourth preset corresponding relation;
the fourth preset corresponding relation comprises a corresponding relation between a preset mapping algorithm function and a preset plug-in path;
and acquiring the mapping algorithm function according to the plug-in path, and calculating the data fragment corresponding to the transaction element information based on the mapping algorithm function.
6. The data information query processing method according to any one of claims 1 to 5, wherein a standby unit taking over the unit is determined according to pre-configuration information; correspondingly, the data information query processing method further comprises the following steps:
if the unit is detected to be abnormal, switching the unit state of the unit into an abnormal state;
and if the unit state of the standby unit is determined to be a normal state, determining database information corresponding to each data fragment of the standby unit according to a third preset corresponding relation, and taking the database information as a data query result.
7. The data information query processing method of claim 6, further comprising:
and pre-storing the first preset corresponding relation, the second preset corresponding relation, the third preset corresponding relation and the fourth preset corresponding relation in a local cache.
8. A data information query processing apparatus, comprising:
the determining unit is used for acquiring the transaction element and determining the data fragment corresponding to the transaction element information according to the first preset corresponding relation;
the first preset corresponding relation comprises a corresponding relation between preset transaction element information and preset data fragments;
the acquisition unit is used for determining a unit corresponding to the data fragment according to a second preset corresponding relation and acquiring the unit state of the unit;
the second preset corresponding relation comprises a corresponding relation between a preset data fragment and a preset unit;
the query unit is used for determining database information corresponding to each data fragment of the unit according to a third preset corresponding relation if the unit state is determined to be a normal state, and taking the database information as a data query result;
the third preset corresponding relationship comprises a corresponding relationship between the preset data fragments and preset database information.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211514988.4A CN115827667A (en) | 2022-11-30 | 2022-11-30 | Data information query processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211514988.4A CN115827667A (en) | 2022-11-30 | 2022-11-30 | Data information query processing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115827667A true CN115827667A (en) | 2023-03-21 |
Family
ID=85532884
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211514988.4A Pending CN115827667A (en) | 2022-11-30 | 2022-11-30 | Data information query processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115827667A (en) |
-
2022
- 2022-11-30 CN CN202211514988.4A patent/CN115827667A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10048996B1 (en) | Predicting infrastructure failures in a data center for hosted service mitigation actions | |
US10922303B1 (en) | Early detection of corrupt data partition exports | |
CN111737104B (en) | Block chain network service platform, test case sharing method thereof and storage medium | |
CN112698992B (en) | Disaster recovery management method and related device for cloud cluster | |
US10963353B2 (en) | Systems and methods for cross-regional back up of distributed databases on a cloud service | |
CN104468150A (en) | Method for realizing fault migration through virtual host and virtual host service device | |
CN106713378B (en) | Method and system for providing service by multiple application servers | |
US9390156B2 (en) | Distributed directory environment using clustered LDAP servers | |
CN114301972B (en) | Hierarchical deployment method and system for blockchain nodes based on cloud edge cooperation | |
US10169139B2 (en) | Using predictive analytics of natural disaster to cost and proactively invoke high-availability preparedness functions in a computing environment | |
CN111158949A (en) | Configuration method, switching method and device of disaster recovery architecture, equipment and storage medium | |
WO2017107984A1 (en) | Data recovery method and device | |
CN110990415A (en) | Data processing method and device, electronic equipment and storage medium | |
CN114422331B (en) | Disaster recovery switching method, device and system | |
CN108733477B (en) | Method, device and equipment for data clustering processing | |
CN107508700B (en) | Disaster recovery method, device, equipment and storage medium | |
CN115134373A (en) | Data synchronization method and device, storage medium and electronic equipment | |
US11977450B2 (en) | Backup system, method therefor, and program | |
CN110298031B (en) | Dictionary service system and model version consistency distribution method | |
CN112073499A (en) | Dynamic service method of multi-machine type cloud physical server | |
US11074229B1 (en) | Distributed read-only database service | |
CN112988738A (en) | Data slicing method and device for block chain | |
CN115827667A (en) | Data information query processing method and device | |
CN112925852B (en) | Distributed database designated node capacity reduction method | |
CN113630317A (en) | Data transmission method and device, nonvolatile storage medium and electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |