Disclosure of Invention
In order to solve the technical problems, the invention provides a point system, a point device, a storage medium and an operation method thereof based on a block chain. The technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a block chain-based scoring system, including a client and a scoring service processor;
the client is used for sending information to the credit service processor and checking the credit account status;
the credit service processor comprises a login module, and the login module is used for:
responding to a client login request, and acquiring a user number and an account password input by the client;
verifying the account password; if the verification is successful, calling the intelligent contract, and meanwhile accumulating the login times on the block;
converting the accumulated login times into integrals according to integral rules preset by the intelligent contract;
and transferring the points to a user account corresponding to the user number.
In a first possible implementation manner of the first aspect of the present invention, the credit service processor further includes a development module, where the development module is configured to:
compiling the integration rule into an intelligent contract code through an editing tool solc;
deploying the intelligent contract codes and objects and functions interacting with the blockchain to generate intelligent contract addresses; the functions that can be implemented by the objects and functions interacting with the blockchain include viewing network status, viewing local accounts, viewing transactions and blocks, sending transactions, compiling/deploying intelligent contracts, and invoking intelligent contracts.
In a second possible implementation manner of the first aspect of the present invention, the credit service processor further includes a registration module, where the registration module is configured to:
acquiring a registration request containing a mobile phone number sent by a client;
sending a short message verification code according to the mobile phone number, and waiting for verification;
and if the verification is successful, acquiring the account password input by the client, and simultaneously generating the intelligent contract corresponding to the account password.
In a third possible implementation manner of the first aspect of the present invention, the registration module further includes a bonus point calculation module, and the bonus point calculation module is configured to:
judging an operator of the mobile phone number; judging the operator to which the mobile phone number belongs according to the first three digits of the mobile phone number, and if the mobile phone number does not belong to any operator, returning failure;
and transferring the reward points to the user account according to the operator of the mobile phone number.
In a second aspect, an embodiment of the present invention provides an integral system operation method based on a block chain, including:
responding to a client login request, and acquiring a user number and an account password input by the client;
verifying the account password; if the verification is successful, calling the intelligent contract, and meanwhile accumulating the login times on the block;
converting the accumulated login times into integrals according to integral rules preset by the intelligent contract;
and transferring the points to a user account corresponding to the user number.
In a first possible implementation manner of the second aspect of the present invention, the integration rule may be set in the smart contract by:
compiling the integration rule into an intelligent contract code through an editing tool solc;
deploying the intelligent contract codes and objects and functions interacting with the blockchain to generate intelligent contract addresses; the functions that can be implemented by the objects and functions interacting with the blockchain include viewing network status, viewing local accounts, viewing transactions and blocks, sending transactions, compiling/deploying smart contracts, and invoking smart contracts.
In a second possible implementation manner of the second aspect of the present invention, the method for operating a score system based on a blockchain further includes registering a user account, and the specific steps are as follows:
acquiring a registration request containing a mobile phone number sent by a client;
sending a short message verification code according to the mobile phone number, and waiting for verification;
and if the verification is successful, acquiring the account password input by the client, and simultaneously generating the intelligent contract corresponding to the account password.
In a third possible implementation manner of the second aspect of the present invention, the acquiring a registration request including a mobile phone number sent by a client further includes:
judging an operator of the mobile phone number; judging the operator to which the mobile phone number belongs according to the first three digits of the mobile phone number, and if the mobile phone number does not belong to any operator, returning failure;
and transferring the reward points to the user account according to the operator of the mobile phone number.
In a third aspect, an embodiment of the present invention provides a block chain based integration apparatus, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor, when executing the computer program, implements the block chain based integration system operation method as described above.
In a fourth aspect, an embodiment of the present invention provides a storage medium of a block chain based integral system operation method, where the storage medium is used to store one or more computer programs, and the one or more computer programs include program code for executing the above block chain based integral system operation method when the computer programs are executed on a computer.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
the invention provides a block chain-based score system, a block chain-based score device, a block chain-based score storage medium and an operation method of the block chain-based score system, the block chain-based score device, the block chain-based score storage medium and the operation method of the block chain-based score storage medium. Meanwhile, once data or information such as point data, login times, point rules and the like are recorded in the blocks and uploaded to the block chain, the data on the block chain can be stored in a server accessed to the network by utilizing the characteristic of distributed data storage of the block chain technology, so that the data on the chain is difficult to lose and tamper.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides an exemplary embodiment, a block chain-based scoring system, which comprises a client and a scoring service processor, wherein the client is connected with the scoring service processor;
the client is used for sending information to the credit service processor and checking the credit account status;
the credit service processor comprises a login module, and the login module is used for:
responding to a client login request, and acquiring a user number and an account password input by the client;
verifying the account password; if the verification is successful, calling the intelligent contract, and meanwhile accumulating the login times on the block;
converting the accumulated login times into integrals according to integral rules preset by the intelligent contract;
for example, 10 points are awarded for every 100 full cumulative times; the preset integration rule is as follows:
and (3) calculating the login times of the day: judging the time of the day, if the time is not the same day as the last login time, resetting the login times of the day, and then adding 1 to the login times of the day;
and (3) calculating the login times in the week: when the week time is judged, if the week time is different from the last login time, the Zhou Denglu times are cleared, and then the login times of the week are added by 1;
and (3) calculating the login times in the month: judging the current month time, if the current month time is different from the last login time, resetting the login times in the current month, and then adding 1 to the login times in the current month;
and (3) calculating the accumulated login times: adding 1 to the accumulated login times;
and (3) calculating the login integral of the current day: if the login times of the day are 1 st time, 10 points are awarded, and the 10 th time is awarded for 5 points. Others are not rewarded;
and (3) logging in and integral calculation in the week: if the number of login times in the week is 10 th, 10 points are awarded, and the 20 th is awarded for 5 points. Others are not awarded;
and (3) calculating the login integral in the month: if the number of login times in the week is 20, 10 points are awarded, and the 30 th point is awarded for 5 points. Others are not rewarded;
and transferring the points to a user account corresponding to the user number.
Referring to fig. 1, the client includes APP (application), wechat, web, and the like.
The credit service processor further comprises a development module, wherein the development module is used for:
compiling the integration rule into an intelligent contract code through an editing tool solc;
deploying the intelligent contract codes and objects and functions interacting with the blockchain to generate intelligent contract addresses; the functions that can be implemented by the objects and functions interacting with the blockchain include viewing network status, viewing local accounts, viewing transactions and blocks, sending transactions, compiling/deploying intelligent contracts, and invoking intelligent contracts.
Specifically, the composition of the intelligent contract code includes a combination of web3.Js + character codes.
Please refer to fig. 2 and 3, web3.Js is a Javascript library provided by etherhouses, which encapsulates JSON, RPC, API of etherhouses, and provides a series of Javascript objects and functions that interact with blockchains, including viewing network status, viewing local accounts, viewing transactions and blocks, sending transactions, compiling/deploying smart contracts, calling smart contracts, etc., of which the most important is the API that interacts with the smart contracts.
An intelligent contract is essentially a piece of code that is deployed to a blockchain. Because the code (strictly speaking, binary code) on the blockchain can be viewed, it is open transparent. When an intelligent contract is deployed on a chain, it creates a contract address that is permanently present in a block in the chain.
It is understood that, before generating the smart contract address, the method further comprises:
and testing the intelligent contract codes.
The credit service processor further comprises a registration module, and the registration module is used for:
acquiring a registration request containing a mobile phone number sent by a client;
sending a short message verification code according to the mobile phone number, and waiting for verification;
and if the verification is successful, acquiring the account password input by the client, and simultaneously generating the intelligent contract corresponding to the account password.
It will be appreciated that the smart contract may also maintain account opening information, transaction times, etc. for the client.
The registration module further comprises a bonus point calculation module for:
judging the legality of the mobile phone number; if the number of the mobile phone number is not eleven, returning to fail;
judging an operator of the mobile phone number; judging the operator to which the mobile phone number belongs according to the first three digits of the mobile phone number, and if the mobile phone number does not belong to any operator, returning failure;
according to the operator of the mobile phone number, transfer the bonus points to the user account.
Specific integration rules are referenced below:
telecom operator credit rewards: if the user number is a telecom operator, the point reward is assigned with 100 points;
mobile operator credit rewards; if the user number is the mobile operator, the point reward is assigned with 10 points;
communicating operator credit rewards; if the user number is a unicom operator, the point reward is assigned a value of 10 points.
The reward point calculation module is further configured to:
acquiring a recommendation number;
judging whether the recommended number exists or not;
judging an operator of the recommended number; judging the operator to which the recommended number belongs according to the first three digits of the recommended number, and ending if the recommended number does not belong to any operator; if the success is achieved, continuing the next step;
and transferring the reward points to the account corresponding to the recommended number according to a preset point rule.
Specific integration rules are referenced below:
if the recommended number is a telecommunication operator number, if the registered user is a telecommunication user, awarding 100 points by the points, otherwise, awarding 10 points by the points;
if the recommended number is a mobile operator number, if the registered user is a telecommunication user, the credit is awarded for 500 credits, otherwise, the credit is awarded for 10 credits;
if the recommendation number is a Unicom operator number, the registered user awards 500 points if the registered user is a telecom user, otherwise the points award 10 points.
Referring to fig. 4, an exemplary embodiment of a method for operating an integral system based on a blockchain according to the present invention includes the steps of:
responding to a client login request, and acquiring a user number and an account password input by the client;
verifying the account password; if the verification is successful, calling the intelligent contract, and meanwhile accumulating the login times on the block;
converting the accumulated login times into integrals according to integral rules preset by the intelligent contract;
for example, 10 points are awarded for every 100 full cumulative times; the preset integration rule is as follows:
and (3) calculating the login times of the day: judging the time of the day, if the time is not the same day as the last login time, resetting the login times of the day, and then adding 1 to the login times of the day;
and (3) calculating the login times in the week: when the week time is judged, if the week time is different from the last login time, the Zhou Denglu times are cleared, and then the login times of the week are added by 1;
and (3) calculating the login times in the month: judging the current month time, if the current month time is different from the last login time, resetting the login times in the current month, and then adding 1 to the login times in the current month;
and (3) calculating the accumulated login times: adding 1 to the accumulated login times;
and (3) calculating the login integral on the same day: if the login times of the day are 1 st time, 10 points are awarded, and the 10 th time is awarded for 5 points. Others are not rewarded;
and (3) logging in and integral calculation in the week: if the number of login times in the week is 10 th, 10 points are awarded, and the 20 th is awarded for 5 points. Others are not rewarded;
and (3) calculating the login integral in the month: if the number of login times in the week is 20, 10 points are awarded, and the 30 th point is awarded for 5 points. Others are not rewarded;
and transferring the points to a user account corresponding to the user number.
Preferably, the integration rule may be set in the smart contract by:
compiling the integration rule into an intelligent contract code through an editing tool solc;
deploying the intelligent contract codes and objects and functions interacting with the blockchain to generate intelligent contract addresses; the functions that can be implemented by the objects and functions interacting with the blockchain include viewing network status, viewing local accounts, viewing transactions and blocks, sending transactions, compiling/deploying intelligent contracts, and invoking intelligent contracts.
Specifically, the composition of the intelligent contract code includes a combination of web3.Js + character codes.
Js is a Javascript library provided by etherhouses, encapsulates JSON, RPC and API of etherhouses, and provides a series of Javascript objects and functions interacting with a block chain, including viewing network status, viewing local accounts, viewing transactions and blocks, sending transactions, compiling/deploying intelligent contracts, calling intelligent contracts and the like, wherein the most important is API interacting with the intelligent contracts.
An intelligent contract is essentially a piece of code that is deployed to a blockchain. Because the code on the blockchain (strictly speaking, binary code) can be viewed, it is open transparent. When an intelligent contract is deployed on a chain, it creates a contract address that is permanently present in a block in the chain.
It is understood that, before generating the smart contract address, the method further comprises:
and testing the intelligent contract codes.
The running method of the integral system based on the block chain also comprises the step of registering a user account, and the specific steps are as follows:
acquiring a registration request containing a mobile phone number sent by a client;
sending a short message verification code according to the mobile phone number, and waiting for verification;
and if the verification is successful, acquiring the account password input by the client, and simultaneously generating the intelligent contract corresponding to the account password.
It will be appreciated that the smart contract may also hold account opening information, transaction times, etc. for the client.
The method for acquiring the registration request containing the mobile phone number sent by the client further comprises the following steps:
judging the legality of the mobile phone number; if the number of the mobile phone number is not eleven, returning to fail;
judging an operator of the mobile phone number; judging the operator to which the mobile phone number belongs according to the first three digits of the mobile phone number, and if the mobile phone number does not belong to any operator, returning failure;
and transferring the reward points to the user account according to the operator of the mobile phone number.
Specific integration rules are referenced below:
telecom operator credit rewards: if the user number is the telecom operator, the point reward is assigned with 100 points;
mobile operator credit rewards; if the user number is the mobile operator, the point reward is assigned with 10 points;
communicating operator credit rewards; if the user number is a unicom operator, the point reward is assigned 10 points.
The method for acquiring the registration request containing the mobile phone number sent by the client further comprises the following steps:
acquiring a recommendation number;
judging whether the recommended number exists or not;
judging an operator of the recommended number; judging the operator to which the recommended number belongs according to the first three digits of the recommended number, and ending if the recommended number does not belong to any operator; if the success is achieved, continuing the next step;
and transferring the reward points to the account corresponding to the recommended number according to a preset point rule.
Specific integration rules are referenced below:
if the recommended number is a telecommunication operator number, if the registered user is a telecommunication user, the credit is awarded to 100 points, otherwise, the credit is awarded to 10 points;
if the recommended number is a mobile operator number, if the registered user is a telecommunication user, the credit is awarded for 500 credits, otherwise, the credit is awarded for 10 credits;
if the recommendation number is a Unicom operator number, the registered user awards 500 points if the registered user is a telecom user, otherwise the points award 10 points.
An embodiment of the present invention provides a block chain based integration apparatus, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the block chain based integration system operation method as described above is implemented.
The present invention provides an exemplary embodiment, a storage medium of a method for blockchain-based bonus system operation, the storage medium for the method for blockchain-based bonus system operation for storing one or more computer programs, the one or more computer programs comprising program code for performing the method for blockchain-based bonus system operation when the computer program runs on a computer.
The computer readable media of the embodiments of the present application may be computer readable signal media or computer readable storage media or any combination of the two. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM). Additionally, the computer-readable storage medium may even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware that is related to instructions of a program, and the program may be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The invention provides a block chain-based score system, a block chain-based score device, a block chain-based score storage medium and an operation method of the block chain-based score system, the block chain-based score device, the block chain-based score storage medium and the operation method of the block chain-based score storage medium. Meanwhile, once data or information such as point data, login times, point rules and the like are recorded in the blocks and uploaded to the block chain, the data on the block chain can be stored in a server accessed to the network by utilizing the characteristic of distributed data storage of the block chain technology, so that the data on the chain is difficult to lose and tamper.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.