CN114357085B - Financial data storage method and device based on block chain and storage medium - Google Patents
Financial data storage method and device based on block chain and storage medium Download PDFInfo
- Publication number
- CN114357085B CN114357085B CN202210252406.3A CN202210252406A CN114357085B CN 114357085 B CN114357085 B CN 114357085B CN 202210252406 A CN202210252406 A CN 202210252406A CN 114357085 B CN114357085 B CN 114357085B
- Authority
- CN
- China
- Prior art keywords
- storage
- role
- node
- financial data
- storage space
- 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
Links
- 238000003860 storage Methods 0.000 title claims abstract description 379
- 238000000034 method Methods 0.000 title claims abstract description 46
- 238000013500 data storage Methods 0.000 title claims abstract description 26
- 230000008859 change Effects 0.000 claims description 19
- 238000010586 diagram Methods 0.000 claims description 19
- 230000008569 process Effects 0.000 claims description 11
- 238000004590 computer program Methods 0.000 claims description 8
- 238000005192 partition Methods 0.000 claims description 4
- 238000012545 processing Methods 0.000 description 5
- 238000004891 communication Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 230000003247 decreasing effect Effects 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 239000000284 extract Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/12—Accounting
- G06Q40/125—Finance or payroll
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Business, Economics & Management (AREA)
- Finance (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- General Business, Economics & Management (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明提供一种基于区块链的财务数据存储方法、装置及存储介质,包括:接收区块链中第一节点上传的第一财务数据,根据所述第一节点所对应的第一角色确定第一节点所对应的多维存储数据信息;将所述第一财务数据分别存储于所述多维存储数据信息所对应的存储空间处;获取所述第一财务数据的属性标记和时间标记,基于所述属性标记选取存储空间中对应的存储单元,根据所述时间标记对存储单元中先前存储的第二财务数据和当前存储的第一财务数据进行排序更新得到第三财务数据;若判断多维存储数据信息所对应的所有存储空间分别更新得到第三财务数据后,对所有第二角色以及第一角色对应的节点进行存储完成提醒。
The present invention provides a blockchain-based financial data storage method, device and storage medium, including: receiving first financial data uploaded by a first node in the blockchain, and determining according to a first role corresponding to the first node The multi-dimensional storage data information corresponding to the first node; store the first financial data in the storage space corresponding to the multi-dimensional storage data information respectively; obtain the attribute mark and time mark of the first financial data, based on the The attribute mark selects the corresponding storage unit in the storage space, and the second financial data previously stored in the storage unit and the first financial data currently stored in the storage unit are sorted and updated to obtain the third financial data according to the time mark; if the multidimensional storage data is judged After all the storage spaces corresponding to the information are respectively updated to obtain the third financial data, a storage completion reminder is given to all the nodes corresponding to the second roles and the first roles.
Description
技术领域technical field
本发明涉及数据存储技术领域,尤其涉及一种基于区块链的财务数据存储方法、装置及存储介质。The present invention relates to the technical field of data storage, and in particular, to a method, device and storage medium for storing financial data based on blockchain.
背景技术Background technique
区块链是一种按照时间顺序将数据区块以顺序相连的方式组合成的一种链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。所以区块链的其中一个重要属性就是能够保障数据的真实性、不可篡改性。Blockchain is a chained data structure that combines data blocks in a sequential manner according to time sequence, and is a cryptographically guaranteed untamperable and unforgeable distributed ledger. Therefore, one of the important attributes of the blockchain is that it can ensure the authenticity of data and cannot be tampered with.
财务数据能够体现出一个公司的经营状态、财务往来等等,通过区块链可以保障财务的真实性,但是在区块链中会存在多个节点,往往多个节点中存在部分节点具有可以查看对方财务数据的可能性。例如说,一个区块链中包括集团公司以及多级子公司,上级公司可以查看下级公司中的部分财务数据,但是下级公司不能够查看上级公司的财务数据,某一个上级公司并不能够查看其它上级公司所对应的下级公司的财务数据,所以对于区块链中各个节点需要设置相对应的角色,使得每个节点相对应的角色能够查看相对应的数据。Financial data can reflect a company's operating status, financial transactions, etc. The authenticity of finance can be guaranteed through the blockchain, but there will be multiple nodes in the blockchain, and often there are some nodes in the multiple nodes that can be viewed. Possibility of counterparty financial data. For example, a blockchain includes group companies and multi-level subsidiaries. The upper company can view some financial data of the lower company, but the lower company cannot view the financial data of the upper company, and a certain upper company cannot view other companies. The financial data of the lower-level company corresponding to the upper-level company, so it is necessary to set corresponding roles for each node in the blockchain, so that the corresponding role of each node can view the corresponding data.
在设置角色后,当每个角色需要调取、查看相应的财务数据时,会判断该角色是否具有相应的权限,该种方式会造成处理量大的问题出现,财务数据一般都是以文字报表的形式存在,文字报表具有数量小的特点,所以可以在对财务数据的存储过程中进行处理,方便相应角色调取财务数据。当前还没有一种方法,能够将角色与存储方式进行结合,使用户在区块链架构中快速确定相应的财务数据。After the role is set, when each role needs to retrieve and view the corresponding financial data, it will determine whether the role has the corresponding authority. This method will cause a large amount of processing. Financial data is generally reported in text. It exists in the form of , and the text report has the characteristics of a small number, so it can be processed in the storage process of financial data, which is convenient for the corresponding role to retrieve financial data. There is currently no way to combine roles and storage methods so that users can quickly determine the corresponding financial data in the blockchain architecture.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供一种基于区块链的财务数据存储方法、装置及存储介质,能够在区块链的架构下,根据区块链中各个节点的角色与其可查看的财务数据进行对应存储,方便每个节点根据其角色调取其具有查看权限的财务数据,无需遍历所有财务数据,速度较快。Embodiments of the present invention provide a blockchain-based financial data storage method, device, and storage medium, which can store corresponding financial data that can be viewed based on the roles of each node in the blockchain and the financial data that can be viewed under the framework of the blockchain. It is convenient for each node to retrieve the financial data that it has viewing permission according to its role, without traversing all financial data, and the speed is faster.
本发明实施例的第一方面,提供一种基于区块链的财务数据存储方法,其特征在于,包括:A first aspect of the embodiments of the present invention provides a blockchain-based financial data storage method, characterized in that it includes:
接收区块链中第一节点上传的第一财务数据,根据所述第一节点所对应的第一角色确定第一节点所对应的多维存储数据信息;Receive the first financial data uploaded by the first node in the blockchain, and determine the multi-dimensional storage data information corresponding to the first node according to the first role corresponding to the first node;
基于所述第一角色确定至少一个第二角色,将所述第一财务数据分别存储于所述多维存储数据信息所对应的存储空间处,其中每个第二角色对应一个存储空间;Determine at least one second role based on the first role, and store the first financial data in storage spaces corresponding to the multi-dimensional storage data information, wherein each second role corresponds to a storage space;
获取所述第一财务数据的属性标记和时间标记,基于所述属性标记选取存储空间中对应的存储单元,根据所述时间标记对存储单元中先前存储的第二财务数据和当前存储的第一财务数据进行排序更新得到第三财务数据;Obtain the attribute mark and the time mark of the described first financial data, select the corresponding storage unit in the storage space based on the attribute mark, and compare the second financial data previously stored in the storage unit and the currently stored first data according to the time mark. The financial data is sorted and updated to obtain the third financial data;
若判断多维存储数据信息所对应的所有存储空间分别更新得到第三财务数据后,对所有第二角色以及第一角色对应的节点进行存储完成提醒。If it is determined that all storage spaces corresponding to the multi-dimensional storage data information are respectively updated to obtain the third financial data, a storage completion reminder is given to all nodes corresponding to the second role and the first role.
可选地,在第一方面的一种可能实现方式中,接收区块链中第一节点上传的第一财务数据,根据所述第一节点所对应的第一角色确定第一节点所对应的多维存储数据信息包括:Optionally, in a possible implementation manner of the first aspect, the first financial data uploaded by the first node in the blockchain is received, and the first role corresponding to the first node is determined according to the first role corresponding to the first node. Multidimensional storage data information includes:
获取第一节点所对应的第一角色,根据所述第一角色确定对应表中相对应的第一集合,所述第一集合中包括至少一个第二角色;Acquiring a first role corresponding to the first node, and determining a corresponding first set in the corresponding table according to the first role, where the first set includes at least one second role;
获取与第一集合中所有第二角色对应的所有存储空间,生成多维存储数据信息,其中每个第二角色对应一个存储空间。All storage spaces corresponding to all the second characters in the first set are acquired, and multi-dimensional storage data information is generated, wherein each second character corresponds to one storage space.
可选地,在第一方面的一种可能实现方式中,通过以下步骤生成对应表,包括:Optionally, in a possible implementation manner of the first aspect, the corresponding table is generated by the following steps, including:
对用户输入的节点配置数据进行处理,生成区块链中每个节点的连接关系信息以及角色级别信息;Process the node configuration data input by the user, and generate the connection relationship information and role level information of each node in the blockchain;
基于所述连接关系信息以及角色级别信息生成树状图,所述树状图包括一个根节点、多个子节点以及多个孙节点;Generate a tree diagram based on the connection relationship information and the role level information, the tree diagram includes a root node, multiple child nodes and multiple grandchild nodes;
根据所述根节点、多个子节点以及多个孙节点生成每个节点所对应的第一集合,基于每个节点所对应的第一集合生成对应表。A first set corresponding to each node is generated according to the root node, multiple child nodes and multiple grandchild nodes, and a correspondence table is generated based on the first set corresponding to each node.
可选地,在第一方面的一种可能实现方式中,根据所述根节点、多个子节点以及多个孙节点生成每个节点所对应的第一集合,基于每个节点所对应的第一集合生成对应表包括:Optionally, in a possible implementation manner of the first aspect, a first set corresponding to each node is generated according to the root node, multiple child nodes, and multiple grandchild nodes, based on the first set corresponding to each node. The corresponding table generated by the set includes:
获取根节点上一级别所对应的节点生成第一集合,若不存在上一级别所对应的节点,则根节点所对应的第一集合中只存在其自身所对应的角色;Obtain the node corresponding to the previous level of the root node to generate the first set, if there is no node corresponding to the previous level, only the role corresponding to itself exists in the first set corresponding to the root node;
提取所述根节点的第一角色与所述第一集合对应。Extracting the first role of the root node corresponds to the first set.
可选地,在第一方面的一种可能实现方式中,根据所述根节点、多个子节点以及多个孙节点生成每个节点所对应的第一集合,基于每个节点所对应的第一集合生成对应表包括:Optionally, in a possible implementation manner of the first aspect, a first set corresponding to each node is generated according to the root node, multiple child nodes, and multiple grandchild nodes, based on the first set corresponding to each node. The corresponding table generated by the set includes:
获取子节点上一级别所对应的根节点生成第一集合,将第一集合内的节点所对应的角色作为第二角色;Obtain the root node corresponding to the previous level of the child node to generate the first set, and use the role corresponding to the node in the first set as the second role;
提取所述子节点的第一角色与所述第一集合对应。Extracting the first role of the child node corresponds to the first set.
可选地,在第一方面的一种可能实现方式中,根据所述根节点、多个子节点以及多个孙节点生成每个节点所对应的第一集合,基于每个节点所对应的第一集合生成对应表包括:Optionally, in a possible implementation manner of the first aspect, a first set corresponding to each node is generated according to the root node, multiple child nodes, and multiple grandchild nodes, based on the first set corresponding to each node. The corresponding table generated by the set includes:
获取孙节点上一级别所对应的子节点、根节点生成第一集合,将第一集合内的节点所对应的角色作为第二角色;Obtain the child nodes and root nodes corresponding to the previous level of the grandchild node to generate the first set, and use the role corresponding to the node in the first set as the second role;
提取所述孙节点的第一角色与所述第一集合对应。The first role of the extracted grandchild node corresponds to the first set.
可选地,在第一方面的一种可能实现方式中,还包括:Optionally, in a possible implementation manner of the first aspect, it further includes:
选取与第一角色对应的第一集合中的第二角色;selecting the second character in the first set corresponding to the first character;
获取与所述第二角色对应的存储空间,对所述第二角色对应的存储空间进行分区以建立与所述第一角色对应的存储单元,与所述第一角色对应的存储单元用于存储第一财务数据。Obtain the storage space corresponding to the second role, partition the storage space corresponding to the second role to establish a storage unit corresponding to the first role, and the storage unit corresponding to the first role is used for storage First Financial Data.
可选地,在第一方面的一种可能实现方式中,获取所述第一财务数据的属性标记和时间标记,基于所述属性标记选取存储空间中对应的存储单元,根据所述时间标记对存储单元中先前存储的第二财务数据和当前存储的第一财务数据进行排序更新得到第三财务数据包括:Optionally, in a possible implementation manner of the first aspect, an attribute mark and a time mark of the first financial data are acquired, a corresponding storage unit in the storage space is selected based on the attribute mark, and a corresponding storage unit in the storage space is selected according to the time mark. Sorting and updating the previously stored second financial data and the currently stored first financial data in the storage unit to obtain the third financial data includes:
获取所述第一财务数据的属性标记,所述属性标记包括第一节点的角色;acquiring an attribute tag of the first financial data, where the attribute tag includes the role of the first node;
选取与第二角色对应的存储空间中与所述第一节点的角色对应的存储单元,将第一财务数据存储至与所述第一节点的角色对应的存储单元;Select the storage unit corresponding to the role of the first node in the storage space corresponding to the second role, and store the first financial data in the storage unit corresponding to the role of the first node;
提取第一节点的角色对应的存储单元中先前存储的所有第二财务数据以及第二财务数据所对应的时间标记;extracting all the second financial data previously stored in the storage unit corresponding to the role of the first node and the time stamp corresponding to the second financial data;
基于所述第二财务数据的时间标记、第一财务数据的时间标记对第二财务数据和第一财务数据进行排序得到按照时间序列排序的第三财务数据。The second financial data and the first financial data are sorted based on the time stamp of the second financial data and the time stamp of the first financial data to obtain third financial data sorted in time series.
可选地,在第一方面的一种可能实现方式中,还包括:Optionally, in a possible implementation manner of the first aspect, it further includes:
统计所有节点所对应的角色,获取每个角色在所有节点所对应的第一集合中的数量;Count the roles corresponding to all nodes, and obtain the number of each role in the first set corresponding to all nodes;
基于每个角色在所有第一集合中的数量确定与相应节点对应的预分配存储空间的量值;determining the amount of preallocated storage space corresponding to the corresponding node based on the number of each character in all the first sets;
通过以下公式计算预分配存储空间的量值,The amount of preallocated storage space is calculated by the following formula,
其中,为第个存储空间的分配存储量值,为第个角色在所有第一集合中 的数量,为第个角色在所有第一集合中的数量,为角色的上限值,为所有空间的 总存储量值,为第个存储空间所对应的节点类型权重值,为第个存储空间所对 应的角色权重值; in, for the first The allocated storage value of the storage space, for the first the number of characters in all first sets, for the first the number of characters in all first sets, is the upper limit of the role, is the total storage value of all spaces, for the first The node type weight value corresponding to each storage space, for the first The role weight value corresponding to each storage space;
基于所述预分配存储空间的量值对总存储空间进行初始化分配,以对每个节点分配相应的初始的存储空间。The total storage space is initially allocated based on the magnitude of the pre-allocated storage space, so as to allocate a corresponding initial storage space to each node.
可选地,在第一方面的一种可能实现方式中,还包括:Optionally, in a possible implementation manner of the first aspect, it further includes:
间隔预设时间段获取每个存储空间内在当前时刻的数据已存储量值;Obtain the value of the data stored at the current moment in each storage space at preset time intervals;
根据每个存储空间内的数据已存储量值得到当前的已存储平均量值;Obtain the current average stored volume value according to the stored volume value of data in each storage space;
根据所述每个存储空间内的数据已存储量值、当前的已存储平均量值以及每个存储空间所对应的角色权重值对存储空间的分配存储量值进行调整。The allocated storage amount value of the storage space is adjusted according to the data stored amount value in each storage space, the current stored average amount value, and the role weight value corresponding to each storage space.
可选地,在第一方面的一种可能实现方式中,根据所述每个存储空间内的数据已存储量值、当前的已存储平均量值以及每个存储空间所对应的角色权重值对存储空间的分配存储量值进行调整包括:Optionally, in a possible implementation manner of the first aspect, according to the stored amount value of the data in each storage space, the current stored average amount value, and the role weight value pair corresponding to each storage space The allocated storage value for storage space is adjusted to include:
若判断所述数据已存储量值大于等于所述当前的已存储平均量值;If it is judged that the stored value of the data is greater than or equal to the current stored average value;
基于数据已存储量值、已存储平均量值得到正向变化趋势值,基于第一正向变化趋势值、角色权重值对存储空间内的分配存储量值进行正向调整;The positive change trend value is obtained based on the stored value of the data and the stored average value, and the allocated storage value in the storage space is positively adjusted based on the first positive change trend value and the role weight value;
若判断所述数据已存储量值小于所述当前的已存储平均量值;If it is judged that the stored value of the data is less than the current stored average value;
基于数据已存储量值、已存储平均量值得到负向变化趋势值,基于所述负向变化趋势值、角色权重值对存储空间内的分配存储量值进行负向调整。The negative change trend value is obtained based on the stored data volume value and the stored average volume value, and the allocated storage volume value in the storage space is negatively adjusted based on the negative change trend value and the role weight value.
可选地,在第一方面的一种可能实现方式中,通过以下公式对存储空间所分配的存储量值进行调整,Optionally, in a possible implementation manner of the first aspect, the storage amount value allocated by the storage space is adjusted by the following formula:
其中,为第个存储空间内的数据已存储量值,为当前的已存储平均量 值,为第个存储空间内的数据已存储量值,为存储空间的上限值,为存储空间的 数量值,为第个存储空间调整后所分配的存储量值,为第个存储空间调整前所分 配的存储量值,为第个存储空间调整前所分配的存储量值,为第个存储空间数据 已存储量值,为第个存储空间所对应的角色权重值。 in, for the first The amount of data in the storage space has been stored, is the current stored average magnitude, for the first The amount of data in the storage space has been stored, is the upper limit of storage space, is the amount of storage space, for the first The allocated storage value after the storage space is adjusted, for the first The amount of storage allocated before the storage space is adjusted, for the first The amount of storage allocated before the storage space is adjusted, for the first The storage space data has stored amount value, for the first The role weight value corresponding to each storage space.
本发明实施例的第二方面,提供一种基于区块链的财务数据存储装置,包括:A second aspect of the embodiments of the present invention provides a blockchain-based financial data storage device, including:
上传模块,用于接收区块链中第一节点上传的第一财务数据,根据所述第一节点所对应的第一角色确定第一节点所对应的多维存储数据信息;an uploading module, configured to receive the first financial data uploaded by the first node in the blockchain, and determine the multi-dimensional storage data information corresponding to the first node according to the first role corresponding to the first node;
存储模块,用于基于所述第一角色确定至少一个第二角色,将所述第一财务数据分别存储于所述多维存储数据信息所对应的存储空间处,其中每个第二角色对应一个存储空间;A storage module, configured to determine at least one second role based on the first role, and store the first financial data in the storage space corresponding to the multi-dimensional storage data information, wherein each second role corresponds to a storage module space;
排序模块,用于获取所述第一财务数据的属性标记和时间标记,基于所述属性标记选取存储空间中对应的存储单元,根据所述时间标记对存储单元中先前存储的第二财务数据和当前存储的第一财务数据进行排序更新得到第三财务数据;The sorting module is used to obtain the attribute mark and time mark of the first financial data, select the corresponding storage unit in the storage space based on the attribute mark, and perform the second financial data and the time mark previously stored in the storage unit according to the time mark. Sort and update the currently stored first financial data to obtain third financial data;
更新提醒模块,用于在多维存储数据信息所对应的所有存储空间分别更新得到第三财务数据后,对所有第二角色以及第一角色对应的节点进行存储完成提醒。The update reminder module is used to remind all nodes corresponding to the second role and the first role to complete the storage after all the storage spaces corresponding to the multi-dimensional storage data information are respectively updated to obtain the third financial data.
本发明实施例的第三方面,提供一种存储介质,所述存储介质中存储有计算机程序,所述计算机程序被处理器执行时用于实现本发明第一方面及第一方面各种可能设计的所述方法。A third aspect of the embodiments of the present invention provides a storage medium, where a computer program is stored in the storage medium, and the computer program is used to implement the first aspect of the present invention and various possible designs of the first aspect when the computer program is executed by a processor. of the method.
本发明提供的一种基于区块链的财务数据存储方法、装置及存储介质。能够在区块链架构的基础上,对区块链中的每个节点按照角色进行区分,根据每个节点的角色的不同为其分配不同的财务数据查看权限,并且本发明会为每个节点设置一个对应的存储空间,本发明会直接将每个节点具有查看权限的财务数据发送至相应节点的存储空间处,使得每个节点在进行财务数据的查看时只需要遍历其具有权限的、可以查看的财务数据即可快速查找到相应的财务数据,无需遍历所有节点对应的财务数据,无需进行身份、角色的认证,降低了数据处理量,提高了财务数据查找的效率。并且,本发明会根据第一财务数据的属性标记和时间标记对存储空间、存储单元内的不同角色对应的财务数据、不同时间对应的财务数据进行更新,使得相应节点在查看财务数据具有存储规律,寻找财务数据更加快速。The present invention provides a blockchain-based financial data storage method, device and storage medium. On the basis of the blockchain architecture, each node in the blockchain can be distinguished according to its role, and different financial data viewing rights can be assigned to each node according to the different roles of each node, and the present invention will provide each node for each node. Set up a corresponding storage space, the present invention will directly send the financial data that each node has viewing authority to the storage space of the corresponding node, so that each node only needs to traverse the financial data that it has authority to view when viewing financial data. Viewed financial data can quickly find the corresponding financial data, without traversing the financial data corresponding to all nodes, without the need for identity and role authentication, reducing the amount of data processing and improving the efficiency of financial data search. In addition, the present invention will update the storage space, the financial data corresponding to different roles in the storage unit, and the financial data corresponding to different times according to the attribute mark and time mark of the first financial data, so that the corresponding nodes have storage rules when viewing the financial data. , find financial data faster.
本发明提供的技术方案,会根据用户主动输入的节点配置数据生成相应的树状图,其中树状图中能够体现出多个节点之间的角色级别关系,使得本发明可以根据当前节点与其他节点的连接关系得到相对应的第一集合,该种方式能够使得树状图中的每个节点都会具有与其对应的第一集合,在进行财务数据的存储时,可以按照第一集合内的第二角色对每个具有访问该财务数据权限的节点所对应的存储空间、存储单元进行财务数据的存储,使得本发明可以在某个节点生成财务数据后主动对该财务数据进行分发,分发至相应的节点所对应的存储空间处,每个节点在需要访问相应的财务数据时,可以直接访问该节点所对应的存储空间内的财务数据,财务数据的确定、访问速度较快。The technical solution provided by the present invention will generate a corresponding tree diagram according to the node configuration data actively input by the user, wherein the tree diagram can reflect the role level relationship between multiple nodes, so that the present invention can be based on the current node and other The connection relationship of the nodes obtains the corresponding first set. In this way, each node in the tree diagram will have its corresponding first set. When storing financial data, the first set can be stored according to the first set. The two roles store financial data in the storage space and storage unit corresponding to each node that has access to the financial data, so that the present invention can actively distribute the financial data after a certain node generates the financial data, and distribute it to the corresponding financial data. At the storage space corresponding to the node, each node can directly access the financial data in the storage space corresponding to the node when it needs to access the corresponding financial data, and the determination and access speed of the financial data is faster.
本发明提供的技术方案,由于区块链中各个节点的权限可能存在不同,所以各个节点所能够查看的财务数据也是不同的,进而每个节点所需要的存储空间存在不同,本发明会根据每个角色在所有第一集合中的数量、频次确定每个角色所对应的预分配存储空间的量值,使在第一集合中出现的数量、频次较多的角色具有较高的预分配存储空间的量值。该种方式有效的保障了本发明可以根据区块链中每个节点所对应的角色的权限不同分配相应的存储空间,使得每个节点具有与其相适应的存储空间,合理利用存储空间,提高资源利用率。由于每个节点的经营情况不同,所以财务数据的数据量也会存在一定的区别,进而导致部分存储空间可能出现数据增长率较高、部分存储空间数据增长率较低的情况,本发明间隔预设时间段即获取每个存储空间内的已存储量值,并根据每个存储空间内的已存储量值与总存储量值之间的比例对所有剩余空间进行重新分配、调整,使得每个存储空间根据时间的变化动态调整对其分配的存储空间,提高存储空间利用率的同时,保障每个存储空间都能对相应节点所能查看的财务数据进行稳定存储。In the technical solution provided by the present invention, since the authority of each node in the blockchain may be different, the financial data that each node can view is also different, and the storage space required by each node is different. The quantity and frequency of each character in all the first sets determine the amount of pre-allocated storage space corresponding to each character, so that characters with more quantity and frequency in the first set have higher pre-allocated storage space amount of. This method effectively guarantees that the present invention can allocate the corresponding storage space according to the authority of the role corresponding to each node in the blockchain, so that each node has a corresponding storage space, rationally utilizes the storage space, and improves resources. utilization. Due to the different operating conditions of each node, the data volume of financial data will also be different to a certain extent, which may lead to a situation where the data growth rate of some storage spaces is relatively high, and the data growth rate of some storage spaces is relatively low. Set the time period to obtain the stored value in each storage space, and redistribute and adjust all remaining spaces according to the ratio between the stored value in each storage space and the total storage value, so that each The storage space dynamically adjusts the storage space allocated to it according to the change of time, improves the utilization of storage space, and ensures that each storage space can stably store the financial data that can be viewed by the corresponding node.
附图说明Description of drawings
图1为基于区块链的财务数据存储方法的第一种实施方式的流程图;Fig. 1 is the flow chart of the first embodiment of the financial data storage method based on blockchain;
图2为基于区块链的财务数据存储方法的第二种实施方式的流程图;Fig. 2 is the flow chart of the second embodiment of the financial data storage method based on blockchain;
图3为树状图的结构示意图;Fig. 3 is the structural representation of tree diagram;
图4为基于区块链的财务数据存储装置的第一种实施方式的结构图。FIG. 4 is a structural diagram of a first embodiment of a blockchain-based financial data storage device.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments It is only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to Describe a particular order or sequence. It is to be understood that the data so used may be interchanged under appropriate circumstances such that the embodiments of the invention described herein can be practiced in sequences other than those illustrated or described herein.
应当理解,在本发明的各种实施例中,各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。It should be understood that, in various embodiments of the present invention, the size of the sequence numbers of each process does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be used in the embodiments of the present invention. The implementation process constitutes any limitation.
应当理解,在本发明中,“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be understood that in the present invention, "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to Those steps or elements that are expressly listed may instead include other steps or elements that are not expressly listed or are inherent to the process, method, product or apparatus.
应当理解,在本发明中,“多个”是指两个或两个以上。“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。“包含A、B和C”、“包含A、B、C”是指A、B、C三者都包含,“包含A、B或C”是指包含A、B、C三者之一,“包含A、B和/或C”是指包含A、B、C三者中任1个或任2个或3个。It should be understood that, in the present invention, "plurality" refers to two or more. "And/or" is just an association relationship that describes an associated object, indicating that there can be three kinds of relationships, for example, A and/or B, which can mean: A alone exists, A and B exist at the same time, and B exists alone. Happening. The character "/" generally indicates that the associated objects are an "or" relationship. "Contains A, B and C", "contains A, B, C" means that A, B, and C are all contained, "contains A, B or C" means that one of A, B, and C is contained, "Comprising A, B and/or C" means including any one or any two or three of A, B, and C.
应当理解,在本发明中,“与A对应的B”、“与A相对应的B”、“A与B相对应”或者“B与A相对应”,表示B与A相关联,根据A可以确定B。根据A确定B并不意味着仅仅根据A确定B,还可以根据A和/或其他信息确定B。A与B的匹配,是A与B的相似度大于或等于预设的阈值。It should be understood that in the present invention, "B corresponding to A", "B corresponding to A", "A corresponds to B" or "B corresponds to A" means that B is associated with A, according to A B can be determined. Determining B based on A does not mean determining B based only on A, but also determining B based on A and/or other information. The matching between A and B means that the similarity between A and B is greater than or equal to a preset threshold.
取决于语境,如在此所使用的“若”可以被解释成为“在……时”或“当……时”或“响应于确定”或“响应于检测”。"If" as used herein may be interpreted as "at" or "when" or "in response to determining" or "in response to detecting," depending on the context.
下面以具体地实施例对本发明的技术方案进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例不再赘述。The technical solutions of the present invention will be described in detail below with specific examples. The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
本发明提供的技术方案,适用于区块链架构下的数据存储场景,例如说存在某个集团公司,集团公司包括1个总公司,每个总公司对应多个1级子公司,每个1级子公司对应多个2级子公司。此时总公司具有的财务数据查询权限最高,总公司可以查询任意一个1级子公司、任意一个2级子公司的财务数据,1级子公司可以查看位于其权限下、由其注资的2级子公司,2级子公司只能够查看其自己的财务数据。在现有技术方案中,每个节点会对其自己的财务数据进行存储,当某个1级子公司需要查看某个2级子公司的财务数据时,其需要发送数据查询请求、对1级子公司的身份进行认证、根据认证结果调取相应的财务数据,在对1级子公司的身份进行认证时,需要遍历所有2级子公司所对应的权限,使得在财务数据的查找过程中效率较低。本发明的技术方案,可以解决区块链结构下财务数据查找效率低的问题。The technical solution provided by the present invention is suitable for data storage scenarios under the blockchain architecture. For example, there is a certain group company, the group company includes one head office, each head office corresponds to multiple first-level subsidiaries, and each one Level 2 subsidiaries correspond to multiple Level 2 subsidiaries. At this time, the head office has the highest financial data query authority. The head office can query the financial data of any level 1 subsidiary and any level 2 subsidiary. Subsidiaries, Level 2 subsidiaries are only able to view their own financial data. In the prior art solution, each node will store its own financial data. When a tier-1 subsidiary needs to view the financial data of a tier-2 subsidiary, it needs to send a data query request to the tier-1 subsidiary. The identity of the subsidiary is authenticated, and the corresponding financial data is retrieved according to the authentication result. When the identity of the first-level subsidiary is authenticated, it is necessary to traverse the corresponding permissions of all the second-level subsidiaries, which makes the search process of financial data efficient. lower. The technical scheme of the present invention can solve the problem of low search efficiency of financial data under the block chain structure.
本发明提供一种基于区块链的财务数据存储方法,如图1所示,包括:The present invention provides a blockchain-based financial data storage method, as shown in Figure 1, including:
步骤S110、接收区块链中第一节点上传的第一财务数据,根据所述第一节点所对应的第一角色确定与第一节点所对应的多维存储数据信息。本发明会将上传第一财务数据的节点作为第一节点。区块链中的某个节点会在某个时刻上传第一财务数据,第一财务数据可以是纳税申报表、利润表、资产负债表等等。区块链中的每个节点都会具有与其对应的角色,本发明会将上传第一财务数据的节点所对应的角色作为第一角色。本发明可以根据第一节点所对应的第一角色确定与第一节点所对应的多维存储数据信息。Step S110: Receive the first financial data uploaded by the first node in the blockchain, and determine the multi-dimensional storage data information corresponding to the first node according to the first role corresponding to the first node. The present invention takes the node that uploads the first financial data as the first node. A node in the blockchain will upload the first financial data at a certain time, and the first financial data can be tax returns, income statements, balance sheets, and so on. Each node in the blockchain will have its corresponding role, and the present invention will use the role corresponding to the node that uploads the first financial data as the first role. The present invention can determine the multi-dimensional storage data information corresponding to the first node according to the first role corresponding to the first node.
本发明提供的技术方案,在一个可能的实施方式中,如图2所示,步骤S110具体包括:In a possible implementation manner of the technical solution provided by the present invention, as shown in FIG. 2 , step S110 specifically includes:
步骤S1101、获取第一节点所对应的第一角色,根据所述第一角色确定对应表中相对应的第一集合,所述第一集合中包括至少一个第二角色。由于每个节点都会具有相应的角色,在某一个节点上传财务数据时,本发明会将上传财务数据的节点作为第一节点,将第一节点所对应的角色作为第一角色,本发明会根据第一角色去确定对应表中相对应的第一集合,通过第一集合对所有的第二角色进行存储,该种方式使得本发明可以存储第一角色与多个第二角色的对应关系。Step S1101: Acquire a first role corresponding to a first node, and determine a corresponding first set in the correspondence table according to the first role, where the first set includes at least one second role. Since each node will have a corresponding role, when uploading financial data to a certain node, the present invention will use the node uploading financial data as the first node, and the role corresponding to the first node will be the first role. The first role determines the corresponding first set in the correspondence table, and stores all the second roles through the first set. This method enables the present invention to store the corresponding relationship between the first role and multiple second roles.
步骤S1102、获取与第一集合中所有第二角色对应的所有存储空间生成多维存储数据信息,其中每个第二角色对应一个存储空间。本发明会根据所有第二角色对应的所有存储空间生成多维存储数据信息,根据多维存储数据信息可以对第一角色处所上传的财务数据进行统一的分发,将所上传的财务数据分发至具有相应权限的第二角色所对应的存储空间中。该种方式能够进行财务数据的主动分发,使得每个节点根据第一集合将自己的财务数据分发给具有查看该节点财务数据的其他节点。Step S1102: Acquire all storage spaces corresponding to all second roles in the first set to generate multi-dimensional storage data information, wherein each second role corresponds to one storage space. The present invention will generate multi-dimensional storage data information according to all the storage spaces corresponding to all the second roles, and according to the multi-dimensional storage data information, the financial data uploaded by the first role can be uniformly distributed, and the uploaded financial data can be distributed to those with corresponding authority. in the storage space corresponding to the second role. This method enables active distribution of financial data, so that each node distributes its own financial data according to the first set to other nodes that have the ability to view the financial data of the node.
本发明提供的技术方案,通过以下步骤生成对应表,包括:The technical solution provided by the present invention generates a corresponding table through the following steps, including:
对用户输入的节点配置数据进行处理生成区块链中每个节点的连接关系信息以及角色级别信息。在初始化生成对应表时,管理员、用户会输入节点配置数据,此时节点配置数据会具有每个节点的连接关系信息以及角色级别信息。例如说,存在公司1、公司2、公司3、公司4以及公司5,连接关系信息可以为公司1与公司2和公司3连接,公司1的角色级别信息为总公司,公司2和公司3的角色级别信息为1级子公司,公司4所对应的连接关系为与公司2连接,公司4为2级子公司,公司5所对应的连接关系为与公司3连接,公司5为2级子公司。The node configuration data input by the user is processed to generate the connection relationship information and role level information of each node in the blockchain. When the corresponding table is initially generated, administrators and users will input node configuration data. At this time, the node configuration data will have the connection relationship information and role level information of each node. For example, if there are company 1, company 2, company 3, company 4 and company 5, the connection relationship information can be that company 1 is connected with company 2 and company 3, and the role level information of company 1 is the head office, company 2 and company 3. The role level information is a level 1 subsidiary, the connection relationship corresponding to company 4 is connected to company 2, company 4 is a level 2 subsidiary, the connection relationship corresponding to company 5 is a connection with company 3, and company 5 is a level 2 subsidiary .
基于所述连接关系信息以及角色级别信息生成树状图,所述树状图包括一个根节点、多个子节点以及多个孙节点。本发明会根据每个节点的连接关系信息以及角色级别信息生成树状图,其中树状图可以是如图3所示,此时总公司所对应的公司1可以对应树状图中的根节点,1级子公司所对应的公司2可以对应树状图中的子节点,2级子公司所对应的公司4可以对应树状图中的孙节点。通过以上方式,使得本发明根据公司不同的角色级别关系生成相应的树状图,易于实现对公司的分类处理。A tree diagram is generated based on the connection relationship information and the role level information, and the tree diagram includes a root node, multiple child nodes and multiple grandchild nodes. The present invention will generate a tree diagram according to the connection relationship information and role level information of each node, wherein the tree diagram can be as shown in FIG. 3, at this time, the company 1 corresponding to the head office can correspond to the root node in the tree diagram , the company 2 corresponding to the first-level subsidiary may correspond to the child node in the tree diagram, and the company 4 corresponding to the second-level subsidiary may correspond to the grandchild node in the tree diagram. Through the above methods, the present invention generates corresponding tree diagrams according to different role level relationships of companies, which is easy to realize the classification processing of companies.
根据所述根节点、多个子节点以及多个孙节点生成每个节点所对应的第一集合,基于每个节点所对应的第一集合生成对应表。本发明会根据根节点、多个子节点以及多个孙节点生成每个节点所对应的第一集合,例如说。2级子公司(公司4)所对应的孙节点与1级子公司(公司2)所对应的子节点连接,1级子公司(公司2)所对应的子节点与总公司(公司1)所对应的根节点连接。此时总公司(公司1)既可以查看1级子公司(公司2)的财务数据,也可以查看2级子公司(公司4)的财务数据,则此时根节点所对应的第一集合即至少包括1级子公司(公司2)所对应的节点的角色、2级子公司(公司4)所对应的节点的角色。此时1级子公司(公司2)所对应的节点、2级子公司(公司4)所对应的节点在上传财务数时,会将财务数据分别发送至根节点(公司1)所对应的存储空间中进行存储。A first set corresponding to each node is generated according to the root node, multiple child nodes and multiple grandchild nodes, and a correspondence table is generated based on the first set corresponding to each node. The present invention generates a first set corresponding to each node according to the root node, multiple child nodes and multiple grandchild nodes, for example. The grandchild node corresponding to the second-level subsidiary (company 4) is connected to the child node corresponding to the first-level subsidiary (company 2), and the child node corresponding to the first-level subsidiary (company 2) is connected to the parent company (company 1). Corresponding root node connection. At this time, the head office (company 1) can view both the financial data of the first-level subsidiary (company 2) and the financial data of the second-level subsidiary (company 4). At this time, the first set corresponding to the root node is It includes at least the role of the node corresponding to the first-level subsidiary (company 2) and the role of the node corresponding to the second-level subsidiary (company 4). At this time, the node corresponding to the first-level subsidiary (company 2) and the node corresponding to the second-level subsidiary (company 4) will send the financial data to the storage corresponding to the root node (company 1) when uploading the financial data. storage in space.
本发明提供的技术方案,在一个可能的实施方式中,根据所述根节点、多个子节点以及多个孙节点生成每个节点所对应的第一集合,基于每个节点所对应的第一集合生成对应表包括:According to the technical solution provided by the present invention, in a possible implementation manner, a first set corresponding to each node is generated according to the root node, multiple child nodes and multiple grandchild nodes, and based on the first set corresponding to each node The generated correspondence table includes:
获取根节点上一级别所对应的节点生成第一集合,若不存在上一级别所对应的节点,则根节点所对应的第一集合中只存在其自身所对应的角色;Obtain the node corresponding to the previous level of the root node to generate the first set, if there is no node corresponding to the previous level, only the role corresponding to itself exists in the first set corresponding to the root node;
提取所述根节点的第一角色与所述第一集合对应。Extracting the first role of the root node corresponds to the first set.
在实际的生产经营活动中,也会存在某个集团公司被收购的情况,则此时先前的根节点(公司1)已经不再有最高的权限,在根节点(公司1)的上部可能会存在新增节点(公司01),则此时第一集合会包括其自身以及新增节点(公司01)。当根节点(公司1)属于最高权限时,此时整个集团公司中,只有总公司(公司1)能够查看其自身的财务数据,此时根节点所对应的第一集合中只存在其自身所对应的角色,本发明会将根节点的第一角色与所述第一集合对应。即根节点上传财务数据时,其只需要向第一集合中其本身对应的角色所对应的存储空间存储财务数据即可,其他节点无法查看根节点上传的财务数据。In the actual production and operation activities, there will also be a situation in which a group company is acquired. At this time, the previous root node (company 1) no longer has the highest authority, and the upper part of the root node (company 1) may have the highest authority. There is a new node (company 01), then the first set will include itself and the new node (company 01). When the root node (company 1) belongs to the highest authority, only the head office (company 1) of the entire group company can view its own financial data. At this time, the first set corresponding to the root node only has its own financial data. For the corresponding role, the present invention will correspond the first role of the root node to the first set. That is, when the root node uploads financial data, it only needs to store the financial data in the storage space corresponding to its own role in the first set, and other nodes cannot view the financial data uploaded by the root node.
本发明提供的技术方案,在一个可能的实施方式中,根据所述根节点、多个子节点以及多个孙节点生成每个节点所对应的第一集合,基于每个节点所对应的第一集合生成对应表包括:According to the technical solution provided by the present invention, in a possible implementation manner, a first set corresponding to each node is generated according to the root node, multiple child nodes and multiple grandchild nodes, and based on the first set corresponding to each node The generated correspondence table includes:
获取子节点上一级别所对应的根节点生成第一集合,将第一集合内的节点所对应的角色作为第二角色。一般来说,子节点的财务数据,根节点都是具有权限查看的,所以第一集合内的节点至少包括根节点以及该子节点本身,此时根节点以及该子节点本身所对应的角色为第一集合内的第二角色,即在子节点上传财务数据时,其会将财务数据上传至第一集合内的第二角色所对应的存储空间中,即根节点所对应的存储空间、其本身所对应的存储空间中。Obtain the root node corresponding to the level above the child node to generate the first set, and use the role corresponding to the node in the first set as the second role. Generally speaking, the root node of the financial data of child nodes has permission to view, so the nodes in the first set at least include the root node and the child node itself. At this time, the roles corresponding to the root node and the child node themselves are: The second role in the first set, that is, when the child node uploads financial data, it will upload the financial data to the storage space corresponding to the second role in the first set, that is, the storage space corresponding to the root node, in its corresponding storage space.
提取所述子节点的第一角色与所述第一集合对应。本发明会将子节点的第一角色与第一集合对应,此时相应的子节点具有与其自身对应的第一集合。Extracting the first role of the child node corresponds to the first set. The present invention will correspond the first role of the child node to the first set, and at this time, the corresponding child node has the first set corresponding to itself.
本发明提供的技术方案,在一个可能的实施方式中,根据所述根节点、多个子节点以及多个孙节点生成每个节点所对应的第一集合,基于每个节点所对应的第一集合生成对应表包括:According to the technical solution provided by the present invention, in a possible implementation manner, a first set corresponding to each node is generated according to the root node, multiple child nodes and multiple grandchild nodes, and based on the first set corresponding to each node The generated correspondence table includes:
获取孙节点上一级别所对应的子节点、根节点生成第一集合,将第一集合内的节点所对应的角色作为第二角色。一般来说,孙节点的财务数据,相应的子节点以及根节点都是具有权限查看的,所以第一集合内的节点至少包括相应的子节点、根节点以及该孙节点本身,此时相应的子节点、根节点以及该孙节点本身所对应的角色为第一集合内的第二角色,即在孙节点上传财务数据时,其会将财务数据上传至第一集合内的第二角色所对应的存储空间中,即相应的子节点所对应的存储空间、根节点所对应的存储空间、其本身所对应的存储空间中。Obtain the child nodes and root nodes corresponding to the next level of the grandchild node to generate a first set, and use the roles corresponding to the nodes in the first set as the second role. Generally speaking, the financial data of the grandchild node, the corresponding child nodes and the root node are all authorized to view, so the nodes in the first set at least include the corresponding child nodes, the root node and the grandchild node itself. At this time, the corresponding The roles corresponding to the child node, the root node, and the grandchild node themselves are the second roles in the first set, that is, when the grandchild node uploads financial data, it will upload the financial data to the second role in the first set. In the storage space, that is, the storage space corresponding to the corresponding child node, the storage space corresponding to the root node, and the storage space corresponding to itself.
提取所述孙节点的第一角色与所述第一集合对应。本发明会将孙节点的第一角色与第一集合对应,此时相应的孙节点具有与其自身对应的第一集合。The first role of the extracted grandchild node corresponds to the first set. The present invention will correspond the first role of the grandchild node to the first set, and at this time, the corresponding grandchild node has the first set corresponding to itself.
本发明提供的技术方案,在一个可能的实施方式中,还包括:The technical solution provided by the present invention, in a possible implementation, also includes:
选取与第一角色对应的第一集合中的第二角色。本发明可以根据第一集合中的第二角色确定财务数据所需要存储的第二角色、节点所对应的存储空间。一般来说,本发明会依次选取第一集合中的所有第二角色。A second character in the first set corresponding to the first character is selected. The present invention can determine the storage space corresponding to the second role and the node that need to be stored for the financial data according to the second role in the first set. Generally speaking, the present invention selects all the second characters in the first set in turn.
获取与所述第二角色对应的存储空间,对所述第二角色对应的存储空间进行分区以建立与所述第一角色对应的存储单元,与所述第一角色对应的存储单元用于存储第一财务数据。本发明会根据第二角色确定相对应的存储空间。当某个集团公司内的公司较多时,例如说根节点所对应的总公司,总公司所对应的存储空间需要存储所有公司的财务数据,如果存储空间多所有公司的财务数据采取随机、杂乱的方式存储则不利于总公司查看相依的财务数据,所以本发明提供的技术方案会将存储空间进行分区得到多个存储单元,本发明会通过每个存储单元存储不同的第一角色传输的第一财务数据,便于使存储空间对所接收到的财务数据进行存储、以及便于相应节点对财务数进行查询。本发明中的第一财务数据属于财务数据,可以这样理解,第一财务数据为当前时刻的财务数据。Obtain the storage space corresponding to the second role, partition the storage space corresponding to the second role to establish a storage unit corresponding to the first role, and the storage unit corresponding to the first role is used for storage First Financial Data. The present invention will determine the corresponding storage space according to the second role. When there are many companies in a group company, such as the head office corresponding to the root node, the storage space corresponding to the head office needs to store the financial data of all companies. Therefore, the technical solution provided by the present invention will partition the storage space to obtain multiple storage units, and the present invention will store the first data transmitted by different first roles through each storage unit. The financial data is convenient for the storage space to store the received financial data, and for the corresponding node to query the financial data. The first financial data in the present invention belongs to financial data, and it can be understood that the first financial data is the financial data at the current moment.
步骤S120、基于所述第一角色确定至少一个第二角色,将所述第一财务数据分别存储于所述多维存储数据信息所对应的存储空间处,其中每个第二角色对应一个存储空间。本发明会根据每个第一角色确定一个第二角色,每个第一角色会具有与其对应的第一集合,第一集合中至少存储有与其本身角色对应的第二角色,本发明会根据每个第一角色所对应的第一集合中的第二角色对财务数据进行主动的分发,使得每个第二角色所对应的节点、存储空间、存储单元对财务数进行预存储,该种方式,使得本发明在每次接收到节点上传的财务数据后即对财务数据进行主动的分发,相较于传统的财务数据寻找方式具有效率高的优点。Step S120: Determine at least one second role based on the first role, and store the first financial data in storage spaces corresponding to the multi-dimensional storage data information, wherein each second role corresponds to a storage space. The present invention will determine a second role according to each first role, each first role will have a first set corresponding to it, and the first set will store at least a second role corresponding to its own role, and the present invention will determine a second role according to each first role. The second roles in the first set corresponding to the first roles actively distribute the financial data, so that the nodes, storage spaces and storage units corresponding to each second role pre-store the financial data. In this way, Therefore, the present invention actively distributes the financial data after each time the financial data uploaded by the node is received, which has the advantage of high efficiency compared with the traditional financial data searching method.
步骤S130、获取所述第一财务数据的属性标记和时间标记,基于所述属性标记选取存储空间中对应的存储单元,根据所述时间标记对存储单元中先前存储的第二财务数据和当前存储的第一财务数据进行排序更新得到第三财务数据。本发明提供的技术方案,每个节点在上传第一财务数据时会具有与其对应的属性标记和时间标记,本发明会根据属性标记选取存储空间中对应的存储单元,将第一财务数据存储于相应的存储单元中。本发明会根据时间标记对存储单元中的当前财务数据(第一财务数据)和历史财务数据(第二财务数据)进行排序更新得到相对应的最新财务总数据(第三财务数据),使得本发明在对财务主动的分发时,能够对财务数按照相应的策略进行归类存储,按照时间序列进行保存,方便用户后续调取、使用相应的财务数据。Step S130, obtain the attribute mark and the time mark of the described first financial data, select the corresponding storage unit in the storage space based on the described attribute mark, and store the second financial data and the current storage previously stored in the storage unit according to the time mark. The first financial data is sorted and updated to obtain the third financial data. According to the technical solution provided by the present invention, each node will have an attribute mark and a time mark corresponding to it when uploading the first financial data, the present invention will select the corresponding storage unit in the storage space according to the attribute mark, and store the first financial data in the in the corresponding storage unit. The present invention sorts and updates the current financial data (the first financial data) and the historical financial data (the second financial data) in the storage unit according to the time stamp to obtain the corresponding latest total financial data (the third financial data), so that this The invention can classify and store the financial data according to the corresponding strategy and save it according to the time series when the financial data is actively distributed, so as to facilitate the user to retrieve and use the corresponding financial data later.
本发明提供的技术方案,在一个可能的实施方式中,步骤S130具体包括:In the technical solution provided by the present invention, in a possible implementation manner, step S130 specifically includes:
获取所述第一财务数据的属性标记,所述属性标记包括第一节点的角色。本发明会在上传第一财务数据添加相应的属性标记,属性标记至少包括了第一节点的角色,角色可以包括第一节点所对应的公司的名称。An attribute tag of the first financial data is acquired, where the attribute tag includes the role of the first node. The present invention adds a corresponding attribute mark to the uploaded first financial data, the attribute mark includes at least the role of the first node, and the role may include the name of the company corresponding to the first node.
选取第二角色的存储空间中与所述第一节点的角色对应的存储单元,将第一财务数据存储至与所述第一节点的角色对应的存储单元。本发明中,会预先在每个存储空间中设置多个存储单元,例如说子节点(公司2)可以查看孙节点(公司4)以及其本身的财务数据,则此时对应的存储单元则可以包括存储单元1和存储单元2,存储单元1可以存储子节点(公司2)的财务数据,存储单元2可以存储孙节点(公司4)的财务数据。例如说当孙节点(公司4)上传财务数据时,则此时孙节点(公司4)所对应的角色即为第一角色,此时会将第一财务数据存储至子节点(公司2)所对应的存储空间中与第一角色(公司4)所对应的存储单元内。The storage unit corresponding to the role of the first node in the storage space of the second role is selected, and the first financial data is stored in the storage unit corresponding to the role of the first node. In the present invention, multiple storage units will be set in each storage space in advance. For example, if the child node (company 2) can view the financial data of the grandchild node (company 4) and its own, the corresponding storage unit at this time can be It includes a storage unit 1 and a storage unit 2. The storage unit 1 can store the financial data of the child node (company 2), and the storage unit 2 can store the financial data of the grandchild node (company 4). For example, when the grandchild node (company 4) uploads financial data, the role corresponding to the grandchild node (company 4) is the first role, and the first financial data will be stored in the child node (company 2). In the storage unit corresponding to the first role (company 4) in the corresponding storage space.
提取第一节点的角色对应的存储单元中先前存储的所有第二财务数据以及第二财务数据所对应的时间标记。在确定存储空间中相应的存储单元后,本发明会提取第一节点的角色对应的存储单元中先前存储的所有第二财务数据以及第二财务数据所对应的时间标记。例如说,第二财务数据为两个,包括2019年的年度纳税申报表、2020年的年度纳税申报表,则此时2019年的年度纳税申报表所对应的时间标记即为2019年、2020年的年度纳税申报表所对应的时间标记即为2020年。Extracting all the second financial data previously stored in the storage unit corresponding to the role of the first node and the time stamp corresponding to the second financial data. After determining the corresponding storage unit in the storage space, the present invention extracts all the second financial data previously stored in the storage unit corresponding to the role of the first node and the time stamp corresponding to the second financial data. For example, if there are two second financial data, including the annual tax return for 2019 and the annual tax return for 2020, the time stamps corresponding to the annual tax return for 2019 are 2019 and 2020. The time stamp corresponding to the annual tax return for 2020 is the year 2020.
基于所述第二财务数据的时间标记、第一财务数据的时间标记对第二财务数据和第一财务数据进行排序得到按照时间序列排序的第三财务数据。例如说第一财务数据的时间标记为2021年,则此时按照时间序列排序的第三财务数据即为2019年的财务数据、2020年的财务数据以及2021年的财务数据。该种方式对财务数据保存,使得财务具有相应的时间序列,易于统计和财务数据的调取。The second financial data and the first financial data are sorted based on the time stamp of the second financial data and the time stamp of the first financial data to obtain third financial data sorted in time series. For example, if the time stamp of the first financial data is 2021, the third financial data sorted by time series at this time are the financial data of 2019, the financial data of 2020, and the financial data of 2021. In this way, the financial data is saved, so that the financial has a corresponding time series, and it is easy to retrieve statistics and financial data.
步骤S140、若判断多维存储数据信息所对应的所有存储空间分别更新得到第三财务数据后,对所有第二角色以及第一角色对应的节点进行存储完成提醒。本发明提供的技术方案,会在多维存储数据信息所对应的所有存储空间分别更新得到第三财务数据后对第二角色以及第一角色对应的节点进行提醒,使得本发明在某一个节点上传财务数据后可以进行相应的提醒,使得每个具有查看该财务数据的权限的节点能够及时核对、查看相应的财务数据。Step S140: If it is determined that all the storage spaces corresponding to the multi-dimensional storage data information are respectively updated to obtain the third financial data, remind all nodes corresponding to the second role and the first role to complete the storage. The technical solution provided by the present invention will remind the nodes corresponding to the second role and the first role after all the storage spaces corresponding to the multi-dimensional storage data information are respectively updated to obtain the third financial data, so that the present invention uploads the financial data on a certain node. After the data, corresponding reminders can be made, so that each node with the authority to view the financial data can check and view the corresponding financial data in time.
本发明提供的技术方案,相较于传统主动查看某个子公司的财务数据时需要主动查询的方式,采取了被动的上传提醒方式,即只要某个节点上传相应的财务数据后,即对财务数据按照角色权限进行主动的分发,使得所有节点被动的接收财务数据,进行财务数据的核对、校验。Compared with the traditional way of actively checking the financial data of a subsidiary company, the technical solution provided by the present invention adopts a passive upload reminder method, that is, as long as a certain node uploads the corresponding financial data, the financial data will be updated. Active distribution is carried out according to role permissions, so that all nodes passively receive financial data, and check and verify financial data.
本发明提供的技术方案,还包括:The technical solution provided by the present invention also includes:
统计所有节点所对应的角色,获取每个角色在所有节点所对应的第一集合中的数量。本发明提供的技术方案,会对每个节点的角色在所有第一集合中的数量进行统计,当数量越大时,则证明向其存储财务数据的节点越多,则其所接收的财务数据越多、需要的存储空间的数量值就越大。Count the roles corresponding to all nodes, and obtain the number of each role in the first set corresponding to all nodes. The technical solution provided by the present invention will count the number of roles of each node in all the first sets. When the number is larger, it is proved that the more nodes that store financial data to it, the more financial data it receives. The more, the greater the amount of storage space required.
基于每个角色在所有第一集合中的数量确定与相应节点对应的预分配存储空间的量值。本发明在对每个存储空间进行存储数量值的初始化分配时,会根据所有第一集合中的数量进行确定,使得每个存储空间具有相适应的存储量值,本次存储量值的分配仅仅是考虑每个角色在所有第一集合中的数量维度,并没有考虑每个节点的财务数据的数据量维度,因为此时还无法确定每个公司的经营状况,所以其财务数据的多少还无法确定。The amount of preallocated storage space corresponding to the corresponding node is determined based on the number of each role in all of the first sets. When the present invention performs the initial allocation of the storage quantity value to each storage space, it will be determined according to the quantity in all the first sets, so that each storage space has a suitable storage quantity value, and the allocation of the storage quantity value this time is only It is to consider the quantity dimension of each role in all the first sets, and does not consider the data volume dimension of the financial data of each node, because the operating status of each company cannot be determined at this time, so the amount of its financial data is not yet available. Sure.
通过以下公式计算预分配存储空间的量值,The amount of preallocated storage space is calculated by the following formula,
其中,为第个存储空间的分配存储量值,为第角色在所有第一集合中的 数量,为第个角色在所有第一集合中的数量,为角色的上限值,为所有空间的总 存储量值,为第个存储空间所对应的节点类型权重值,为第个存储空间所对应 的角色权重值。通过可以得到第个角色在所有第一集合中的数量占总数量值的比 重,进而将总存储量值按照相应的比例进行分配,节点类型权重值可以是预先设置的,根节 点的节点类型权重值可以大于子节点的节点类型权重值,子节点的节点类型权重值可以大 于孙节点的节点类型权重值。角色权重值可以是用户预先设置的,根据每个节点、角色的属 性不同进行确定,例如说该子公司为传统产业,进出项较少,则财务数据可能较少,则此时 角色权重值可能较低,例如说该子公司为新能源等新兴产业,进出项较多,则财务数据可能 较多,则此时角色权重值可能较高。 in, for the first The allocated storage value of the storage space, for the first the number of characters in all first sets, for the first the number of characters in all first sets, is the upper limit of the role, is the total storage value of all spaces, for the first The node type weight value corresponding to each storage space, for the first The role weight value corresponding to each storage space. pass can get the first The proportion of the number of roles in all the first sets to the total number value, and then the total storage value is allocated according to the corresponding proportion. The node type weight value can be preset, and the node type weight value of the root node can be greater than the child type weight value. The node type weight value of the node. The node type weight value of the child node can be greater than the node type weight value of the grandchild node. The role weight value can be preset by the user and determined according to the attributes of each node and role. For example, if the subsidiary is a traditional industry and there are few in and out items, the financial data may be less, then the role weight value may be If it is relatively low, for example, if the subsidiary is an emerging industry such as new energy, and there are many in and out items, there may be more financial data, and the role weight value may be higher at this time.
基于所述预分配存储空间的量值对总存储空间进行初始化分配,以对每个节点分配相应的初始的存储空间。本发明会根据每个存储空间的分配存储量值对每个空间进行初始化分配,使得每个节点都具有相应的存储空间。The total storage space is initially allocated based on the magnitude of the pre-allocated storage space, so as to allocate a corresponding initial storage space to each node. The present invention will initialize and allocate each storage space according to the allocated storage value of each storage space, so that each node has a corresponding storage space.
本发明提供的技术方案,还包括:The technical solution provided by the present invention also includes:
间隔预设时间段获取每个存储空间内在当前时刻的数据已存储量值。在公司的实际生产经营活动中,由于公司的类型、经营情况不同,每个节点所对应的公司的进项、出项等内容可能会相差较大,此时所生成的财务数据的量值就会存在较大的偏差,所以每个节点发送给其他节点存储的财务数据也会存在不同。本发明会间隔预设时间段获取每个存储空间内在当前时刻的数据已存储量值,根据每个存储空间的已存储量值对该空间再次分配的存储空间的量值进行动态调整。Obtain the value of the data stored at the current moment in each storage space at preset time intervals. In the actual production and operation activities of the company, due to the different types and operating conditions of the company, the input and output items of the company corresponding to each node may be quite different, and the value of the financial data generated at this time will be There is a large deviation, so the financial data sent by each node to other nodes will also be different. The present invention obtains the data stored quantity value at the current moment in each storage space at preset time intervals, and dynamically adjusts the quantity of the redistributed storage space according to the stored quantity value of each storage space.
根据每个存储空间内的数据已存储量值得到当前的已存储平均量值。Obtain the current average stored volume value according to the stored volume value of data in each storage space.
根据所述每个存储空间内的数据已存储量值、当前的已存储平均量值以及每个存储空间所对应的角色权重值对存储空间的分配存储量值进行调整。本发明会根据数据已存储量值、当前的已存储平均量值以及每个存储空间所对应的角色权重值对存储空间的分配存储量值进行调整,使得每个存储空间再次分配的存储量值与其当前的已存储量值具有对应关系,进而达到存储量值的合理分配,将更大的存储量空间分配至更加需要的节点,保障财务数据的稳定存储。The allocated storage amount value of the storage space is adjusted according to the data stored amount value in each storage space, the current stored average amount value, and the role weight value corresponding to each storage space. The present invention will adjust the allocated storage value of the storage space according to the stored data value, the current stored average value, and the role weight value corresponding to each storage space, so that the re-allocated storage value of each storage space can be adjusted. There is a corresponding relationship with its current stored value, so as to achieve a reasonable allocation of storage value, allocate more storage space to more needed nodes, and ensure the stable storage of financial data.
本发明提供的技术方案,根据所述每个存储空间内的数据已存储量值、当前的已存储平均量值以及每个存储空间所对应的角色权重值对存储空间的分配存储量值进行调整包括:According to the technical solution provided by the present invention, the allocated storage capacity value of the storage space is adjusted according to the stored value of the data in each storage space, the current stored average value and the role weight value corresponding to each storage space include:
若判断所述数据已存储量值大于等于所述当前的已存储平均量值。此时相应节点的存储空间的数据增加量的趋势大于其他节点的存储空间的数据增加量的趋势,则其需要更多的存储空间来满足数据存储需求。If it is judged that the stored quantity value of the data is greater than or equal to the current stored average quantity value. At this time, the trend of the data increase of the storage space of the corresponding node is greater than the trend of the data increase of the storage space of other nodes, so it needs more storage space to meet the data storage requirement.
基于数据已存储量值、已存储平均量值得到正向变化趋势值,基于所述第一正向变化趋势值、角色权重值对存储空间内的分配存储量值进行正向调整。本发明会根据数据已存储量值、已存储平均量值得到正向变化趋势值,当数据已存储量值大于已存储平均量值越多时,则此时正向变化趋势值越大,正向调整的幅度越大,分配的存储空间越多。A positive change trend value is obtained based on the stored data volume value and the stored average volume value, and a positive adjustment is performed on the allocated storage volume value in the storage space based on the first positive change trend value and the role weight value. The present invention will obtain the positive change trend value according to the stored value of the data and the stored average value. When the stored value of the data is greater than the stored average value, the larger the positive change trend value, the greater the positive change trend value. The larger the adjustment, the more storage space is allocated.
若判断所述数据已存储量值小于所述当前的已存储平均量值。此时相应节点的存储空间的数据增加量的趋势小于其他节点的存储空间的数据增加量的趋势,则其需要较少的存储空间即可满足数据存储需求。If it is judged that the stored quantity value of the data is less than the current stored average quantity value. At this time, the trend of the data increase of the storage space of the corresponding node is smaller than the trend of the data increase of the storage space of other nodes, so it needs less storage space to meet the data storage requirement.
基于数据已存储量值、已存储平均量值得到负向变化趋势值,基于所述负向变化趋势值、角色权重值对存储空间内的分配存储量值进行负向调整。本发明会根据数据已存储量值、已存储平均量值得到负向变化趋势值,当数据已存储量值小于已存储平均量值越多时,则此时负向变化趋势值越大,负向调整的幅度越大,分配的存储空间越少。The negative change trend value is obtained based on the stored data volume value and the stored average volume value, and the allocated storage volume value in the storage space is negatively adjusted based on the negative change trend value and the role weight value. The present invention will obtain the negative change trend value according to the stored volume value and the stored average volume value of the data. When the stored volume value of the data is smaller than the stored average volume value, the larger the negative change trend value, the greater the negative change trend value. The larger the adjustment, the less storage space is allocated.
通过以上的方式,可以实现本发明动态的、按需的对存储空间的存储量值进行合理的分配,保障每个节点所对应的存储空间的存储量值与其存储需求是相对应的。Through the above methods, the present invention can realize the dynamic and on-demand allocation of the storage capacity value of the storage space, and ensure that the storage capacity value of the storage space corresponding to each node corresponds to its storage requirement.
本发明提供的技术方案,通过以下公式对存储空间所分配的存储量值进行调整,The technical solution provided by the present invention adjusts the storage amount value allocated by the storage space through the following formula:
其中,为第个存储空间内的数据已存储量值,为当前的已存储平均量 值,为第个存储空间内的数据已存储量值,为存储空间的上限值,为存储空间的数 量值,为第个存储空间调整后所分配的存储量值,为第个存储空间调整前所分配 的存储量值,为第个存储空间调整前所分配的存储量值,为第个存储空间数据已 存储量值,为第个存储空间所对应的角色权重值。 in, for the first The amount of data in the storage space has been stored, is the current stored average magnitude, for the first The amount of data in the storage space has been stored, is the upper limit of storage space, is the amount of storage space, for the first The allocated storage value after the storage space is adjusted, for the first The amount of storage allocated before the storage space is adjusted, for the first The amount of storage allocated before the storage space is adjusted, for the first The storage space data has stored amount value, for the first The role weight value corresponding to each storage space.
本发明可以设置分段函数,分段函数包括段和段,通过可以得到当前的数据已存储量值与已存储平均量值之间的关系,当 越大时,则此时存储空间中存储量值的增加或减少的趋势越大。即当时,数据空 间中数据量值增加的趋势越大,即当时,数据空间中数据量值减小的趋势越大。 通过可以得到所有节点的所有存储空间中还剩余的存储量值的总量。 The present invention can set a piecewise function, and the piecewise function includes segment and segment, through The relationship between the current data stored value and the stored average value can be obtained, when The larger the value, the greater the increasing or decreasing trend of the storage value in the storage space at this time. immediately When , the increasing trend of the data volume value in the data space is greater, that is, when When , the data volume value in the data space has a greater tendency to decrease. pass The total amount of remaining storage value in all storage spaces of all nodes can be obtained.
通过可以得到具有增加趋势的存储 空间在增加相应的存储量值后所所分配的存储量值,即新分配的存储量值,此时。 pass The storage capacity value allocated by the storage space with an increasing trend after the corresponding storage capacity value is increased, that is, the newly allocated storage capacity value can be obtained. ,at this time .
通过可以得到具有减少趋势的存储 空间在减少相应的存储量值后所分配的存储量值,即新分配的存储量值,此时。 pass The storage value allocated by the storage space with a decreasing trend after the corresponding storage value is reduced, that is, the newly allocated storage value ,at this time .
通过以上的技术方案,使得本发明可以间隔预设时间即对所有未被占用的存储量值进行再次分配,使得每个存储空间具有与其存储财务数据的量值相对应的存储空间,保障了区块链架构中对每个节点所存储的财务数据的空间进行及时、有效的管理,保障区块链架构的稳定性。Through the above technical solutions, the present invention can re-allocate all unoccupied storage values at preset time intervals, so that each storage space has a storage space corresponding to the storage space of its financial data, ensuring the area In the blockchain architecture, the space of financial data stored by each node is managed in a timely and effective manner to ensure the stability of the blockchain architecture.
本发明提供的技术方案,还提供一种基于区块链的财务数据存储装置,如图4所示,包括:The technical solution provided by the present invention also provides a blockchain-based financial data storage device, as shown in FIG. 4 , including:
上传模块,用于接收区块链中第一节点上传的第一财务数据,根据所述第一节点所对应的第一角色确定第一节点所对应的多维存储数据信息;an uploading module, configured to receive the first financial data uploaded by the first node in the blockchain, and determine the multi-dimensional storage data information corresponding to the first node according to the first role corresponding to the first node;
存储模块,用于基于所述第一角色确定至少一个第二角色,将所述第一财务数据分别存储于所述多维存储数据信息所对应的存储空间处,其中每个第二角色对应一个存储空间;A storage module, configured to determine at least one second role based on the first role, and store the first financial data in the storage space corresponding to the multi-dimensional storage data information, wherein each second role corresponds to a storage module space;
排序模块,用于获取所述第一财务数据的属性标记和时间标记,基于所述属性标记选取存储空间中对应的存储单元,根据所述时间标记对存储单元中先前存储的第二财务数据和当前存储的第一财务数据进行排序更新得到第三财务数据;The sorting module is used to obtain the attribute mark and time mark of the first financial data, select the corresponding storage unit in the storage space based on the attribute mark, and perform the second financial data and the time mark previously stored in the storage unit according to the time mark. Sort and update the currently stored first financial data to obtain third financial data;
更新提醒模块,用于若判断多维存储数据信息所对应的所有存储空间分别更新得到第三财务数据后,对所有第二角色以及第一角色对应的节点进行存储完成提醒。The update reminder module is used to remind all nodes corresponding to the second role and the first role to complete the storage if it is determined that all the storage spaces corresponding to the multi-dimensional storage data information are respectively updated to obtain the third financial data.
本发明还提供一种存储介质,所述存储介质中存储有计算机程序,所述计算机程序被处理器执行时用于实现上述的各种实施方式提供的方法。The present invention also provides a storage medium, where a computer program is stored in the storage medium, and when the computer program is executed by a processor, is used to implement the methods provided by the above-mentioned various embodiments.
其中,存储介质可以是计算机存储介质,也可以是通信介质。通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。计算机存储介质可以是通用或专用计算机能够存取的任何可用介质。例如,存储介质耦合至处理器,从而使处理器能够从该可读存储介质读取信息,且可向该可读存储介质写入信息。当然,可读存储介质也可以是处理器的组成部分。处理器和可读存储介质可以位于专用集成电路(Application SpecificIntegrated Circuits,简称:ASIC)中。另外,该ASIC可以位于用户设备中。当然,处理器和可读存储介质也可以作为分立组件存在于通信设备中。可读存储介质可以是只读存储器(ROM)、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。The storage medium may be a computer storage medium or a communication medium. Communication media includes any medium that facilitates transfer of a computer program from one place to another. Computer storage media can be any available media that can be accessed by a general purpose or special purpose computer. For example, a storage medium is coupled to the processor such that the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may be located in application specific integrated circuits (Application Specific Integrated Circuits, ASIC for short). Alternatively, the ASIC may be located in the user equipment. Of course, the processor and the readable storage medium may also exist in the communication device as discrete components. The readable storage medium may be read only memory (ROM), random access memory (RAM), CD-ROMs, magnetic tapes, floppy disks, optical data storage devices, and the like.
本发明还提供一种程序产品,该程序产品包括执行指令,该执行指令存储在可读存储介质中。设备的至少一个处理器可以从可读存储介质读取该执行指令,至少一个处理器执行该执行指令使得设备实施上述的各种实施方式提供的方法。The present invention also provides a program product including execution instructions stored in a readable storage medium. At least one processor of the device can read the execution instruction from the readable storage medium, and the execution of the execution instruction by the at least one processor causes the device to implement the methods provided by the various embodiments described above.
在上述终端或者服务器的实施例中,应理解,处理器可以是中央处理单元(英文:Central Processing Unit,简称:CPU),还可以是其他通用处理器、数字信号处理器(英文:Digital Signal Processor,简称:DSP)、专用集成电路(英文:Application SpecificIntegrated Circuit,简称:ASIC)等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。In the above embodiments of the terminal or server, it should be understood that the processor may be a central processing unit (English: Central Processing Unit, CPU for short), or other general-purpose processors, digital signal processors (English: Digital Signal Processor) , referred to as: DSP), application specific integrated circuit (English: Application Specific Integrated Circuit, referred to as: ASIC) and so on. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in conjunction with the present invention can be directly embodied as executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions described in the foregoing embodiments can still be modified, or some or all of the technical features thereof can be equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present invention. scope.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210252406.3A CN114357085B (en) | 2022-03-15 | 2022-03-15 | Financial data storage method and device based on block chain and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210252406.3A CN114357085B (en) | 2022-03-15 | 2022-03-15 | Financial data storage method and device based on block chain and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114357085A CN114357085A (en) | 2022-04-15 |
CN114357085B true CN114357085B (en) | 2022-06-03 |
Family
ID=81094334
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210252406.3A Active CN114357085B (en) | 2022-03-15 | 2022-03-15 | Financial data storage method and device based on block chain and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114357085B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114708080B (en) * | 2022-06-06 | 2022-08-26 | 湖南涉外经济学院 | A method for online processing of distributed financial data |
CN114995772B (en) * | 2022-08-08 | 2022-10-21 | 南京三百云信息科技有限公司 | Customer data migration and storage method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106796688A (en) * | 2016-12-26 | 2017-05-31 | 深圳前海达闼云端智能科技有限公司 | Permission control method, device and system of block chain and node equipment |
CN109684333A (en) * | 2018-12-24 | 2019-04-26 | 杭州复杂美科技有限公司 | A kind of storage of data and method of cutting out, equipment and storage medium |
CN111427959A (en) * | 2020-03-27 | 2020-07-17 | 北京贝斯平云科技有限公司 | Data storage method and device |
CN112036995A (en) * | 2020-08-20 | 2020-12-04 | 深圳市易链信息技术有限公司 | Large-scale enterprise financial data management method and system based on block chain and readable storage medium |
CN112307444A (en) * | 2020-10-30 | 2021-02-02 | 平安数字信息科技(深圳)有限公司 | Role creation method, role creation device, computer equipment and storage medium |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180152442A1 (en) * | 2003-12-22 | 2018-05-31 | Guardtime Ip Holdings Limited | Blockchain-supported, hash tree-based digital signature infrastructure |
US20190188411A1 (en) * | 2017-12-19 | 2019-06-20 | Vladislav Kroutik | Systems and Methods for Decentralizing Consumer Preferences, Consent and Permissions Management with Reward and Reputation Network for Enterprises Using a Blockchain Ledger |
CN109492431A (en) * | 2018-10-31 | 2019-03-19 | 国网河南省电力公司信息通信公司 | Financial data storage method and system and electronic device |
CN109767336A (en) * | 2018-12-27 | 2019-05-17 | 福建省农村信用社联合社 | It is a kind of based on block chain P2P financing platform fund bank deposit pipe management method |
CN109729168B (en) * | 2018-12-31 | 2021-10-01 | 浙江成功软件开发有限公司 | Data sharing exchange system and method based on block chain |
US10839377B2 (en) * | 2019-01-25 | 2020-11-17 | Coinbase, Inc. | Syncing blockchain nodes with snapshots |
CN110659298B (en) * | 2019-08-14 | 2022-06-07 | 金蝶软件(中国)有限公司 | Financial data processing method and device, computer equipment and storage medium |
CN112819599A (en) * | 2021-02-23 | 2021-05-18 | 南京启用宝信息科技有限公司 | Enterprise finance and tax accounting management system based on block chain |
CN113778681B (en) * | 2021-09-10 | 2024-05-03 | 施麟 | Data processing method and device based on cloud computing and storage medium |
-
2022
- 2022-03-15 CN CN202210252406.3A patent/CN114357085B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106796688A (en) * | 2016-12-26 | 2017-05-31 | 深圳前海达闼云端智能科技有限公司 | Permission control method, device and system of block chain and node equipment |
CN109684333A (en) * | 2018-12-24 | 2019-04-26 | 杭州复杂美科技有限公司 | A kind of storage of data and method of cutting out, equipment and storage medium |
CN111427959A (en) * | 2020-03-27 | 2020-07-17 | 北京贝斯平云科技有限公司 | Data storage method and device |
CN112036995A (en) * | 2020-08-20 | 2020-12-04 | 深圳市易链信息技术有限公司 | Large-scale enterprise financial data management method and system based on block chain and readable storage medium |
CN112307444A (en) * | 2020-10-30 | 2021-02-02 | 平安数字信息科技(深圳)有限公司 | Role creation method, role creation device, computer equipment and storage medium |
Non-Patent Citations (2)
Title |
---|
《Block chain Based Medical Reports Monitoring System》;M N. Thippeswamy 等;《IEEE》;20201110;第1-6页 * |
《基于区块链的共享数据访问控制研究》;潘启青;《中国优秀硕士学位论文全文数据库 (信息科技辑)》;20210315;第I138-11页 * |
Also Published As
Publication number | Publication date |
---|---|
CN114357085A (en) | 2022-04-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10776395B2 (en) | System and method for implementing a scalable data storage service | |
CN114357085B (en) | Financial data storage method and device based on block chain and storage medium | |
US9507818B1 (en) | System and method for conditionally updating an item with attribute granularity | |
US9836517B2 (en) | Systems and methods for mapping and routing based on clustering | |
CN105512167B (en) | A kind of multi-service user data management system and method based on hybrid database | |
US11734313B2 (en) | Systems and methods for intelligently grouping financial product users into cohesive cohorts | |
US9595003B1 (en) | Compiler with mask nodes | |
US20110119251A1 (en) | System and Method for SQL Query Load Balancing | |
CN106649401A (en) | Data writing method and device of distributed file system | |
CN112783644B (en) | A distributed oblique stream processing method and system based on high-frequency key-value counting | |
CN105096174A (en) | Transaction matching method and transaction matching system | |
US20150100661A1 (en) | Systems and methods for mapping and routing based on clustering | |
WO2021082936A1 (en) | Method and apparatus for counting number of webpage visitors | |
US12026162B2 (en) | Data query method and apparatus, computing device, and storage medium | |
US9898614B1 (en) | Implicit prioritization to rate-limit secondary index creation for an online table | |
CN107656989B (en) | Neighbor query method based on data distribution awareness in cloud storage system | |
CN107203557A (en) | The method and device of object to be searched for handling | |
US10579676B2 (en) | Highly scalable fine grained rate limiting | |
CN114691032A (en) | An information storage optimization method based on blockchain technology | |
CN110020954A (en) | A kind of income distribution method, device and computer equipment | |
CN109522915B (en) | Virus file clustering method and device and readable medium | |
CN110750897A (en) | DDS automatic discovery method based on threshold bloom filter | |
CN112764935B (en) | Big data processing method and device, electronic equipment and storage medium | |
CN111988131A (en) | Block chain construction method facing mobile crowd sensing | |
CN113722332B (en) | Method and system for improving efficiency and robustness of matching algorithm based on data structure |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |