Relational database writing method and system based on block chain technology

文档序号:1952729 发布日期:2021-12-10 浏览:7次 中文

阅读说明:本技术 基于区块链技术的关系数据库写入方法及系统 (Relational database writing method and system based on block chain technology ) 是由 张翼 于 2021-01-12 设计创作,主要内容包括:本发明提出了一种基于区块链技术的关系数据库写入方法及系统,涉及区块链技术领域。其中包含一种基于区块链技术的关系数据库写入方法,包括如下步骤:将多个行数据分别写入区块链数据库,上述区块链数据库为每个写入操作提供两种干预机制,其中一种上述干预机制包含选择一个或多个上述行数据为可读取项,另一种上述干预机制包含控制是否允许插入上述行数据。本发明还提供一种基于区块链技术的关系数据库写入系统,基于上述一种基于区块链技术的关系数据库写入方法实现。(The invention provides a relational database writing method and system based on a block chain technology, and relates to the technical field of block chains. The method comprises the following steps: respectively writing a plurality of rows of data into a blockchain database, wherein the blockchain database provides two intervention mechanisms for each write operation, one intervention mechanism comprises selecting one or more rows of data as readable items, and the other intervention mechanism comprises controlling whether the insertion of the rows of data is allowed. The invention also provides a relational database writing system based on the blockchain technology, which is realized based on the relational database writing method based on the blockchain technology.)

1. The relational database writing method based on the block chain technology is characterized by comprising the following steps of: respectively writing a plurality of row data into a blockchain database, wherein the blockchain database provides two intervention mechanisms for each writing operation, one intervention mechanism comprises selecting one or more row data as readable items, and the other intervention mechanism comprises controlling whether the row data is allowed to be inserted or not.

2. The method of claim 1, wherein selecting one or more of the rows of data as the readable item is accomplished by a filter write operation.

3. The method of writing a relational database based on the blockchain technique according to claim 1, wherein control of whether the line data is allowed to be inserted is achieved by a flip-flop write operation.

4. The method of writing a relational database according to the blockchain technique according to claim 1, wherein inputting a user request digitally signed writes a plurality of the row data into the blockchain database, respectively.

5. The method of claim 4, wherein the blockchain database provides an API mechanism to input the digitally signed user request.

6. The method of claim 5, wherein the API mechanism comprises receiving the digitally signed user request using a number of API interfaces.

7. The method as claimed in claim 6, wherein the blockchain database sets different user identities and corresponding user permissions of the API interfaces respectively through parameters, and the user permissions are used for setting permissions of the intervention mechanisms according to the user identities.

8. The method of claim 7, wherein the API interface verifies the user's identity based on the digital signature and provides a response to one of the intervention mechanisms using the user authority.

9. A relational database writing system based on a block chain technology, which is characterized by comprising a block chain database, a filter and a trigger, wherein the block chain database is used for writing row data for multiple times through user requests, and two intervention mechanisms are provided for each writing operation, wherein one intervention mechanism comprises selecting one or more row data as readable items, and the other intervention mechanism comprises controlling whether the row data are allowed to be inserted or not; the filter is used for realizing the selection of one or more row data through a writing operation; the flip-flop is used for controlling whether the insertion of the line data is allowed or not through a write operation.

10. The system for writing to a relational database according to the blockchain technique as claimed in claim 9, comprising a plurality of API interfaces, each of the API interfaces verifying the identity of the user based on a different identity of the user and responding to the selectable intervention mechanism based on the identity of the user.

Technical Field

The invention relates to the technical field of block chains, in particular to a relational database writing method and system based on a block chain technology.

Background

A relational database, which is a database based on a relational database model, processes data in the database by using concepts and methods such as set algebra and is also organized into a set of tables with formal descriptive nature as a special collection of loaded data items, and the data in the tables can be accessed or recalled in many different ways without reorganizing the database tables. The definition of a relational database results in a table of metadata or in a formal description of tables, columns, ranges, and constraints. Each table (sometimes referred to as a relationship) contains one or more data categories represented by columns. Each row contains a unique data entity, which is a category defined by the columns.

In a traditional information system based on a relational database, codes are needed to express business logic at the back end, and finally the codes are written into the database to ensure that data conforms to the business logic. The write workload is considerable due to such work as backend development and deployment. Therefore, there is a need for a method and a system for writing a relational database based on a blockchain technique, which can reduce the workload of writing operation, thereby improving the efficiency of information management.

Disclosure of Invention

The invention aims to provide a relational database writing method based on a block chain technology, which can reduce the workload of writing operation and improve the efficiency of information management.

Another object of the present invention is to provide a relational database writing system based on the blockchain technique, which can reduce the workload of writing operation, thereby improving the efficiency of information management.

The embodiment of the invention is realized by the following steps:

in a first aspect, an embodiment of the present application provides a method for writing a relational database based on a blockchain technique, including the following steps: respectively writing a plurality of rows of data into a blockchain database, wherein the blockchain database provides two intervention mechanisms for each write operation, one intervention mechanism comprises selecting one or more rows of data as readable items, and the other intervention mechanism comprises controlling whether the insertion of the rows of data is allowed.

In some embodiments of the invention, selecting one or more of the lines of data as the readable item is accomplished by writing a filter to the readable item.

In some embodiments of the invention, the control of whether the above-described line data is allowed to be inserted is achieved by writing a flip-flop.

In some embodiments of the present invention, inputting a digitally signed user request writes a plurality of the row data into the blockchain database, respectively.

In some embodiments of the invention, the blockchain database provides an API mechanism to input the digitally signed user request.

In some embodiments of the present invention, the API mechanism comprises receiving the digitally signed user request using a number of API interfaces.

In some embodiments of the present invention, the blockchain database sets different user identities and corresponding user permissions of the API interfaces respectively through parameters, where the user permissions are used to set permissions of the intervention mechanism according to the user identities.

In some embodiments of the invention, the API verifies the identity of the user based on the digital signature and provides a response to one of the intervention mechanisms using the user rights.

In a second aspect, an embodiment of the present application provides a relational database writing system based on a blockchain technology, including a blockchain database, a filter, and a trigger, where the blockchain database is configured to write row data multiple times by a user request, and provides two intervention mechanisms for each write operation, where one of the intervention mechanisms includes selecting one or more row data as a readable item, and another intervention mechanism includes controlling whether to allow the row data to be inserted; the filter is used for selecting one or more row data through writing operation; the flip-flop is used to control whether the insertion of the line data is permitted by a write operation.

In some embodiments of the present invention, the system for writing a relational database based on a blockchain technique includes a plurality of API interfaces, each of the API interfaces verifies the user identity according to a different user identity, and responds to the selectable intervention mechanism according to the user identity.

Compared with the prior art, the embodiment of the invention has at least the following advantages or beneficial effects:

in a first aspect, an embodiment of the present application provides a method for writing a relational database based on a blockchain technique, including the following steps: respectively writing a plurality of rows of data into a blockchain database, wherein the blockchain database provides two intervention mechanisms for each write operation, one intervention mechanism comprises selecting one or more rows of data as readable items, and the other intervention mechanism comprises controlling whether the insertion of the rows of data is allowed.

With respect to the first aspect: according to the embodiment of the application, the plurality of row data are respectively written into the block chain database, so that the sharing and the safety of the row data are met by using a block chain technology; the block chain database provides two interference mechanisms for each writing operation, so that a code does not need to be developed by using a back end when row data is written, and the database writing efficiency and safety are further improved; one intervention mechanism is set to select one or more line data as a readable item, so that the read permission of the written line data is set, and the efficiency and the safety of information management are improved; the secondary write authority of the line data is managed by setting another intervention mechanism to control whether the insertion of the line data is permitted. The invention reduces the workload of writing operation, thereby improving the efficiency and the safety of information management.

In a second aspect, an embodiment of the present application provides a relational database writing system based on a blockchain technology, including a blockchain database, a filter, and a trigger, where the blockchain database is configured to write row data multiple times by a user request, and provides two intervention mechanisms for each write operation, where one of the intervention mechanisms includes selecting one or more row data as a readable item, and another intervention mechanism includes controlling whether to allow the row data to be inserted; the filter is used for selecting one or more row data through writing operation; the flip-flop is used to control whether the insertion of the line data is permitted by a write operation.

With respect to the second aspect: according to the embodiment of the application, the plurality of row data are respectively written into the block chain database, so that the sharing and the safety of the row data are met by using a block chain technology; the block chain database provides two intervention mechanisms for each writing operation, so that a code does not need to be developed by using a back end when row data is written, and the database writing efficiency is further improved; one intervention mechanism is set to select one or more line data as a readable item through a filter, so that the read permission of the written line data is set, and the efficiency and the safety of information management are improved; the secondary write authority of the line data is managed by setting another intervention mechanism to control whether the insertion of the line data is permitted. The invention reduces the workload of writing operation, thereby improving the efficiency of information management.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.

Fig. 1 is a flowchart illustrating a method for writing a relational database based on a blockchain technique according to an embodiment 1 of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.

Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.

It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

In the description of the present application, it is also to be noted that, unless otherwise explicitly specified or limited, the terms "disposed" and "connected" are to be interpreted broadly, e.g., as being either fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art.

Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the individual features of the embodiments can be combined with one another without conflict.

Example 1

Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a method for writing a relational database based on a blockchain technique according to an embodiment of the present disclosure. A relational database writing method based on a block chain technology comprises the following steps: respectively writing a plurality of rows of data into a blockchain database, wherein the blockchain database provides two intervention mechanisms for each write operation, one intervention mechanism comprises selecting one or more rows of data as readable items, and the other intervention mechanism comprises controlling whether the insertion of the rows of data is allowed.

In detail, the way that a plurality of rows of data are written into the blockchain database respectively can utilize any conventional choice in the prior art, and a detailed description thereof is not necessary. Two intervention mechanisms are provided for each write row data operation according to the blockchain database, and any conventional selection implementation may be used as well, and need not be described in detail herein. The two intervention mechanisms can be used simultaneously, and one of the two intervention mechanisms can be selected by a writing party or a reading party through a mode of computer terminal input. In detail, one of the intervention mechanisms includes selecting one or more lines of data as readable items, whereby the contents of the lines of data are set to be disclosed to others when the lines of data are written. Optionally, when a plurality of line data are input one at a time, one line data is selected as a readable item; when the line data input each time is plural, one or more line data are selected as readable items. In detail, another intervention mechanism includes controlling whether to allow the line data to be inserted, so that another person can insert the line data between the previous lines when writing the line data next time. Optionally, the inserted row data is allowed to be one of the input one or more row data.

The method has the advantages that the plurality of line data are respectively written into the block chain database, two intervention mechanisms are provided for each writing operation through the block chain database, one intervention mechanism is readable content, workload of background operation is reduced, efficiency and safety of writing data are improved, and the other intervention mechanism is used for controlling whether the line data are allowed to be inserted, so that editability and safety during line data sharing are protected, and efficiency of information management is improved.

In some embodiments of the invention, selecting one or more of the lines of data as the readable item is accomplished by writing a filter to the readable item.

In detail, the filter is written into each operation, thereby implementing an intervention mechanism that selects one or more lines of data as readable items. The filter is a filter screen between the client and the server resource file, and before accessing the resource file, requests which do not accord with the rules are intercepted or modified in the middle through modifying, judging and the like of the requests through a series of filters. Responses may also be filtered, intercepted, or modified. The filter is generally used for operations such as login authority verification, resource access authority control, sensitive vocabulary filtering, character coding conversion and the like, so that code reuse is facilitated, and corresponding operations are not required to be performed in each servlet.

In some embodiments of the invention, the control of whether the above-described line data is allowed to be inserted is achieved by writing a flip-flop.

In detail, an intervention mechanism of whether line data is allowed to be inserted or not is realized by a trigger write operation. Wherein triggers can be used to enforce referential integrity to preserve the relationships defined between tables when rows are added, updated, or deleted from multiple tables. However, the best way to enforce referential integrity is to define primary and foreign key constraints in the associated tables. If a database relational graph is used, relationships can be created between tables to automatically create foreign key constraints.

In some embodiments of the present invention, inputting a digitally signed user request writes a plurality of the row data into the blockchain database, respectively.

In detail, a user requests to write a plurality of line data into the blockchain database, respectively, so that one line of data is written by using different user requests. In detail, the user requests to pass through the digital signature, so that the information source is conveniently verified, and the safety of line data writing is improved.

In some embodiments of the invention, the blockchain database provides an API mechanism to input the digitally signed user request.

The API mechanism is a resource API interface externally provided by Ecstore. Optionally, the direct connection API is implemented, that is, an API mechanism directly connected to the external system without using a matrix includes a verification mechanism that needs to be added by the caller, and the caller needs to obtain a token open API (open API) in advance to provide a path for directly interconnecting with the external system, so that the security of data writing is improved by the API mechanism.

In some embodiments of the present invention, the API mechanism comprises receiving the digitally signed user request using a number of API interfaces.

In detail, the API mechanism receives the user requests through the plurality of API interfaces, respectively, and further improves the processing efficiency of writing the line data by the plurality of user requests.

In some embodiments of the present invention, the blockchain database sets different user identities and corresponding user permissions of the API interfaces respectively through parameters, where the user permissions are used to set permissions of the intervention mechanism according to the user identities.

In detail, the block chain database sets different user identities and user permissions corresponding to the API interfaces through parameters, so that the user requests of different users are processed by using different API interfaces. When the API interface verifies the user request through the user identity, the set user permission is used for setting the permission of one or two intervention mechanisms after the verification is passed. The authority of the intervention mechanism can set the readable item or whether the insertion function is allowed by starting one of the intervention mechanisms, and optionally, the authority of the intervention mechanism can be set respectively according to different input line data.

In some embodiments of the invention, the API verifies the identity of the user based on the digital signature and provides a response to one of the intervention mechanisms using the user rights.

In detail, the API interface verifies the user identity of the user request based on the digital signature, and provides a response of one of the intervention mechanisms by using the user rights. Optionally, when one of the intervention mechanisms is to select one or more line data readable items, the readable items may be automatically selected, and another intervention mechanism is set to default line data to allow or disallow insertion.

Example 2

The embodiment of the application provides a schematic diagram of a relational database writing system based on a block chain technology. A relational database writing system based on a blockchain technology comprises a blockchain database, a filter and a trigger, wherein the blockchain database is used for writing row data for multiple times through user requests, and two intervention mechanisms are provided for each writing operation, wherein one intervention mechanism comprises selecting one or more row data as readable items, and the other intervention mechanism comprises controlling whether the row data are allowed to be inserted or not; the filter is used for selecting one or more row data through writing operation; the flip-flop is used to control whether the insertion of the line data is permitted by a write operation.

In some embodiments of the present invention, the system for writing a relational database based on a blockchain technique includes a plurality of API interfaces, each of the API interfaces verifies the user identity according to a different user identity, and responds to the selectable intervention mechanism according to the user identity.

The above embodiment is the same in principle as embodiment 1, and a repeated description is not necessary here.

In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the 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), a magnetic disk or an optical disk, and other various media capable of storing program codes.

To sum up, the embodiment of the present application provides a method and a system for writing a relational database based on a blockchain technique:

according to the embodiment of the application, the plurality of row data are respectively written into the block chain database, so that the sharing and the safety of the row data are met by using a block chain technology; the block chain database provides two interference mechanisms for each writing operation, so that a code does not need to be developed by using a back end when row data is written, and the database writing efficiency and safety are further improved; one intervention mechanism is set to select one or more line data as a readable item, so that the read permission of the written line data is set, and the efficiency and the safety of information management are improved; the secondary write authority of the line data is managed by setting another intervention mechanism to control whether the insertion of the line data is permitted. The invention reduces the workload of writing operation, thereby improving the efficiency and the safety of information management.

The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于区块链关系数据库的脚本语言管理方法和系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!