1 Introduction

Fitness gives people a strong body and strong will. Proper fitness can help people maintain health and improve their physical function, release pressure, regulate emotions, improve learning and work efficiency, and enhance self-confidence and willpower (Hock et al. 2018). The fast-paced life, severe environmental pollution, and food safety problems cause the continued growth of diabetes and obesity, which makes people gradually realize the importance of healthy and take part in physical exercise (Animaw and Seyoum 2017). In recent years, China's fitness industry develops rapidly, and the number of gyms increases four times from 2004 to 2014, and the tax revenue increase six times. Many large companies are equipped with gyms, swimming pools for employees (Li et al. 2019). At the same time, the sale of fitness equipment, especially small portable equipment increases year by year. This shows that people’s demand for fitness increases significantly. There are various types of exercise, which can be divided into outdoor and indoor sports according to the location of the activity (Wang and Lv 2019). Outdoor sports such as running, climbing, playing football are restricted by uncontrollable factors such as venues, weather, and air quality, and indoor sports such as equipment exercise, aerobics, yoga have the characteristics of flexibility. Therefore, taking exercises becomes a popular and healthy lifestyle after study and work (Fühner et al. 2021) because exercise and diet are two key factors to maintain health. And scientific management and monitoring of these two aspects are important to maintain people’s health. Most people choose to rely on personal training instead of the guidance of coaches (Johnson and Acabchuk 2018). On the internet, there are a large number of video tutorials, text tutorials, nutritional and dietary collocations, food caloric values, and other resources to refer to in the process of taking exercises, which can help people arrange fitness programs and dietary plans more reasonably. The popularity of mobile devices such as smartphones, tablets, and mobile Internet enables these resources to be accessed anytime and anywhere, meeting people's immediate needs for exercise and food (Serrano et al. 2017). At the same time, mobile devices can be used as a convenient recording tool and record people’s weight, exercise time, exercise intensity, heat intake, and other related data. Research on the mobile applications for collecting and analyzing these data can realize the quantitative management of exercise and diet, allowing people to have a more objective understanding of their situation and thus developing a more scientific and efficient plan (Kildare and Middlemiss 2017).

At present, watching fitness video tutorials is an important way for users to learn how to keep fit personally. However, there are tens of thousands of videos on the Internet, and it is difficult for users to obtain information that meets their needs in a short time, which causes the problem of information overload (Anacleto et al. 2021). In this case, the recommendation system is proposed to solve this problem. It can collect and analyze users' historical browsing data, find videos that meet the users' needs from a large number of videos and produce a recommendation list to users (Meng et al. 2020). The time required to obtain the recommendation list affects the recommendation quality. The traditional recommendation system usually needs many hours or a day to calculate the user's historical data and update the recommendation results. If the system can capture changes in user interest and update the recommendation results in time, the quality of the recommendation results will be greatly improved (Gyrard and Sheth 2020). If most of the user's historical records are about abdominal muscle training videos and he is also interested in yoga teaching videos, the recommendation results are most likely to give more muscle training videos, resulting in recommendation failure. For new users of the website, the system cannot give recommendations and can only expect users to make recommendations when they log in again after the recommendation results are updated (Guo et al. 2018). The traditional fitness mode is closed, and the user has difficulty in obtaining fitness information, and the user's exercise data is not fully utilized. In today’s society, people use various intelligent devices to record their sports information, such as Xiaomi’s “smart bracelet”, WeChat’s “WeChat movement” and QQ’s “sports platform”, and the popularity of “Internet + ” changes the way people obtain information and the way they exercise. And fitness APPs are the perfect embodiment of “Internet + fitness” (Harder et al. 2017). Nowadays, with the popularity of smartphones, more and more people are accustomed to using fitness APP to keep fit. There are tens of millions of users in some high-quality fitness APPs such as 'Gudong Movement' and 'Keep'. When going into any gym, you can see many users taking exercise following the APP (Application) of the video tutorial. Therefore, the study of fitness real-time recommendation systems has great significance to solve the above problems.

The main contributions of this study are as follows: (1) based on the independent development of fitness APP and big data processing platforms, the basic functions of fitness APP are realized. And NFC (Near Field Communication) is used to realize the networking of fitness equipment so that fitness APP can realize data interaction with fitness equipment. In addition, Websocket instant communication technology is used to realize the real-time update of user rating information and solve the problem of information delay; (2) After Spark big data processing platform and the big data machine learning technology are used, user’s fitness data collected by fitness APP are processed and analyzed, and the intelligent recommendation is realized. An intelligent recommendation system is based on the user's previous fitness data and the fitness data of other users who have a similar interest to analyze their preferences. The implied information can be mined from user fitness data to improve user experience and increase the income for gyms.

2 Literature review

2.1 Internet fitness platform

The emergence and development of the Internet change the traditional way of fitness. Fitness APP lowers the cost of fitness, and people can get professional fitness knowledge at home by following the tutorial to complete the corresponding fitness exercise (Barkley et al. 2020). Tehranipoor et al. (2018) argued that the Internet + fitness shows a positive developmental trend (). Foreign countries pay attention to fitness earlier, and the development of their fitness tends to be mature, and the combination of fitness APP and online and offline fitness clubs are perfect. In the past two years, fitness in China becomes popular and sets off a boom, and some high-quality fitness APP software begins to emerge (Shen 2019). Seven major fitness O2O companies in the United States are Fitmob, Fitstar, Strava, Runkeeper, Fitbit, Pact Fitness, and Myfitnesspal. These seven companies provide users with rich sports fitness services by collecting personal health data, increasing social functions, and using psychological methods (Raghuveer et al. 2020; Grundy et al. 2017; Dancy et al. 2018). These companies have their characteristics. Fitmob provides online reservations and coaches through cooperation with local fitness centers. Fitbit users can invite friends online to work out or compete with others, or even pick them up (Pellizzari Cid 2020). Pact Fitness provides the function of the cash incentive. Through the cooperation of online and offline cooperation, users go to specific fitness centers for exercise and obtain cash incentives when they complete the task. If the task is not completed, users will be fined, which can encourage users to do exercise (Klesmith and Hackel 2019). In recent years, there appear some high-quality fitness APPs in the Chinese market, such as Gudong exercise, super weight loss king, and Keep (Huang and Zhou 2018). Among them, the Gudang movement provides GPS positioning function and social function. GPS (Global Positioning System) can be used to locate the user’s position, track the movement route and record the user’s movement trajectory. Besides, Gudang friends around can be found to run together and exercise together when its social function is performed (Cai et al. 2021). The super weight loss king provides a comprehensive slimming scheme for the user, calculates the user's body mass index according to the user's height, weight, gender, age, and other data. Keep Fitness APP provides users with a variety of fitness video teaching materials and courses, and performs the function of recording fitness trajectory and social interaction (Li et al. 2021).

2.2 Fitness platform recommendation algorithm

The recommendation system is an important way to solve the problem of information overload. Although search engines can help users filter information, the search method is only meant for users with clear objectives. Different from the search engine, the recommendation system does not need users to accurately describe their needs. Instead, it establishes an interesting model for users by studying the historical behavior of users and providing users with the information needed. The search results are always arranged in a certain order, and the most useful results to meet the needs of most people are ranked in the front, which is easy to obtain. Personalized, decentralized, small demand results are placed behind, and it is not easily found by users. However, the total demand for this long-tailed information is huge, which becomes a problem that cannot be ignored (Feng et al. 2019). The krill swarm algorithm is inspired by the simulation experiment of the living environment and living habits of the Antarctic krill population. A swarm intelligence optimization algorithm is proposed in 2012. Like other swarm intelligence algorithms, there is always a contradiction between the diversity of the population and the convergence rate of the algorithm in the optimization process (Kandhway et al. 2020). Arithmetic optimization algorithm uses the distribution behavior of the main arithmetic operators in mathematics to model and implements mathematics in the optimization process in a large search space. This algorithm can realize the personalized recommendation of fitness data, so it attracts the attention of many scholars (Xu et al. 2021). Aquila Optimizer, a new population-based optimization method, is inspired by the natural behavior of Aquila during prey capture. Therefore, the optimization process of the proposed AO algorithm can be represented by four methods. The search space is selected by the high flight of vertical bending. Under the short-range gliding attack, the search space is explored in the scattered search space by contour flight. Under the slow descent attack, the search space is explored in the convergent search space by low-speed flight, and the search space is explored by walking and predatory (Abualigah et al. 2021). Sine cosine algorithm SCA (Sine Cosine Algorithm) is a new type of swarm intelligence optimization algorithm, which is proposed by Australian scholars. The algorithm uses the properties of the sine cosine function to make the solution oscillation tend to be globally optimal. The adaptive parameters and random parameters in the algorithm can balance the exploration and development ability of the algorithm, and solve the wing design problem (Abualigah and Diabat 2021). A collaborative filtering algorithm is a famous and commonly used recommendation algorithm. It is based on the mining of user's historical behavior data to find user preferences and offers users the appropriate information (Jiang et al. 2019). Compared with the existing algorithms, the collaborative filtering algorithm is in line with the needs of fitness recommendation, and the collaborative filtering algorithm is used to realize the analysis and processing of fitness data.

2.3 Problems of the online fitness platform

Generally, the development of China's Internet + fitness is good. The fitness APP and offline fitness centers are growing rapidly, but they are not as mature as those in European and American countries. Fitness APPs usually cooperate with fitness centers. China’s high-quality fitness APPs can provide the functions of recording trajectory, social interaction, and watching fitness videos. However, compared with a large number of high-quality fitness APPs abroad, there is still a certain gap in the number of types and fun. Since the needs of users are changing all the time, the traditional recommendation system, which is largely dependent on historical data, cannot meet the needs of users in the current situation. Therefore, it is necessary to study a real-time recommendation system. In the film websites, social networking sites, and news websites, the disadvantages of traditional recommendation systems are particularly obvious. In the video-sharing website, new videos and user’s rating data increase frequently. The faster these data are added to the recommendation model, the better the recommendation effect is. On the contrary, the longer the system update cycle is, the worse the recommendation effect is. Shortening the update cycle can only alleviate the problem to a certain extent, and it cannot solve the problem fundamentally. The real-time recommendation system can solve this problem, which is an important trend in the development of the recommendation system. Aiming at the shortcomings of traditional fitness methods, a new green intelligent fitness system is designed and implemented combined with mobile Internet technology. Equipping the fitness system with a corresponding fitness APP can realize the combination of 'Internet + ' and fitness, and NFC near-field communication technology is used to realize the network of fitness equipment. And users can view their exercise information through fitness APPs. In addition, the big data processing platform is built to process the user's exercise data, and the machine learning technology is used to realize the intelligent recommendation of fitness equipment.

3 Construction of the online national fitness system

3.1 Design of the internet fitness platform

Mobile Internet is evolved from the development of the PC Internet, which combines mobile communication with the Internet. It is the general term that combines practice with Internet technology, the platform, the business mode, and mobile communication technology. In the study, the sensor on the fitness equipment is used to detect the exercise data of users, and the data are written into the NFC chip on the fitness equipment (Reda et al. 2018). The data are read from the NFC chip and uploaded to the cloud server through the mobile application APP with NFC function. Users can view fitness data and historical data at any time through APP, and ensure real-time updating of data through WebSocket instant messaging technology, realizing the combination of “Internet + ” and fitness. The design idea and structure are shown in Fig. 1.

Fig. 1
figure 1

Design of the mobile internet fitness platform

Figure 3, 1 shows that the realization of the “Internet + fitness” system consists of five functions, namely, A, B, C, D, E, and F in the figure. A corresponds to the use of PhoneGap technology and Web front-end technology to develop the mobile APP used in this study. B is the NFC near-field communication technology used to achieve mobile APP and fitness equipment data interaction. C is the Web front-end technology used to develop various functions of fitness APPs, like viewing user’s exercise data and ranking information. D shows the real-time update of user ranking information by WebSocket technology. E is the cloud server used to build the LNMP architecture. F is the user's real-time data. The fitness equipment uses sensors to collect user exercise data and write the data into the NFC chip on the fitness equipment (Tang and Wang 2020).

3.2 Implementation of the System Platform

The “internet + fitness” is realized as follows: First, the mobile fitness APP used in this article should be developed, which is shown in Fig. 2A. Fitness APPs can read user’s exercise data from fitness equipment and upload the data to the cloud server. Besides, the exercise information can be viewed at any time through APPs. Fitness APP is developed using Web front-end technology and packaged using PhoneGap technology (Rodriguez and Rocha 2018). Web front-end technology is a technology for developing web pages in browsers. Using Web front-end technology can quickly develop mobile applications with powerful functions, exquisite interfaces, and cross-platform operation. PhoneGap is a mobile application encapsulation technology, which can encapsulate the mobile applications developed by Web front-end language into mobile APPs that adapt to various mobile platforms. The principle is shown in Fig. 2.

Fig. 2
figure 2

Mobile Internet Packaging Mobile APPs

PhoneGap provides a series of function interfaces for developers to call the original function of the mobile phone while the packaging function is provided. Calling the original function of the mobile phone (camera, geographic location, NFC function) needs to use the original language of the mobile phone, like java for Android phones. The interface provided by PhoneGap can convert the front-end language into the native language of the phone to call its original functions. The NFC function of the phone is called through the front-end javascript script.

NFC is a near-field communication technology, which enables two NFC devices to complete data interaction in a short distance. In this system, sensors and NFC chips are installed on fitness equipment, and the motion data generated by users during exercise are collected by sensors. The collected fitness data are written into the NFC chip of fitness equipment by a microprocessor so that the data on the NFC chip of fitness equipment can be read through the NFC mobile phone and uploaded to the cloud server to realize the networking of fitness equipment (Luna et al. 2017). The function is shown in Fig. 3. The NFC chip on the fitness equipment is the Fudan M1 card, which is a non-contact IC card. The full name of the Fudan M1 card is FM11RF08 and it is also a white card. The data collected on the fitness equipment are written to the NFC card, and the data interaction between the mobile phone and the fitness equipment is only completed by interacting with the NFC card. The mobile phone used in the study is Huawei Chel-CL10 with the function of NFC. Because the fitness APP used in this study is developed through Web front-end technology and PhoneGap technology, PhoneGap provides a series of interfaces for developers to call the original function of mobile phones while the encapsulation function is provided. Therefore, the NFC function of the mobile phone can be called only by using the corresponding NFC interface function in the Web front-end program, and its implementation principle is shown in Fig. 3.

Fig. 3
figure 3

Calling of NFC function by Web application

The nfc. addNdefListener function can be used to call the NFC function of the phone in a Web application because PhoneGap converts the corresponding front-end code into the native code of the phone, and then the native code calls the NFC function of the phone. However, PhoneGap does not directly provide the function interface for calling the original function of the mobile phone. When the original function of the mobile phone is used, it needs to lead into the corresponding plug-in. The system is used to develop fitness equipment for the dynamic bicycle, and mobile phones read fitness data from the dynamic bicycle, as shown in Fig. 4. The NFC chip on the fitness equipment is fixed in the white box, and the mobile phone can read the data on the fitness equipment from the NFC chip in the white box.

Fig. 4
figure 4

Physical map of the interaction between the mobile phone and fitness equipment

3.3 Design of the collaborative filtering algorithm

As its name implies, the collaborative filtering algorithm consists of two parts, namely the collaborative algorithm and the filtering algorithm. The collaborative algorithm is used to evaluate the user's historical data and assist the user in making decisions in the process. The filtering algorithm is used to provide the recommendation that the user may prefer. In the recommendation system, the collaborative filtering algorithm is based on the similarity between users to complete the final recommendation. According to the different ways of calculating the similarity between users and items, the collaborative filtering algorithm can be divided into the following three categories: user-based collaborative filtering recommendation algorithm, item-based collaborative filtering recommendation algorithm, and content-based collaborative filtering recommendation algorithm (Jiang et al. 2019).

Figure 5 shows that the content-based collaborative filtering recommendation algorithm refers to the use of the content of the recommended item to complete the entire recommendation process. The first step is to establish a recommendation list of similar items for project A, for example, two items B C can be found from the project library according to the similar value. The second step is to determine user A's preference for project A, completing the sorting of user A's preference. The last step is to complete the final recommendation of items B and C of user A according to item A.

Fig. 5
figure 5

Content-based collaborative filtering recommendation algorithm

The collaborative filtering recommendation algorithm is proposed and developed from the basic system filtering algorithm. Its main idea is to provide video recommendations for users by calculating the similarity between videos, which is calculated through the analysis of the record of the behavior of users. Before the effective recommendations are obtained, the similarity between videos must be calculated. For a user, there are multiple videos similar to the video that they watch in the video library. And their similarities are shown by different values. The higher the value is, the more similar the two videos are, which ranks the top in the recommendation list of this user.

The similarity between two videos is calculated through the browsing history of users and videos, as shown in Eq. (1):

$${\mathrm{w}}_{\mathrm{a},\mathrm{b}}=\frac{|\mathrm{M}(\mathrm{a})\bigcap \mathrm{M}(\mathrm{b})|}{\sqrt{\left|\mathrm{M}\left(\mathrm{a}\right)\right||\mathrm{M}(\mathrm{b})|}}$$
(1)

where \({w}_{a,b}\) is the similarity between video a and video b. The molecular part of Eq. (1) represents the intersection of the number of people who have watched the video a and video b, which can reflect the similarity between video a and b. The denominator is the product of the total number of people who have watched the video a and the total number of people who have watched video b, and the square root is obtained. And then the total number of videos are calculated. The ratio of the similarity can be obtained by dividing the intersection by the total number.

The calculation results obtained from Eq. (1) are only the similarity between videos rather than the browsing times of the user, which needs to be multiplied by the user's interest in the original video, as shown in Eq. (2).

$${\mathrm{P}}_{\mathrm{u},\mathrm{b}}=\sum_{\mathrm{a}\in \mathrm{N}(\mathrm{u})\bigcap \mathrm{N}(\mathrm{b},\mathrm{m})}{\mathrm{w}}_{\mathrm{a},\mathrm{b}}{\mathrm{r}}_{\mathrm{u},\mathrm{a}}$$
(2)

where \({P}_{u,b}\) is the probability that user u likes video b, and a represents the video that user u has watched. \(N(u)\) is the video sets that user u likes to watch, and \(N(b,m)\) is the set of m video that is most similar to video b. Therefore, the video in the recommendation should be guaranteed to be both videos watched by user u and one of m video that is most similar to video b. \({w}_{a,b}\) is the same as the meaning expressed in Ep. 1, that is, the similarity between video a and video b, and \({r}_{u,a}\) is the probability of user u's interest in video a.

The forward matching, reverse matching, and probability statistics method are used to carry out word segmentation processing with the help of the total cut method, and then the best word segmentation results are obtained by using the understanding method, as shown in Fig. 4:

$$ P(W\left| C \right.) = \frac{P(W,C)}{{P(C)}} = \frac{P(W)P(C\left| W \right.)}{{P(C)}} $$
(3)

However, the popularity of the video may bring about inaccurate recommendations. For some current popular videos, the number of viewers will increase naturally, which causes inaccurate results in video similarity calculation. Therefore, it is necessary to deal with the popularity problem between videos to improve the accuracy of recommendation results. The exclusion of the popularity of videos is shown in Eq. 3.

$${w}_{a,b}=\frac{{\sum }_{u\in M(a)\bigcap M(b)}\frac{1}{log1+|M(u)|}}{\sqrt{|M(a)||M(b)|}}$$
(4)

Compared with the video similarity in Eq. (1), the equation has 3 molecules, namely \({\sum }_{u\in M(a)\bigcap M(b)}\frac{1}{log1+|M(u)|}\). For user u who has watched both videos a and video b, the factor \(\frac{1}{log1+|M(u)|}\) is added to user u. Therefore, the influence of the popularity of videos on the video similarity calculation is limited.

3.4 Data source and performance analysis

The Spark platform based on YARN is compatible with the original Hadoop platform, and the HDFS distributed file system function of Hadoop can be used. The Spark version is corresponding to the Hadoop version. The Hadoop version used in this study is 2.7.2, and the installation environment is the Linux Ubuntu system. It is installed and deployed on three computer nodes in the laboratory. One of them is used as the main node, and the other two are used as the working nodes because the calculation data during the operation of the Spark cluster are stored in memory (Emara and Huang 2019). Therefore, there is a high demand for computer memory, so each computer node has at least 8G memory. The computer hardware used in this study is mainly configured, as shown in Table 1:

Table 1 Configuration parameters of the cluster hardware

As shown above, the cluster contains three nodes, one main node, and two working nodes. The function of the main node is to assign tasks to the working nodes, manage the operation of each node in the cluster, and control the operation of the whole cluster. The cluster contains a small number of working nodes and does not need the main node. The physical composition of the computer cluster built in this study includes three hosts (one main node and two working nodes), two screens, and a gigabit router. One screen controls three computers using the Linux SSH remote login function, and the other monitors the running of the cluster on the Web browser using the ports provided by the Spark platform. The router is responsible for connecting three computers to form a LAN, and the wired LAN is composed of gigabit routers, which enable the rapid exchange of data between computers. The offline recommendation process of the system uses the ItemCF algorithm on the Movielens dataset. The Movielens dataset is divided into the training and test sets. 80% of the data is randomly selected as a training set, and the rest is the test set.

There are many indicators to measure the quality of recommendations. According to different experimental methods, different indicators are used to evaluate the quality of the recommendation. The indicators, like prediction, coverage, and diversity, are used to evaluate the accuracy of the recommendation system (Karabadji et al. 2018). User surveys and online experiments can obtain indicators that cannot be obtained by offline experiments such as user satisfaction and surprise. The commonly used evaluation indicator evaluating recommendation systems is score prediction accuracy, which is one of the most important indicators for evaluating offline experiments. The user's rating data are divided into a training set and a test set according to time sequence and a certain proportion. The user's interest model is established on the training set to predict the user's rating of items that are not evaluated on the test set. Then the consistency between the predicted score and the actual score on the test set is calculated, and the accuracy of the score prediction is obtained. Score prediction accuracy is generally obtained by RMSE (Root Mean Square Error) and MAE (Mean Absolute Error). For user u and item i in the test set, the predicted score of user u to item i given by the recommendation system is the actual score of user u to item i, and T represents the test set.

$$ RMSE = \sqrt {\frac{{\sum\nolimits_{u,i \in T} {(r_{ui} - p_{ui} )^{2} } }}{\left| T \right|}} $$
(4)
$$ MAE = \frac{{\sum\nolimits_{u,i \in T} {\left| {r_{ui} - p_{ui} } \right|} }}{\left| T \right|} $$
(5)

The accuracy rate and recall rate are obtained. Some websites provide users with a recommendation list, which does not involve rating information. The prediction accuracy of the recommended list is defined by the accuracy rate and the recall rate. Accuracy describes the ratio of the number of items recommended by the system and preferred by users to the number of items in the recommendation list. If U is the user set, \(r_{ui}\) is the list of the recommendations for users obtained from the training set, and \(p_{ui}\) is the list of the behaviors of users on the test set.

4 Effect analysis of the fitness platform system

4.1 Realization of the fitness online platform

Figure 6 shows that the user enters the Add Training Plan page through the plan options in the navigation bar. The training plan includes inputting the name of the plan, adding and deleting sports items and exercise time, and determining the implementation date of this plan. The implementation date of training plan 1 is Monday, Wednesday, and Friday. The navigation bar is displayed on the slide screen, where the home button symbolizes the user's daily fitness and food. The date button is at the top of the log, and the user can choose the implementation data as he/she likes. The homepage is an overview of users' intake and consumption of heat. Users can view and record sports and food through the consumption and intake buttons in the navigation bar through the sliding screen.

Fig. 6
figure 6

Implementation of the Fitness Online Platform

4.2 System recommendation and performance evaluation

Figure 7 shows that the results of four indicators of model recommendation accuracy rate, recall rate, coverage rate, and popularity under different k values are compared. The figure indicates that the accuracy and recall rate of the model first increase and then decrease with the increase of k value, so does the coverage rate as well as the popularity. When the k value is 10, the accuracy rate and the recall rate of the algorithm reach the highest.

Fig. 7
figure 7

System recommendation and performance evaluation

4.3 System model performance comparison

Figure 8 shows that the system is compared with the actual fitness needs, and the results show that the recommendation results obtained by this system are consistent with the actual user needs. In MAE and RMSE, the results are maintained at about 0.1–0.2, which indicates that the model proposed in this study has high prediction accuracy.

Fig. 8
figure 8

Comparison results of the model performance

Figure 9 shows that the system in this study is compared with the fitness system in the latest research. It is found that the prediction accuracy of the system is maintained at 89%, and the RMSE is maintained at about 0.1. This proves that the proposed model has better performance than the existing model.

Fig. 9
figure 9

Comparison results of different model systems

4.4 Visualization of fitness data

Figure 10 shows that the system in the study is tested and the actual fitness visualization effect is obtained. The weight, fat rate, muscle rate, and BMI value of the tester are tested at different times. The above results show that the system has a high degree of visualization, which meets the data analysis of the developer, as well as the user's personalized needs.

Fig. 10
figure 10

Visualization effect of fitness data

5 Discussion and conclusions

Based on the function of the big data processing platform, big data platforms are compared and Spark big data processing platform suitable for the fitness system is used to form a Spark cluster with one main node and two working nodes using the three computers in the laboratory. Spark SQL components are used to obtain the user’s fitness rating data from the server and prepare for subsequent machine learning. After the Spark platform obtains the rating data and prediction rating pairs, the pow method of math is used to calculate the sum of squares for each set of actual and predicted deviations, and then the MSE is calculated to be 0.08503 by dividing the total number of ratings. The root means square error RMSE for MSE is 0.29160, which shows that MSE and RMSE are very small, and the prediction effect is good. The MAE is 0.2048, the average error between the actual rating and the predicted rating is about 0.2, and the model reaches a high prediction accuracy. Aiming at the machine learning function, the fitness equipment rating function on the fitness APP is developed, the user's rating data of fitness equipment is collected, the user's rating data on the Spark big data processing platform are analyzed, and the user's preference for each fitness equipment is calculated by using the matrix decomposition method of the collaborative filtering, realizing the intelligent recommendation of user's fitness equipment. Due to the insufficient rating data of fitness equipment, the MovieLens 100 k dataset is used to replace the rating dataset of fitness equipment. The results of the experiment also prove the effectiveness of the proposed algorithm.

PhoneGap and Web front-end technology are used to develop mobile fitness APPs, and the functions of each module in the APP are realized. Through the APP, user exercise information and rating information can be viewed. NFC near-field communication technology is used to realize the data interaction between fitness APPs and fitness equipment, so that the mobile phone with NFC function can read data from the NFC chip of fitness equipment and upload them to the server, realizing the networking of fitness equipment. The energy-saving contribution list module of fitness APPs is developed by using the new WebSocket function of HTML5, and the real-time update of user’s rating information is realized by using the instant communication characteristics of WebSocket. A cross-platform fitness APP based on PhoneGap and Web front-end technology is developed in this study, and it queries user's exercise information and historical exercise records. NFC near-field communication technology is used to realize the data interaction between fitness APPs and fitness equipment. Mobile phones with NFC function can read exercise data from the NFC chip of fitness equipment and upload them to the server, realizing the networking of fitness equipment. Although a national fitness system is built, there are still many shortcomings in this study: 1) the functions of fitness equipment in this study are developed on the dynamic bicycle. The large-scale commercial operation needs to get support for more fitness equipment. 2) Fitness APPs have some basic functions, and more functions can be added to improve user experience, such as social function, positioning function, and viewing fitness videos.