# Social Governance Structure Construction and Resource Allocation Methods under the Management Mode of the Internet of Things

Authors: Zonggang Xu
Journal: Wireless Communications and Mobile Computing
 (2021)

---

## Abstract

Aiming at the problems in the social governance structure level under the management mode of the Internet of Things, this paper designs a network agent based on the idea of service grid construction that has the functions of service resource configuration discovery, load balancing, and protocol conversion. Using it as a service governance infrastructure reduces the coupling between business services and service governance, and the network agent will intercept the service call traffic within the platform to achieve cross-protocol and cross-frame service communication. Through the proposed global query decomposition strategy and algorithm, a global query mapping is realized, which solves the problem of global query decomposition based on the global data model. We designed the unified management mechanism of two commonly used IoT databases based on XML. This process involves the realization of heterogeneous Internet of Things database resource configuration, data mode conversion, and global query mapping. Among them, in the process of data schema conversion, the conflict of the data in the schema mapping is resolved, the XML Schema is generated, the schema mapping metadata is established, and the XML document of the data is generated. We build a framework for optimal allocation of cloud computing resources based on load forecasting and propose an adaptive elastic control system for resource allocation based on resource status monitoring and demand forecasting. In view of the low resource utilization problem caused by the resource management mode of single virtual machine serving single user adopted by Internet of Things service providers, this paper constructs a new public cloud architecture with a five-layer structure. On the basis of this architecture, an adaptive configuration mode of virtualized resources based on a single virtual machine serving multiple users is proposed. This mode can automatically search for optimal virtualization resources for application resource requests made by different users and run different applications on the same virtual machine without affecting the quality of service, so that IoT providers can guarantee services. At the same time, it improves the utilization efficiency of IoT resources and reduces energy consumption.


---

## Body

## 1. Introduction

The integration and development of intelligent technology has changed people’s work style, lifestyle and learning style, and on this basis has profoundly affected people’s thinking style and innovative activities. Smart technology is not only a technological revolution; it is also a social revolution [1]. Closely related to society is the revolution of government public governance and public services. In the intelligent age, intelligent technology provides technical tools for the modernization of government governance. The current technological development is changing with each passing day. New technologies such as big data and Internet of Things have begun to be applied well in the commercial field [2]. If they can be combined with government governance, they will be able to produce dazzling sparks. Smart governance helps build a smart government and improve government administrative efficiency; smart governance helps strengthen the government’s responsibility and serviceability and increase public trust in the government; smart governance helps the public participate in government decision-making and improve the quality of decision-making. Smart governance is a new governance paradigm in the smart era, which is in harmony with the current social environment [3].The rapid development of the Internet has provided good conditions for the development of intelligence. The vigorous development of intelligent technology has not only changed the previous social structure and social model, but also brought opportunities for social development and innovative social governance. The intelligentization of social governance requires following the rapid development of intelligent information technology, making good use of big data resources and applying big data and information technology to social governance innovations, so as to realize the intelligentization of social governance and create something that is in line with the development of today’s society [4, 5]. At the same time, while developing and innovating social governance, it also requires every subject involved in social governance to be precise and meticulous in their work. At the same time, it is necessary to carefully analyze the problems encountered in this process, take appropriate measures to provide appropriate services, and handle various feedbacks to be truly accurate and meticulous and ultimately promote the improvement of governance capabilities [6].This article analyzes the commonly used SOA architecture and microservice architecture in the construction of IoT platforms. Based on the design concepts of the two architecture methods and the characteristics of the IoT platform, it is concluded that the microservice architecture design is more suitable for the IoT platform. Specifically, the technical contributions of this article can be summarized as follows:First. We conduct an in-depth analysis of microservices and point out that the IoT platform built by the microservice architecture has high coupling between business code and service governance at the architecture level, and it is difficult to achieve interconnection and intercommunication between services built with different technical frameworks and communication protocols. Aiming at these two problems, the design ideas of service grid are introduced, and the difference between service grid and microservice service invocation is compared, and the design of service grid network proxy can solve the two major problems of traditional microservices.Second. Based on the idea of service grid and the network status of the Internet of Things platform, a network agent with service resource configuration discovery, load balancing, and protocol conversion is designed and implemented as a service governance infrastructure to solve the existence of traditional microservice architecture. The two major issues are verified through experiments.Third. Based on the framework of the unified management mechanism of the Internet of Things database based on XML, this article combines the characteristics of the heterogeneity of the Internet of Things database in the USPIOT platform and the characteristics of the Internet of Things business data itself and designs the unified database of the Internet of Things based on XML Management mechanism. In view of the low resource utilization caused by the current resource management mode of single virtual machine serving single user adopted by Internet of Things service providers, this paper constructs a new public cloud architecture with a five-layer structure.Fourth. This article proposes an adaptive configuration mode of virtualized resources based on a single virtual machine serving multiple users. This mode can automatically search for the optimal virtualization resources for application resource requests made by different users and run different applications on the same virtual machine without affecting the quality of service. At the same time of quality, it improves the utilization efficiency of IoT resources and reduces energy consumption. The experimental results show that the network proxy design in this paper overcomes the problems existing in the traditional microservice architecture and has better performance.The rest of this article is organized as follows. Section2 discusses related work. Section 3 constructs the social governance structure of service governance infrastructure network agency. Section 4 designs a unified management mechanism for the Internet of Things database based on XML. In Section 5, a simulation experiment was carried out. Section 6 summarizes the full text.


## 2. Related Work

Electronic governance has transformed Canada from a vertical governance structure of decision-making and power to a full-scale vertical and horizontal governance. The most basic change is the sharing of government decision-making power by smart communities. Electronic governance provides a realistic way for citizens to conduct real-time dialogue and cooperation with governing subjects and establish a cooperation mechanism between government and citizens in this process [7]. In the past, the relationship between the local government and the central government had only the obligation to obey, and electronic governance made the local government one of the decision makers. In Canada, local voices can usually be fully expressed, which provides great support for the construction of a multilevel governance system and the realization of governance goals [8]. Of course, the Canadian E-governance process also explains that the challenge of governance does not only come from information technology itself. Governance is efficient coordination in an environment of dynamic resource allocation. E-governance requires new organizational structures, new forms of leadership, and even the determination of new goals. At the same time, it also requires a significant expansion and transformation of public-private partnerships.Under the influence of globalization and information technology, the functions and roles of cities are changing, and urban communities have become important places for citizens to participate in and express themselves in politics [9]. In the development of Canadian cities, banks, cities, and political parties have all experienced serious financial difficulties and governance crises. However, the decentralized management of cities and the initial electronic governance have produced a certain degree of incompatibility [10]. Driven by a series of complex issues arising from the development of new information technology and urban expansion, Canada has placed the construction of online government and the construction of smart cities and communities on the agenda. Canada’s experience in building smart communities and government online is closely related to the development of information technology, and the level of development of information technology has a serious impact on the level and level of smart cities and communities [11].Singapore is one of the earliest countries to build E-government. The start and development of E-government in Singapore are based on the establishment of a sound development of E-government. Singapore emphasizes the integration of system construction, service network construction, and information and communication technology tool development in E-governance construction. First, it promotes the development of information and communication technology through government decision-making and then uses new technology to build a service network that is compatible with the E-governance environment. Currently, Singapore’s E-governance is still in progress.The United Kingdom has also conducted research on the urban heat island effect caused by air pollution [12–14]. Among them, the University of Birmingham has launched the “Hi Temp” project, which uses a large number of environmental and temperature sensing nodes to build an atmospheric environment monitoring and management network. The environmental protection data obtained by various sensing nodes are sent to the remote processing center, and the remote acquisition and sharing of environmental information are realized through intelligent analysis and processing [15, 16]. Foreign countries have made progress in the application and practical exploration of the smart and environmentally friendly Internet of Things. Related scholars have described an environmental monitoring platform WSN that can be deployed in specific scenarios [17]. This platform can realize the access of a large number of terminal sensor data. At the same time, it is easy to maintain and develop and can be quickly deployed according to specific needs. The platform can accelerate the deployment of the environmental protection industry in the Internet of Things applications [18]. The researchers described the acquisition of various pollution data in environmental detection through the Internet of Things gateway [19]. The specific design of the gateway is based on the oneM2M standard and resource tree configuration to realize the establishment of the application software system and the terminal device sensor network. The gateway has been practically used in the environmental pollution detection and prevention of the Rongshan River. With the continuous development of the Internet of Things technology, smart and environmental protection industry applications will incorporate more new technologies, and the architecture system in actual applications will also continue to develop and improve [20–22].However, microservices are not an omnipotent “silver bullet.” As microservices take root in many enterprises and fields, the microservice architecture also exposes the high coupling between business services and service governance and the difficulty in realizing the construction of different technical frameworks and communication protocols. The reason for the problem of interconnection between services is that the service governance framework adopted by the microservice architecture is a traditional intrusive development framework, which is difficult to solve the high coupling problem caused by code intrusion.


## 3. Construction of Social Governance Structure of Service Governance Infrastructure Network Agency

### 3.1. Microservice Architecture

The monolithic architecture has distinctive features, and early project management is convenient. You only need to package the entire project into a web container to run. However, with the expansion of business and the increase in the number of users, the monolithic system can no longer simply increase the system’s tolerance through horizontal expansion and cannot meet the huge device connection requirements of the IoT platform. Distributed architecture is to split the function of the entire system. Each functional module has an independent process. It is designed to provide prerequisites for the good operation of large and complex systems. It is widely used in the construction of IoT platforms [23–25].Microservice architecture is an architectural style that divides a large and complex system into multiple services that can operate independently and with a single function [26, 27]. The services are communicated through lightweight protocols. Different from the SOA architecture, microservices are divided into fine-grained services according to the module functions, and loose coupling of service functions is realized. Compared with the SOA architecture, the system built by the microservice architecture has the advantages of system scalability and agility. Obvious advantages are more suitable for systems that focus on agile development and rapid iteration, such as IoT platforms [28]. More and more IoT platforms choose to use microservice architecture for construction, and microservice architecture gradually replaces SOA architecture as the preferred solution for the construction of IoT platform architecture.


### 3.2. Service Grid and Microservices

Traditional microservices do not realize the separation of business services and service governance. Service governance is deployed in the same service with business services through framework configuration and other methods. The coupling is high, which is not conducive to the upgrade and iteration of services. Developers and maintenance personnel must complete business services. It is also necessary to take into account service management work such as service discovery resource allocation, which undoubtedly increases the cost of development and maintenance; in addition, when the system needs to access services built with different technical frameworks and communication protocols, it is necessary to add protocol conversion functions for each connected service. This is unacceptable for a large system. The service constructed by the service grid architecture extracts service management functions such as service discovery resource configuration and integrates it into an independent network agent. This network agent is deployed in the same container as a sidecar and business service, reducing the cost of service and service governance. Coupling, developers and maintenance personnel only need to focus on realizing business services, which improves the efficiency of development and maintenance; when the service is called, the network agent deployed in the same container is requested, and the actual service communication is completed between the network agents of two different containers. When the system needs to access services built with different technical frameworks and communication protocols, it only needs to support functions such as protocol conversion in the general network agent and will not cause intrusion to the service. The resource demand response and resource allocation management architecture is shown in Figure1.Figure 1
Resource demand response and resource allocation management architecture.


### 3.3. Service Grid and IoT Platform

Most of the IoT platforms are constructed using SOA architecture or microservice architecture. With the development of the platform, the IoT platform built by SOA architecture has gradually shown low system resource utilization, single technology selection, low development and operation efficiency, and bloated code. There is still a high coupling between business code and service governance, and it is difficult to implement services with different technical frameworks and communication protocols. These two issues are interconnected. The service grid analyzes the problems of the microservice architecture on the basis of microservices. In the architecture design, the network agent in the form of a sidecar is used as the infrastructure for service governance. This design can discover the service resource configuration. Load balancing and other functions are extracted from the service, which is more suitable for the application service of the Internet of Things platform that has complex service calling relationships and focuses on agile development.Research on the service grid in the software industry has gradually emerged. Although its design can theoretically solve the problems of the traditional microservice architecture and provide support for the multilingual ecology, unfortunately, the related work has just begun. Open sourced some frameworks and toolkits in vertical fields that include service grid ideas, which are not suitable for the construction of the Internet of Things platform in this article. Therefore, this article builds a network agent based on the service grid idea as a service governance infrastructure to solve traditional microservices. There are two major problems in the architecture of the Internet of Things slices. Figure2 shows the public cloud architecture for resource allocation under the management mode of the Internet of Things.Figure 2
Public cloud architecture for resource allocation in IoT management mode.


## 3.1. Microservice Architecture

The monolithic architecture has distinctive features, and early project management is convenient. You only need to package the entire project into a web container to run. However, with the expansion of business and the increase in the number of users, the monolithic system can no longer simply increase the system’s tolerance through horizontal expansion and cannot meet the huge device connection requirements of the IoT platform. Distributed architecture is to split the function of the entire system. Each functional module has an independent process. It is designed to provide prerequisites for the good operation of large and complex systems. It is widely used in the construction of IoT platforms [23–25].Microservice architecture is an architectural style that divides a large and complex system into multiple services that can operate independently and with a single function [26, 27]. The services are communicated through lightweight protocols. Different from the SOA architecture, microservices are divided into fine-grained services according to the module functions, and loose coupling of service functions is realized. Compared with the SOA architecture, the system built by the microservice architecture has the advantages of system scalability and agility. Obvious advantages are more suitable for systems that focus on agile development and rapid iteration, such as IoT platforms [28]. More and more IoT platforms choose to use microservice architecture for construction, and microservice architecture gradually replaces SOA architecture as the preferred solution for the construction of IoT platform architecture.


## 3.2. Service Grid and Microservices

Traditional microservices do not realize the separation of business services and service governance. Service governance is deployed in the same service with business services through framework configuration and other methods. The coupling is high, which is not conducive to the upgrade and iteration of services. Developers and maintenance personnel must complete business services. It is also necessary to take into account service management work such as service discovery resource allocation, which undoubtedly increases the cost of development and maintenance; in addition, when the system needs to access services built with different technical frameworks and communication protocols, it is necessary to add protocol conversion functions for each connected service. This is unacceptable for a large system. The service constructed by the service grid architecture extracts service management functions such as service discovery resource configuration and integrates it into an independent network agent. This network agent is deployed in the same container as a sidecar and business service, reducing the cost of service and service governance. Coupling, developers and maintenance personnel only need to focus on realizing business services, which improves the efficiency of development and maintenance; when the service is called, the network agent deployed in the same container is requested, and the actual service communication is completed between the network agents of two different containers. When the system needs to access services built with different technical frameworks and communication protocols, it only needs to support functions such as protocol conversion in the general network agent and will not cause intrusion to the service. The resource demand response and resource allocation management architecture is shown in Figure1.Figure 1
Resource demand response and resource allocation management architecture.


## 3.3. Service Grid and IoT Platform

Most of the IoT platforms are constructed using SOA architecture or microservice architecture. With the development of the platform, the IoT platform built by SOA architecture has gradually shown low system resource utilization, single technology selection, low development and operation efficiency, and bloated code. There is still a high coupling between business code and service governance, and it is difficult to implement services with different technical frameworks and communication protocols. These two issues are interconnected. The service grid analyzes the problems of the microservice architecture on the basis of microservices. In the architecture design, the network agent in the form of a sidecar is used as the infrastructure for service governance. This design can discover the service resource configuration. Load balancing and other functions are extracted from the service, which is more suitable for the application service of the Internet of Things platform that has complex service calling relationships and focuses on agile development.Research on the service grid in the software industry has gradually emerged. Although its design can theoretically solve the problems of the traditional microservice architecture and provide support for the multilingual ecology, unfortunately, the related work has just begun. Open sourced some frameworks and toolkits in vertical fields that include service grid ideas, which are not suitable for the construction of the Internet of Things platform in this article. Therefore, this article builds a network agent based on the service grid idea as a service governance infrastructure to solve traditional microservices. There are two major problems in the architecture of the Internet of Things slices. Figure2 shows the public cloud architecture for resource allocation under the management mode of the Internet of Things.Figure 2
Public cloud architecture for resource allocation in IoT management mode.


## 4. Design of the Unified Management Mechanism of the Internet of Things Database Based on XML

### 4.1. Resource Configuration of Heterogeneous Internet of Things Database

The resource configuration of the underlying heterogeneous Internet of Things database can prepare for the unified management of the Internet of Things database, because through the resource configuration of the Internet of Things database, the essential connection information of the underlying heterogeneous Internet of Things database can be obtained. The connection information and partial data mode of the Internet of Things database are one of the basic tasks to realize the unified management mechanism of the Internet of Things database based on XML.In the process of resource configuration of the underlying heterogeneous Internet of Things database, two roles are required to complete the work together. They are the administrator of each heterogeneous Internet of Things database at the bottom and the unified administrator of the Internet of Things database. They need to cooperate to complete the access authority setting. In this article, the information generated by the resource configuration of the heterogeneous Internet of Things database is stored in the form of XML documents. Figure3 is a flowchart of the configuration of heterogeneous Internet of Things database resources.Figure 3
Flowchart of resource configuration of heterogeneous Internet of Things database.The process of heterogeneous IoT database resource configuration is divided into two steps: resource configuration of local IoT database and unified management of global data. The operations are completed by the various heterogeneous Internet of Things database administrators and the unified administrator of the Internet of Things database at the bottom layer.


### 4.2. Global Query Mapping

This article combines the characteristics of the business itself in the USPIOT platform and studies the global query mapping for the unified query mode. The users in the USPIOT platform see the global virtual data view, and the user’s queries are all queries for the global virtual data view, and the global query statements must be decomposed into subquery statements in the underlying heterogeneous Internet of Things database. The decomposition of the global query depends on the pattern mapping information between the global and local data patterns. Figure4 shows the architecture of query and result processing in the unified management system of the Internet of Things database based on XML.Figure 4
The complete query and result processing process.When performing global data query processing, a global query may need multiple conversions of the query resolver. If a global query is too complex, it may need to go through different levels, and the query converter needs to be converted into the query statement form of the corresponding level.


### 4.3. The Object-Level Resource Allocation Strategy of the Internet of Things Database

Object-level keyword retrieval can better integrate the information scattered in each tuple. This section proposes a new sorting strategy for the result sorting problem in the relational Internet of Things database keyword retrieval system. This strategy also considers the relevance of the key attribute content information and the nonkey attribute information and uses the matching degree to measure the object. The content information of key attributes in the middle, and the correlation degree is used to measure the distribution of nonkey attributes in the object. This article proposes an object-level resource allocation algorithm for IoT database based on content and nonkey attribute values. Finally, combining the matching degree of key attributes and the correlation degree of nonkey attributes, a scoring function is given.Sorting the results of the keyword query is a very important work that needs to be done before submitting the final result to the user. In this article, the return result of the keyword search of the relational Internet of Things database is the object. This strategy uses the attribute value of each attribute in the tuple obtained from the keyword search in the relational Internet of Things database to perform data statistics, analyzes the distribution of each attribute value, and sorts according to the analysis result. The sorting algorithm proposed in this section includes two parts: nonkey attribute-based relevance and content-based relevance. Finally, the two relevance score functions are added to obtain the total score function. Each query result will get a comprehensive relevance score according to this sorting algorithm, and then, the results will be returned to the user in descending order of the score.The correlation between the nonkey attributes of the object and the keywordki is calculated. The relevant calculation formula is as follows:(1)ki;tiz=∏Auk⟶X−AktWAuk×Fki,tizAuk.Among them,ki is the keyword, Ak is the attribute where the keyword ki is located, Auk is the nonkey attribute, WAuk is the weight of the corresponding nonkey attribute, tizAuk is the value of the tuple tiz in the attribute Auk, and Fx,y is a function that measures the correlation between x and y.We use information entropy to measure the weight of nonkey attribute values. LetW be a certain attribute, where wi can be regarded as the attribute value assignment on attribute W. For the probability pwi of the attribute value wi, the calculation formula of the information entropy on the noncritical attribute W is as follows:(2)EAw=−∏wi⟶Wmlnpwi⋅1−pwi−1.According to the nature of information entropy, we defineWAw as the weight of nonkey attribute values:(3)WAw=1−EAw−1.Define the number of occurrences of each nonkey attribute value of the keywordki in the full attribute set A+Bki as fj. The larger the fj, the more important the attribute is relative to the keyword ki. fj may be relatively large; get the formula about tfj:(4)tfj=1−lnfj−1.The greater the number of occurrences of the nonkey attribute valuej, the greater the correlation with the keyword. We use the correlation Rj to indicate the correlation between the nonkey attribute value and the keyword. We use Faj,ki to denote its correlation function:(5)Faj,ki=1−lnfj−1⋅e−x.If the keywordki appears in the tuple ti, it is said that the tuple ti directly matches the keyword ki. The value used to measure the similarity of the attribute values in the key attributes is called the matching degree, which is recorded as weightnki. The greater the matching degree, the greater the weight of the attribute value of the key attribute, calculated as follows:(6)weightnki=nkif−1⋅stf⋅nkl−1.The standardized keyword length nkl is calculated as follows:(7)nkl=kl−Fnkl,kl,sl⋅h−1.Among them, keyword length (keyword length, kl) represents the matching degree between the attribute value of the key attribute containing the keywordki and the string of ki, nkl represents the length of the keyword, and sl is the actual length of the string. The parameter nkl introduced in this paper standardizes kl. In practice, it is found that when the value interval of h is [0.1, 0.2], the standardization effect is the best. Among them, when kl is equal to nkl, a complete match is achieved; then, kl is the attribute value in the key attribute, which is the most ideal, but in general, it may only be a partial match.The overall summation formula of the object is:(8)Scoreobject=1−θ⋅ScorewK+θ1+θ⋅Scorecorrth−1,K.Among them,θ is a variable parameter, and its value satisfies [0,1], which plays a regulatory role. θ is used to score the results based on content relevance and based on nonkey attributes. Using this scoring function can be sorted in descending order, and the highest score can be ranked first, that is, the best result is ranked first.


## 4.1. Resource Configuration of Heterogeneous Internet of Things Database

The resource configuration of the underlying heterogeneous Internet of Things database can prepare for the unified management of the Internet of Things database, because through the resource configuration of the Internet of Things database, the essential connection information of the underlying heterogeneous Internet of Things database can be obtained. The connection information and partial data mode of the Internet of Things database are one of the basic tasks to realize the unified management mechanism of the Internet of Things database based on XML.In the process of resource configuration of the underlying heterogeneous Internet of Things database, two roles are required to complete the work together. They are the administrator of each heterogeneous Internet of Things database at the bottom and the unified administrator of the Internet of Things database. They need to cooperate to complete the access authority setting. In this article, the information generated by the resource configuration of the heterogeneous Internet of Things database is stored in the form of XML documents. Figure3 is a flowchart of the configuration of heterogeneous Internet of Things database resources.Figure 3
Flowchart of resource configuration of heterogeneous Internet of Things database.The process of heterogeneous IoT database resource configuration is divided into two steps: resource configuration of local IoT database and unified management of global data. The operations are completed by the various heterogeneous Internet of Things database administrators and the unified administrator of the Internet of Things database at the bottom layer.


## 4.2. Global Query Mapping

This article combines the characteristics of the business itself in the USPIOT platform and studies the global query mapping for the unified query mode. The users in the USPIOT platform see the global virtual data view, and the user’s queries are all queries for the global virtual data view, and the global query statements must be decomposed into subquery statements in the underlying heterogeneous Internet of Things database. The decomposition of the global query depends on the pattern mapping information between the global and local data patterns. Figure4 shows the architecture of query and result processing in the unified management system of the Internet of Things database based on XML.Figure 4
The complete query and result processing process.When performing global data query processing, a global query may need multiple conversions of the query resolver. If a global query is too complex, it may need to go through different levels, and the query converter needs to be converted into the query statement form of the corresponding level.


## 4.3. The Object-Level Resource Allocation Strategy of the Internet of Things Database

Object-level keyword retrieval can better integrate the information scattered in each tuple. This section proposes a new sorting strategy for the result sorting problem in the relational Internet of Things database keyword retrieval system. This strategy also considers the relevance of the key attribute content information and the nonkey attribute information and uses the matching degree to measure the object. The content information of key attributes in the middle, and the correlation degree is used to measure the distribution of nonkey attributes in the object. This article proposes an object-level resource allocation algorithm for IoT database based on content and nonkey attribute values. Finally, combining the matching degree of key attributes and the correlation degree of nonkey attributes, a scoring function is given.Sorting the results of the keyword query is a very important work that needs to be done before submitting the final result to the user. In this article, the return result of the keyword search of the relational Internet of Things database is the object. This strategy uses the attribute value of each attribute in the tuple obtained from the keyword search in the relational Internet of Things database to perform data statistics, analyzes the distribution of each attribute value, and sorts according to the analysis result. The sorting algorithm proposed in this section includes two parts: nonkey attribute-based relevance and content-based relevance. Finally, the two relevance score functions are added to obtain the total score function. Each query result will get a comprehensive relevance score according to this sorting algorithm, and then, the results will be returned to the user in descending order of the score.The correlation between the nonkey attributes of the object and the keywordki is calculated. The relevant calculation formula is as follows:(1)ki;tiz=∏Auk⟶X−AktWAuk×Fki,tizAuk.Among them,ki is the keyword, Ak is the attribute where the keyword ki is located, Auk is the nonkey attribute, WAuk is the weight of the corresponding nonkey attribute, tizAuk is the value of the tuple tiz in the attribute Auk, and Fx,y is a function that measures the correlation between x and y.We use information entropy to measure the weight of nonkey attribute values. LetW be a certain attribute, where wi can be regarded as the attribute value assignment on attribute W. For the probability pwi of the attribute value wi, the calculation formula of the information entropy on the noncritical attribute W is as follows:(2)EAw=−∏wi⟶Wmlnpwi⋅1−pwi−1.According to the nature of information entropy, we defineWAw as the weight of nonkey attribute values:(3)WAw=1−EAw−1.Define the number of occurrences of each nonkey attribute value of the keywordki in the full attribute set A+Bki as fj. The larger the fj, the more important the attribute is relative to the keyword ki. fj may be relatively large; get the formula about tfj:(4)tfj=1−lnfj−1.The greater the number of occurrences of the nonkey attribute valuej, the greater the correlation with the keyword. We use the correlation Rj to indicate the correlation between the nonkey attribute value and the keyword. We use Faj,ki to denote its correlation function:(5)Faj,ki=1−lnfj−1⋅e−x.If the keywordki appears in the tuple ti, it is said that the tuple ti directly matches the keyword ki. The value used to measure the similarity of the attribute values in the key attributes is called the matching degree, which is recorded as weightnki. The greater the matching degree, the greater the weight of the attribute value of the key attribute, calculated as follows:(6)weightnki=nkif−1⋅stf⋅nkl−1.The standardized keyword length nkl is calculated as follows:(7)nkl=kl−Fnkl,kl,sl⋅h−1.Among them, keyword length (keyword length, kl) represents the matching degree between the attribute value of the key attribute containing the keywordki and the string of ki, nkl represents the length of the keyword, and sl is the actual length of the string. The parameter nkl introduced in this paper standardizes kl. In practice, it is found that when the value interval of h is [0.1, 0.2], the standardization effect is the best. Among them, when kl is equal to nkl, a complete match is achieved; then, kl is the attribute value in the key attribute, which is the most ideal, but in general, it may only be a partial match.The overall summation formula of the object is:(8)Scoreobject=1−θ⋅ScorewK+θ1+θ⋅Scorecorrth−1,K.Among them,θ is a variable parameter, and its value satisfies [0,1], which plays a regulatory role. θ is used to score the results based on content relevance and based on nonkey attributes. Using this scoring function can be sorted in descending order, and the highest score can be ranked first, that is, the best result is ranked first.


## 5. Simulation Experiment

### 5.1. Experimental Test of Network Agent under the Management Mode of the Internet of Things

The experiment designs a consumer implemented by Spring Cloud to consume three different performance providers implemented by Dubbo, pressures the consumer through the wrk pressure measurement tool, and obtains the pressure test results through the lua script. The experimental scenario is not complicated. The system only involves single-interface evaluation, and the QPS obtained from the stress test is used as the throughput evaluation score to evaluate the performance of the network agent.The experiment realizes the communication between the service built with Dubbo as the technical framework and DUBBO as the transmission protocol and the service built with Spring Cloud as the technical framework and HTTP as the transmission protocol through the network proxy, and the network proxy and business services are independent of each other. On the other hand, the experiment puts pressure on the experimental scene through the wrk test tool and uses QPS as the evaluation score of network agent performance. In order to simulate different business environments, the concurrent numbers are 100~500, respectively, and the wrk test results are shown in Figure5.Figure 5
wrk test results.The experiment also compares the load balancing algorithms of random method, round-robin method, and weighted round-robin method, by recording the number of requests processed by each provider. QPS analyzes the performance of different load balancing algorithms, and the experimental results are shown in Figure6. Experiments show that the number of requests processed by the three providers of the polling and random load balancing algorithms is basically the same, and the QPS of the polling method is relatively more stable. Both of these two load balancing algorithms have abnormal requests. This is because the load is not properly distributed. Excessive requests will fill up and overflow the low-configured small-provider thread pool, causing requests to fail. The load balancing algorithm of weighted round-robin load balancing algorithm handles reasonable load distribution of the number of requests processed by the three providers, QPS is higher than the other two load balancing algorithms, and there is no request failure in the whole process. Experimental results show that the weighted round-robin load balancing algorithm is more suitable for the design of network agents.Figure 6
Experimental results of different load balancing algorithms.In order to compare the impact of different serialization methods on network transmission performance, the experiment compared Java native serialization, JackSon, Hessian, and protobuf. We analyze the performance of network transmission in different serialization modes through the test results under 10 times of concurrency, and the experimental results are shown in Figure7. The experimental results show that the system QPS based on the protobuf serialization method is better than several other serialization methods and is more suitable for the design of network agents.Figure 7
Experimental results of different serialization methods.


### 5.2. Analysis of Simulation Results

In order to evaluate the effectiveness of the hybrid resource allocation strategy, the Google IoT platform data is used as experimental data to compare the performance with the strategy that only relies on the reactive resource allocation strategy for resource allocation.The average valueN′ of the number of virtual machines used for the service in all time periods is used as the evaluation index. In the experiment, the service request arrival rate per second in the Poisson distribution λ is set to 100~500, and the service rate of each virtual machine can also be obtained accordingly. Figure 8 shows the evaluation and comparison results.Figure 8
Comparison of two resource allocation strategies.It can be seen from the comparison result in Figure8 that the hybrid resource allocation strategy is better than the reactive resource allocation strategy. This is related to the preparation of the hybrid resource allocation strategy in advance and the delayed release of resources, so as to ensure the supply of resources and respond to the Internet of Things in a timely manner. The resource demand changes, and there is no shortage of resources. The insufficient resource supply of the reactive response strategy far exceeds that of the hybrid resource allocation strategy because its response delay in resource supply cannot keep up with changes in resource demand. In the Internet of Things environment, it is very dangerous when resources are insufficiently supplied. It can lead to a decline in service quality and cause economic losses for operators; at worst, it can lead to server paralysis and even the collapse of the entire data center. Therefore, the IoT resource optimization configuration system and method based on adaptive elastic control can better adapt to the IoT environment, provide a practical and effective guarantee for the optimal and reasonable allocation of resources, and ensure the stability of the IoT platform while providing high service quality.This article uses the open source Internet of Things platform OpenStack to build an adaptive virtualized resource optimization configuration public cloud architecture. The public cloud architecture is a five-layer structure. From bottom to top, they are the infrastructure layer, resource management layer, resource demand scheduling layer, user interface layer, and application layer. OpenStack supports a variety of virtual machine types. This article uses XEN virtual machines and installs Nova components in XEN. This component enables the IoT platform to complete a series of tasks including user request management, virtual machine configuration, and resource type definition.Virtualized resource configuration modes are divided into single virtual machine service single user (SVSC) and single virtual machine service multiuser (SVMC). In the SVSC virtualization resource configuration mode, after the Nova controller recognizes the user demand type and allocates the corresponding virtual machine, it will only serve the user within the set time period, regardless of whether the task is completed or not; after the Nova controller recognizes the user demand type, it is necessary to select a currently running instance based on the current virtualized resource operating status, and the instance is already running other applications, that is, it conforms to the single virtual machine service multirequest mode. The selection criterion is that the instance can meet the resource requirements of the user’s application, and after running the application, the total resource load running on the instance is closest to the capacity set by the type of virtual machine. Under the IoT platform built, the above two virtualization resource allocation methods are comprehensively compared in terms of resource consumption, service performance (the inverse of resource request response time), and average service waiting time. The results are shown in Figure9. Compared with the current SVSC-based virtualization resource configuration mode, the SVMC virtualization resource configuration mode can save resources and improve the utilization rate of IoT resources while ensuring service quality.Figure 9
Comparison results of SVSC and SVMC. (a) Comparison of resource consumption between SVSC and SVMC, (b) comparison of service performance between SVSC and SVMC, and (c) comparison of average service waiting time between SVSC and SVMC.
(a)(b)(c)


## 5.1. Experimental Test of Network Agent under the Management Mode of the Internet of Things

The experiment designs a consumer implemented by Spring Cloud to consume three different performance providers implemented by Dubbo, pressures the consumer through the wrk pressure measurement tool, and obtains the pressure test results through the lua script. The experimental scenario is not complicated. The system only involves single-interface evaluation, and the QPS obtained from the stress test is used as the throughput evaluation score to evaluate the performance of the network agent.The experiment realizes the communication between the service built with Dubbo as the technical framework and DUBBO as the transmission protocol and the service built with Spring Cloud as the technical framework and HTTP as the transmission protocol through the network proxy, and the network proxy and business services are independent of each other. On the other hand, the experiment puts pressure on the experimental scene through the wrk test tool and uses QPS as the evaluation score of network agent performance. In order to simulate different business environments, the concurrent numbers are 100~500, respectively, and the wrk test results are shown in Figure5.Figure 5
wrk test results.The experiment also compares the load balancing algorithms of random method, round-robin method, and weighted round-robin method, by recording the number of requests processed by each provider. QPS analyzes the performance of different load balancing algorithms, and the experimental results are shown in Figure6. Experiments show that the number of requests processed by the three providers of the polling and random load balancing algorithms is basically the same, and the QPS of the polling method is relatively more stable. Both of these two load balancing algorithms have abnormal requests. This is because the load is not properly distributed. Excessive requests will fill up and overflow the low-configured small-provider thread pool, causing requests to fail. The load balancing algorithm of weighted round-robin load balancing algorithm handles reasonable load distribution of the number of requests processed by the three providers, QPS is higher than the other two load balancing algorithms, and there is no request failure in the whole process. Experimental results show that the weighted round-robin load balancing algorithm is more suitable for the design of network agents.Figure 6
Experimental results of different load balancing algorithms.In order to compare the impact of different serialization methods on network transmission performance, the experiment compared Java native serialization, JackSon, Hessian, and protobuf. We analyze the performance of network transmission in different serialization modes through the test results under 10 times of concurrency, and the experimental results are shown in Figure7. The experimental results show that the system QPS based on the protobuf serialization method is better than several other serialization methods and is more suitable for the design of network agents.Figure 7
Experimental results of different serialization methods.


## 5.2. Analysis of Simulation Results

In order to evaluate the effectiveness of the hybrid resource allocation strategy, the Google IoT platform data is used as experimental data to compare the performance with the strategy that only relies on the reactive resource allocation strategy for resource allocation.The average valueN′ of the number of virtual machines used for the service in all time periods is used as the evaluation index. In the experiment, the service request arrival rate per second in the Poisson distribution λ is set to 100~500, and the service rate of each virtual machine can also be obtained accordingly. Figure 8 shows the evaluation and comparison results.Figure 8
Comparison of two resource allocation strategies.It can be seen from the comparison result in Figure8 that the hybrid resource allocation strategy is better than the reactive resource allocation strategy. This is related to the preparation of the hybrid resource allocation strategy in advance and the delayed release of resources, so as to ensure the supply of resources and respond to the Internet of Things in a timely manner. The resource demand changes, and there is no shortage of resources. The insufficient resource supply of the reactive response strategy far exceeds that of the hybrid resource allocation strategy because its response delay in resource supply cannot keep up with changes in resource demand. In the Internet of Things environment, it is very dangerous when resources are insufficiently supplied. It can lead to a decline in service quality and cause economic losses for operators; at worst, it can lead to server paralysis and even the collapse of the entire data center. Therefore, the IoT resource optimization configuration system and method based on adaptive elastic control can better adapt to the IoT environment, provide a practical and effective guarantee for the optimal and reasonable allocation of resources, and ensure the stability of the IoT platform while providing high service quality.This article uses the open source Internet of Things platform OpenStack to build an adaptive virtualized resource optimization configuration public cloud architecture. The public cloud architecture is a five-layer structure. From bottom to top, they are the infrastructure layer, resource management layer, resource demand scheduling layer, user interface layer, and application layer. OpenStack supports a variety of virtual machine types. This article uses XEN virtual machines and installs Nova components in XEN. This component enables the IoT platform to complete a series of tasks including user request management, virtual machine configuration, and resource type definition.Virtualized resource configuration modes are divided into single virtual machine service single user (SVSC) and single virtual machine service multiuser (SVMC). In the SVSC virtualization resource configuration mode, after the Nova controller recognizes the user demand type and allocates the corresponding virtual machine, it will only serve the user within the set time period, regardless of whether the task is completed or not; after the Nova controller recognizes the user demand type, it is necessary to select a currently running instance based on the current virtualized resource operating status, and the instance is already running other applications, that is, it conforms to the single virtual machine service multirequest mode. The selection criterion is that the instance can meet the resource requirements of the user’s application, and after running the application, the total resource load running on the instance is closest to the capacity set by the type of virtual machine. Under the IoT platform built, the above two virtualization resource allocation methods are comprehensively compared in terms of resource consumption, service performance (the inverse of resource request response time), and average service waiting time. The results are shown in Figure9. Compared with the current SVSC-based virtualization resource configuration mode, the SVMC virtualization resource configuration mode can save resources and improve the utilization rate of IoT resources while ensuring service quality.Figure 9
Comparison results of SVSC and SVMC. (a) Comparison of resource consumption between SVSC and SVMC, (b) comparison of service performance between SVSC and SVMC, and (c) comparison of average service waiting time between SVSC and SVMC.
(a)(b)(c)


## 6. Conclusion

Aiming at the problems at the architectural level, this paper designs and implements a network proxy with service resource configuration discovery, load balancing, and protocol conversion as the infrastructure of service communication based on the idea of service grid, which reduces the coupling between business code and service quality. It also intercepts service communication traffic and realizes the interconnection and intercommunication between services constructed by different technologies and communication protocols. In the design of the unified management mechanism for the Internet of Things database based on XML, a global data model was designed for the data model conversion problem, the mapping between the local data model and the global data model was established, and the schema mapping metadata was generated. We solve the data conflict in the schema mapping and define the XML Schema for the partial data schema of the underlying heterogeneous Internet of Things database. A hybrid elastic control resource allocation strategy based on the combination of active control and passive response is proposed to realize the effective use of cloud computing resources. Considering that in the process of implementing resource allocation in the Internet of Things, a good platform architecture is particularly important. It needs to be able to adapt as quickly as possible according to changes in the resource requirements of the Internet of Things and carry out efficient resource allocation. Therefore, in order to build an adaptive Internet of Things architecture and optimize the allocation of virtualized resources, this paper constructs an architecture with adaptive virtualized resource optimal allocation capabilities in a public cloud environment. The public cloud architecture has five layers. The structure, from bottom to top, is the infrastructure layer, the resource management layer, the resource demand scheduling layer, the user interface layer, and the application layer. Under this architecture, a resource optimization configuration method based on a single virtual machine service multirequest resource configuration method is emphatically put forward. While ensuring that the user service quality is satisfied, the resource utilization rate is improved, and the operator’s cost is effectively reduced.



---

*Source: 7963311-2021-07-20.xml*