| China has fully entered an aging society,and the elderly care industry has become a sunrise industry.With the increasing aging population,traditional elderly care models no longer meet people’s needs,and smart pension is a better solution.Faced with the increasing aging population,smart pension cloud platforms increasingly need the ability to efficiently and stably handle transactions in highly concurrent environments.This thesis is based on the existing smart pension cloud platform in the laboratory.The existing distributed transaction management system of the smart pension cloud platform is built based on the ZAB protocol,which ensures data consistency.However,with the increase of the concurrency of the smart pension cloud platform,the availability of the original distributed transaction management system in a high concurrency environment is challenged.In order to address such challenges,the transaction management system cluster in the smart pension cloud platform in this thesis is built based on the Raft protocol,and improvements have been made in two important stages of the original Raft protocol.A design and implementation scheme for the clustering model of the transaction management system in the smart pension cloud platform is proposed.The main innovations and achievements of this thesis are as follows:1.In order to avoid the problem of a large number of cluster nodes in the transaction management system of the smart pension cloud platform,which may result in the cluster being unavailable for a long time after the leader node goes down,this article improves the election stage after the leader node goes down in the Raft protocol and proposes a waiting mechanism for selective voting.By adding a waiting mechanism,the probability of dividing votes during the election phase is greatly reduced,thereby reducing the time when the cluster is unavailable after the main node goes down.After theoretical analysis and experimental testing,it was found that when the number of nodes is large,the improved election stage can reduce the unavailable time of more than half of the clusters,which is more advantageous compared to before the improvement.2.In order to avoid the problem of log blocking caused by low log replication efficiency in high concurrency environments of the transaction management system cluster in the smart pension cloud platform,this article has made improvements in the log replication phase of the Raft protocol.By setting the log buffer,the buffering and diversion of a large number of logs in a short period of time has been achieved,effectively solving the problem of log heap blocking.After experimental comparison,the efficiency of the improved log replication stage has been greatly improved in high concurrency environments.3.Considering the relatively narrow bandwidth in the smart pension cloud platform and the low query efficiency of existing ID information in high concurrency environments,this article refers to the generation strategy of Baidu’s open-source snowflake like algorithm UidGenerator and designs and implements a new snowflake like algorithm.This algorithm can reduce the number of fields transmitted during the log replication phase by uniquely designing the structure of ID information,thereby more effectively utilizing bandwidth,The ID information generated by this algorithm improves query efficiency,and the service life of the ID generator in the smart pension cloud platform has also increased to a certain extent.The clustered model of the transaction management system designed and implemented in this thesis has been deployed and launched on the smart pension cloud platform,effectively solving some practical problems and having certain value in engineering. |