1 Introduction

The supply chain is a collection made up of multiple systems, and a change in a factor can lead to an imbalance in the supply chain [1]. However, with the continuous development of computer technology, the use of computer technology in the supply chain can help us solve a lot of problems. The use of computational principles of dynamics in solving the problems of supply chain, and the design of the Internet of things method based on two-level supply chain dynamics are the main research topics [2]. Through the precise calculation and analysis by using the dynamics, the balance point in the two-level supply chain is found, so that it will enable the Internet of things system to play a greater role. The precise calculation process of external dynamics will make up for what people need to improve in the Internet of things, and reduce the difficulty of human labor. But the problems faced are still grim [3].

However, at present, the authors of this paper are not very close to the dynamics research, and the development of the two-level supply chain is not very mature. It is difficult to implement the development plan of Internet of things based on the two-level supply chain dynamics, and a small detail with bad handling may lead to the failure of our entire project [4]. However, in this paper, through detailed researches and the precision calculation of dynamics, the feasibility of the scheme was studied in detail. It can not only broaden the application scope of dynamics, but also make the two-level supply chain develop stably for a long time, thus providing an impetus for the high-speed development of the Internet of things in China. The computational results and structures of the refined theorems optimize the calculation steps and calculation methods, thus greatly improving the computational efficiency of dynamics [5]. On the other hand, it also promotes the rapid development of the Internet of things, and improves the operation ability of the Internet of things.

2 State of the Art

The study of supply chain dynamics was firstly conducted in the 60s and 70s of last century, and it began at Massachusetts Institute of Technology. In the book of “industrial dynamics”, it makes a long introduction to supply chain dynamics, which is also the beginning of supply chain dynamics. But the word was firstly put forward in the early 90s of the last century [6]. It is used to solve the inventory time and production delays and other problems, and it also provides a great impetus to the development of Internet of things and helps the Internet of things to broaden the application channels, which is a popular research direction at home and abroad. At present, the development in foreign countries has reached a stage of application, and a variety of theoretical researches are relatively mature, which has become an indispensable research method in people’s life [7]. However, the calculation of the two-level supply chain dynamics still has a little insufficient, and foreign countries are also in a research stage, which has not yet been applied and realized [8].

For the domestic research, supply chain dynamics is a new term. Domestic supply chain dynamics was introduced into China at the end of last century, and its development time was short, and there was no profound research in the same field of course. But fortunately, it is noticed and developed vigorously, so it is growing very fast [9]. The research on the two-level supply chain dynamics seems to be a little insufficient, and there is little research on the two-level supply chain in China. Basically, there are no long-time studies by experts and scholars, but it is thought that the study of supply chain dynamics is at the end, and it is necessary to focus on the study of two-level supply chain dynamics, and strive to catch up with foreign countries in the same field, so that China will become the direction of development [10].

3 Methodology

3.1 Operation Analysis of Two-Level Supply Chain Dynamics

In today’s economic integration, the circulation of goods has not been restricted by the region, but the requirement for supply chain is even higher. In this paper, an Internet of things program based on two-level supply chain dynamics was established. The two-level supply chain system model is shown in Fig. 1.

Fig. 1
figure 1

Two-level supply chain system model

From the picture above, it can be seen that this two-level supply chain is actually a kind of supply chain with goods and information. Suppliers deliver raw materials to manufacturers for processing and manufacturing, then the product produced by the manufacturer is delivered to the retailer through logistics, and the product is purchased by the customer finally. Thus, the operation of a supply chain is completed. Then, the customer’s market demand will be collected by retailers, and then retailers will summarize and analyze the market demand of the goods according to the information, and then make orders for the manufacturer. The manufacturer submits the raw material order to the supplier according to the retailer’s production order, then the supplier delivers the goods to the manufacturer according to the raw material order, thus, the joint operation of the two supply chains is completed. In this way, they can reduce the waste and achieve the purchase through the actual needs, which can not only save money, but also reduce the pressure of logistics operation. It is also a top-down transfer model of goods, and the transparency of information is realized. Inventory management and control of manufacturers and retailers are based on the market demand, and the demand planning or ordering plan is developed according to the inventory levels, which greatly reduces the deviation caused by demand forecasting. As shown in Fig. 2, the gap is what the authors should make up for.

Fig. 2
figure 2

Demand and supply deviation

This deviation needs to be calculated and analyzed by the principle of dynamics, and the market demand should also be consistent with the quantity of manufacturer’s orders. It is necessary to sort out the difference between the movement of the logistics and the time of the information transmission, calculate the difference and make up the distribution by the form of algorithm. This requires us to establish an information center, the overall planning and integration are achieved here through the calculation, and the algorithm research is used for complement, so as to ensure the accuracy and smoothness of information and the veracity of algorithm in calculating data. The planned smoothing time, inventory turnaround time and other times are integrated for planning, which is mainly to eliminate the time difference caused by various delays. Through the analysis of the algorithm, the information is predicted ahead of time, and it is also necessary to control the delivery delay of the manufacturer to the retailer and the time delay of the processing of the manufacturer, so as to ensure that the quantity of the goods is in conformity with the demand of the commodity. The main aspect of this algorithm is to eliminate the time error, and as long as this point is grasped, it can be ensured that the algorithm does not make a mistake in calculation, so as to ensure that the computing time and the calculation of the content can meet the requirements of use, thus achieving the co-ordination of the logistics and all aspects. This requires us to highly grasp the accuracy of information, then, the algorithm of two-level supply chain dynamics will be analyzed.

3.2 Mathematical Model Analysis of Two-Level Supply Chain Dynamics

Firstly, the meaning of various calculation formulas of the algorithm should be introduced. The meaning of various symbols should be introduced firstly, and because there are too many symbols, they are introduced in Table 1, so that it will be clearer, and it is easier to find the meaning of symbols.

Table 1 Symbols in the formula table

The above table has already introduced the required parameter symbols, then the next step is to start the analysis of the specific formula of the algorithm.

For the study of supply chain system, the first thing we need to do is to introduce the inventory management in the supply chain system clearly. The relationship between the variables in time is not disturbed by other factors, but we need to ensure the consistency of the stock relations in the supply chain system. Only in this way can the data in the whole supply chain system be integrated. Take raw materials for example, we need to ensure that the total amount of raw materials in various departments consistent, to meet the balance between a stock. Only in this way can we ensure the integration and visualization of the relationships among all kinds of materials and goods. The calculation formula of various inventory accumulation is as follows:

$$RM_{t}^{M} = RM_{t - 1}^{M} + RI_{t}^{M} - RO_{t}^{M}$$
(1)
$$WIP_{t}^{M} = WIP_{t - 1}^{M} + SM_{t}^{M} - FM_{t}^{M}$$
(2)
$$FG_{t}^{R} = FG_{t - 1}^{M} + FM_{t}^{M} - DR_{t}^{M}$$
(3)
$$FG_{t}^{R} = FG_{t - 1}^{M} + DM_{t}^{M} - DR_{t}^{M}$$
(4)

It is pointed out that the members of the two echelon supply chain generally guide the enterprise decision-making and make the production and distribution arrangements by smoothing the downstream demand. Through our research on various data and materials, it is found that reducing the lead time can increase the supply efficiency and accuracy of the entire supply chain, and also enhance our competitiveness. Lead time generally includes preparation, processing, queuing and other time, we can organic time short. Squeeze unnecessary waste time, and make our production lines more compact and compact. In addition, in the supply chain lead time stage, there are a lot of delay time, this part of our main compression object, the delay time can be shortened through our workflow optimization, in this way, the orderly compression of time. To increase the efficiency of information transmission, reduce the delay time, we can make the lead time compression to the extreme, this will reach our purpose of improving competitiveness, we are not disorderly and messy for the compression of time can not, must be carefully through analysis of the calculation formula of the following calculation.

$$RDT^{M} = \left\{ {\begin{array}{*{20}l} {T_{1} + T_{2} + T_{3} + T_{4} ,TIS} \hfill \\ {T_{2} + T_{3} + T_{4} ,VMI} \hfill \\ {T_{3} + T_{4} ,CPFR} \hfill \\ {T_{4} ,loT} \hfill \\ \end{array} } \right.$$
(5)

We establish an example to prove the correctness of the calculation in this paper. Taking the market demand forecast of retailers as an example, it is assumed that the retailer’s market demand is \(D_{t}^{R}\) at the time of t, the density function is f(dt), the distribution function is F(dt), and the mathematical expectation is μ. If the retailer’s lead time (holding time) remain unchanged, retailers need to submit orders to the manufacturer in 0 times; in the information of different control strategies under the action of the retailer orders submitted time point \(t_{m}\) will also change. The pre compressed from l into \(l - t_{m} ,\,\left( {0 \le t_{m} \le l} \right)\), so the variance (i.e. the forecasting error) for:

$$\sigma \left( {t_{m} } \right) = \sigma_{o} + \frac{{\left( {\sigma_{l} - \sigma_{o} } \right)}}{l},\quad so,\;\sigma \left( {t_{m} } \right) \le \sigma_{o}$$
(6)

Therefore, the retailer’s forecasting error on demand will decrease with the shortening of the leading time.

Also we can analyze is affected by many factors for manufacturers of raw materials demand and production demand, inventory, sales will not only cause affected by the price of raw materials and raw material supply, is very tedious to calculate. We need to integrate these information with computer algorithms by reasonable means, and use different formulas to calculate. Each part has a special formula to calculate the relationship between the production demands and a mathematical relation. Our main formulas are as follows.

$$O_{t}^{M} = \left\{ {\begin{array}{*{20}l} {D_{t - 1}^{M} + CQ_{t - 1}^{M} ,TIS} \hfill \\ {D_{t - 1}^{R} + CQ_{t - 1}^{M} ,VMI} \hfill \\ {\frac{1}{2}\left( {D_{t - 1}^{M} - D_{t - 1}^{R} } \right) + CQ_{t - 1}^{M} ,CPFR} \hfill \\ {R_{{{\text{t}} - 1}} + CQ_{t - 1}^{M} ,I{\text{o}}T} \hfill \\ \end{array} } \right.$$
(7)

Through the calculation and analysis of the above formulas, the calculation requirements in this paper can be basically completed. But the theory of this two-level supply chain dynamics needs to be connected with the Internet of things, which shows that it is necessary for us to connect it with the computer, and the algorithm is calculated through the computer, so that there is a need to program the algorithm and make a networking. It is necessary to edit and analyze the calculation steps of the algorithm in the computer, and Fig. 3 is the computing process of our algorithm in the computer. Through the above formulas and the setting of calculation steps, the algorithm design can be the completed. The algorithm of this paper has the capability that the Internet of things of the one-level supply chain does not have, and the flow of goods and information is within our control, and more accurate data can be calculated through the supply chain dynamics.

Fig. 3
figure 3

Algorithm in the computer application calculation process

4 Result Analysis and Discussion

After the design of the algorithm of two-level supply chain dynamics, the performance of the algorithm was tested, and the performance of the algorithm of two-level supply chain dynamics was also tested, thus the feasibility of the algorithm was proved. And compared with the one-level algorithm, it proves that the algorithm has great advantages and can make the information processing calculation more accurate and perfect. The simulation interval of the experiment is 0.25 days, and the simulation time is 320 days. The experimental group uses the algorithm of two-level supply chain dynamics, the comparison group uses the other algorithms, and the comparison group 1 uses the algorithm of one-level supply chain dynamics.

Firstly, the accuracy of the algorithm was studied, because accuracy was the primary concern, followed by the time used for various information processing, and a total of four comparative experiments were conducted. In order to ensure the reliability of our experiments, two calculations on this algorithm have to been carried out. The experimental data is summarized in Table 2.

Table 2 Comparison of experimental data table

What can be seen from the previous table is that the time of the algorithm in this paper is the maximum through the comparison of calculation results and times, which also shows that this algorithm has more advantages and more stabilities, and this shows that the algorithm has the highest rate of fault tolerance, the stability of the algorithm is the best, and the ability to resist risk is the strongest. Under the same risk changes, the algorithm can have enough time to rectify the data and deal with the information in time. In addition, the computing time of the algorithm is the shortest, and more data can be processed in the same case, so the efficiency of two supply chains is much greater than the calculation speed of one supply chain. The algorithm has not only a shorter computation time, but also a higher accuracy, and the transfer time and computing time of all kinds of information are also the shortest.

In addition to the attention on accuracy and computing time, another test point is that how many economic benefits the algorithm can bring for us, which is what people should pay attention to. It is well known that a good algorithm will bring great benefits in the operation of the Internet of things, so a comparative experiment of two algorithms is carried out through various indices of the above experiments, as shown in Fig. 4.

Fig. 4
figure 4

Algorithm total cost comparison chart

Through the comparison diagram of total costs above, it can be clearly seen that the total cost of the two is almost the same at the beginning of the test. But with the increase of time, the cost of the contrast group is much higher than that of the experimental group, which shows that the algorithm can reduce the total cost, that is to say, with the increase of time, the scheme of Internet of things based on two-level supply chain dynamics can bring more and more benefits to us.

Through tests, it can be found that the algorithm not only achieves a 100% accuracy, but also has a great advantage compared with other algorithms. It is a good algorithm, which guarantees the accuracy and efficiency of our calculations on data. At the same time, this algorithm can also reduce our costs in use, and the longer the time, the more the cost saving. Although great achievements have been made, it is believed that the algorithm can continue to be optimized and improved, and the computing speed can also be further improved by optimizing the programming mode. It is necessary to continue to study and strive to further improve the computational efficiency of the algorithm.

5 Conclusion

The application of computer technology has brought great convenience to our life, and the Internet of things formed by the combination of computer and logistics is a good example. With the further combination, the established Internet of things method based on two-level supply chain dynamics can better promote the development of logistics in our country. In this paper, an algorithm of two-level supply chain dynamics was presented, which had a great advantage. The accuracy of calculation is 100%, and the time of calculating the same firm is only half of the other algorithms. Great achievements have been made in the efficiency and accuracy compared with other algorithms. Through the simulation of the total cost, the algorithm can reduce a cost input of 20,000 yuan compared with other algorithms in a use of 400 days, which shows that this algorithm takes both computational accuracy and computational efficiency into account, while the cost control can also be very good. The longer the use time is, the more cost it can reduce. In addition, this algorithm still has some defects, and it is necessary to continue to streamline the algorithm editing in programming, so as to achieve the optimal computing time, and it is the research direction of the next step. Through the continuous research, it is believed that this Internet of things method of two-level supply chain dynamics will certainly show extraordinary advantages, bring great benefits to the society and better serve the society.