CN109871408B - Multi-type database adaptation method, device, electronic equipment and storage medium - Google Patents

Multi-type database adaptation method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109871408B
CN109871408B CN201910164464.9A CN201910164464A CN109871408B CN 109871408 B CN109871408 B CN 109871408B CN 201910164464 A CN201910164464 A CN 201910164464A CN 109871408 B CN109871408 B CN 109871408B
Authority
CN
China
Prior art keywords
type
database
operation instruction
actual
adaptation
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.)
Active
Application number
CN201910164464.9A
Other languages
Chinese (zh)
Other versions
CN109871408A (en
Inventor
陆路
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Onething Technology Co Ltd
Shenzhen Xunlei Network Technology Co Ltd
Original Assignee
Shenzhen Onething Technology Co Ltd
Shenzhen Xunlei Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Onething Technology Co Ltd, Shenzhen Xunlei Network Technology Co Ltd filed Critical Shenzhen Onething Technology Co Ltd
Priority to CN201910164464.9A priority Critical patent/CN109871408B/en
Publication of CN109871408A publication Critical patent/CN109871408A/en
Application granted granted Critical
Publication of CN109871408B publication Critical patent/CN109871408B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a multi-type database adaptation method, which utilizes a multi-type database adaptation rule comprising the corresponding relation between a first type of operation instruction (standard operation instruction) with each function and a second type of operation instruction (actual operation instruction) with the same function as each type of database to convert the first type of operation instruction (standard operation instruction) sent by a target blockchain network into the second type of operation instruction (actual operation instruction) corresponding to the actual database, so that the database which cannot process the format originally can also perform corresponding operation according to the converted actual operation instruction, a user does not need to install the database of a specific type through a complex installation process again due to mismatching of the database types, the universality of the database is improved, and the user experience is improved. The application also discloses a multi-type database adapting device, electronic equipment and a computer readable storage medium, which have the beneficial effects.

Description

Multi-type database adaptation method, device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a method, an apparatus, an electronic device, and a computer readable storage medium for adapting a multi-type database.
Background
Because of the decentralised and undeletable nature of blockchain technology, blockchain technology is well suited for storing important data that is large in data volume but small in volume, such as storing transaction data in bitcoin networks using blockchain technology as a ledger for recording bitcoin transactions.
With the development of blockchain technology and the hot nature of bitcoin, there are a number of different types of blockchains that follow, each of which will exist as a node that makes up the blockchain network to store the data stored in the blockchain.
Blockchain networks of different types or purposes often require that node devices belonging thereto use a particular type of database to respond to their associated operating instructions in view of preventing collisions with other data. When a database of a required type is not installed in the node apparatus, the user can only reinstall this database. Sometimes, a node device may exist as node devices of different blockchain networks at the same time, which may cause that multiple types of databases may need to be installed in the node device, which not only causes the objection of a user, but also greatly occupies the residual computing resources in the device with poor performance.
Therefore, how to overcome the technical defects existing in the manner of implementing the storage of data by using the specific type of data matched with the blockchain network in the prior art is a problem to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a multi-type database adaptation method, a multi-type database adaptation device, electronic equipment and a computer readable storage medium, and aims to solve the problems that in the prior art, the universality is poor and the physical examination of users is poor in a mode of storing data by using specific type data matched with a block chain network.
To achieve the above object, the present application provides a multi-type database adaptation method, including:
receiving a first type of operation instruction issued by a block chain network;
detecting the type of a database actually installed in current blockchain node equipment, and determining the type of an operation instruction which is suitable for the type of the database as a second type;
converting the first type of operation instruction into a second type of operation instruction through a preset multi-type database adaptation rule; the multi-type database adaptation rule comprises a corresponding relation between a first type of operation instruction of each function and a second type of operation instruction of the same function of each type of database;
and carrying out corresponding operation on the database through the second type of operation instruction.
Optionally, before receiving the first type of operation instruction issued by the target blockchain network, the method further includes:
acquiring a second type of operation instruction which represents the same function in each type of database;
generating a first type of operation instruction representing the same function according to the same or similar parts in each second type of operation instruction;
establishing a corresponding relation between a first type of operation instruction of each function and a second type of operation instruction of the same function of the databases of various types, and generating the multi-type database adaptation rule according to each corresponding relation.
Optionally, the multi-type database adaptation method further includes:
and when the number of types of the databases actually installed in the current block chain link point equipment is more than 1, taking the type of one selected at will as the actual database type.
Optionally, taking the type of the arbitrarily selected database as the actual database type, including:
calculating the instruction similarity between the operation instructions corresponding to each type of database and the first type of operation instructions respectively;
the type of database having the highest instruction similarity is selected as the actual database type.
Optionally, the multi-type database adaptation method further includes:
and converting the format of the information returned by the database into a format which can be identified by the target blockchain network through the multi-type database adaptation rule.
To achieve the above object, the present application further provides a multi-type database adapting device, including:
the first type operation instruction receiving unit is used for receiving a first type operation instruction issued by the blockchain network;
a second type operation instruction determining unit, configured to detect a type of a database actually installed in a current blockchain node device, and determine that a type of an operation instruction adapted to the type of the database is a second type;
an operation instruction type conversion unit, configured to convert the first type of operation instruction into a second type of operation instruction according to a preset multi-type database adaptation rule; the multi-type database adaptation rule comprises a corresponding relation between a first type of operation instruction of each function and a second type of operation instruction of the same function of each type of database;
and the converted operation instruction execution unit is used for carrying out corresponding operation on the database through the operation instruction of the second type.
Optionally, the multi-type database adaptation apparatus further comprises:
each second type of operation instruction acquisition unit is used for acquiring second type of operation instructions which express the same function in each type of database before receiving standard operation instructions issued by the target blockchain network;
a first type operation instruction generation unit configured to generate a first type operation instruction representing the same function from the same or similar part in each of the second type operation instructions;
the corresponding relation establishing and adapting rule generating unit is used for establishing the corresponding relation between the first type of operation instruction of each function and the second type of operation instruction of the same function of the databases of various types, and generating the adapting rule of the databases of various types according to each corresponding relation.
Optionally, the multi-type database adaptation apparatus further comprises:
and the actual database type selection unit is used for taking the type of one type of the database which is arbitrarily selected as the actual database type when the number of types of the databases which are actually installed in the current block chain link point equipment is more than 1.
Optionally, the multi-type actual database selection unit includes:
the instruction similarity calculation subunit is used for calculating the instruction similarity between the operation instructions corresponding to each type of database and the first type of operation instructions respectively;
and the highest instruction similarity database type selection subunit is used for selecting the type of the database with the highest instruction similarity as the actual database type.
Optionally, the multi-type database adaptation apparatus further comprises:
and the returned information format conversion unit is used for converting the format of the information returned by the database into a format which can be identified by the target blockchain network through the multi-type database adaptation rule.
To achieve the above object, the present application still further provides an electronic device, which includes a memory, a processor, and a bus, on which a multi-type real database adaptation program executable on the processor is stored, the multi-type real database adaptation program being transferred to the processor by the bus, and implementing the multi-type real database adaptation method as described above when executed by the processor.
To achieve the above object, the present application still further provides a computer-readable storage medium having stored thereon a multi-type real database adaptation program executable by one or more processors to implement the multi-type real database adaptation method as described above.
Obviously, according to the technical scheme provided by the application, the multi-type database adaptation rule comprising the corresponding relation between the first type of operation instruction (standard operation instruction) with each function and the second type of operation instruction (actual operation instruction) with the same function as the various types of databases is utilized to convert the first type of operation instruction (standard operation instruction) sent by the target blockchain network into the second type of operation instruction (actual operation instruction) corresponding to the actual database, so that the database which cannot process the format originally can also perform corresponding operation according to the converted actual operation instruction, a user does not need to install the database of a specific type through a complex installation process again due to mismatching of the database types, the universality of the database is improved, and the user experience is improved. The application also provides a multi-type database adapting device, an electronic device and a computer readable storage medium, which have the beneficial effects and are not described herein.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings may be obtained according to the provided drawings without inventive effort to a person skilled in the art.
FIG. 1 is a flowchart of a method for adapting a multi-type database according to an embodiment of the present application;
fig. 2 is a schematic diagram of a correspondence relationship of a special adaptation rule provided in an embodiment of the present application;
fig. 3 is a schematic diagram of a correspondence relationship of a general adaptation rule provided in an embodiment of the present application;
FIG. 4 is a flowchart of a method for generating standard operation instructions according to an embodiment of the present application;
FIG. 5 is a flowchart of a method for selecting a multi-type actual database in the multi-type database adaptation method according to the embodiment of the present application;
fig. 6 is a block diagram of a multi-type data adapting device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims of this application and in the above-described figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the description of "first", "second", etc. in this disclosure is for descriptive purposes only and is not to be construed as indicating or implying a relative importance or implying an indication of the number of technical features being indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be considered to be absent and not within the scope of protection claimed in the present invention.
Example 1
Referring to fig. 1, fig. 1 is a flowchart of a multi-type database adaptation method according to an embodiment of the present application, which includes the following steps:
s101: receiving a first type of operation instruction issued by a block chain network;
after receiving an operation instruction (referred to as a standard operation instruction in the present invention) issued by the blockchain network, determining a type of the operation instruction, wherein the first type may refer to any type, and the first type of operation instruction may be an operation instruction corresponding to an existing type of database or may be a custom operation instruction.
S102: detecting the type of a database actually installed in the current blockchain node equipment, and determining the type of an operation instruction which is suitable for the type of the database as a second type;
the type of database actually installed in the current blockchain node device is determined, the type of database that can be detected is referred to as the actual database type, and the type of operation instruction that is adapted to the actual database type is determined as the second type (relative to the standard operation instruction issued by the blockchain network, the second type of operation instruction may be referred to herein as the actual operation instruction) in order to effect the conversion of the operation instruction type, because the blockchain network cannot identify the second type of operation instruction used by the blockchain node when the first type is different from the second type on the same function of instructions, and the blockchain node cannot identify the first type of operation instruction that it receives until the database that is adapted to the first type of operation instruction is not installed.
Furthermore, if multiple types of databases are actually installed on the current blockchain node device, one of the most suitable types of databases can be selected as an actual database type according to actual conditions, and an operation instruction corresponding to the actual database type is determined as a second type. The specific manner may be based on the similarity between each type of operation instruction in describing the same function as the first type of operation instruction, all possible special requirements, etc., and is not specifically limited herein.
S103: converting the first type of operation instruction into the second type of operation instruction through a preset multi-type database adaptation rule;
based on S102, this step aims to complete the conversion from the first type to the second type (conversion from standard operation instruction to actual operation instruction) of the operation instruction through the preset multi-type database adaptation rule, so that the current block link point device can complete the task and related operation issued by the block chain network according to the converted operation instruction without installing the specific type of database. The multi-type database adaptation rule comprises a corresponding relation between a first type of operation instruction of each function and a second type of operation instruction of the same function of each type of database.
The adaptation rule may also be embodied as a special adaptation rule as shown in fig. 2 or a general adaptation rule as shown in fig. 3, depending on whether the first type of operation instruction is an existing operation instruction of a certain type.
FIG. 2 is a representation of an adaptation rule corresponding to a first type of operation as an existing type of operation instruction, i.e., a special adaptation rule is provided for a blockchain network requiring the use of a database of a certain type, and assuming that a blockchain network requires the use of a T-class operation instruction corresponding to a database of class X, then the same is true of providing an operation instruction conversion rule capable of converting the T-class operation instruction into an operation instruction recognizable by a plurality of other types of databases, i.e., a special adaptation rule is provided for the A blockchain network in a targeted manner, so that the database of class X no longer has to be installed in a node device as the A blockchain network to normally process the T-class operation instruction from the A blockchain network. However, in this case, once the other blockchain network that requires the use of the non-X type database is replaced, it is also necessary to provide an adaptation rule for adapting between the operation instruction type corresponding to the non-X type database and the other operation instruction types.
In consideration of that when the special adaptation rule is used, the special instruction conversion rule between each type of database and other types of databases needs to be created respectively, which is troublesome and is relatively responsible for management, a new operation instruction can be generated as a standard operation instruction according to the operation instruction types respectively used by the existing multiple types of databases, and when all blockchain networks apply the standard blockchain network, only the general adaptation rule created according to the correspondence between the standard operation instruction and other types of operation instructions needs to be provided (the correspondence contained in the general adaptation rule formed in this way can be seen in fig. 3). In other words, the standard operation instruction at this time is obtained after processing according to a plurality of existing operation instructions (corresponding to each type of database respectively), and the processing process is that is, the process of establishing the corresponding relationship, that is, the standard operation instruction at this time will be used as an upper operation instruction to send the operation instruction to the specific blockchain node device, and the general adaptation rule changes the operation instruction into the actual operation instruction corresponding to the type of the actual database through the corresponding relationship contained in the general adaptation rule, so as to achieve higher universality.
Under the condition that the standard operation instruction is generated according to the general adaptation rule, a database capable of directly processing the standard operation instruction without conversion does not exist, that is to say, the simple standard operation instruction does not have any meaning and is only used as a source operation instruction for determining the target operation instruction in the corresponding relation, so that the length of the standard operation instruction can be shortened as far as possible, the flow consumed in the data transmission process is reduced, and the information interaction efficiency is improved.
S104: and carrying out corresponding operation on the database through the second type of operation instruction.
According to the method and the device, the multi-type database adaptation rule comprising the corresponding relation between the first type of operation instruction (standard operation instruction) with each function and the second type of operation instruction (actual operation instruction) with the same function as each type of database is utilized, the first type of operation instruction (standard operation instruction) sent by the target blockchain network is converted into the second type of operation instruction (actual operation instruction) corresponding to the actual database, so that the database which cannot process the format originally can also perform corresponding operation according to the converted actual operation instruction, a user does not need to install the database of the specific type through a complex installation process again due to mismatching of the database types, the universality of the database is improved, and the user experience is improved.
Example two
Referring to fig. 4, fig. 4 is a flowchart of a general adaptation rule generating method provided in an embodiment of the present application, and on the basis of the first embodiment, the present embodiment aims to provide a general adaptation rule generating method without providing a respective special adaptation rule for each type of database, including the following steps:
s201: acquiring a second type of operation instruction which represents the same function in each type of database;
s202: generating a first type of operation instruction representing the same function according to the same or similar parts in each second type of operation instruction;
in order to make the first type of operation instruction (standard operation instruction) more relevant to the second type of operation instruction corresponding to the currently existing database type, the present embodiment generates the first type of operation instruction (standard operation instruction) representing the same function from the same or similar part of each second type of operation instruction.
S203: and establishing a corresponding relation between the first type of operation instruction of each function and the second type of operation instruction of the same function of the databases of various types, and generating a multi-type database adaptation rule according to each corresponding relation.
On the basis of S202, a correspondence may be easily established according to the process of searching for the same point, and a general adaptation rule may be generated according to each correspondence.
Under the mode of adopting general adaptation rule, firstly, a more superior operation instruction type with higher universality is required to be determined, and the original operation instruction type can be selected and also can be automatically established, when the self-establishment is adopted, the self-establishment can be combined with the position or meaning of the keyword in each existing operation instruction according to different modes, and the standard operation instruction obtained by the self-establishment cannot be directly processed by the existing various databases in the self-establishment mode, namely, the simple standard operation instruction has no meaning and is only used as the source operation instruction for determining the target operation instruction in the corresponding relation, so that the length of the operation instruction can be shortened as far as possible, the flow consumed in the data transmission process is reduced, and the information interaction efficiency is increased.
Example III
Referring to fig. 5, fig. 5 is a flowchart of a method for selecting a multi-type actual database in a multi-type database adaptation method provided in an embodiment of the present application, and on the basis of the foregoing embodiments, the embodiment provides a method for determining an actual type for a scenario in which a plurality of types of databases are installed in a current blockchain node, including the following steps:
s301: calculating the instruction similarity between the operation instructions corresponding to each type of database and the operation instructions of the first type respectively;
s302: the type of database with the highest instruction similarity is selected as the actual database type.
The instruction similarity represents the difference between the actual operation instructions of the databases of different types when the operation instructions of the same function are represented, the higher the similarity is, the smaller the difference between the two types of data is, the higher the coupling degree of the execution mode of the instructions is in the actual operation process, and the less error is likely to happen, so the embodiment selects the type of the database with the highest instruction similarity as the actual database type, and performs the conversion operation of the subsequent step according to the selected actual database type.
Because of the complexity and cannot be illustrated by one, those skilled in the art will recognize that many examples exist in accordance with the basic method principles provided herein in combination with actual situations, which are within the scope of the present application without significant inventive effort.
Example IV
Referring to fig. 6, fig. 6 is a block diagram of a multi-type data adapting device according to an embodiment of the present application, where the device may include:
a first type of operation instruction receiving unit 100, configured to receive a first type of operation instruction issued by the blockchain network;
a second type operation instruction determining unit 200 for detecting a type of a database actually installed in the current blockchain node device, and determining a type of an operation instruction adapted to the type of the database as a second type;
an operation instruction type conversion unit 300, configured to convert the first type of operation instruction into the second type of operation instruction according to a preset multi-type database adaptation rule; the multi-type database adaptation rule comprises a corresponding relation between a first type of operation instruction of each function and a second type of operation instruction of the same function of each type of database;
the converted operation instruction execution unit 400 is configured to perform corresponding operations on the database through the operation instruction of the second type.
Further, the multi-type database adaptation apparatus may further include:
each second type of operation instruction acquisition unit is used for acquiring second type of operation instructions which express the same function in each type of database before receiving standard operation instructions issued by the target blockchain network;
a first-type operation instruction generation unit configured to generate a first-type operation instruction representing the same function from the same or similar part of each of the second-type operation instructions;
the corresponding relation establishing and adapting rule generating unit is used for establishing the corresponding relation between the first type of operation instruction of each function and the second type of operation instruction of the same function of the databases of various types, and generating the adapting rule of the databases of various types according to each corresponding relation.
Still further, the multi-type database adaptation apparatus may further include:
the actual database type selecting unit is used for taking the type of one type of the database which is selected at will as the actual database type when the number of types of the database which is actually installed in the current block chain node equipment is more than 1.
Wherein the multi-type actual database selection unit may further include:
the instruction similarity calculation subunit is used for calculating the instruction similarity between the operation instruction corresponding to each type of database and the first type of operation instruction respectively;
the highest instruction similarity database type selection subunit is configured to select, as the actual database type, the type of the database having the highest instruction similarity.
Further, the multi-type database adaptation apparatus may further include:
and the returned information format conversion unit is used for converting the format of the information returned by the database into a format which can be identified by the target blockchain network through a multi-type database adaptation rule.
The present embodiment exists as an embodiment of the apparatus corresponding to the above embodiment of the method, and has all the beneficial effects of the method embodiment, which are not described herein in detail.
In the foregoing, how to implement the conversion of the operation instructions between different database types has been described in detail by some embodiments, and the present application further provides an entity hardware device corresponding to the method, where the content principles correspond to the scheme portions, and the portions of the implementation principles are not repeated here, and the hardware components of the entity hardware device will be described below, and please refer to fig. 7, where fig. 7 is a schematic structural diagram of an electronic device provided in the embodiment of the present application:
the electronic device 500 comprises a memory 510, a processor 520 and a bus 530, the memory 510 having stored thereon a multi-type real database adaptation program executable on the processor 520, which multi-type real database adaptation program is transferred to the processor 520 via the bus 530 and which when executed by the processor 520 implements the steps of the multi-type real database adaptation method as described in the above embodiments.
The memory 510 includes at least one type of readable storage medium including flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 510 may be an internal storage unit of the electronic device 500 in some embodiments, such as a hard disk of the electronic device 500. The memory 510 may also be an external storage device of the electronic device 500 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device 500. Further, the memory 510 may also be composed of both an internal memory unit and an external memory device. Further, the memory 510 may be used not only for storing various application software and various types of data installed in the electronic device 500, but also for temporarily storing data that has been output or is to be output.
The processor 520 may be, in some embodiments, a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing data stored in the memory 510, such as a multi-type real database adaptation program or the like.
Bus 530 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one bi-directional hollow indicator line is shown in fig. 7, but not only one bus or one type of bus.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of elements is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods presented in the various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It should be noted that, the foregoing reference numerals of the embodiments of the present invention are merely for describing the embodiments, and do not represent the advantages and disadvantages of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, apparatus, article or method that comprises the element.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (7)

1. A method of multi-type database adaptation, comprising:
receiving a first type of operation instruction issued by a block chain network;
detecting the type of a database actually installed in current blockchain node equipment, taking the detected type of the database as an actual database type, and determining the type of an operation instruction which is suitable for the actual database type as a second type;
converting the first type of operation instruction into a second type of operation instruction through a preset multi-type database adaptation rule; the multi-type database adaptation rule comprises a corresponding relation between a first type of operation instruction of each function and a second type of operation instruction of the same function of each type of database;
performing corresponding operation on the database through the second type of operation instruction;
when the number of types of the databases actually installed in the current block chain link point equipment is more than 1, taking the type of one selected database as the actual database type;
wherein, the type of the selected database is taken as the actual database type, which comprises the following steps:
calculating the instruction similarity between the operation instructions corresponding to each type of database and the first type of operation instructions respectively;
the type of database having the highest instruction similarity is selected as the actual database type.
2. The method of claim 1, further comprising, prior to receiving the first type of operation instruction issued by the blockchain network:
acquiring a second type of operation instruction which represents the same function in each type of database;
generating a first type of operation instruction representing the same function according to the same or similar parts in each second type of operation instruction;
establishing a corresponding relation between a first type of operation instruction of each function and a second type of operation instruction of the same function of the databases of various types, and generating the multi-type database adaptation rule according to each corresponding relation.
3. The multi-type database adaptation method according to claim 1 or 2, further comprising:
and converting the format of the information returned by the database into a format which can be identified by the blockchain network through the multi-type database adaptation rule.
4. A multi-type database adaptation apparatus, comprising:
the first type operation instruction receiving unit is used for receiving a first type operation instruction issued by the blockchain network;
the second type operation instruction determining unit is used for detecting the type of a database actually installed in the current block chain node equipment, taking the detected type of the database as an actual database type, and determining the type of an operation instruction which is suitable for the actual database type as a second type;
an operation instruction type conversion unit, configured to convert the first type of operation instruction into a second type of operation instruction according to a preset multi-type database adaptation rule; the multi-type database adaptation rule comprises a corresponding relation between a first type of operation instruction of each function and a second type of operation instruction of the same function of each type of database;
the converted operation instruction execution unit is used for carrying out corresponding operation on the database through the operation instruction of the second type;
the actual database type selecting unit is used for taking the type of one selected database as the actual database type when the type number of the database actually installed in the current block chain link point equipment is more than 1;
wherein the actual database selection unit includes:
the instruction similarity calculation subunit is used for calculating the instruction similarity between the operation instructions corresponding to each type of database and the first type of operation instructions respectively;
and the highest instruction similarity database type selection subunit is used for selecting the type of the database with the highest instruction similarity as the actual database type.
5. The multi-type database adaptation apparatus of claim 4, further comprising:
each second type of operation instruction acquisition unit is used for acquiring second type of operation instructions which express the same function in each type of database before receiving standard operation instructions issued by the target blockchain network;
a first type operation instruction generation unit configured to generate a first type operation instruction representing the same function from the same or similar part in each of the second type operation instructions;
the corresponding relation establishing and adapting rule generating unit is used for establishing the corresponding relation between the first type of operation instruction of each function and the second type of operation instruction of the same function of the databases of various types, and generating the adapting rule of the databases of various types according to each corresponding relation.
6. An electronic device comprising a memory, a processor and a bus, the memory having stored thereon a multi-type database adaptation program executable on the processor, the multi-type database adaptation program being transferred by the bus to the processor and when executed by the processor implementing a multi-type database adaptation method as claimed in any one of claims 1 to 3.
7. A computer readable storage medium having stored thereon a multi-type database adaptation program executable by one or more processors to implement the multi-type database adaptation method of any of claims 1 to 3.
CN201910164464.9A 2019-03-05 2019-03-05 Multi-type database adaptation method, device, electronic equipment and storage medium Active CN109871408B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910164464.9A CN109871408B (en) 2019-03-05 2019-03-05 Multi-type database adaptation method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910164464.9A CN109871408B (en) 2019-03-05 2019-03-05 Multi-type database adaptation method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109871408A CN109871408A (en) 2019-06-11
CN109871408B true CN109871408B (en) 2023-07-14

Family

ID=66919658

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910164464.9A Active CN109871408B (en) 2019-03-05 2019-03-05 Multi-type database adaptation method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109871408B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110825807B (en) * 2019-09-23 2023-07-25 平安科技(深圳)有限公司 Data interactive conversion method, device, equipment and medium based on artificial intelligence
CN112749177A (en) * 2019-10-31 2021-05-04 北京国双科技有限公司 Database data processing method and device
CN111192143B (en) * 2019-12-25 2023-07-18 达闼机器人股份有限公司 Data processing method, device, storage medium and blockchain node

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103823815A (en) * 2012-11-19 2014-05-28 中国联合网络通信集团有限公司 Server and database access method
CN106156330A (en) * 2016-07-06 2016-11-23 北京金山安全管理系统技术有限公司 A kind of data base's adaptation method and database adapter

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100555288C (en) * 2007-11-21 2009-10-28 金蝶软件(中国)有限公司 A kind of method and system of visiting distinct type data-base
CN102193922B (en) * 2010-03-04 2013-07-24 杭州华三通信技术有限公司 Method and device for accessing database
US20130110798A1 (en) * 2011-10-27 2013-05-02 Microsoft Corporation Intercepting and processing database commands
CN106933869B (en) * 2015-12-30 2020-09-01 北京京东尚科信息技术有限公司 Method and device for operating database
CN106383754A (en) * 2016-09-19 2017-02-08 北京众享比特科技有限公司 Database backup and recovery system based on block chain technology, and database backup method based on block chain technology, and database recovery method based on block chain technology
US10706027B2 (en) * 2017-01-09 2020-07-07 Sap Se Database management system with dynamic allocation of database requests
CN107239479B (en) * 2017-03-28 2020-03-13 创新先进技术有限公司 Block chain based data storage and query method and device
CN108647361B (en) * 2018-05-21 2021-12-03 中国工商银行股份有限公司 Data storage method, device and system based on block chain

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103823815A (en) * 2012-11-19 2014-05-28 中国联合网络通信集团有限公司 Server and database access method
CN106156330A (en) * 2016-07-06 2016-11-23 北京金山安全管理系统技术有限公司 A kind of data base's adaptation method and database adapter

Also Published As

Publication number Publication date
CN109871408A (en) 2019-06-11

Similar Documents

Publication Publication Date Title
CN109871408B (en) Multi-type database adaptation method, device, electronic equipment and storage medium
CN110708212B (en) Method and device for tracking call link in distributed system
CN103593419A (en) Method, device, server and system for inquiring data
CN114500690B (en) Interface data processing method and device, electronic equipment and storage medium
CN110135590B (en) Information processing method, information processing apparatus, information processing medium, and electronic device
CN109617647A (en) Message forwarding method, device, computer equipment and computer readable storage medium
US11341842B2 (en) Metering data management system and computer readable recording medium
CN112632132B (en) Processing method, device and equipment for abnormal imported data
CN111026613B (en) Log processing method and device
CN111045983B (en) Nuclear power station electronic file management method, device, terminal equipment and medium
CN113986995A (en) Request distribution method and device, storage medium and electronic equipment
CN111784174A (en) Method and device for managing risk policy based on user portrait and electronic equipment
CN114338846A (en) Message testing method and device
CN112181825A (en) Test case library construction method and device, electronic equipment and medium
US8341215B2 (en) Processing-time-definition creating program, processing-time-definition creating method, and information processing apparatus
CN112016081B (en) Method, device, medium and electronic equipment for realizing identifier mapping
CN112215527A (en) Logistics management method and device
CN110888811A (en) Code coverage rate information processing method and device, electronic equipment and medium
CN109063206B (en) Article monitoring method and device
CN113395370B (en) Method and device for automatically configuring user-defined domain name
CN115454354B (en) Data processing method, system, electronic device and storage medium
CN112070525B (en) Data processing method, device, equipment and storage medium
CN111242592B (en) Resource transfer detection method, device, server and computer readable storage medium
CN111178044B (en) Method and device for determining target text elements
CN115529229A (en) Fault positioning method, device and equipment

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210909

Address after: 518000 21 / f-23 / F, block B, building 12, Shenzhen Bay science and technology ecological park, No. 18, South Keji Road, high tech community, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Xunlei Networking Technologies, Ltd.

Applicant after: SHENZHEN ONETHING TECHNOLOGIES Co.,Ltd.

Address before: 518052 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant before: SHENZHEN ONETHING TECHNOLOGIES Co.,Ltd.

GR01 Patent grant
GR01 Patent grant