CN110427760B - Data management method and device and computer storage medium - Google Patents

Data management method and device and computer storage medium Download PDF

Info

Publication number
CN110427760B
CN110427760B CN201910578884.1A CN201910578884A CN110427760B CN 110427760 B CN110427760 B CN 110427760B CN 201910578884 A CN201910578884 A CN 201910578884A CN 110427760 B CN110427760 B CN 110427760B
Authority
CN
China
Prior art keywords
data
data block
user
authority
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910578884.1A
Other languages
Chinese (zh)
Other versions
CN110427760A (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.)
Zhuo Erzhi Lian Wuhan Research Institute Co Ltd
Original Assignee
Zhuo Erzhi Lian Wuhan Research Institute 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 Zhuo Erzhi Lian Wuhan Research Institute Co Ltd filed Critical Zhuo Erzhi Lian Wuhan Research Institute Co Ltd
Priority to CN201910578884.1A priority Critical patent/CN110427760B/en
Publication of CN110427760A publication Critical patent/CN110427760A/en
Application granted granted Critical
Publication of CN110427760B publication Critical patent/CN110427760B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/604Tools and structures for managing or administering access control systems
    • 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
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices

Abstract

The embodiment of the application discloses a data management method, a data management device and a computer storage medium, wherein the method comprises the following steps: determining a first data block of data needing to be modified on a data chain; acquiring a permission consumption value of the modified data, wherein the permission consumption value represents the cost required for modifying the data in the first data block; acquiring a current authority value of a user according to a user account; and determining that the current authority value of the user is greater than or equal to the authority consumption value, and writing the modified data of the first data block into the current data block on the data chain. The database is managed through the authority consumption value and the current authority value of the user, and the user is prevented from modifying data in the database randomly.

Description

Data management method and device and computer storage medium
Technical Field
The present application relates to the field of software engineering technologies, and in particular, to a data management method, an apparatus, and a computer storage medium.
Background
At present, a relational database is a database composed of a plurality of mutually-associated two-dimensional lists, data are stored in a two-dimensional array structure, a proper management method is not available for managing the database, and a user can randomly modify data in the database according to own needs, so that the database is disordered. Under the circumstances, how to effectively manage the database becomes a problem to be solved urgently.
Disclosure of Invention
In view of the above, embodiments of the present application provide a data management method, apparatus, and computer storage medium for effectively managing a database to solve at least one problem in the prior art.
In order to achieve the above purpose, the technical solution of the embodiment of the present application is implemented as follows:
in a first aspect, an embodiment of the present application provides a data management method, where the method includes:
determining a first data block of data needing to be modified on a data chain;
acquiring a permission consumption value of the modified data, wherein the permission consumption value represents the cost required for modifying the data in the first data block;
acquiring a current authority value of a user according to a user account;
and determining that the current authority value of the user is greater than or equal to the authority consumption value, and writing the modified data of the first data block into the current data block on the data chain.
In the above technical solution, the obtaining of the right consumption value of the modified data includes:
acquiring a timestamp of the first data block;
acquiring the weight of modified data according to the attribute of the first data block;
and determining the authority consumption value of the modified data according to the current moment, the timestamp of the first data block and the weight of the modified data.
In the above technical solution, the obtaining the weight of the modified data according to the attribute of the first data block includes:
acquiring the attribute of the first data block;
and matching the attribute of the first data block with an attribute table to obtain the weight of the modified data corresponding to the first data block, wherein the attribute table comprises the corresponding relation between the attribute of the data block and the weight of the modified data.
In the above technical solution, the obtaining the current authority value of the user according to the user account includes:
acquiring a user account;
and matching the user account with a user authority table to obtain the current authority value of the user, wherein the user authority table comprises the corresponding relation between the user account and the authority value of the user.
In the above technical solution, after determining that the current authority value of the user is greater than or equal to the authority consumption value, the method further includes:
and updating the current authority value of the user according to the authority consumption value.
In the above technical solution, after writing the modified data of the first data block into the current data block on the data chain, the method further includes:
generating a modification mark according to the first data block, wherein the modification mark is used for indicating that the data in the current data block is the modified data of the first data block;
writing the modification mark to a block header in the current data block.
In the above technical solution, the method further includes:
acquiring a permission reward value, wherein the permission reward value is used for increasing the current permission value of the user;
and updating the current authority value of the user according to the authority reward value.
In a second aspect, an embodiment of the present application provides a data management apparatus, where the apparatus includes:
the first determining unit is used for determining a first data block on a data chain, wherein the data block needs to be modified;
a first obtaining unit, configured to obtain an authority consumption value for modifying data, where the authority consumption value represents a cost required for modifying data in the first data block;
the second acquisition unit is used for acquiring the current authority value of the user according to the user account;
and the second determining unit is used for determining that the current authority value of the user is greater than or equal to the authority consumption value and writing the modified data of the first data block into the current data block on the data chain.
In a third aspect, an embodiment of the present application provides a data management apparatus, where the apparatus includes a network interface, a memory, and a processor; wherein the content of the first and second substances,
the network interface is configured to realize connection communication between the components;
the memory configured to store a computer program operable on the processor;
the processor is configured to perform the method of the first aspect when running the computer program.
In a fourth aspect, embodiments of the present application provide a computer storage medium storing a computer program, which when executed by at least one processor implements any of the methods of the first aspect.
According to the data management method, the data management device and the computer storage medium, a first data block of data needing to be modified on a data chain is determined; acquiring a permission consumption value of the modified data, wherein the permission consumption value represents the cost required for modifying the data in the first data block; acquiring a current authority value of a user according to a user account; and determining that the current authority value of the user is greater than or equal to the authority consumption value, and writing the modified data of the first data block into the current data block on the data chain. The database is managed through the authority consumption value and the current authority value of the user, and the user is prevented from modifying data in the database randomly.
Drawings
Fig. 1 is a first schematic flow chart illustrating an implementation of a data management method according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating an implementation process of a data management method according to an embodiment of the present application;
fig. 3 is a schematic flow chart illustrating a third implementation process of a data management method according to an embodiment of the present application;
fig. 4 is a schematic flow chart of an implementation of a data management method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data management apparatus 500 according to an embodiment of the present invention;
fig. 6 is a schematic hardware structure diagram of a data management apparatus 600 according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will describe the specific technical solutions of the present application in further detail with reference to the accompanying drawings in the embodiments of the present application. The following examples are intended to illustrate the present application but are not intended to limit the scope of the present application.
In order to solve the problem that any user can modify the data in the relational database at will according to the requirement of the user, an administrator can be set for the relational database, and the administrator has the authority to modify the data. However, this arrangement makes the relational database too centralized and management efficiency very low. Therefore, the embodiments of the present application provide a data management method, which is applied to a data link, and the data link structure can solve the problems of centralization and low efficiency of a relational database.
The database is a data chain layer, the data chain layer comprises at least one data chain, the data chain is a chained data structure and is similar to a directed acyclic graph, namely, the nth data block (data block) in the data chain comprises an information abstract of the (n-1) th data block, and the (n + 1) th data block comprises an information abstract of the nth data block, wherein the information abstract refers to information of the data block after hash operation compression mapping, and the hash operation refers to operation of compressing information of any length to a fixed length. Once the information of the nth data block is changed, the information abstract of the changed nth data block is changed, so that the information abstract of the nth data block contained in the (n + 1) th data block cannot be matched with the information abstract of the changed nth data block, and the data can be effectively prevented from being tampered by the information abstract of the data chain. The data block comprises a block head and a block body, the block head comprises a time stamp, the time stamp represents a certain moment, and the block body is used for writing data.
Different types of data may be on corresponding types of data chains, for example financial data on a financial data chain and warehouse data on a warehouse data chain, on which data can be entered by a user with corresponding authority.
An embodiment of the present application provides a data management method, where the data management method may be applied to a terminal and may also be applied to a server, fig. 1 is a schematic diagram of an implementation flow of the data management method provided in the embodiment of the present application, and as shown in fig. 1, the method mainly includes the following steps:
step 101, determining a first data block of data needing to be modified on a data chain.
It should be noted that, at least one data block is provided on the data chain, each data block of the data chain may be displayed on a display interface of the terminal, when a user needs to modify data in a certain data block, the data block that needs to modify data may be selected on an input interface of the terminal, and after completing the input, a first data block that needs to modify data is formed, where the first data block is any data block that needs to modify data on the data chain, and thus the terminal may determine the first data block that needs to modify data.
And 102, acquiring a permission consumption value of the modified data, wherein the permission consumption value represents the cost required for modifying the data in the first data block.
It should be noted that, the larger the authority consumption value for modifying data is, the larger the cost required for modifying data in the first data block is; the smaller the consumption value of the right to modify the data, the less the cost required to modify the data in the first data block.
The acquiring of the right consumption value of the modified data comprises: acquiring a timestamp of the first data block; acquiring the weight of modified data according to the attribute of the first data block; and determining the authority consumption value of the modified data according to the current moment, the timestamp of the first data block and the weight of the modified data. The block header of the data block on the data chain includes a time stamp, and the terminal can obtain the time stamp of each data block. The terminal can obtain the current time according to the clock program, and can obtain the difference value between the current time and the timestamp of the first data block according to the current time and the timestamp of the first data block, when the difference value is larger, the authority consumption value is larger, and the cost required for modifying the data in the first data block is larger; the smaller the difference, the smaller the entitlement consumption value will be, and the less the cost required to modify the data in the first data block. The weight of the modified data can be obtained according to the attribute of the first data block, the weight of the modified data is used for representing the importance degree of the data needing to be modified, and the authority consumption value of the modified data can be obtained according to the difference value of the current time and the timestamp of the first data block and the weight of the modified data.
It should be noted that, obtaining the weight of the modified data according to the attribute of the first data block includes: acquiring the attribute of the first data block; and matching the attribute of the first data block with an attribute table to obtain the weight of the modified data corresponding to the first data block, wherein the attribute table comprises the corresponding relation between the attribute of the data block and the weight of the modified data. The user can preset an attribute table in the terminal, match the attribute of the first data block with the attribute table, and obtain the weight of the modified data corresponding to the first data block, and the user can preset the weight of the modified data in the attribute table according to actual requirements.
And 103, acquiring the current authority value of the user according to the user account.
It should be noted that the current user permission value is used to judge whether the user can modify the data, and the current user permission value corresponding to each user account may be different.
The method for acquiring the current authority value of the user according to the user account comprises the following steps: acquiring a user account; and matching the user account with a user authority table to obtain the current authority value of the user, wherein the user authority table comprises the corresponding relation between the user account and the authority value of the user. The terminal can acquire the user account and match the user account with the user authority table to acquire the current authority value of the user after the user inputs the user account and the user password on the terminal and passes verification, so that whether the user can modify data is determined according to the current authority value and the authority consumption value of the user.
And 104, determining that the current authority value of the user is greater than or equal to the authority consumption value, and writing the modified data of the first data block into the current data block on the data chain.
It should be noted that the current authority value of the user may not meet the current modification of the user, and when the current authority value of the user is greater than or equal to the authority consumption value, it indicates that the number of times the user modifies the data is small, and the user has authority to modify the data, and can write the modified data of the first data block into the current data block on the data chain, where the current data block is a data block on the data chain where data needs to be written, that is, a data block where data is not written in the block; when the current authority value of the user is smaller than the authority consumption value, the times that the user modifies the data are more, and the user does not have the authority to modify the data.
It should be noted that, when it is determined that the current authority value of the user is greater than or equal to the authority consumption value, it is determined that the user can perform the modification, and the authority consumption value is deducted to update the current authority value of the user.
It should be noted that after the modified data of the first data block is written into the current data block on the data chain, a modification flag may also be generated according to the first data block, where the modification flag is used to indicate that the data in the current data block is the modified data of the first data block; writing the modification mark to a block header in the current data block. Whether the data in the data block is the modified data or not can be described through the modification mark, so that a reward mechanism can be realized according to the modification mark subsequently.
It should be noted that, in order to ensure the accuracy of writing data in the data block by the user each time and avoid the user from frequently modifying the data, a reward mechanism may be set, that is, a permission reward value is set according to the data block in which the modified data is not written within a preset time period, the permission reward value is used to increase the current permission value of the user, and the current permission value of the user is updated according to the permission reward value.
According to the method and the device, the database is managed through the authority consumption value and the current authority value of the user, and the user is prevented from modifying data in the database randomly.
An embodiment of the present application provides a data management method, where the data management method may be applied to a terminal and may also be applied to a server, fig. 2 is a schematic diagram of an implementation flow of the data management method provided in the embodiment of the present application, and as shown in fig. 2, the method mainly includes the following steps:
step 201, receiving a user authentication request, where the user authentication request includes a user account and a user password.
It should be noted that, when a user needs to enter data on a data link, that is, data uplink, a user account and a user password are input on the terminal, the terminal receives a user authentication request, and the user authentication request is used to authenticate whether the user can enter data on the data link.
Step 202, obtaining the data type of the data chain to be recorded.
It should be noted that a user may select a data type to be entered on an input interface of the terminal, for example, the user may select the data type to be entered by sliding an input frame roller of the input interface, or may directly input the data type to be entered on the input interface, and the user completes inputting the data type to be entered on the input interface, that is, the data type of the data chain to be entered is formed, so that the terminal may obtain the data type of the data chain to be entered, for example, the data type may be financial data, warehouse data, or the like.
It should be noted that steps 201 and 202 are not in obvious sequence.
Step 203, determining whether data corresponding to the data type can be input or not according to the user account and the user password, and if the data corresponding to the data type can be input, turning to step 204; and if the data corresponding to the data type cannot be input, ending the current flow.
It should be noted that, a user may preset a verification table in a database, where the verification table includes a user account, a user password, and a corresponding relationship with a data type of an input data chain, compare a user verification request with the verification table, that is, compare the user account, the user password, and the user account, the user password, in the user verification request with the data type of the input data chain to obtain a data type of the data chain which can be input by the user, determine whether the obtained data type of the data chain which can be input by the user matches the data type of the data chain to be input by the user, and if so, determine that data corresponding to the data type can be input, that is, the user has a right to input data corresponding to the data type; if not, determining that the data corresponding to the data type cannot be entered, namely that the user does not have the right to enter the data corresponding to the data type.
It should be noted that users with corresponding authorities can enter data of corresponding types on the data chain, for example, only financial staff can enter financial data on the financial data chain, only warehouse administrators can enter warehouse entry and exit data on the warehouse data chain, and the warehouse administrators cannot enter data on the financial data chain.
And 204, writing the data corresponding to the data type into the current data block.
It should be noted that the original data entered by the user on the terminal may be data in the form of video, audio, pictures, characters, and the like, and since the data written in the data block is normalized data, that is, data in a uniform form, the original data needs to be processed by a computer-aided tool, for example, the user enters the original data, such as an invoice picture, on the terminal, the terminal converts the invoice picture into a text format by using Optical Character Recognition (OCR) software, and the user generates data that can be written in the data block after auditing and correcting the text format.
The method includes the steps of carrying out normalization processing on original data corresponding to data types to obtain data corresponding to the data types, for example, the original data corresponding to warehouse data is a video of goods entering and leaving a warehouse in a certain day, extracting text information of the goods entering and leaving the warehouse through edge calculation or video analysis technology, writing the data corresponding to the data types into a current data block, wherein the current data block is a data block needing data writing on a data chain, namely a data block not writing data in a block, for example, N data blocks are sequentially connected in the data chain, the current data block is the last data block, namely the Nth data block, and the Nth data block is a data block needing data writing, namely a data block not writing data in the block.
It should be noted that the data block includes a block body, and the block body is used for writing data corresponding to the data type. And writing the data corresponding to the data type into the block body in the current data block.
And after the data corresponding to the data type is written into the current data block, performing hash operation on the data in the current data block to obtain the information abstract of the current data block, writing the information abstract of the current data block into the next data block, and finishing data entry, namely data chaining, on the current data block, thereby avoiding the user from modifying the data in the data block arbitrarily.
And step 205, writing the current time into the time stamp of the current data block, wherein the current time is the time when the data corresponding to the data type is written into the current data block.
It should be noted that the data block includes a block header, where the block header includes a timestamp, and the timestamp is a current time.
And when the data corresponding to the data type is written into the current data block, acquiring the current time based on the clock program, and writing the current time into the timestamp in the current data block.
It should be noted that step 204-. The following step 206-213 is the process of modifying the data in the data block, as shown in fig. 3. The steps 204-205 and 206-213 are not in obvious sequence.
Step 206, determine the first data block of the data that needs to be modified.
It should be noted that each data block of the data chain may be displayed on a display interface of the terminal, when a user needs to modify data in a certain data block, the data block that needs to modify data may be selected on an input interface of the terminal, for example, the user may select the data block that needs to modify data by sliding an input box roller of the input interface, the user completes inputting the data block that needs to modify data on the input interface, that is, the first data block that needs to modify data is formed, the first data block is any data block that needs to modify data on the data chain, so that the terminal may determine the first data block that needs to modify data, for example, there are 8 data blocks on the financial data chain, and the 5 th data block that needs to be modified is input on the terminal by the user, and the terminal may acquire the data block that needs to modify data as the 5 th data block.
Step 207, the timestamp of the first data block is obtained.
It should be noted that, after the user determines that the first data block of the data needs to be modified, the terminal may obtain a timestamp of the first data block, where the timestamp represents a time when the data is entered in the first data block.
And step 208, acquiring the weight of the modified data according to the attribute of the first data block.
It should be noted that the attribute of the first data block is a type of the first data block, such as a financial data block, a warehouse data block, and the like.
The user may preset a first attribute table in the terminal, where the first attribute table includes attributes of the data blocks and a corresponding relationship between the attributes and weights of the modified data, match the attributes of the first data block with the first attribute table, and obtain the weights of the modified data corresponding to the first data block, where the weights of the modified data are used to represent an importance degree of data to be modified, and the user may set the weights of the modified data in the first attribute table in advance according to actual requirements, for example, the financial data is more important than the warehouse data, and the weights of the modified financial data are more important than the warehouse data, for example, the weights of the modified data corresponding to the financial data blocks in the attribute table are 2, the weights of the modified data corresponding to the warehouse data blocks are 1, and in general, the user does not have authority to modify the financial data.
Step 209, determining a permission consumption value according to the current time, the timestamp of the first data block and the weight of the modified data, wherein the permission consumption value represents the cost required for modifying the data in the first data block.
It should be noted that the terminal may obtain the current time according to a clock program. According to the current time, the timestamp of the first data block and the weight of the modified data, a permission consumption value can be determined, and the formula of the permission consumption value is as follows:
gas=R×△t×Wupdated (1)
gas in the above formula (1) represents a right consumption value, and R represents an adjustable coefficient for adjusting according to actual requirementsThe whole authority consumption value has a value range of (0, 2), can be preset artificially, and delta t represents the difference value between the current time and the timestamp of the first data block, when the delta t is larger, the authority consumption value is larger, and the cost required for modifying the data in the first data block is larger; when Δ t is smaller, the right consumption value will be smaller, the cost required for modifying the data in the first data block is smaller, WupdatedRepresenting the weight of the modified data.
And step 210, acquiring the current authority value of the user according to the user account.
It should be noted that the current user permission value is used to judge whether the user can modify the data, and the current user permission value corresponding to each user account may be different.
After determining whether data can be entered according to the user account and the user password, the user account and a user authority table can be matched to obtain the current authority value of the user, the user authority table includes the corresponding relationship between the user account and the authority value of the user, for example, the authority value corresponding to the user account 1 in the user authority table is 10, the authority value corresponding to the user account 2 is 5, that is, the authority value of the user account 1 is greater than the authority value of the user account 2, and the user account 1 can modify more data relative to the user account 2.
Step 211, determining whether the current authority value of the user is greater than or equal to the authority consumption value, and if the current authority value of the user is greater than or equal to the authority consumption value, turning to step 212; and if the current authority value of the user is smaller than the authority consumption value, ending the current flow.
It should be noted that, the current authority value of the user may not meet the current modification of the user, and when the current authority value of the user is greater than or equal to the authority consumption value, it indicates that the number of times the user modifies the data is small, and the user has the authority to modify the data; when the current authority value of the user is smaller than the authority consumption value, the number of times that the user modifies the data is large, the user does not have the authority to modify the data, and prompt information is displayed on the terminal and used for representing that the user does not have the authority to modify the data, for example, the prompt information can be that the current authority value is insufficient, the database is managed through the authority consumption value, and the user is prevented from modifying the data in the database randomly.
And step 212, updating the current authority value of the user according to the authority consumption value.
It should be noted that, when it is determined that the current authority value of the user is greater than or equal to the authority consumption value, it is determined that the user can perform the modification, and the authority consumption value is deducted to update the current authority value of the user.
Step 213, writing the modified data of the first data block into the current data block.
It should be noted that the data link is a chained data structure, data in a data block on the data link cannot be changed, and when data in the data block needs to be modified, only the modified data can be written into the current data block. Therefore, when it is determined that the data in the first data block can be modified according to the authority consumption value and the current authority value of the user, the modified data needs to be written into the current data block, which is a data block in which data needs to be written on the data chain, that is, a data block in which data is not written in the block body.
It should be noted that, after the modified data in the first data block is written into the current data block, a modification flag is generated according to the first data block, and the modification flag is written into the block header in the current data block, where the modification flag is used to indicate that the data in the current data block is the modified data of the first data block.
It should be noted that step 206-. The following step 214-217 is a process for updating the current authority value of the user according to the authority reward value, as shown in FIG. 4. Steps 206-213 and 214-217 are not in obvious sequence.
And step 214, determining the data blocks into which the modified data is not written in the preset time period according to the time stamps of the data blocks and the modification marks.
It should be noted that, in order to ensure the accuracy of writing data in the data block by the user each time and avoid the user from frequently modifying the data, a reward mechanism may be set, that is, a permission reward value is set according to the data block in which modified data is not written within a preset time period.
And traversing the data blocks in the data chain in sequence, determining that the time stamp of the data block belongs to a preset time period, and determining that the data block has no modification mark, wherein the data block is a data block in which modified data is not written in the preset time period, and the preset time period is a certain time period in which a user inputs a reward on an input interface of the terminal.
Step 215, obtaining data weight according to the attribute of the data block without written modified data.
It should be noted that, a user may preset a second attribute table in the terminal, where the second attribute table includes attributes of the data blocks and a corresponding relationship between the attributes and the data weights, and match the attributes of the data blocks into which modified data is not written with the second attribute table to obtain the data weights corresponding to the data blocks into which modified data is not written, where the data weights are used to represent the importance of data in the data blocks, and the user may set the data weights in the second attribute table in advance according to actual requirements. The first attribute table may be the same as the second attribute table, that is, the weight of the modified data may be the same as the data weight, or the first attribute table may be different from the second attribute table, that is, the weight of the modified data is different from the data weight.
And step 216, determining an authority reward value according to the current time, the time stamp of each data block which is not written with the modified data and the data weight, wherein the authority reward value is used for updating the current authority value of the user.
It should be noted that the terminal may obtain the current time according to a clock program. According to the current time, the time stamp of each data block which is not written with the modified data and the data weight, an authority reward value can be determined, and the authority reward value is expressed by the following formula:
Figure BDA0002112659390000121
the bonus value of the authority is shown by bonus in the above formula (2), n is the number of data blocks in which the modified data is not written, and R' is an adjustable coefficient for the purpose of actual useThe value range of the demand regulation authority reward value is (0, 2), and can be preset artificially and delta t'iRepresenting the difference between the time of the present time and the time stamp of the ith block of unwritten modified data, WiIndicating the data weight corresponding to the ith data block in which the modified data is not written.
And step 217, updating the current authority value of the user according to the authority reward value.
It should be noted that, in order to encourage the user to write accurate data in the data block, an incentive mechanism may be provided, an authority incentive value is determined according to the current time, the timestamp of each data block in which modified data is not written, and the data weight, and the authority incentive value is added to the current authority value of the user to update the current authority value of the user.
Based on the same inventive concept of the foregoing embodiments, an embodiment of the present application provides a data management apparatus, and fig. 5 is a schematic structural diagram of a data management apparatus 500 according to an embodiment of the present invention, as shown in fig. 5, the apparatus 500 includes:
a first determining unit 501, configured to determine a first data block on a data chain, where data needs to be modified;
a first obtaining unit 502, configured to obtain an authority consumption value of modifying data, where the authority consumption value represents a cost required for modifying data in the first data block;
a second obtaining unit 503, configured to obtain a current authority value of the user according to the user account;
a second determining unit 504, configured to determine that the current authority value of the user is greater than or equal to the authority consumption value, and write the modified data of the first data block into the current data block on the data chain.
It should be noted that the first obtaining unit 502 specifically includes a first processing unit 5021, a second processing unit 5022, and a third processing unit 5023; wherein the content of the first and second substances,
the first processing unit 5021 is configured to obtain a timestamp of the first data block;
the second processing unit 5022 is configured to obtain a weight of the modified data according to the attribute of the first data block;
the third processing unit 5023 is configured to determine an authority consumption value of the modified data according to the current time, the timestamp of the first data block, and the weight of the modified data.
It should be noted that, the second processing unit 5022 is specifically configured to obtain an attribute of the first data block; and matching the attribute of the first data block with an attribute table to obtain the weight of the modified data corresponding to the first data block, wherein the attribute table comprises the corresponding relation between the attribute of the data block and the weight of the modified data.
It should be noted that the second obtaining unit 503 is specifically configured to obtain a user account; and matching the user account with a user authority table to obtain the current authority value of the user, wherein the user authority table comprises the corresponding relation between the user account and the authority value of the user.
It should be noted that the second determining unit 504 is further configured to determine that the current authority value of the user is greater than or equal to the authority consumption value, and update the current authority value of the user according to the authority consumption value.
The data management apparatus 500 further includes:
a writing unit 505, configured to generate a modification flag according to the first data block, where the modification flag is used to indicate that data in the current data block is modified data of the first data block; writing the modification mark to a block header in the current data block.
The data management device 500 further includes
An updating unit 506, configured to obtain a rights award value, where the rights award value is used to increase a current rights value of the user; and updating the current authority value of the user according to the authority reward value.
The components in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware or a form of a software functional module.
Based on the understanding that the technical solution of the embodiments of the present invention essentially or a part of the technical solution contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method of the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Accordingly, embodiments of the present invention provide a computer storage medium storing a computer program that, when executed by at least one processor, performs the steps of the above-described embodiments.
Referring to fig. 6, a specific hardware structure of a data processing apparatus 600 provided in an embodiment of the present invention is shown, including: a network interface 601, a memory 602, and a processor 603; the various components are coupled together by a bus system 604. It is understood that the bus system 604 is used to enable communications among the components. The bus system 604 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 604 in fig. 6. Wherein the content of the first and second substances,
the network interface 601 is configured to receive and transmit signals during information transmission and reception with other external network elements;
a memory 602 for storing a computer program capable of running on the processor 603;
a processor 603 for, when running the computer program, performing:
determining a first data block of data needing to be modified on a data chain;
acquiring a permission consumption value of the modified data, wherein the permission consumption value represents the cost required for modifying the data in the first data block;
acquiring a current authority value of a user according to a user account;
and determining that the current authority value of the user is greater than or equal to the authority consumption value, and writing the modified data of the first data block into the current data block on the data chain.
It will be appreciated that the memory 602 in embodiments of the invention may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous SDRAM (ESDRAM), Sync Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 602 of the methodologies described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
And the processor 603 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 603. The Processor 603 may be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. 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 connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 602, and the processor 603 reads the information in the memory 602, and performs the steps of the above method in combination with the hardware thereof.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present invention, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention. The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. The above-described terminal embodiments are only illustrative, for example, the division of the unit is only a logical function division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. The above-described terminal embodiments are only illustrative, for example, the division of the unit is only a logical function division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The methods disclosed in the several method embodiments provided in the present application may be combined arbitrarily without conflict to obtain new method embodiments.
Features disclosed in several of the product embodiments provided in the present application may be combined in any combination to yield new product embodiments without conflict.
The features disclosed in the several method or apparatus embodiments provided in the present application may be combined arbitrarily, without conflict, to arrive at new method embodiments or apparatus embodiments.

Claims (9)

1. A method for managing data, the method comprising:
determining a first data block of data needing to be modified on a data chain; acquiring a timestamp of the first data block;
acquiring the weight of modified data according to the attribute of the first data block;
determining an authority consumption value of the modified data according to the current time, the timestamp of the first data block and the weight of the modified data,
the entitlement consumption value represents a cost required to modify data in the first data block;
acquiring a current authority value of a user according to a user account;
and determining that the current authority value of the user is greater than or equal to the authority consumption value, and writing the modified data of the first data block into the current data block on the data chain.
2. The method of claim 1, wherein obtaining the weight of the modified data according to the property of the first data block comprises:
acquiring the attribute of the first data block;
and matching the attribute of the first data block with an attribute table to obtain the weight of the modified data corresponding to the first data block, wherein the attribute table comprises the corresponding relation between the attribute of the data block and the weight of the modified data.
3. The method of claim 1, wherein the obtaining the current authority value of the user according to the user account comprises:
acquiring a user account;
and matching the user account with a user authority table to obtain the current authority value of the user, wherein the user authority table comprises the corresponding relation between the user account and the authority value of the user.
4. The method of claim 1, wherein after determining that the current user entitlement value is greater than or equal to the entitlement consumption value, further comprising:
and updating the current authority value of the user according to the authority consumption value.
5. The method of claim 1, wherein after writing the modified data of the first data block into the current data block on the data chain, further comprising:
generating a modification mark according to the first data block, wherein the modification mark is used for indicating that the data in the current data block is the modified data of the first data block;
writing the modification mark to a block header in the current data block.
6. The method of claim 1, further comprising:
acquiring a permission reward value, wherein the permission reward value is used for increasing the current permission value of the user;
and updating the current authority value of the user according to the authority reward value.
7. A data management apparatus, characterized in that the apparatus comprises:
the first determining unit is used for determining a first data block on a data chain, wherein the data block needs to be modified;
a first obtaining unit, configured to obtain a timestamp of the first data block; acquiring the weight of modified data according to the attribute of the first data block; determining an authority consumption value of the modified data according to the current time, the timestamp of the first data block and the weight of the modified data, wherein the authority consumption value represents the cost required for modifying the data in the first data block;
the second acquisition unit is used for acquiring the current authority value of the user according to the user account;
and the second determining unit is used for determining that the current authority value of the user is greater than or equal to the authority consumption value and writing the modified data of the first data block into the current data block on the data chain.
8. A data management apparatus, characterized in that the apparatus comprises a network interface, a memory and a processor; wherein the content of the first and second substances,
the network interface is configured to realize connection communication between the components;
the memory configured to store a computer program operable on the processor;
the processor, when executing the computer program, is configured to perform the method of any of claims 1 to 6.
9. A computer storage medium, characterized in that the computer storage medium stores a computer program which, when executed by at least one processor, implements the method according to any one of claims 1 to 6.
CN201910578884.1A 2019-06-28 2019-06-28 Data management method and device and computer storage medium Active CN110427760B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910578884.1A CN110427760B (en) 2019-06-28 2019-06-28 Data management method and device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910578884.1A CN110427760B (en) 2019-06-28 2019-06-28 Data management method and device and computer storage medium

Publications (2)

Publication Number Publication Date
CN110427760A CN110427760A (en) 2019-11-08
CN110427760B true CN110427760B (en) 2021-09-10

Family

ID=68408865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910578884.1A Active CN110427760B (en) 2019-06-28 2019-06-28 Data management method and device and computer storage medium

Country Status (1)

Country Link
CN (1) CN110427760B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103412950A (en) * 2013-08-28 2013-11-27 浙江大学 Method for increasing read-write speed of spatial big data files
CN103609050A (en) * 2012-09-07 2014-02-26 华为技术有限公司 Air interface transmission method and relevant device and system
CN108830453A (en) * 2018-05-07 2018-11-16 中国科学院力学研究所 A kind of appraisal procedure and system remotely operating effect
CN109460675A (en) * 2018-10-26 2019-03-12 温州博盈科技有限公司 A kind of enterprise information security management method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7280880B2 (en) * 2005-12-21 2007-10-09 Schmale Michael D Manufacturing analysis using a part-process matrix

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103609050A (en) * 2012-09-07 2014-02-26 华为技术有限公司 Air interface transmission method and relevant device and system
CN103412950A (en) * 2013-08-28 2013-11-27 浙江大学 Method for increasing read-write speed of spatial big data files
CN108830453A (en) * 2018-05-07 2018-11-16 中国科学院力学研究所 A kind of appraisal procedure and system remotely operating effect
CN109460675A (en) * 2018-10-26 2019-03-12 温州博盈科技有限公司 A kind of enterprise information security management method

Also Published As

Publication number Publication date
CN110427760A (en) 2019-11-08

Similar Documents

Publication Publication Date Title
US11816141B2 (en) Media consumption history
US8977860B2 (en) Method and apparatus for tamper proof camera logs
US8818107B2 (en) Identification generation and authentication process application
US9633215B2 (en) Application of differential policies to at least one digital document
US11616639B2 (en) Storing time-sensitive secrets in a blockchain network
CN107451184A (en) Page display method and device, user equipment, storage medium
WO2020186785A1 (en) Method and device for constructing sample set, computer apparatus, and storage medium
CN110377762A (en) Information query method, device and computer equipment based on electronics folder
CN101118585A (en) Method and apparatus for authenticating a user
CN110472219A (en) Electronic document generation method, device, computer equipment and storage medium
CN112036147B (en) Method, device, computer equipment and storage medium for converting picture into webpage
US9218589B2 (en) Issuance, conveyance and management of endorsements
CN107391535A (en) The method and device of document is searched in document application
US11849183B2 (en) Video security system
CN111966971A (en) Profit distribution method, apparatus, server and storage medium for copyright product
CN110427760B (en) Data management method and device and computer storage medium
CN113382289B (en) Live broadcast room delivery method and device, electronic equipment and storage medium
CN110598475A (en) Block chain-based work attribute information acquisition method and device and computer equipment
US20130321435A1 (en) Format and method for representing a dynamic digital image
CN111552810B (en) Entity extraction and classification method, entity extraction and classification device, computer equipment and storage medium
CN115994232A (en) Online multi-version document identity authentication method, system and computer equipment
CN110597977B (en) Data processing method, data processing device, computer equipment and storage medium
CN105354506B (en) The method and apparatus of hidden file
US20200372104A1 (en) Methods, systems, apparatuses and devices for facilitating book formatting
WO2023010701A1 (en) Image generation method, apparatus, and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant