| Proof-of-work,as the core technology of public blockchain,requires users to pay a certain amount of work in order to create new blocks by competition.This article innovatively applies it to the train ticket market,and introduces such a mechanism at the interface of the ticketing system to prevent the system from being attacked.Based on the background of China’s internet train ticketing system,this paper analyzes the internal and external attacks on the system,designs an algorithm based on proof-of-work,and expands according to the geographical location,credit rating,and system load based on different problems.However,there is a big difference in CPU performance between different computer devices,leading to the difficulty for some users with insufficient computing power to buy tickets.The time difference in accessing the memory has the same algorithm complexity.Therefore,the algorithm that was previously limited to the CPU needs to be adjusted to Memory-bound algorithms.The results show that the application of memory-bound proof-of-work algorithm in the ticket purchasing market can better balance the difficulty of buying tickets and resist external attacks,so as to satisfy most people’s ticket requirements and ease the pressure of Spring Festival travel.Blockchain technology uses a well-designed consensus algorithm protocol in Internet financial transaction systems that users do not trust each other.Without transaction centers,they can verify the legitimacy of each transaction and use a blockchain ledger that cannot be tampered to record all transaction information to ensure that the transactions are safe and efficient.However,blocks are slow to generate and the chain fault tolerance rate is not high in the existing consensus mechanism.The system consumes a large amount of computing resources to obtain a few benefits,resulting in waste of resources and inefficiency.There are similar problems in the ticket market which blockchain applies in.This paper also designs a new blockchain hybrid consensus mechanism to meet the needs of the ticket market,introduces a new hybrid consensus mechanism,and the mechanism divides consensus into equal time.During the work phase,each work cycle uses NewPOS to generate the ticketing committee,and then runs the CPU-bound proof-of-work algorithm in the ticketing committee.The hybrid algorithm generates blocks with higher efficiency and less consumption of resources,and plays an important role in the ticketing system. |