CN115130136B - Vacation general certification system and method based on improved block chain NFT protocol - Google Patents

Vacation general certification system and method based on improved block chain NFT protocol Download PDF

Info

Publication number
CN115130136B
CN115130136B CN202210846856.5A CN202210846856A CN115130136B CN 115130136 B CN115130136 B CN 115130136B CN 202210846856 A CN202210846856 A CN 202210846856A CN 115130136 B CN115130136 B CN 115130136B
Authority
CN
China
Prior art keywords
vacation
user
nft
certification
intelligent contract
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
CN202210846856.5A
Other languages
Chinese (zh)
Other versions
CN115130136A (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.)
Chengdu Magic Sea Dune Network Technology Co ltd
University of Electronic Science and Technology of China
Original Assignee
Chengdu Magic Sea Dune Network Technology Co ltd
University of Electronic Science and Technology of China
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 Chengdu Magic Sea Dune Network Technology Co ltd, University of Electronic Science and Technology of China filed Critical Chengdu Magic Sea Dune Network Technology Co ltd
Priority to CN202210846856.5A priority Critical patent/CN115130136B/en
Publication of CN115130136A publication Critical patent/CN115130136A/en
Application granted granted Critical
Publication of CN115130136B publication Critical patent/CN115130136B/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/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists

Abstract

The invention belongs to the technical field of block chains, and particularly relates to a vacation certification system and a method based on an improved block chain NFT protocol. The user management module is mainly used for logging in and registering a user, the function of the system can be used after the logging is finished, and the identity of the user after logging in is an administrator or a common user; the vacation certification module is used for converting a vacation of a user into NFT certification by an administrator, each vacation of the user corresponds to one NFT certification, and the administrator can convert the vacations of multiple days into multiple NFT certificates in batches by utilizing an improved NFT protocol; the vacation pass-evidence using module is used for enabling a user to use the owned vacation NFT pass-evidence, and the user selects to convert the vacation NFT pass-evidence into a real vacation or convert the vacation NFT pass-evidence into points, and the points can be used for exchanging employee benefits or used as employee assessment indexes. Based on the scheme, the problems that the vacation management of staff is not transparent, the overtime income cannot be quantified, the gas consumption of casting multiple NFTs is too high and the like are solved.

Description

Vacation general certification system and method based on improved block chain NFT protocol
Technical Field
The invention belongs to the technical field of block chains, and particularly relates to a vacation certification system and a vacation certification method based on an improved block chain NFT protocol.
Background
The Smart Contract (Smart Contract) is a program deployed on a blockchain and cannot be modified once deployed, and the property enables the Smart Contract to have certain transparency. With the application of the EtherFang Smart contracts, non-homogeneous Token (NFT) also gradually enters the public horizon. The non-detachability and uniqueness of the NFT enable the NFT to be associated with specific articles and to be applied to wider practical scenes.
Currently, most of the NFTs in EtherFang follow the ERC-721 (Ethereum Request for Comments-721) protocol, which defines some standard methods for operating NFTs, but does not specify the casting (mint) operation. Most NFT implementations on the market cast only one NFT at a time, which is not only inefficient but also high in gas consumption. Meanwhile, in the last two years, topics such as shift-over, shift-over income and vacation management are also concerned, and the problems mainly focus on the aspects that shift-over income cannot be quantified, vacation management is not transparent and the like.
Disclosure of Invention
In order to solve the technical problems in the prior art, the present invention provides a vacation certification system and a vacation certification method based on an improved block chain NFT protocol, which are intended to solve the problems of high consumption of casting NFT certification and lack of batch casting NFT certification in the current NFT protocol mentioned in the background art. Meanwhile, the method is applied to the vacation management scene of a company or an enterprise, and the problem that the vacation management and overtime income cannot be quantized is solved.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
the vacation certification system based on the improved block chain NFT protocol comprises a user management module, a vacation certification module and a vacation certification using module;
the user management module is used for logging in and registering a user, an administrator and a common user are arranged in the user management module, and corresponding operation authorities are respectively set for the administrator and the common user;
the vacation certification module is used for changing the vacation of the user into NFT certification by an administrator, each vacation of each user corresponds to one NFT certification mark, and the vacations of multiple days are converted into multiple NFT certificates in batch by utilizing an NFT protocol;
the vacation evidence using module is used for enabling a user to use the owned vacation NFT evidence, and the user selects to convert the vacation NFT evidence into a real vacation or convert the vacation NFT evidence into points, and the points can be used for exchanging employee benefits or serve as employee assessment indexes.
The vacation certification method based on the improved block chain NFT protocol comprises a user management stage, a vacation certification stage and a vacation certification use stage;
the user management phase comprises the following steps:
A1. the user logs in or registers by using an account and a password to enter the system;
A2. judging whether the user is an administrator or a common user, and if the user is the administrator, giving the user the permission to use the vacation certification-passing module and the vacation certification-passing module; if the user is a common user, only giving the user the permission to use the vacation pass-certificate use module;
A3. allocating a unique address identifier to each user;
A4. the user selects a module to be used according to all the authorities, if the vacation general certification module is to be used, the system enters B1, and if the vacation general certification module is to be used, the system enters C1;
the vacation certification stage comprises the following steps:
B1. the user applies for the administrator to convert the vacation days of the user into vacation NFT certificates, and each vacation corresponds to one vacation NFT certificate;
B2. an administrator calls a mintBatchVacations function in an intelligent contract, transmits an address identifier of a user applying for and the number of vacations applying for, and converts the vacations of the user into NFT certificates in batches, wherein each vacation NFT certificate corresponds to an identifier;
B3. the intelligent contract increases the holiday balance of the application user, and the number of the holiday balance is equal to the number of the holidays applied by the user;
the vacation general evidence using stage comprises the following steps:
C1. the user selects to convert the vacation NFT evidence into the integral or selects to convert the vacation NFT evidence into the real vacation, and if the user selects to convert the vacation NFT evidence into the integral, the C2 is entered; if the certification of the vacation NFT is converted into a real vacation, entering C3;
C2. the user calls a withdraw function in the intelligent contract, a vacation NFT (network file transfer) permit identifier array is transmitted, the length of the array is more than or equal to 1, all the vacation balances of the user are reduced after the execution is finished, the vacation NFT permit is converted into points, and the points can be used for exchanging employee benefits or used as employee assessment indexes;
C3. the user calls a useBatchVacations function in the intelligent contract, transmits a vacation NFT (NFT) certification passing identifier array, the length of the array is more than or equal to 1, reduces all the vacation balances of the user after execution is finished, and finishes converting the vacation NFT certification passing into a real vacation.
Preferably, the step B1 includes the steps of:
B101. the user puts forward a vacation certification-passing application to the administrator, and submits a duty certification of the user, and the number of days on duty is attached;
B102. b, the administrator checks whether the overtime proof is valid, if so, the administrator records the address identification of the application user and the valid overtime days, and the step B2 is entered; if not, the procedure returns to step B101.
Preferably, the step B2 includes the steps of:
B201. the administrator calls a mintBatchVacations function in the intelligent contract, and transmits the address identification of the user and the number of holiday days to be converted;
B202. the intelligent contract checks whether the incoming address identification and the vacation number are legal, if the address identification is not 0 address and the vacation number is more than 0, the step B203 is entered, otherwise, the step B201 is returned;
B203. the intelligent contract uses a built-in variable vacationCounter as an identifier of a vacation NFT pass, adds 1 to the vacationCounter when generating an NFT pass, and records the owner of the generated vacation NFT pass as the address identifier of the user;
B204. the intelligent contract repeats step B203 a number of times equal to the number of incoming vacations and notes the generated vacation NFT pass-through identifier with an array vacationIds equal in length to the number of incoming vacation days.
Preferably, the step B3 includes the steps of:
B301. adding vacationBalances corresponding to the application user by the intelligent contract, wherein the number of the vacationBalances is equal to the number of the vacation of the application, and finishing the increase of the vacation balance of the user;
B302. the intelligent contract triggers a MintBatchVacations event, an incoming user's address identifier and a generated vacation NFT passport identifier array vacationIds;
B303. the system informs the user that the vacation certification applied by the user has been successfully executed and sends the user a vacation NFT certification identifier array vacatedIds, wherein the length of the vacation NFT certification identifier array vacatedIds is equal to the number of vacation days applied by the user.
Preferably, the step C1 includes the steps of:
C101. a user calls a vacationBalanceof function in the intelligent contract, transmits an address identifier of the user into the intelligent contract, inquires the vacation NFT (network File transfer) certification balance, and if the vacation certification balance is more than 0, the method enters a step C102, otherwise, the method returns to the step 101;
C102. and C2, if the user selects to convert the vacation NFT evidence into the integral or selects to convert the vacation NFT evidence into the real vacation, the step C2 is carried out, and if the user selects to convert the vacation NFT evidence into the real vacation, the step C3 is carried out.
Preferably, the step C2 includes the steps of:
C201. a user calls a withdraw function in an intelligent contract and transmits a vacation NFT (network file) evidence-passing identifier array, wherein the length of the array is more than or equal to 1;
C202. traversing the NFT pass identifier array by the intelligent contract, checking whether the owner of each NFT pass is an application user, if so, turning to the step C203, otherwise, returning to the step C201;
C203. the intelligent contract traverses the NFT pass identifier array, and sets the owner of each NFT pass to be null;
C204. the intelligent contract reduces the vacationBalances corresponding to the application user, and the number of the vacationBalances is equal to the length of the vacation NFT certification identifier array transmitted by the user;
C205. the intelligent contract triggers a Withdraw event, and transmits an address identifier and a vacation NFT (network file) pass evidence identifier array of an application user;
C206. the system returns a vacation conversion certificate to the user, the certificate comprises the number of vacation days converted by the user, and the user submits the certificate to an administrator to finish the conversion of vacation NFT evidence into points.
Preferably, the step C3 includes the steps of:
C301. a user calls a useBatchVacations function in an intelligent contract and transmits a vacation NFT (network File transfer) certification identifier array, wherein the length of the array is more than or equal to 1;
C302. traversing the NFT certification identifier array by the intelligent contract, checking whether the owner of each NFT certification is the application user, if so, turning to the step C303, otherwise, returning to the step C301;
C303. the intelligent contract traverses the NFT pass identifier array, and sets the owner of each NFT pass to be null;
C304. the intelligent contract reduces the vacationBalances corresponding to the application user, and the number of the vacationBalances is equal to the length of the vacation NFT certification identifier array transmitted by the user;
C305. the intelligent contract triggers a UseBatchVacations event, and transmits an address identifier and a vacation NFT (network File transfer) certification identifier array of an application user;
C306. the system informs the application user that the vacation of the application is effective, the number of the vacation days is the length of a vacation NFT pass identifier array transmitted by the user, and the vacation NFT pass is converted into a real vacation.
The beneficial effects of the invention include:
1. the invention provides a vacation certification system and a method based on an improved block chain NFT protocol, which realize a batch NFT casting method by improving the original NFT protocol of an Etheng, and a user can realize batch NFT certification by calling an intelligent contract once, thereby saving a large amount of gas consumption for the user needing to cast NFT certification in batch; the frequent calling of the contracts is saved, and the time wasted due to the frequent calling of the contracts is saved for the user; different from the original NFT protocol, one-time batch casting of NFT general evidence operation only generates one transaction on an Etherhouse, and the transaction is not generated every time one general evidence is cast like the original NFT protocol, so that the improved NFT protocol can reduce the number of transactions in the Etherhouse and relieve the congestion problem of the Etherhouse to a certain extent.
2. The method is divided into three stages: the user management stage is responsible for logging or registering of the user, the vacation certification-passing stage is responsible for converting the vacation of the user into vacation NFT certification-passing, the vacation of the user can be converted into a vacation NFT certification-passing each day, and in the vacation certification-passing use stage, the user can select to convert the vacation NFT certification-passing into points or select to convert the vacation NFT certification-passing into a real vacation. Through the design of the three stages, the hierarchy of the vacation certification system is clearer, and by using the improved block chain NFT protocol, a user can convert a vacation of multiple days into multiple vacation NFT certificates in batch, each vacation NFT certificate has a unique identifier and an owner, and a manager can manage the vacation of the user more conveniently.
3. The invention provides a vacation certification system and a vacation certification method based on an improved block chain NFT protocol, and the method and the system are applied to a vacation management scene in a company or an enterprise, a manager can convert a vacation of an employee into a vacation NFT certification, each vacation of the employee corresponds to one vacation NFT certification, and each vacation NFT certification has a unique identifier and an owner. And the related data of the vacation NFT general evidence of the user are stored in the intelligent contract, so that the vacation management is more transparent, the staff can quantify the benefits brought by overtime, and the transparency of the vacation management system is improved.
Drawings
FIG. 1 is a schematic diagram of the system of the present invention.
FIG. 2 is a flow chart of the method of the present invention.
FIG. 3 is a diagram of the general activity of vacation in the example.
Fig. 4 is a diagram of the vacation general evidence using activity in the embodiment.
FIG. 5 is a graph comparing gas consumption for the NFT protocol and the modified NFT protocol in an embodiment.
FIG. 6 is a comparison of the number of transactions for the NFT protocol and the modified NFT protocol in an embodiment.
Fig. 7 is a pseudo-code diagram of the improved NFT protocol of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of embodiments of the present application, generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
The present invention is further described in detail below with reference to fig. 1 to 7:
the vacation certification system based on the improved block chain NFT protocol comprises a user management module, a vacation certification module and a vacation certification using module;
the user management module is used for logging in and registering a user, an administrator and a common user are arranged in the user management module, and corresponding operation authorities are respectively set for the administrator and the common user;
the vacation certification module is used for changing the vacation of the user into NFT certification by an administrator, each vacation of each user corresponds to one NFT certification mark, and the vacations of multiple days are converted into multiple NFT certificates in batch by utilizing an NFT protocol;
the vacation evidence-passing using module is used for enabling a user to use the owned vacation NFT evidence, and the user selects to convert the vacation NFT evidence into a real vacation or convert the vacation NFT evidence into a score, and the score can be used for exchanging employee benefits or used as an employee assessment index.
The vacation certification method based on the improved block chain NFT protocol comprises a user management stage, a vacation certification stage and a vacation certification use stage;
the user management phase comprises the following steps:
A1. the user logs in or registers by using an account and a password to enter the system;
A2. judging whether the user is an administrator or a common user, and if the user is the administrator, giving the user the permission to use the vacation certification-passing module and the vacation certification-passing module; if the user is a common user, only giving the user the permission to use the vacation pass-certificate use module;
A3. assigning a unique address identifier to each user;
A4. the user selects a module to be used according to all the authorities, if the vacation general certification module is to be used, the user enters B1, and if the vacation general certification module is to be used, the user enters C1;
the vacation certification stage comprises the following steps:
B1. the user applies for the administrator to convert the vacation days of the user into vacation NFT certificates, and each vacation corresponds to one vacation NFT certificate;
the step B1 comprises the following steps:
B101. the user puts forward a vacation certification-passing application to the administrator, and submits a duty certification of the user, and the number of days on duty is attached;
B102. the administrator checks whether the overtime proof is valid, if so, the administrator records the address identification of the application user and the valid overtime days, and the step B201 is entered; if not, the procedure returns to step B101.
B2. An administrator calls a mintBatchVacations function in an intelligent contract, transmits an address identifier of a user applying for and the number of vacations applying for, and converts the vacations of the user into NFT certificates in batches, wherein each vacation NFT certificate corresponds to an identifier;
the step B2 comprises the following steps:
B201. the administrator calls a mintBatchVacations function in the intelligent contract, and transmits the address identification of the user and the number of holiday days to be converted;
B202. the intelligent contract checks whether the incoming address identification and the vacation number are legal, if the address identification is not 0 address and the vacation number is more than 0, the step B203 is entered, otherwise, the step B201 is returned;
B203. the intelligent contract uses a built-in variable vacationCounter as an identifier of the vacation NFT pass, adds 1 to the vacationCounter when generating an NFT pass, and records the owner of the generated vacation NFT pass as the address identifier of the user;
B204. the smart contract repeats step B203 a number of times equal to the number of incoming vacations and records the generated vacation NFT permit identifier using an array vacationIds equal in length to the number of incoming vacation days.
B3. The intelligent contract increases the holiday balance of the user applying for, and the number is equal to the number of holidays applied by the user;
the step B3 comprises the following steps:
B301. the intelligent contract increases the vacationBalances corresponding to the application user, the number of the vacationBalances is equal to the number of the vacation periods of the application, and the increase of the vacation balance of the user is completed;
B302. the intelligent contract triggers a MintBatchVacations event, an incoming user's address identifier and a generated vacation NFT passport identifier array vacationIds;
B303. the system informs the user that the vacation certification applied by the user has been successfully executed and sends the user a vacation NFT certification identifier array vacateIds, and the length of the vacation NFT certification identifier array vacateIds is equal to the number of days of the vacation applied by the user.
The vacation general evidence using stage comprises the following steps:
C1. the user selects to convert the vacation NFT evidence into the integral or selects to convert the vacation NFT evidence into the real vacation, and if the user selects to convert the vacation NFT evidence into the integral, the C2 is entered; if the certification of the vacation NFT is converted into a real vacation, entering C3;
the step C1 comprises the following steps:
C101. the user calls a vacationBalanceof function in the intelligent contract, transmits an address identifier of the user, inquires the vacation NFT (network File transfer) certification balance, if the vacation certification balance is greater than 0, the step C102 is carried out, otherwise, the step C101 is carried out;
C102. the user selects to convert the vacation NFT evidence into the credit or selects to convert the vacation NFT evidence into the real vacation, if the user selects to convert the vacation NFT evidence into the credit, the step C201 is entered, and if the user selects to convert the vacation NFT evidence into the real vacation, the step C301 is entered.
C2. The user calls a withdraw function in the intelligent contract, a vacation NFT (network file transfer) permit identifier array is transmitted, the length of the array is more than or equal to 1, all the vacation balances of the user are reduced after the execution is finished, the vacation NFT permit is converted into points, and the points can be used for exchanging employee benefits or used as employee assessment indexes;
the step C2 comprises the following steps:
C201. a user calls a withdraw function in an intelligent contract and transmits a vacation NFT (network file) evidence-passing identifier array, wherein the length of the array is more than or equal to 1;
C202. traversing the NFT pass identifier array by the intelligent contract, checking whether the owner of each NFT pass is an application user, if so, turning to the step C203, otherwise, returning to the step C201;
C203. traversing the NFT permit identifier array by the intelligent contract, and setting the owner of each NFT permit to be null;
C204. the intelligent contract reduces the vacationBalances corresponding to the application user, and the number of the vacationBalances is equal to the length of the vacation NFT certification identifier array transmitted by the user;
C205. the intelligent contract triggers a Withdraw event, and transmits an address identifier and a vacation NFT (network file transfer) certification identifier array of an application user;
C206. the intelligent contract returns a vacation conversion certificate to the user, the certificate comprises the number of vacation days converted by the user, the user submits the certificate to an administrator, the vacation NFT certificate can be converted into points, and the points can be used for exchanging employee benefits or used as employee assessment indexes.
C3. The user calls a useBatchVacations function in the intelligent contract, transmits a vacation NFT (NFT) certification passing identifier array, the length of the array is more than or equal to 1, reduces all the vacation balances of the user after execution is finished, and finishes converting the vacation NFT certification passing into a real vacation;
the step C3 comprises the following steps:
C301. a user calls a useBatchVacations function in an intelligent contract and transmits a vacation NFT (network File transfer) certification passing identifier array, wherein the length of the array is more than or equal to 1;
C302. the intelligent contract traverses the NFT pass identifier array, checks whether the owner of each NFT pass is an application user, if so, the step C303 is carried out, otherwise, the step C301 is returned;
C303. traversing the NFT permit identifier array by the intelligent contract, and setting the owner of each NFT permit to be null;
C304. the intelligent contract reduces the vacationBalances corresponding to the application user, and the number of the vacationBalances is equal to the length of the vacation NFT certification identifier array transmitted by the user;
C305. the intelligent contract triggers a UseBatchVacations event, and transmits an address identifier and a vacation NFT (network name Table) certification identifier array of an application user;
C306. the system informs the application user that the vacation of the application is effective, the number of the vacation days is the length of a vacation NFT pass identifier array transmitted by the user, and the vacation NFT pass is converted into a real vacation.
The invention is improved based on NFT protocol, and the system is divided into three stages: the user management stage is responsible for logging or registering of the user, the vacation certification-passing stage is responsible for converting the vacation of the user into vacation NFT certification-passing, the vacation of the user can be converted into a vacation NFT certification-passing each day, and in the vacation certification-passing use stage, the user can select to convert the vacation NFT certification-passing into points or select to convert the vacation NFT certification-passing into a real vacation. The scheme realizes the batch casting of the NFT method by improving the original NFT protocol, saves a large amount of gas consumption and time consumed by frequently calling contracts for users, greatly reduces the required transaction number, and has a certain improvement effect on the congestion problem of the ether workshop. The administrator can convert the vacation of the employee into a vacation NFT permit, each vacation of the employee corresponds to one vacation NFT permit, each vacation NFT permit has a unique identifier and an owner, through the conversion, the administrator is convenient for the vacation management of the user, and the possible confusion condition in the vacation management process is reduced. The introduction of the intelligent contract also enables the vacation management to be more transparent, and the staff can also quantify the gains brought by overtime, so that the transparency of the vacation management system is improved.
On the basis, the invention can realize the following technical effects:
in this embodiment, as shown in fig. 2, the method includes a user management stage, a vacation certification stage, and a vacation certification use stage. The improvement of the NFT protocol is completed in a vacation certification stage, the original NFT protocol does not stipulate the NFT casting mode, and most NFT implementation modes on the market only can cast one NFT at a time for safety consideration, so that the time efficiency is low, and gas consumption is high. The invention improves the NFT protocol by realizing batch casting of NFT, and can realize casting of a plurality of NFTs by one contract call, and the identifier and the owner of each NFT are unique, and the data structure is the same as the original NFT protocol.
In this embodiment, as shown in fig. 2, the improvement of the NFT protocol of the present invention exists in the vacation certification phase, and the pseudo code of the improved NFT protocol is shown in fig. 7;
referring to FIG. 7, to is the address identifier of the user, and amount is the number of cast NFTs, and three internal variables of the intelligent contract are used: vacationBalanes, vacationOwners, and vacationCounter. Wherein, vacationBalances represents the vacation balance of the user and is a key value pair from address to integer; vacationOwners represents the owner of the vacation NFT certificate, and is a key-value pair from integer to address; the vacationCounter represents the identifier of the vacation NFT pass, i.e., the id of the NFT, and is an integer variable. The address in the variables is a special variable in the Etherhouse intelligent contract and represents an account, namely the unique ID of the user.
Through the pseudo code thought of fig. 7, the invention realizes the batch casting of NFTs, that is, casting of multiple NFTs can be realized through one-time calling of a contract function, and in a vacation management scenario, the NFTs are converted into a certification which can help users to cast vacation NFTs in batches. The data structure of each vacation NFT certificate is the same as that of a common NFT, the balance of an owner and a user of the NFT is recorded through two key value pairs of owner and balance, and the NFT batch casting method is realized by introducing a third variable vacationCounter. The contract built-in variable vacatecounter is a unique identifier of a vacation NFT pass, the identifier is increased by 1 each time the vacation NFT pass is generated, and the variable is a private variable, and a user can only change the value of the vacatecounter by calling a mintBatchVacations function and cannot directly modify the variable, so that the user cannot repeatedly cast the vacation NFT pass with the same identifier, and the safety of the contract is guaranteed.
The gas consumption and the transaction number of the vacation general certification system and method based on the improved block chain NFT protocol provided by the present invention are further described in the following two specific experimental examples.
(1) gas consumption
In the ether house, gas consumption can be understood as the overhead incurred by miners to validate and chain transactions, since chaining requires some overhead as the state of the blockchain needs to be modified. The user's interaction with the intelligent contract may also be viewed as a transaction from the user to the intelligent contract with additional data, i.e., the function to be called and its required parameters. Each intelligent contract has its own storage space and stores variables related to the contract, so that the functions in the contract are divided into two types, one is a function which consumes gas, and the other is a function which does not consume gas. The function consuming gas modifies the built-in variable in the contract, while the function not consuming gas only queries the built-in variable of the contract and does not modify the built-in variable. Therefore, the gas consumption is a key index for measuring the efficiency of the intelligent contract, the lower the gas consumption is, the less the overhead is generated, the number of operations executed in the intelligent contract is reduced, and the efficiency is higher as a whole.
In this embodiment, as shown in fig. 5, a gas consumption comparison between the improved NFT protocol of the present invention and the original NFT protocol is shown. It can be seen from the figure that the consumption of gas is much less than that of the original NFT protocol in the case of a larger number of NFTs to be cast by the batch NFT casting method of the present invention. It can also be seen from this figure that both gas consumption curves are straight lines, i.e., the gas consumption is linearly related to the number of cast NFTs.
The gas consumption of the original NFT protocol is in a linear relationship with the number of the cast NFTs, because only one NFT can be cast at a time in consideration of safety and practical application scenarios, and because the gas consumption of the NFT can be fixed in each time of casting the NFT, that is, calling the casting function in the smart contract, when a plurality of NFTs are to be cast, the casting function in the contract can be called only for a plurality of times, so that the final gas consumption and the number of the cast NFTs are in a linear relationship.
The gas consumption of the improved NFT protocol is linearly related to the number of the cast NFTs because in the improved NFT protocol, the batch casting NFT method is essentially implemented by a loop, and the termination condition of the control loop is the incoming parameter amount, i.e. the number of the cast NFTs, so that the loop will be done more than once every time the number of the cast NFTs is increased by one, and the statement to be executed in each loop is fixed, and the gas consumption thereof is also fixed, so that the final gas consumption and the number of the cast NFTs are linearly related. In consideration of application scenarios, in a vacation management scenario, NFT is cast in batch, that is, a user's vacation is converted into a vacation NFT general certificate in batch, each vacation corresponds to a vacation NFT general certificate, which is of practical significance, and the employee's vacation often has more than one day, and if the number of vacation days is large, gas consumption is greatly reduced compared with the original NFT protocol.
(2) Number of transactions
In the etherhouses, transactions are roughly divided into two types, one is a transaction between a user and a user, and the other is a transaction between a user and an intelligent contract. There are also two functions in a smart contract, one that will consume gas and the other that will not. If the user interacts with a function consuming gas in the intelligent contract, a transaction is generated each time the function is called; if a user interacts with a function that does not consume gas in the smart contract, no transaction is generated regardless of how the function is invoked.
In an etherhouse, a transaction requires a certain time from release to uplink, which depends on the total number of transactions and the speed of out-blocking within the same time. If the number of the transactions submitted to the whole network in the same time is small and the speed of the block output is high, the confirmation time of the transactions is relatively short, and on the contrary, the confirmation time of the transactions is relatively long. The ether house has a congestion problem nowadays, that is, the number of transactions in the whole network is too large, the speed of the outgoing block cannot catch up with the speed of the transaction generation, so that the acknowledgement time for a transaction to wait is very long, and if the user does not set a higher gas, the user may need to wait for several hours before the transaction is linked up.
In this embodiment, as shown in fig. 6, a comparison between the number of transactions of the improved NFT protocol and the original NFT protocol is shown. As can be seen from the figure, the original NFT protocol produces a new transaction for each NFT cast, while the modified NFT protocol can cast multiple NFTs in one transaction. Therefore, in the improved NFT protocol, no matter how many NFTs are cast, only one transaction is generated as long as the upper limit of gas set by the transaction is not exceeded; whereas in the original NFT protocol, one transaction is generated at a time when an NFT is cast, the number of transactions to improve the NFT protocol is much smaller than that of the original NFT protocol in terms of the number of transactions. Each transaction needs a certain time from sending to uplink, so that a plurality of NFTs can be cast by one transaction, thereby saving a great deal of waiting time for users; moreover, the number of interactions with the intelligent contracts is reduced, the number of transactions is also reduced, and the improvement can provide a certain relieving effect on the current congestion problem of the Ethermen.
The above embodiments only express specific embodiments of the present application, and the description is specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for those skilled in the art, without departing from the technical idea of the present application, several changes and modifications can be made, which all belong to the protection scope of the present application.

Claims (5)

1. The vacation certification method based on the improved block chain NFT protocol is characterized by comprising a vacation certification system based on the improved block chain NFT protocol, wherein the system comprises a user management module, a vacation certification module and a vacation certification using module;
the user management module is used for logging in and registering a user, an administrator and a common user are arranged in the user management module, and corresponding operation authorities are respectively set for the administrator and the common user;
the vacation certification-passing module is used for changing the vacation of the user into NFT certification-passing by an administrator, wherein each day of the vacation of each user corresponds to one NFT certification-passing identifier, and the vacation of multiple days is converted into multiple NFT certification-passing in batches by utilizing an NFT protocol;
the vacation pass-evidence using module is used for enabling a user to use the owned vacation NFT pass-evidence, and the user selects to convert the vacation NFT pass-evidence into a real vacation or convert the vacation NFT pass-evidence into a score, and the score can be used for exchanging employee benefits or used as an employee assessment index;
the method comprises a user management stage, a vacation certification stage and a vacation certification use stage;
the user management phase comprises the following steps:
A1. the user logs in or registers by using an account and a password to enter the system;
A2. judging whether the user is an administrator or a common user, and if the user is the administrator, giving the user the permission to use the vacation certification-based module and the vacation certification-based module; if the user is a common user, only giving the user the permission to use the vacation general evidence using module;
A3. assigning a unique address identifier to each user;
A4. the user selects a module to be used according to all the authorities, if the vacation general certification module is to be used, the user enters B1, and if the vacation general certification module is to be used, the user enters C1;
the vacation certification stage comprises the following steps:
B1. the user applies for the administrator, the holiday days of the user are converted into holiday NFT certificates, and each holiday corresponds to one holiday NFT certificate;
B2. an administrator calls a mintBatchVacations function in an intelligent contract, transmits an address identifier of a user applying for and the number of vacations applying for, and converts the vacations of the user into NFT certificates in batches, wherein each vacation NFT certificate corresponds to an identifier;
B3. the intelligent contract increases the holiday balance of the application user, and the number of the holiday balance is equal to the number of the holidays applied by the user;
the vacation general evidence using stage comprises the following steps:
C1. the user selects to convert the vacation NFT evidence into the integral or selects to convert the vacation NFT evidence into the real vacation, and if the user selects to convert the vacation NFT evidence into the integral, the C2 is entered; if the certification of the vacation NFT is converted into a real vacation, entering C3;
C2. the user calls a withdraw function in the intelligent contract, a vacation NFT (network file transfer) permit identifier array is transmitted, the length of the array is more than or equal to 1, all the vacation balances of the user are reduced after the execution is finished, the vacation NFT permit is converted into points, and the points can be used for exchanging employee benefits or used as employee assessment indexes;
C3. the user calls a useBatchVacations function in the intelligent contract, a vacation NFT (network File transfer) certification passing identifier array is transmitted, the length of the array is more than or equal to 1, all vacation balances of the user are reduced after execution is completed, and the vacation NFT certification passing is converted into a real vacation;
the step C2 comprises the following steps:
C201. a user calls a withdraw function in an intelligent contract and transmits a vacation NFT (network file) evidence-passing identifier array, wherein the length of the array is more than or equal to 1;
C202. traversing the NFT certification identifier array by the intelligent contract, checking whether the owner of each NFT certification is the application user, if so, turning to the step C203, otherwise, returning to the step C201;
C203. the intelligent contract traverses the NFT pass identifier array, and sets the owner of each NFT pass to be null;
C204. the intelligent contract reduces the vacationBalances corresponding to the application user, and the number of the vacationBalances is equal to the length of the vacation NFT certification identifier array transmitted by the user;
C205. the intelligent contract triggers a Withdraw event, and transmits an address identifier and a vacation NFT (network file) pass evidence identifier array of an application user;
C206. the intelligent contract returns a vacation conversion certificate to the user, the certificate comprises the number of vacation days converted by the user, and the user submits the certificate to an administrator to finish the conversion of the vacation NFT certificate into a score;
the step C3 comprises the following steps:
C301. a user calls a useBatchVacations function in an intelligent contract and transmits a vacation NFT (network File transfer) certification identifier array, wherein the length of the array is more than or equal to 1;
C302. the intelligent contract traverses the NFT pass identifier array, checks whether the owner of each NFT pass is an application user, if so, the step C303 is carried out, otherwise, the step C301 is returned;
C303. traversing the NFT permit identifier array by the intelligent contract, and setting the owner of each NFT permit to be null;
C304. the intelligent contract reduces the vacationBalances corresponding to the application user, and the number of the vacationBalances is equal to the length of the vacation NFT certification identifier array transmitted by the user;
C305. the intelligent contract triggers a UseBatchVacations event, and transmits an address identifier and a vacation NFT (network File transfer) certification identifier array of an application user;
C306. the system informs the application user that the vacation of the application is effective, the number of the vacation days is the length of a vacation NFT pass identifier array transmitted by the user, and the vacation NFT pass is converted into a real vacation.
2. The method according to claim 1, wherein said step B1 comprises the following steps:
B101. the user puts forward a vacation general certification application to the administrator, and submits a duty certification of the user, and the number of days on duty is attached;
B102. b, the administrator checks whether the overtime proof is valid, if so, the address identification of the application user and the valid overtime days are recorded, and the step B2 is entered; if not, the procedure returns to step B101.
3. The method according to claim 1, wherein said step B2 comprises the following steps:
B201. the administrator calls a mintBatchVacations function in the intelligent contract, and transmits the address identification of the user and the number of holiday days to be converted;
B202. the intelligent contract checks whether the incoming address identification and the vacation number are legal, if the address identification is not 0 address and the vacation number is more than 0, the step B203 is entered, otherwise, the step B201 is returned;
B203. the intelligent contract uses a built-in variable vacationCounter as an identifier of a vacation NFT pass, adds 1 to the vacationCounter when generating an NFT pass, and records the owner of the generated vacation NFT pass as the address identifier of the user;
B204. the intelligent contract repeats step B203 a number of times equal to the number of incoming vacations and notes the generated vacation NFT pass-through identifier with an array vacationIds equal in length to the number of incoming vacation days.
4. The method according to claim 1, wherein said step B3 comprises the following steps:
B301. adding vacationBalances corresponding to the application user by the intelligent contract, wherein the number of the vacationBalances is equal to the number of the vacation of the application, and finishing the increase of the vacation balance of the user;
B302. the intelligent contract triggers a mintbatcchvacations event, an incoming user's address identifier and a generated vacation NFT currency identifier array vacationIds;
B303. the system informs the user that the vacation certification applied by the user has been successfully executed and sends the user a vacation NFT certification identifier array vacatedIds, wherein the length of the vacation NFT certification identifier array vacatedIds is equal to the number of vacation days applied by the user.
5. The method according to claim 1, wherein said step C1 comprises the following steps:
C101. a user calls a vacationBalanceof function in the intelligent contract, transmits an address identifier of the user into the intelligent contract, inquires the vacation NFT (network File transfer) certification balance, and if the vacation certification balance is more than 0, the method enters a step C102, otherwise, the method returns to the step 101;
C102. and C2, if the user selects to convert the vacation NFT evidence into the integral or selects to convert the vacation NFT evidence into the real vacation, the step C2 is carried out, and if the user selects to convert the vacation NFT evidence into the real vacation, the step C3 is carried out.
CN202210846856.5A 2022-07-05 2022-07-05 Vacation general certification system and method based on improved block chain NFT protocol Active CN115130136B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210846856.5A CN115130136B (en) 2022-07-05 2022-07-05 Vacation general certification system and method based on improved block chain NFT protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210846856.5A CN115130136B (en) 2022-07-05 2022-07-05 Vacation general certification system and method based on improved block chain NFT protocol

Publications (2)

Publication Number Publication Date
CN115130136A CN115130136A (en) 2022-09-30
CN115130136B true CN115130136B (en) 2023-03-28

Family

ID=83383134

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210846856.5A Active CN115130136B (en) 2022-07-05 2022-07-05 Vacation general certification system and method based on improved block chain NFT protocol

Country Status (1)

Country Link
CN (1) CN115130136B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109767188A (en) * 2018-12-29 2019-05-17 百度在线网络技术(北京)有限公司 Employee inspiration method, apparatus, equipment and storage medium based on block chain
WO2020016792A1 (en) * 2018-07-19 2020-01-23 Asia Top Loyalty Limited A method of loyalty exchange transaction by using blockchain for reward point exchange
CN114372293A (en) * 2021-12-01 2022-04-19 北京众享比特科技有限公司 Block chain based data approval method, device, equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
BR112018016805A2 (en) * 2016-02-23 2018-12-26 Nchain Holdings Ltd method and system for efficient cryptocurrency transfer associated with a payment on a blockchain that leads to an automated payment, smart contract-based method and system
US20200065899A1 (en) * 2018-08-23 2020-02-27 GET IT FIRST, Inc. Item market place in blockchain environment
CN111126974A (en) * 2019-12-03 2020-05-08 贾沛颐 Data interaction system based on block chain technology

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020016792A1 (en) * 2018-07-19 2020-01-23 Asia Top Loyalty Limited A method of loyalty exchange transaction by using blockchain for reward point exchange
CN109767188A (en) * 2018-12-29 2019-05-17 百度在线网络技术(北京)有限公司 Employee inspiration method, apparatus, equipment and storage medium based on block chain
CN114372293A (en) * 2021-12-01 2022-04-19 北京众享比特科技有限公司 Block chain based data approval method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN115130136A (en) 2022-09-30

Similar Documents

Publication Publication Date Title
US7184985B2 (en) Method, system, and apparatus for providing secure access to a digital work
WO2019055585A1 (en) Parallel-chain architecture for blockchain systems
CN113438084B (en) Green power source tracing method and system based on R-PBFT consensus algorithm and timestamp
CN103067406A (en) Access control system and access control method between public cloud and private cloud
CN109768961A (en) Wechat small routine login method, device and the storage medium led to based on an account
CN101873333B (en) Enterprise data maintenance method, device and system based on banking system
CN110471951A (en) Determine the method for the sequence of Transaction Information, accounting nodes and medium in data block
CN111800434A (en) Multi-channel asset docking platform and working method thereof
US20200349556A1 (en) Methods and devices for managing access to account in blockchain system
US20230126408A1 (en) Resource allocating and scheduling for a network
CN111581278B (en) Warehouse order circulation system and method based on block chain technology
CN113379485B (en) Hash algorithm and secondary quotation-based demand response bidding transaction method and system
CN201733328U (en) Enterprise data maintaining device and system based on bank system
CN110084977A (en) Self-service query method, system, computer equipment and the storage medium of Immovable Property Registration information
CN115130136B (en) Vacation general certification system and method based on improved block chain NFT protocol
Cardelli et al. Digital social contracts: a foundation for an egalitarian and just digital society
CN110210307A (en) Face Sample Storehouse dispositions method is based on recognition of face method for processing business and device
CN107609870A (en) More application key management method, system and POS terminals for POS
CN116860856A (en) Financial data processing method and device, computer equipment and storage medium
CN111553496A (en) Electronic warranty list management system based on alliance block chain
CN111291048A (en) Data processing system
US20220311595A1 (en) Reducing transaction aborts in execute-order-validate blockchain models
CN114549149A (en) Smart grid energy transaction data processing method and device and computer equipment
WO2021000488A1 (en) Automatic data importing method, device, and computer readable storage medium
CN112685451A (en) Data query processing method and device, computer equipment and storage medium

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