| With the arrival of "Made in China 2025",China’s manufacturing industry has officially entered a new stage of digitalization,networking and intelligence.More and more enterprises have begun to use different industrial software to improve production efficiency and reduce costs.However,there are many kinds of industrial software,and data needs to be exchanged between multiple systems.The interface specifications provided by different systems are different,and there are a lot of repeated development.In addition,how to transmit business information efficiently,safely and stably between different systems has become an urgent demand to be solved.Therefore,the design and implementation of API gateway in the industrial Internet scenario is of great significance to simplify system docking and ensure data security.First of all,to solve the problem of interface specifications,this thesis realizes standardization through unified calling method,unified protocol and unified style specification.Based on Netty network programming framework,requests are processed asynchronously.And protocol conversion is realized through JsonPath expression.Finally a Rest style interface is provided externally.Secondly,to solve the problem of data transmission,the API gateway designed in this thesis implements some general functions,such as flow control,authentication,data cache,system monitoring,etc.They ensures efficient,safe and stable data transmission.At the same time,the background management system is implemented to facilitate operation,maintenance and management.With the increasing number of requests,the cache hit rate in the API gateway becomes lower and lower.Then the cache becomes the performance bottleneck of the system.To solve this problem,this thesis designs a rate-dependent bloom filter.The bottom layer uses bit group storage,and dynamically expands the array length according to the rate of request arrival.The experiment shows that the improved bloom filter has a lower false positive rate.By applying it to the API gateway,it can improve the cache hit rate and reduce the response delay of the API gateway.Finally,this thesis tests each functional module of the API gateway,and several performance indicators.The test results show that the API gateway designed in this thesis is not only practical for industrial software data interaction,but also has good performance. |