CN110839071A - Information storage method, device and storage medium based on block chain - Google Patents

Information storage method, device and storage medium based on block chain Download PDF

Info

Publication number
CN110839071A
CN110839071A CN201911071476.3A CN201911071476A CN110839071A CN 110839071 A CN110839071 A CN 110839071A CN 201911071476 A CN201911071476 A CN 201911071476A CN 110839071 A CN110839071 A CN 110839071A
Authority
CN
China
Prior art keywords
information
service
storage
resource
target account
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.)
Granted
Application number
CN201911071476.3A
Other languages
Chinese (zh)
Other versions
CN110839071B (en
Inventor
李茂材
周开班
王宗友
刘攀
张劲松
朱耿良
孔利
时一防
黄焕坤
刘区城
杨常青
蓝虎
崔嘉辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911071476.3A priority Critical patent/CN110839071B/en
Publication of CN110839071A publication Critical patent/CN110839071A/en
Application granted granted Critical
Publication of CN110839071B publication Critical patent/CN110839071B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6227Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Accounting & Taxation (AREA)
  • Databases & Information Systems (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an information storage method, equipment and a storage medium based on a block chain, wherein the method comprises the following steps: acquiring service information sent based on a target account, and acquiring the service data volume of the service information, wherein the target account is account information in a service block chain; acquiring residual resource use information corresponding to the target account in the storage resources based on the resource available information of the storage resources allocated to the target account in the intelligent contract; matching the service data volume with the residual resource use information to obtain a matching result; and storing the service information based on the matching result. By adopting the method and the device, the use of the service information of different accounts for the storage resources can be optimized, the resource available information of different accounts can be adjusted according to the actual running condition, and the controllability and the control flexibility of the service information storage are improved.

Description

Information storage method, device and storage medium based on block chain
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an information storage method and apparatus based on a block chain, and a storage medium.
Background
With the continuous development and improvement of computer technology, various service scenarios can now be completed through block chains, for example: the information record storage, transaction, information inquiry and the like ensure the information safety because the block chain is decentralized and has the characteristics of non-falsification and traceability. However, as the blockchain technology continues to be popularized, the service information required to be stored by the blockchain node device in the blockchain also gradually increases, when the blockchain node device needs to store multiple pieces of service information of multiple accounts, the situation that the service information of a certain account is more and occupies more storage resources in the device often occurs, and due to the limited storage resources of the blockchain node device, the service information of other accounts which is more important is easily not stored, which affects the controllability and flexibility of service information storage.
Disclosure of Invention
Embodiments of the present invention provide an information storage method, an information storage device, and a storage medium based on a block chain, which can optimize the use of storage resources by service information of different accounts, adjust the resource availability information of different accounts according to the actual operation condition, and improve controllability of service information storage and flexibility of management and control.
An embodiment of the present invention provides an information storage method based on a block chain, including:
acquiring service information sent based on a target account, and acquiring the service data volume of the service information, wherein the target account is account information in a service block chain;
acquiring residual resource use information corresponding to the target account in the storage resources based on the resource available information of the storage resources allocated to the target account in the intelligent contract;
matching the service data volume with the residual resource use information to obtain a matching result;
and storing the service information based on the matching result.
Wherein, before the acquiring the service information sent based on the target account and the acquiring the service data volume of the service information, the method further comprises:
establishing a service block in a service block chain based on a target account, and synchronizing block information of the service block to all block node devices in the service block chain.
The obtaining of the remaining resource usage information corresponding to the target account in the storage resource based on the resource availability information of the storage resource allocated to the target account in the intelligent contract includes:
acquiring resource availability information of storage resources allocated to the target account based on an intelligent contract, and acquiring resource availability data volume corresponding to the target account in the storage resources based on the resource availability information and total resource data volume of the storage resources;
acquiring the used data volume of the resources corresponding to the target account in the storage resources;
and acquiring the resource residual data volume corresponding to the target account in the storage resource based on the resource available data volume and the resource used data volume.
Wherein the matching the service data volume and the remaining resource usage information to obtain a matching result includes:
matching the service data volume with the residual resource use data volume;
when the service data volume is less than or equal to the residual resource usage data volume, determining that a matching result is to execute information storage of the target account;
and when the service data volume is larger than the residual resource use data volume, determining that the matching result is the information storage of the target account is stopped.
Wherein the storing the service information based on the matching result includes:
when the matching result is that the information storage of the target account is executed, the service information is stored;
and when the matching result is that the information storage of the target account is stopped, stopping the storage of the service information.
Wherein, still include:
and generating storage record information of the target account based on the target account, the timestamp for acquiring the service information and the storage processing result of the service information, and performing uplink storage on the storage record information.
Wherein, still include:
acquiring modification information of the resource available information in the intelligent contract, and updating the resource available information by adopting the modification information;
and synchronizing the intelligent contract containing the updated resource availability information to all block node equipment of the service block chain.
An embodiment of the present invention provides an information storage device, including:
a service data volume obtaining unit, configured to obtain service information sent based on a target account, and obtain a service data volume of the service information, where the target account is account information in a service block chain;
a resource information obtaining unit, configured to obtain, based on resource availability information of a storage resource allocated to the target account in an intelligent contract, remaining resource usage information corresponding to the target account in the storage resource;
a data volume matching unit, configured to match the service data volume with the remaining resource usage information to obtain a matching result;
and the information processing unit is used for storing the service information based on the matching result.
Wherein, still include:
the block establishing unit is used for establishing a service block in a service block chain based on the target account and synchronizing the block information of the service block to all block node equipment in the service block chain.
Wherein the resource information acquiring unit includes:
an available data volume obtaining subunit, configured to obtain, based on an intelligent contract, resource availability information of a storage resource allocated to the target account, and obtain, based on the resource availability information and a total resource data volume of the storage resource, a resource available data volume corresponding to the target account in the storage resource;
the used data volume acquiring subunit is used for acquiring the used data volume of the resource corresponding to the target account in the storage resource;
and a remaining data amount obtaining subunit, configured to obtain, based on the available resource data amount and the used resource data amount, a resource remaining data amount corresponding to the target account in the storage resource.
Wherein the data amount matching unit includes:
a data volume matching subunit, configured to match the service data volume with the remaining resource usage data volume;
a result determining subunit, configured to determine, when the traffic data amount is less than or equal to the remaining resource usage data amount, that a matching result is to perform information storage of the target account;
the result determining subunit is further configured to determine that the matching result is to stop information storage of the target account when the service data amount is greater than the remaining resource usage data amount.
The information processing unit is specifically configured to store the service information when the matching result is that information storage of the target account is executed;
and when the matching result is that the information storage of the target account is stopped, stopping the storage of the service information.
Wherein, still include:
and the record information storage unit is used for generating the storage record information of the target account based on the target account, the timestamp for acquiring the service information and the storage processing result of the service information, and performing uplink storage on the storage record information.
Wherein, still include:
an available information updating unit, configured to acquire modification information of the resource available information in the intelligent contract, and update the resource available information by using the modification information;
and the contract synchronization unit is used for synchronizing the intelligent contract containing the updated resource availability information to all block node devices of the service block chain.
An aspect of the embodiments of the present invention provides a computer storage medium storing a computer program comprising program instructions that, when executed by a processor, perform the above-mentioned method steps.
One aspect of the embodiments of the present invention provides a computer device, including a processor, a memory, and an input/output interface;
the processor is respectively connected with the memory and the input/output interface, wherein the input/output interface is used for page interaction, the memory is used for storing program codes, and the processor is used for calling the program codes to execute the method steps.
In the embodiment of the invention, the storage resources of the block node equipment in the block chain are controlled by adopting the intelligent contract, and the service information can be stored for different accounts according to the allocated resource available information, so that the service information of a single account is prevented from occupying excessive storage resources, the use of the storage resources by the service information of different accounts is optimized, the controllability of the storage of the service information is improved, and meanwhile, the resource available information of different accounts can be adjusted according to the actual running condition by adopting the control of the intelligent contract, so that the flexibility of the control of the storage of the service information is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a system architecture diagram of an information store provided by an embodiment of the present invention;
FIG. 2 is a schematic diagram of a scenario of information storage provided by an embodiment of the present invention;
fig. 3 is a schematic flowchart of an information storage method based on a block chain according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of an information storage method based on a block chain according to an embodiment of the present invention;
FIG. 5 is a schematic flow diagram of a contract update provided by an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of an information storage device according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of an information storage device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a resource information obtaining unit according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a data amount matching unit according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. 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 invention.
With reference to the embodiments shown in fig. 1 to fig. 5, a detailed description is given of an information storage method based on a block chain according to an embodiment of the present invention.
Referring to fig. 1, a system architecture diagram for information storage is provided according to an embodiment of the present invention. As shown in fig. 1, for the processing of the information storage service based on the block chain, for example: the hospital prescription information storage, the company data storage, and the like correspond to a plurality of user groups, that is, users (users 1, 2, …, N) for the same business can realize information storage processing by user terminals (user terminals 1, 2, …, N) respectively owned by the users. The user terminal may include, but is not limited to, a mobile phone, an e-reader, a tablet computer, a personal computer, a vehicle-mounted device, etc., it is understood that, different users of the same storage service are allocated with individual service account information in the corresponding service block chain, for distinguishing the service information of different users and performing storage processing, the block node device (block node devices 1, 2, …, N) can obtain the service information sent by the user terminal based on the target account, obtain the service data volume of the service information, obtain the remaining resource usage information corresponding to the target account in the storage resources based on the resource availability information of the storage resources allocated to the target account in the intelligent contract, and matching the service data volume with the residual resource use information to obtain a matching result, and finally storing the service information based on the matching result.
In the embodiment of the invention, in order to further ensure the controllability and flexibility of information storage, a block chain of an information storage scene is established, and the block chain can comprise a block chain bottom platform, a platform product service layer and an application service layer.
The block chain underlying platform can comprise processing modules such as user management, basic service, intelligent contract and operation monitoring. The user management module is responsible for identity information management of all blockchain participants, and comprises public and private key generation maintenance (account management), key management, user real identity and blockchain address corresponding relation maintenance (authority management) and the like, and under the authorization condition, the user management module supervises and audits the transaction condition of certain real identities and provides rule configuration (wind control audit) of risk control; the basic service module is deployed on all block chain node equipment and used for verifying the validity of the service request, recording the service request to storage after consensus on the valid request is completed, for a new service request, the basic service firstly performs interface adaptation analysis and authentication processing (interface adaptation), then encrypts service information (consensus management) through a consensus algorithm, transmits the service information to a shared account (network communication) completely and consistently after encryption, and performs recording and storage; the intelligent contract module is responsible for registering and issuing contracts, triggering the contracts and executing the contracts, developers can define contract logics through a certain programming language, issue the contract logics to a block chain (contract registration), call keys or other event triggering and executing according to the logics of contract clauses, complete the contract logics and simultaneously provide the function of upgrading and canceling the contracts; the operation monitoring module is mainly responsible for deployment, configuration modification, contract setting, cloud adaptation in the product release process and visual output of real-time states in product operation, such as: alarm, monitoring network conditions, monitoring node equipment health status, and the like.
The platform product service layer provides basic capability and an implementation framework of typical application, and developers can complete block chain implementation of business logic based on the basic capability. The application service layer provides the application service based on the block chain scheme for the business participants to use.
In an information storage scene, the block node devices may be distributed in a range corresponding to an entity, or may be distributed in the cloud service device, the entity may include but is not limited to a store for business processing, a user mainly centralizing a center, and the like, and by building an information storage scene based on a block chain manner, the use of the business information of different accounts for storage resources may be optimized, the resource availability information of different accounts may be adjusted according to an actual running condition, and controllability and control flexibility of business information storage are improved.
Fig. 2 is a schematic view of a scene of information storage according to an embodiment of the present invention. As shown in fig. 2, a storage component and an intelligent contract exist in a block node device in a service block chain, all block node devices in the service block chain are commonly identified by the intelligent contract, and the intelligent contract may be used to manage and control the use of a storage resource of the storage component by an account managed by the block node device. Specifically, when the block node device obtains service information of a target account, the block node device may allocate storage resources of a storage component, obtain service information sent based on the target account, obtain a service data volume of the service information, where the target account is account information in a service block chain, obtain remaining resource usage information corresponding to the target account in the storage resources based on resource availability information of the storage resources allocated to the target account in an intelligent contract, match the service data volume and the remaining resource usage information to obtain a matching result, and store the service information based on the matching result, for example: when the matching result is that the information storage of the target account is executed, the service information is stored; and when the matching result is that the information storage of the target account is stopped, stopping the storage of the service information and the like. The method has the advantages that the storage resources of the block node equipment in the block chain are controlled by adopting the intelligent contract, the service information can be stored according to the allocated resource available information for different accounts, the service information of a single account is prevented from occupying too many storage resources, the use of the storage resources by the service information of different accounts is optimized, the controllability of the service information storage is improved, meanwhile, the resource available information of different accounts can be adjusted according to the actual operation condition by adopting the control of the intelligent contract, and the flexibility of the control of the service information storage is improved.
Referring to fig. 3 together with the implementation frameworks based on fig. 1-fig. 2, a schematic flow chart of an information storage method based on a block chain is provided in an embodiment of the present invention. The information storage device proposed in the embodiment of the present invention may be a block node device in the service block chain in the above embodiment. As shown in fig. 3, the method of the embodiment of the present invention may include the following steps S101 to S104.
S101, acquiring service information sent based on a target account, and acquiring service data volume of the service information;
specifically, the information storage device may obtain service information sent based on a target account, where the information storage device may specifically be a block node device in a service block chain where current service information is stored, the target account may specifically be account information in the service block chain, each information storage device may be respectively responsible for performing storage processing of service information on a plurality of different accounts in the service block chain, and the information storage device may further obtain a service data volume of the service information, where the service data volume is specifically used to indicate a data size of the service information.
S102, acquiring residual resource use information corresponding to the target account in the storage resources based on the resource available information of the storage resources allocated to the target account in the intelligent contract;
specifically, after the information storage device obtains the service data volume of the service information, the information storage device may further obtain remaining resource usage information corresponding to the target account in the storage resources based on resource availability information of the storage resources allocated to the target account in the intelligent contract, where the resource availability information may specifically be a resource availability data volume of the storage resources for the target account, or may also be a resource availability ratio of the storage resources for the target account, and it may be understood that, for the storage of the service information, only the storage resources of the current information storage device may be used, so that the resource availability data volume of the target account may be directly defined in the intelligent contract, for example: the current information storage device manages two accounts, namely, a and B, and can limit the available resource data amount of the account a to be 3T and the available resource data amount of the account B to be 1T. Of course, the service information may be stored in a plurality of block node devices, and since the total data amount of resources of storage resources of different block node devices is not necessarily the same, the resource availability ratio of the target account may be defined in the intelligent contract, and the method may be applied to a case where only the service information is stored in the information storage device, for example: the current information storage device manages two accounts, a and B, and can limit the amount of available data of resources of account a to 70%, the amount of available data of resources of account B to 30%, and so on. Taking the resource available information as the resource available data amount as an example, the information storage device may obtain a resource used data amount of the storage resource currently used by the target account, and further may obtain remaining resource usage information corresponding to the target account in the storage resource based on the resource available data amount and the resource used data amount, where the remaining resource usage information may specifically be a resource remaining data amount corresponding to the target account in the storage resource.
S103, matching the service data volume with the residual resource use information to obtain a matching result;
specifically, the resource storage device may match the service data volume with the remaining resource usage information to obtain a matching result, where the matching result is used to determine whether information storage of the target account can be continued at present.
S104, storing the service information based on the matching result;
specifically, the information storage device may store the service information based on the matching result, and it may be understood that, if the matching result indicates that information storage of a target account may be continuously performed currently, the information storage device stores the service information, and if the matching result indicates that information storage of the target account is stopped, the information storage device stops storing the service information.
In the embodiment of the invention, the storage resources of the block node equipment in the block chain are controlled by adopting the intelligent contract, and the service information can be stored for different accounts according to the allocated resource available information, so that the service information of a single account is prevented from occupying excessive storage resources, the use of the storage resources by the service information of different accounts is optimized, the controllability of the storage of the service information is improved, and meanwhile, the resource available information of different accounts can be adjusted according to the actual running condition by adopting the control of the intelligent contract, so that the flexibility of the control of the storage of the service information is improved.
Referring to fig. 4 together based on the implementation frameworks of fig. 1-2, a schematic flow chart of an information storage method based on a block chain is provided in an embodiment of the present invention. The information storage device proposed in the embodiment of the present invention may be a block node device in the service block chain in the above embodiment. As shown in fig. 4, the method of the embodiment of the present invention may include the following steps S201 to S211.
S201, establishing a service block in a service block chain based on a target account, and synchronizing block information of the service block to all block node equipment in the service block chain;
specifically, before storing the service information of the target account, the information storage device may further establish a service block based on the target account obtained by registering the user in a service block chain, uplink the service block, synchronize the block information of the service block to all block node devices in the service block chain, and simultaneously synchronize the block information of all blocks in other block node devices.
S202, acquiring service information sent based on a target account, and acquiring service data of the service information;
specifically, the information storage device may obtain service information sent based on a target account, where the information storage device may specifically be a block node device in a service block chain where current service information is stored, the target account may specifically be account information in the service block chain, each information storage device may be respectively responsible for performing storage processing of service information on a plurality of different accounts in the service block chain, and the information storage device may further obtain a service data volume of the service information, where the service data volume is specifically used to indicate a data size of the service information.
S203, acquiring resource availability information of the storage resources allocated to the target account based on the intelligent contract, and acquiring resource availability data volume corresponding to the target account in the storage resources based on the resource availability information and total resource data volume of the storage resources;
specifically, the information storage device may obtain, based on the intelligent contract, resource availability information of the storage resource allocated to the target account, and obtain, based on the resource availability information and a total resource data amount of the storage resource, a resource availability data amount corresponding to the target account in the storage resource, it may be understood that, for the storage of the service information, only the storage resource of the current information storage device may be used, so that the resource availability data amount of the target account may be directly defined in the intelligent contract, for example: the current information storage device manages two accounts, namely, a and B, and can limit the available resource data amount of the account a to be 3T and the available resource data amount of the account B to be 1T. Of course, the service information may be stored in a plurality of block node devices, and since the total data amount of resources of storage resources of different block node devices is not necessarily the same, the resource availability ratio of the target account may be defined in the intelligent contract, and the method may be applied to a case where only the service information is stored in the information storage device, for example: the current information storage device manages two accounts, a and B, and can limit the amount of available data of resources of account a to 70%, the amount of available data of resources of account B to 30%, and so on. Taking the resource availability information as the resource availability ratio as an example, the information storage device may obtain a total resource data amount of storage resources of at least one block node device used for managing a target account in the service block chain, may obtain a resource availability ratio of the storage resources of the target account in an intelligent contract, and finally obtain a resource availability data amount corresponding to the target account based on the total resource data amount and the resource availability ratio, and optionally, the resource availability data amount is a product of the total resource data amount and the resource availability ratio.
S204, acquiring the used data volume of the resources corresponding to the target account in the storage resources;
specifically, the information storage device may obtain a resource used data amount corresponding to the target account in the storage resource, where the resource used data amount is used to represent a sum of data sizes of service information of the target account that has been stored historically.
S205, acquiring the resource residual data volume corresponding to the target account in the storage resource based on the resource available data volume and the resource used data volume;
specifically, the information storage device may obtain a resource remaining data amount corresponding to the target account in the storage resource based on the resource available data amount and the resource used data amount, and optionally, the resource remaining data amount is a difference between the resource available data amount and the resource used data amount.
S206, matching the service data volume with the residual resource using data volume;
s207, when the service data volume is less than or equal to the residual resource usage data volume, determining a matching result as executing information storage of the target account;
specifically, when the service data amount is less than or equal to the remaining resource usage data amount, it indicates that sufficient storage resources are currently provided to store the service information, and the information storage device may determine that the matching result is to perform information storage of the target account.
S208, when the service data volume is larger than the residual resource use data volume, determining that the matching result is the information storage of the target account is stopped;
specifically, when the service data volume is larger than the remaining resource usage data volume, it indicates that there is not enough storage resources to store the service information at present, and the information storage device determines that the matching result is to stop information storage of the target account.
S209, when the matching result is that the information storage of the target account is executed, storing the service information;
s210, when the matching result is that the information storage of the target account is stopped, stopping the storage of the service information;
s211, generating storage record information of the target account based on the target account, the timestamp for acquiring the service information and the storage processing result of the service information, and performing uplink storage on the storage record information;
specifically, after the service information is stored based on the matching result, the information storage device may further generate storage record information of the target account based on the target account, a timestamp for obtaining the service information, and a storage processing result of the service information, and perform uplink storage on the storage record information, so that a user may determine whether the current service information is completely uplink stored through the storage record information, and if the storage fails, apply for more storage resources to a manager of the service block chain based on the storage record information, or request the manager to store the service information into other storage devices, which may specifically be determined according to an actual storage requirement.
Optionally, referring to fig. 5, a schematic flow chart of contract updating is provided for the embodiment of the present invention. As shown in fig. 5, steps S301 and S302 may be included.
S301, acquiring modification information of the resource available information in the intelligent contract, and updating the resource available information by adopting the modification information;
s302, synchronizing the intelligent contract containing the updated resource availability information to all block node devices of the service block chain;
specifically, when the manager of the service blockchain adjusts the resource availability information of the account in the intelligent contract, for example: when the information storage device receives modification information of resource availability information of a target account in an intelligent contract, the information storage device may update the resource availability information with the modification information, and synchronize the updated resource availability information to other block node devices in the service block chain except for the information storage device.
In the embodiment of the invention, the storage resources of the block node equipment in the block chain are controlled by adopting the intelligent contract, and the service information can be stored for different accounts according to the allocated resource available information, so that the service information of a single account is prevented from occupying excessive storage resources, the use of the storage resources by the service information of different accounts is optimized, the controllability of the storage of the service information is improved, meanwhile, the resource available information of different accounts can be adjusted according to the actual running condition by adopting the control of the intelligent contract, and the flexibility of the control of the service information storage is improved; by generating the storage record information, the related conditions of the service information storage can be traced conveniently, meanwhile, a user can know the progress of the service information storage in time conveniently, and the user viscosity is improved.
Based on the implementation frameworks of fig. 1-2, the information storage device provided by the embodiment of the invention will be described in detail below with reference to fig. 6-9. It should be noted that the apparatus shown in fig. 6-9 may specifically be a block node apparatus in the embodiment shown in fig. 1-2, which is used to execute the method of the embodiment shown in fig. 3-5 of the present invention, for convenience of description, only the portion related to the embodiment of the present invention is shown, and details of the specific technology are not disclosed, please refer to the embodiment shown in fig. 3-5 of the present invention.
Referring to fig. 6, a schematic structural diagram of an information storage device according to an embodiment of the present invention is provided. As shown in fig. 6, the information storage apparatus 1 of the embodiment of the present invention may include: a traffic data amount acquisition unit 11, a resource information acquisition unit 12, a data amount matching unit 13, and an information processing unit 14.
A service data volume obtaining unit 11, configured to obtain service information sent based on a target account, and obtain a service data volume of the service information;
a resource information obtaining unit 12, configured to obtain, based on resource availability information of a storage resource allocated to the target account in an intelligent contract, remaining resource usage information corresponding to the target account in the storage resource;
a data volume matching unit 13, configured to match the service data volume with the remaining resource usage information to obtain a matching result;
and an information processing unit 14, configured to store the service information based on the matching result.
In the embodiment of the invention, the storage resources of the block node equipment in the block chain are controlled by adopting the intelligent contract, and the service information can be stored for different accounts according to the allocated resource available information, so that the service information of a single account is prevented from occupying excessive storage resources, the use of the storage resources by the service information of different accounts is optimized, the controllability of the storage of the service information is improved, and meanwhile, the resource available information of different accounts can be adjusted according to the actual running condition by adopting the control of the intelligent contract, so that the flexibility of the control of the storage of the service information is improved.
Fig. 7 is a schematic structural diagram of an information storage device according to an embodiment of the present invention. As shown in fig. 7, the information storage apparatus 1 of the embodiment of the present invention may include: a traffic data amount acquisition unit 11, a resource information acquisition unit 12, a data amount matching unit 13, an information processing unit 14, a tile creation unit 15, a record information storage unit 16, an available information update unit 17, and a contract synchronization unit 18.
The block establishing unit 15 is configured to establish a service block in a service block chain based on a target account, and synchronize block information of the service block to all block node devices in the service block chain;
a service data volume obtaining unit 11, configured to obtain service information sent based on a target account, and obtain a service data volume of the service information;
a resource information obtaining unit 12, configured to obtain, based on resource availability information of a storage resource allocated to the target account in an intelligent contract, remaining resource usage information corresponding to the target account in the storage resource;
specifically, please refer to fig. 8, which provides a schematic structural diagram of a resource information obtaining unit according to an embodiment of the present invention. As shown in fig. 8, the resource information acquiring unit 12 may include:
an available data amount obtaining subunit 121, configured to obtain resource availability information of the storage resource allocated to the target account based on an intelligent contract, and obtain a resource available data amount corresponding to the target account in the storage resource based on the resource availability information and a total resource data amount of the storage resource;
a used data amount obtaining subunit 122, configured to obtain a resource used data amount corresponding to the target account in the storage resource;
a remaining data amount obtaining subunit 123, configured to obtain, based on the resource available data amount and the resource used data amount, a resource remaining data amount corresponding to the target account in the storage resource.
A data volume matching unit 13, configured to match the service data volume with the remaining resource usage information to obtain a matching result;
specifically, please refer to fig. 9, which provides a schematic structural diagram of the data size matching unit according to the embodiment of the present invention. As shown in fig. 9, the data amount matching unit 13 may further include:
a data size matching subunit 131, configured to match the service data size and the remaining resource usage data size;
a result determining subunit 132, configured to determine that a matching result is to perform information storage of the target account when the traffic data amount is less than or equal to the remaining resource usage data amount;
the result determining subunit 132 is further configured to determine that the matching result is to stop storing the information of the target account when the service data amount is greater than the remaining resource usage data amount.
An information processing unit 14, configured to store the service information based on the matching result;
a record information storage unit 16, configured to generate storage record information of the target account based on the target account, the timestamp for acquiring the service information, and a storage processing result of the service information, and perform uplink storage on the storage record information;
an available information updating unit 17, configured to acquire modification information of the resource available information in the intelligent contract, and update the resource available information with the modification information;
a contract synchronization unit 18, configured to synchronize the intelligent contract containing the updated resource availability information to all block node devices of the service block chain.
In the embodiment of the invention, the storage resources of the block node equipment in the block chain are controlled by adopting the intelligent contract, and the service information can be stored for different accounts according to the allocated resource available information, so that the service information of a single account is prevented from occupying excessive storage resources, the use of the storage resources by the service information of different accounts is optimized, the controllability of the storage of the service information is improved, meanwhile, the resource available information of different accounts can be adjusted according to the actual running condition by adopting the control of the intelligent contract, and the flexibility of the control of the service information storage is improved; by generating the storage record information, the related conditions of the service information storage can be traced conveniently, meanwhile, a user can know the progress of the service information storage in time conveniently, and the user viscosity is improved.
An embodiment of the present invention further provides a computer storage medium, where the computer storage medium may store a plurality of program instructions, where the program instructions are suitable for being loaded by a processor and executing the method steps in the embodiments shown in fig. 3 to 5, and a specific execution process may refer to specific descriptions of the embodiments shown in fig. 3 to 5, which is not described herein again.
Fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present invention. As shown in fig. 10, the computer apparatus 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, input output interfaces 1003, memory 1005, at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others. The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may optionally be at least one memory device located remotely from the processor 1001. As shown in fig. 10, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, an input-output interface module, and an information storage application program.
In the computer apparatus 1000 shown in fig. 10, the input/output interface 1003 is mainly used as an interface for providing input for a user and acquiring data input by the user.
In one embodiment, the processor 1001 may be configured to invoke an information storage application stored in the memory 1005 and specifically perform the following operations:
acquiring service information sent based on a target account, and acquiring the service data volume of the service information, wherein the target account is account information in a service block chain;
acquiring residual resource use information corresponding to the target account in the storage resources based on the resource available information of the storage resources allocated to the target account in the intelligent contract;
matching the service data volume with the residual resource use information to obtain a matching result;
and storing the service information based on the matching result.
Optionally, before performing acquiring the service information sent based on the target account and acquiring the service data volume of the service information, the processor 1001 further performs the following steps:
establishing a service block in a service block chain based on a target account, and synchronizing block information of the service block to all block node devices in the service block chain.
Optionally, when executing the resource availability information of the storage resource allocated to the target account based on the intelligent contract and acquiring the remaining resource usage information corresponding to the target account in the storage resource, the processor 1001 specifically executes the following steps:
acquiring resource availability information of storage resources allocated to the target account based on an intelligent contract, and acquiring resource availability data volume corresponding to the target account in the storage resources based on the resource availability information and total resource data volume of the storage resources;
acquiring the used data volume of the resources corresponding to the target account in the storage resources;
and acquiring the resource residual data volume corresponding to the target account in the storage resource based on the resource available data volume and the resource used data volume.
Optionally, when the processor 1001 performs matching on the service data volume and the remaining resource usage information to obtain a matching result, the following steps are specifically performed:
matching the service data volume with the residual resource use data volume;
when the service data volume is less than or equal to the residual resource usage data volume, determining that a matching result is to execute information storage of the target account;
and when the service data volume is larger than the residual resource use data volume, determining that the matching result is the information storage of the target account is stopped.
Optionally, when the processor 1001 stores the service information based on the matching result, the following steps are specifically performed:
when the matching result is that the information storage of the target account is executed, the service information is stored;
and when the matching result is that the information storage of the target account is stopped, stopping the storage of the service information.
Optionally, the processor 1001 further performs the following steps:
and generating storage record information of the target account based on the target account, the timestamp for acquiring the service information and the storage processing result of the service information, and performing uplink storage on the storage record information.
Optionally, the processor 1001 further performs the following steps:
acquiring modification information of the resource available information in the intelligent contract, and updating the resource available information by adopting the modification information;
and synchronizing the intelligent contract containing the updated resource availability information to all block node equipment of the service block chain.
In the embodiment of the invention, the storage resources of the block node equipment in the block chain are controlled by adopting the intelligent contract, and the service information can be stored for different accounts according to the allocated resource available information, so that the service information of a single account is prevented from occupying excessive storage resources, the use of the storage resources by the service information of different accounts is optimized, the controllability of the storage of the service information is improved, meanwhile, the resource available information of different accounts can be adjusted according to the actual running condition by adopting the control of the intelligent contract, and the flexibility of the control of the service information storage is improved; by generating the storage record information, the related conditions of the service information storage can be traced conveniently, meanwhile, a user can know the progress of the service information storage in time conveniently, and the user viscosity is improved.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (10)

1. An information storage method based on a block chain is characterized by comprising the following steps:
acquiring service information sent based on a target account, and acquiring the service data volume of the service information, wherein the target account is account information in a service block chain;
acquiring residual resource use information corresponding to the target account in the storage resources based on the resource available information of the storage resources allocated to the target account in the intelligent contract;
matching the service data volume with the residual resource use information to obtain a matching result;
and storing the service information based on the matching result.
2. The method of claim 1, wherein before the obtaining the service data volume of the service information based on the service information sent by the target account, the method further comprises:
establishing a service block in a service block chain based on a target account, and synchronizing block information of the service block to all block node devices in the service block chain.
3. The method according to claim 1, wherein the obtaining of the remaining resource usage information corresponding to the target account in the storage resources based on the resource availability information of the storage resources allocated to the target account in the smart contract comprises:
acquiring resource availability information of storage resources allocated to the target account based on an intelligent contract, and acquiring resource availability data volume corresponding to the target account in the storage resources based on the resource availability information and total resource data volume of the storage resources;
acquiring the used data volume of the resources corresponding to the target account in the storage resources;
and acquiring the resource residual data volume corresponding to the target account in the storage resource based on the resource available data volume and the resource used data volume.
4. The method of claim 3, wherein the matching the traffic data volume and the remaining resource usage information to obtain a matching result comprises:
matching the service data volume with the residual resource use data volume;
when the service data volume is less than or equal to the residual resource usage data volume, determining that a matching result is to execute information storage of the target account;
and when the service data volume is larger than the residual resource use data volume, determining that the matching result is the information storage of the target account is stopped.
5. The method of claim 4, wherein the storing the service information based on the matching result comprises:
when the matching result is that the information storage of the target account is executed, the service information is stored;
and when the matching result is that the information storage of the target account is stopped, stopping the storage of the service information.
6. The method of claim 1, further comprising:
and generating storage record information of the target account based on the target account, the timestamp for acquiring the service information and the storage processing result of the service information, and performing uplink storage on the storage record information.
7. The method of claim 1, further comprising:
acquiring modification information of the resource available information in the intelligent contract, and updating the resource available information by adopting the modification information;
and synchronizing the intelligent contract containing the updated resource availability information to all block node equipment of the service block chain.
8. An information storage device, comprising:
a service data volume obtaining unit, configured to obtain service information sent based on a target account, and obtain a service data volume of the service information, where the target account is account information in a service block chain;
a resource information obtaining unit, configured to obtain, based on resource availability information of a storage resource allocated to the target account in an intelligent contract, remaining resource usage information corresponding to the target account in the storage resource;
a data volume matching unit, configured to match the service data volume with the remaining resource usage information to obtain a matching result;
and the information processing unit is used for storing the service information based on the matching result.
9. A computer device comprising a processor, a memory, an input output interface;
the processor is connected with the memory and the input/output interface respectively, wherein the input/output interface is used for page interaction, the memory is used for storing program codes, and the processor is used for calling the program codes to execute the method according to any one of claims 1 to 7.
10. A computer storage medium, characterized in that the computer storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the method according to any one of claims 1-7.
CN201911071476.3A 2019-11-05 2019-11-05 Information storage method, device and storage medium based on block chain Active CN110839071B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911071476.3A CN110839071B (en) 2019-11-05 2019-11-05 Information storage method, device and storage medium based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911071476.3A CN110839071B (en) 2019-11-05 2019-11-05 Information storage method, device and storage medium based on block chain

Publications (2)

Publication Number Publication Date
CN110839071A true CN110839071A (en) 2020-02-25
CN110839071B CN110839071B (en) 2023-02-14

Family

ID=69576073

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911071476.3A Active CN110839071B (en) 2019-11-05 2019-11-05 Information storage method, device and storage medium based on block chain

Country Status (1)

Country Link
CN (1) CN110839071B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112052021A (en) * 2020-08-12 2020-12-08 中钞信用卡产业发展有限公司杭州区块链技术研究院 Method, device, equipment and storage medium for upgrading block chain of alliance
CN113254537A (en) * 2021-06-17 2021-08-13 支付宝(杭州)信息技术有限公司 Block chain state storage and reading method and block chain link point
CN113791764A (en) * 2021-09-09 2021-12-14 四川启睿克科技有限公司 Method for automatically monitoring surplus energy of wave field area block chain account and giving alarm
CN117440004A (en) * 2023-12-19 2024-01-23 苏州元脑智能科技有限公司 Resource storage system, method, equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1805437A (en) * 2005-01-14 2006-07-19 中兴通讯股份有限公司 Method of processing resources stored in data synchronization server
CN105792359A (en) * 2014-12-22 2016-07-20 华为技术有限公司 Resource distribution method and device, and data mapping method and device
CN106796685A (en) * 2016-12-30 2017-05-31 深圳前海达闼云端智能科技有限公司 Block chain authority control method and device and node equipment
WO2018004820A1 (en) * 2016-06-28 2018-01-04 Visa International Service Association Digital asset account management
US20180158058A1 (en) * 2016-12-06 2018-06-07 Fujitsu Limited Apparatus and method to prevent execution of an unauthorized transaction via a distributed database
CN108984125A (en) * 2018-07-17 2018-12-11 郑州云海信息技术有限公司 A kind of method, apparatus and storage medium of resource allocation
CN110134510A (en) * 2019-03-28 2019-08-16 熊睿 RAM resource allocation methods and device based on intelligent contract

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1805437A (en) * 2005-01-14 2006-07-19 中兴通讯股份有限公司 Method of processing resources stored in data synchronization server
CN105792359A (en) * 2014-12-22 2016-07-20 华为技术有限公司 Resource distribution method and device, and data mapping method and device
WO2018004820A1 (en) * 2016-06-28 2018-01-04 Visa International Service Association Digital asset account management
US20180158058A1 (en) * 2016-12-06 2018-06-07 Fujitsu Limited Apparatus and method to prevent execution of an unauthorized transaction via a distributed database
CN106796685A (en) * 2016-12-30 2017-05-31 深圳前海达闼云端智能科技有限公司 Block chain authority control method and device and node equipment
CN108984125A (en) * 2018-07-17 2018-12-11 郑州云海信息技术有限公司 A kind of method, apparatus and storage medium of resource allocation
CN110134510A (en) * 2019-03-28 2019-08-16 熊睿 RAM resource allocation methods and device based on intelligent contract

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
RONG CHAI等: "A resource characteristic and user QoS oriented bandwidth and power allocation algorithm for heterogeneous networks", 《WIRELESS NETWORKS》 *
孔繁超: "基于区块链的开放获取资源建设与管理", 《情报理论与实践》 *
李斌等: "一种高效的用户级通信协议的研究与实现", 《计算机工程》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112052021A (en) * 2020-08-12 2020-12-08 中钞信用卡产业发展有限公司杭州区块链技术研究院 Method, device, equipment and storage medium for upgrading block chain of alliance
CN113254537A (en) * 2021-06-17 2021-08-13 支付宝(杭州)信息技术有限公司 Block chain state storage and reading method and block chain link point
CN113791764A (en) * 2021-09-09 2021-12-14 四川启睿克科技有限公司 Method for automatically monitoring surplus energy of wave field area block chain account and giving alarm
CN113791764B (en) * 2021-09-09 2023-06-16 四川启睿克科技有限公司 Method for automatically monitoring residual energy of wave field block chain account and giving alarm
CN117440004A (en) * 2023-12-19 2024-01-23 苏州元脑智能科技有限公司 Resource storage system, method, equipment and storage medium
CN117440004B (en) * 2023-12-19 2024-03-15 苏州元脑智能科技有限公司 Resource storage system, method, equipment and storage medium

Also Published As

Publication number Publication date
CN110839071B (en) 2023-02-14

Similar Documents

Publication Publication Date Title
CN110839071B (en) Information storage method, device and storage medium based on block chain
CN110417918B (en) Distributed storage method and device for archive information, electronic equipment and medium
CN103905651A (en) Method and system for application permission management in intelligent terminal
CN111277711B (en) Virtual contact number generation method and device, storage medium and computer equipment
CN111291060A (en) Method, device and computer readable medium for managing block chain nodes
CN110740057B (en) Service deployment method and block chain platform
CN110866265A (en) Data storage method, device and storage medium based on block chain
CN104333556A (en) Distributed configuration management method of safety certificate gateways based on resource service management systems
US20200233699A1 (en) Platform-based change management
CN110677453A (en) ZooKeeper-based distributed lock service implementation method, device, equipment and storage medium
CN111222841A (en) Block chain-based data distribution method and equipment and storage medium thereof
CN110908812A (en) Business data processing method and device, readable storage medium and computer equipment
CN111339141A (en) Data transmission method, block link node equipment and medium
CN112231755A (en) Data authorization method, device and system based on block chain
CN112039886A (en) Edge computing-based terminal device management and control method, electronic device and medium
CN112799970B (en) Test data processing method, device, electronic equipment and medium
CN112256760B (en) Data prediction method and device, computer equipment and storage medium
CN111327602B (en) Equipment access processing method, equipment and storage medium
US10320894B2 (en) Method and apparatus for allocating availability zone
CN113010238A (en) Permission determination method, device and system for micro application call interface
CN110602133B (en) Intelligent contract processing method, block chain management device and storage medium
CN114553608A (en) Method and device for accessing cloud platform
CN111083200B (en) Intelligent service network system
CN114860402A (en) Scheduling strategy model training method, scheduling method, device, equipment and medium
CN110806941A (en) Service processing method, equipment and storage medium based on block chain

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