CN109361761B - Internet of things communication terminal operating system - Google Patents

Internet of things communication terminal operating system Download PDF

Info

Publication number
CN109361761B
CN109361761B CN201811404521.8A CN201811404521A CN109361761B CN 109361761 B CN109361761 B CN 109361761B CN 201811404521 A CN201811404521 A CN 201811404521A CN 109361761 B CN109361761 B CN 109361761B
Authority
CN
China
Prior art keywords
data
layer
communication
protocol
internet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811404521.8A
Other languages
Chinese (zh)
Other versions
CN109361761A (en
Inventor
鲁晓军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Chao Yan Intelligent Technology Co Ltd
Original Assignee
Nanjing Chao Yan Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Chao Yan Intelligent Technology Co Ltd filed Critical Nanjing Chao Yan Intelligent Technology Co Ltd
Priority to CN201811404521.8A priority Critical patent/CN109361761B/en
Publication of CN109361761A publication Critical patent/CN109361761A/en
Application granted granted Critical
Publication of CN109361761B publication Critical patent/CN109361761B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/61Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources taking into account QoS or priority requirements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/62Establishing a time schedule for servicing the requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/321Interlayer communication protocols or service data unit [SDU] definitions; Interfaces between layers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Communication Control (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses an operating system of an internet of things communication terminal, which comprises: an application layer, a protocol layer, a data link layer and a communication layer; the application layer is used for collecting field signals and transmitting the field signals to the Internet of things terminal and the protocol layer; the protocol layer assembles the original data acquired by the application layer and converts the protocol format to generate a number, check data, encrypt or not and an encryption method and transmits the number, the check data, the encryption method and the encryption method to a server of the terminal of the Internet of things; the data link layer schedules the received data of the protocol layer and sends the data to the communication layer by adopting a priority scheduling algorithm; the input end of the communication layer is in communication connection with a server of the Internet of things terminal, and each functional module is processed in a layered mode; and the data link layer schedules and distributes data contents and operates a specific communication module, so that the operation difficulty of the communication module is reduced.

Description

Internet of things communication terminal operating system
Technical Field
The invention belongs to the technical field of communication systems, and particularly relates to an operating system of an internet of things communication terminal.
Background
The terminal of the Internet of things integrates field data acquisition and communication, the field data Can be acquired through RS232/RS485/Can and other buses, then is sent through a network, and is generally sent through a Uart bus in the form of AT commands or an embedded TCP/IP protocol.
According to the characteristics of field data, the Internet of things equipment is designed into various forms to meet the requirements of different rates, the communication mode is selected according to the characteristics of the data, modules such as GPRS (general packet radio service) and NBIOT (negative band operation) can be selected at low speed, and schemes such as 4G and Ethernet can be selected at high speed. Therefore, the internet of things equipment has the characteristics of multiple selectable modules and various terminal types.
However, the management of the modules is troublesome, for a single internet of things terminal, the number of integrated modules is small, complex operating system management is not needed, all work can be completed by one software program, but the selectable types are multiple, the service is more and more complex, the service volume is complex along with the increase of the selectable modules, the software development workload is increased in a geometric progression manner, if no good management software exists, the newly-increased service can hardly be performed, and the original code can not be maintained.
Disclosure of Invention
In order to solve the technical problems in the background art, the invention provides an operating system of an internet of things communication terminal, which unifies the operating modes of the internet of things terminal, enables data acquired from a plurality of data sources to be sent by using different links, and enables the system to perform content scheduling according to the data sources and control external equipment according to instructions issued by the network.
The invention is realized by the following technical scheme: an internet of things communication terminal operating system, comprising: an application layer, a protocol layer, a data link layer and a communication layer; the output end of the application layer is in communication connection with the input end of the protocol layer; the output end of the protocol layer is in communication connection with the input end of the data link layer; the output end of the data link layer is in communication connection with the input end of the communication layer;
the application layer is used for collecting field signals and transmitting the field signals to the Internet of things terminal and the protocol layer;
the protocol layer assembles the original data acquired by the application layer and converts the protocol format to generate a number, check data, encrypt or not and an encryption method and transmits the number, the check data, the encryption method and the encryption method to a server of the terminal of the Internet of things;
the data link layer schedules the received data of the protocol layer and sends the data to the communication layer by adopting a priority scheduling algorithm;
the input end of the communication layer is in communication connection with the server of the Internet of things terminal, time points are set on the communication layer, and the communication layer counts every time when the timer arrives.
In a further embodiment, the application layer, the protocol layer, the data link layer and the communication layer are connected to each other by a common interface.
In a further embodiment, the application layer is connected with a corresponding bus interface of an external sensor through a bus such as RS232, RS485, CAN, and the like, communicates with the external sensor, and sends acquired data returned by the sensor to the protocol layer.
In a further embodiment, the protocol layer is operated by a protocol layer abstraction structure, specifically comprising the steps of:
step (1): and initializing a protocol layer abstract structure body, and selecting a specific communication protocol.
Step (2): setting a protocol header comprising a terminal number, a data length, a check value, an encryption method and a characteristic code of a protocol start;
and (3): analyzing the data received in the application layer, and packaging the data into a specified format according to a protocol;
and (4): and unpacking the data sent by the server according to the protocol and then transmitting the data to a corresponding application layer for processing.
In a further embodiment, the data link layer determines the content of the data of the communication layer, and in the sending link, the layer schedules the data of the protocol layer, and directly sends the data when the communication link is smooth, otherwise, the data is temporarily stored in a buffer memory of the terminal, and the data is sent again after the link communication is recovered; upon receipt, the layer will send the received data to the protocol layer.
In a further embodiment, the priority scheduling algorithm comprises:
the method comprises the following steps: setting n data sources, wherein the n data sources are S1、S2、S3…SnThe initial priority of the n data sources is set as a1、a2、a3…anThe optimized data source priority is w1、w2、w3…wn
Step two: each data source S set at time tiAmount of incoming data CitThe last unsent data volume is RitAnd CitAnd RitSum of (2)it(ii) a When C is presentitThe smaller the proof of the data source S at that timeiThe data volume sent is small, the real-time requirement is high, and high priority is needed for sending; when L isitThe larger the data is, the more the data source accumulates, the buffer needs to be cleared in time, and the sending priority of the data source also needs to be improved;
step three: the CPU processes and sends the data of each data source one by one, and the CPU needs to wait in a queue under the condition of a large number of data sources, so that a queuing system is formed; to clarify the priority of these data sources under different processing conditions, a queuing theory is used to handle this case;
step four: the number of data sources in the system at the time t is N (t), and the queuing theory shows that when the data sources are in the system at the time t, the data sources are in the same order
Figure BDA0001877045080000031
At 1, N (t) is not traversed, and when ρ < 1, N (t) is traversed, the average queue length at steady state is
Figure BDA0001877045080000032
After the average queue length is obtained, the average number N of the arriving bytes in each arriving queue at the time t in the stable state is calculated respectivelytAnd accumulated byte number Mt
Figure BDA0001877045080000033
Figure BDA0001877045080000034
Based on the above derivation, a data source S is providediThe priority calculation formula at time t:
Figure BDA0001877045080000035
in a further embodiment, the system is initialized before use, and communication layer initialization, data link layer initialization, protocol layer initialization and application layer initialization are sequentially performed; after the initialization is completed, the system enters a while cycle of system standby, a low-authority timing task can be operated, a timer of the Internet of things terminal is activated when a specific service arrives in a normal state, and the system is switched to the specific service operation after the timer is interrupted.
The invention has the beneficial effects that: processing each functional module in a layered mode; the data link layer schedules and distributes data contents, and operates a specific communication module, so that the operation difficulty of the communication module is reduced; the protocol layer carries out coding and decoding processing on the data, so that the data can be transmitted by the protocol layer in a server interaction mode; interaction among the modules is carried out through the abstract structure, specific functions are only realized in each functional module, external operation is carried out through the abstract structure, and the coupling degree among the modules is reduced; the communication module can set the period of the timer by itself, and the requirements of different transmission rates are met.
Drawings
Fig. 1 is an internal connection diagram of an operating system of an internet of things communication terminal according to the present invention.
Fig. 2 is a structural diagram of a protocol layer in the present invention.
Fig. 3 is a flow chart of data scheduling in the present invention.
Fig. 4 is a structural diagram of a data link layer in the present invention.
FIG. 5 is a flow chart of system initialization of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
An internet of things communication terminal operating system, comprising: an application layer, a protocol layer, a data link layer, and a communication layer. As shown in fig. 1, the output terminal of the application layer is communicatively connected to the input terminal of the protocol layer; the output end of the protocol layer is in communication connection with the input end of the data link layer; the output end of the data link layer is in communication connection with the input end of the communication layer; the application layer, the protocol layer, the data link layer and the communication layer are connected with each other through a common interface. Deep coupling is avoided, and development by programmers is facilitated.
The application layer is used for collecting field signals and transmitting the field signals to the Internet of things terminal and the protocol layer. Data transmission CAN be carried out through buses such as RS232, RS485 and CAN, the Internet of things terminal CAN read the data, and the terminal CAN directly acquire analog signals and convert the analog signals into digital signals through AD. Conversely, the terminal can also send commands to external devices via these buses. The data of the part is original data and cannot be directly transmitted on the network.
In this embodiment, the application layer mainly processes data interaction with an external sensor, and taking an RS485 bus interface provided by most sensors as an example, the application layer sends a command to the sensor through 485, and the returned data is sent to the protocol layer for assembly. The processing strategy of the layer can be defined by a user, only the original data is processed, and the processing strategy only carries out data interaction with the protocol layer and is not directly contacted with other layers.
The protocol layer assembles the original data acquired by the application layer and converts the protocol format to generate a number, check data, encrypt or not and an encryption method and transmits the number, the check data, the encryption method and the encryption method to a server of the terminal of the Internet of things; so that the server can process the messages conveniently. Various industries have various protocol formats, such as JTT808 protocol of vehicle-mounted key points, national standard protocol of electric vehicles, IEC61850 and other power grid data, and also factory-defined communication formats. The protocol layer mainly completes the encoding and decoding of real-time data, and the layer can be operated by a protocol layer abstract structure body and finally realized by a concrete protocol, and the concrete structure of the layer is shown in fig. 2.
The contents of the PROTOCOL layer abstraction structure PROTOCOL _ OP are shown in table 1.
TABLE 1 contents of PROTOCOL layer abstraction structure PROTOCOL _ OP
Figure BDA0001877045080000051
Taking the DMOP protocol developed based on our reference to the national standard electric vehicle data standard as an example, its message header is:
Figure BDA0001877045080000052
Figure BDA0001877045080000061
in implementation, the PROTOCOL needs to implement the function in the PROTOCOL _ OP and point it to the PROTOCOL layer abstract structure, and declares the following variables:
PROTOCOL_OP g_PRO_DMOP_op=
{
.ProtoName="DMOP",
.m_RecvCharcter="##",
.Init=Dmop_Init,
.AssemBuff=Dmop_AssemBuff,
.RecvFunc=DmopRecvFunc,
RecvAppFunc. NULL// this protocol does not require hardware operations, so this function does not need to be implemented
};
And then the g _ PRO _ DMOP _ op points to the virtual structure, and when other layers use the layer, the data operation of the DMOP protocol can be realized only through the pointer operation of the virtual structure.
And the data link layer schedules the received data of the protocol layer and sends the data to the communication layer by adopting a priority scheduling algorithm. The data link layer determines the content of the data of the communication layer, and in the sending link, the layer schedules the data of the protocol layer, and directly sends the data when the communication link is smooth, otherwise, the data is temporarily stored in a buffer memory of the terminal, and the data is sent again after the link communication is recovered; upon reception, the layer will send the received data to the communication layer.
The layer uses a priority scheduling algorithm to determine the transmitted content, carries out priority sequencing aiming at the data of different data sources, and dynamically adjusts the priority of each data source.
In practice, the processing capacity of the MCU of the Internet of things equipment is weak, and the method is not suitable for a complex priority calculation method.
The priority scheduling algorithm comprises:
the method comprises the following steps: setting n data sources, wherein the n data sources are S1、S2、S3…SnThe initial priority of the n data sources is set as a1、a2、a3…anThe optimized data source priority is w1、w2、w3…wn
Step two: each data source S set at time tiAmount of incoming data CitThe last unsent data volume is RitAnd CitAnd RitSum of (2)it(ii) a When C is presentitThe smaller the proof of the data source S at that timeiThe data volume sent is small, the real-time requirement is high, and high priority is needed for sending; when L isitThe larger the data is, the more the data source accumulates, the buffer needs to be cleared in time, and the sending priority of the data source also needs to be improved;
step three: the CPU processes and sends the data of each data source one by one, and the CPU needs to wait in a queue under the condition of a large number of data sources, so that a queuing system is formed; to clarify the priority of these data sources under different processing conditions, a queuing theory is used to handle this case;
the phenomenon of queuing exists in the processing of the data sources, the cpu processes and sends the data of each data source one by one, and the cpu needs to wait in a queue under the condition that the number of the data sources is large, so that a queuing system is formed. To clarify the priority of these data sources under different processing conditions, we use queuing theory to handle this case. The M/M/1 queuing is a queuing system of a single attendant, the data arrival interval time of the data sources obeys exponential distribution with a parameter of lambda, and the processing time obeys exponential distribution with a parameter of mu and is independently and equally distributed;
step four: the number of data sources in the system at the time t is N (t), and the queuing theory shows that when the data sources are in the system at the time t, the data sources are in the same order
Figure BDA0001877045080000071
At 1, N (t) is not traversed, and when ρ < 1, N (t) is traversed, the average queue length at steady state is
Figure BDA0001877045080000072
After the average queue length is obtained, the average number N of the arriving bytes in each arriving queue at the time t in the stable state is calculated respectivelytAnd accumulated byte number Mt
Figure BDA0001877045080000073
Figure BDA0001877045080000074
Based on the above derivation, a data source S is providediThe priority calculation formula at time t:
Figure BDA0001877045080000081
in a specific field environment, most of the situations encountered by people are that RS485 equipment information and can bus information are acquired simultaneously. For RS485 equipment information, a Modbus protocol is mostly adopted, and the method has the characteristics of short and bold. For can bus information, although the amount of data arriving each time is small, the real-time requirement is high, and data in a time period needs to be completely packaged and uploaded, which results in that more data are received and need to be sent when the data arrive at the sending node.
Considering the reliability of communication and the bearing capacity of a link, a communication layer is designed to upload data to a server every 5s, and the maximum length of the uploaded data is 800 bytes. And randomly intercepting data in a period of time through a serial port tool to calculate the priority of the data and compare the priority with the actual situation.
Table 2 data source data
Figure BDA0001877045080000082
Setting an M/M/1 model that at the data transmission moment, the arrival time of the data source data which arrives randomly obeys
Figure BDA0001877045080000083
Is referred to asNumber distribution, processing time compliance
Figure BDA0001877045080000084
The average queue length of the data sources when coming is calculated
Figure BDA0001877045080000085
L-9 can be obtained, and then the number of arriving bytes N in the average queue length at each time t will be calculatedtAnd accumulated byte number MtAs shown in Table 3
TABLE 3 number of bytes arriving N in average queue LengthtAnd accumulated byte number Mt
Figure BDA0001877045080000086
Figure BDA0001877045080000091
For the
Figure BDA0001877045080000092
In the initial case, 485 data sources with higher priority a1 being 1 and can data sources with lower priority a2 being 2 are set, and the specific priorities of the data sources at each communication time in the communication layer are calculated according to table 2 and table 3, as shown in table 4.
TABLE 4 data Source priority ωi
Time (t) 485 data Source priority ω1 Can data source priority ω2
5 0.079 4.997
10 1.027 0.964
15 0.060 1.182
20 0.079 0.018
25 1.027 2.116
30 0.960 0.835
For each time of data source priority calculation, the average queue length L in the 5s time period is calculated, then the priorities pi 1 and pi 2 of the 485 data source and the can data source at the moment are calculated respectively according to a formula, and the smaller data source has higher priority by comparing the sizes of the priorities. Through calculation, when the communication layer uploads data to the server each time, the system can select the data of the data source to be sent according to an optimal mode under the actual condition, and the data of the data source to be sent is not arranged and selected according to the predefined priority. The data source selected and sent by the system is consistent with the situation calculated by people and is in line with the expectation.
The data scheduling is realized in the layer, and the content of interaction with the server comprises real-time data, an operation instruction, buffer temporary data and the like. The data state is adjusted according to the content.
For example, data state is used to represent the data state, and the specific values are:
value taking Means of
FWDATA Firmware update
RTDATA Real-time data
UNSEND Sending buffered unsent data
HBDATA Sending heartbeat packets
A flow chart of data scheduling is shown in fig. 3.
For data reception, the layer mainly establishes a data reception hook array, and calls a hook function according to feature codes of different data, for example, a unit of the set hook array has the following structure:
RECV_FUNC
Figure BDA0001877045080000093
Figure BDA0001877045080000101
for example, some protocols have a "##" tag at the beginning, and the system registers the protocol tag and the corresponding protocol processing function in the array. When data of the protocol arrives, the layer can be transmitted to the protocol layer for processing through the function hook.
This layer defines the abstract structure DATALL _ OP that operates on the communication module, which needs to implement concrete functions and then assign these functions to these pointers in order to operate. The structure is shown in fig. 4.
The abstract structure DATALL _ OP of this layer is as follows:
Figure BDA0001877045080000102
after the communication module sets the timer, the timing processing function of the module can be linked to the timing clock of the system, and the processing function realizes the timing transmission of the data sent by the link layer to the finite state machine of the module.
Taking an M6313 module of a middle-shift physical association as an example, the module is a GPRS module, data transceiving of a communication bottom layer is realized in the system, and according to a datal _ OP structure of a link layer, the system can be connected as long as several functions are realized, for example, a structure declaring M6313_ OP:
DATALL_OP M6313_op=
{
.init=M6313_init,
.SetSend=M6313_SetSend,
.send=M6313_Send,
.recv=M6313_Recv,
.checkLos=M6313_CheckLos,
.reboot=M6313_reboot,
.close=M6313_close
};
according to the AT command manual of M6313, these functions in the structure body can be realized.
The input end of the communication layer is in communication connection with the server of the Internet of things terminal, time points are set on the communication layer, and the communication layer counts every time when the timer arrives.
The system is initialized before use, and communication layer initialization, data link layer initialization, protocol layer initialization and application layer initialization are carried out in sequence; after the initialization is completed, the system enters a while cycle of system standby, a low-authority timing task can run at the place, a timer of the internet of things terminal is triggered when a specific service arrives under a normal state, and the system runs after the timer is interrupted.
As shown in fig. 5, the system initializes the operations of the main initialization MCU, such as clock, timer interrupt.
The communication module initialization is mainly based on the characteristics of the specific module to initialize the relevant buffer area.
And initializing a data area, a scheduling strategy, firmware updating and a continuous transmission area by a link layer.
And initializing a protocol layer to configure a terminal number, setting a message header and the like.
And the application layer is initialized to set a data acquisition bus, such as the configuration of an RS485 bus.
After the initialization is completed, the system enters a while loop of standby, and some low-authority timing tasks can run in the loop. The timer interrupt triggered by the arrival of a specific service is waited for to operate at ordinary times.
The timing task is placed in a timing operation array, the unit of the array is a time function structure body, and the content is as follows: TIMER _ FUNC
Type (B) Name (R) Use of
int tID Timer ID
void (*time_function)() Entry address of timing processing function
int ticks Cycles of timed execution, multiples of the basic clock
During initialization, each module using a timing task needs to register its own timing processing function in the array, and after a timer interrupt occurs, the interrupted processing function ISR will sequentially call the processing functions in the array.

Claims (6)

1. An internet of things communication terminal operating system, comprising: an application layer, a protocol layer, a data link layer and a communication layer; the output end of the application layer is in communication connection with the input end of the protocol layer; the output end of the protocol layer is in communication connection with the input end of the data link layer; the output end of the data link layer is in communication connection with the input end of the communication layer;
the application layer is used for collecting field signals and transmitting the field signals to the Internet of things terminal and the protocol layer;
the protocol layer assembles the original data acquired by the application layer and converts the protocol format to generate a number, check data, encrypt or not and an encryption method and transmits the number, the check data, the encryption method and the encryption method to a server of the terminal of the Internet of things;
the data link layer schedules the received data of the protocol layer and sends the data to the communication layer by adopting a priority scheduling algorithm;
the input end of the communication layer is in communication connection with a server of the Internet of things terminal, time points are set on the communication layer, and the communication layer counts every time a timer arrives;
the priority scheduling algorithm comprises:
the method comprises the following steps: setting n data sources, wherein the n data sources are S1、S2、S3…SnThe initial priority of the n data sources is set as a1、a2、a3…anThe optimized data source priority is w1、w2、w3…wn
Step two: each data source S set at time tiAmount of incoming data CitThe last unsent data volume is RitAnd CitAnd RitSum of (2)it(ii) a When C is presentitThe smaller the proof of the data source S at that timeiThe data volume sent is small, the real-time requirement is high, and high priority is needed for sending; when L isitThe larger the data is, the more the data source accumulates, the buffer needs to be cleared in time, and the sending priority of the data source also needs to be improved;
step three: the CPU processes and sends the data of each data source one by one, and the CPU needs to wait in a queue under the condition of a large number of data sources, so that a queuing system is formed; to clarify the priority of these data sources under different processing conditions, a queuing theory is used to handle this case;
step four: the number of data sources in the system at the time t is N (t), and the queuing theory shows that when the data sources are in the system at the time t, the data sources are in the same order
Figure FDA0002331461030000011
Figure FDA0002331461030000012
When N (t) is not traversal, and when ρ < 1, N (t) is traversal, the average queue length in steady state is
Figure FDA0002331461030000013
Wherein, λ is λ exponential distribution, μ is μ exponential distribution;
after the average queue length is obtained, the average time per unit at the time t in the stable state is calculated respectivelyNumber of incoming bytes in incoming queue NtAnd accumulated byte number Mt
Figure FDA0002331461030000014
Figure FDA0002331461030000021
Based on the above derivation, a data source S is providediThe priority calculation formula at time t:
Figure FDA0002331461030000022
2. the internet-of-things communication terminal operating system as claimed in claim 1, wherein the application layer, the protocol layer, the data link layer and the communication layer are connected to each other through a common interface.
3. The operating system of the communication terminal of the internet of things as claimed in claim 1, wherein the application layer is connected with and communicates with the corresponding bus interface of the external sensor through RS232 and RS485, and the CAN bus, and sends the collected data returned by the sensor to the protocol layer.
4. The internet of things communication terminal operating system according to claim 1, wherein the protocol layer is operated by a protocol layer abstraction structure, specifically comprising the steps of:
step (1): initializing a protocol layer abstract structure body, and selecting a specific communication protocol;
step (2): setting a protocol header comprising a terminal number, a data length, a check value, an encryption method and a characteristic code of a protocol start;
and (3): analyzing the data received in the application layer, and packaging the data into a specified format according to a protocol;
and (4): and unpacking the data sent by the server according to the protocol and then transmitting the data to a corresponding application layer for processing.
5. The internet-of-things communication terminal operating system according to claim 1, wherein the data link layer determines the content of communication layer data, and in the sending link, the layer schedules protocol layer data, and directly sends the protocol layer data when the communication link is smooth, otherwise, the protocol layer data is temporarily stored in a buffer of the terminal, and the protocol layer data is sent again after the link communication is recovered; upon receipt, the layer will send the received data to the protocol layer.
6. The operating system of the communication terminal of the internet of things according to claim 1, wherein the system is initialized before use, and communication layer initialization, data link layer initialization, protocol layer initialization and application layer initialization are sequentially performed; after the initialization is completed, the system enters a while cycle of system standby, a low-authority timing task can be operated, a timer of the Internet of things terminal is activated when a specific service arrives in a normal state, and the system is switched to the specific service operation after the timer is interrupted.
CN201811404521.8A 2018-11-23 2018-11-23 Internet of things communication terminal operating system Active CN109361761B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811404521.8A CN109361761B (en) 2018-11-23 2018-11-23 Internet of things communication terminal operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811404521.8A CN109361761B (en) 2018-11-23 2018-11-23 Internet of things communication terminal operating system

Publications (2)

Publication Number Publication Date
CN109361761A CN109361761A (en) 2019-02-19
CN109361761B true CN109361761B (en) 2020-03-31

Family

ID=65338661

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811404521.8A Active CN109361761B (en) 2018-11-23 2018-11-23 Internet of things communication terminal operating system

Country Status (1)

Country Link
CN (1) CN109361761B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110166340A (en) * 2019-06-05 2019-08-23 北京京投信安科技发展有限公司 T-NET full system type pictorial single line multi-source data acquiring and transmission system
CN116684203B (en) * 2023-08-03 2023-12-22 南京南自华盾数字技术有限公司 Method and system for realizing ModbusTCP protocol security protection without code variation

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104168056A (en) * 2014-09-01 2014-11-26 绵阳灵通电讯设备有限公司 Satellite communication terminal based on Android operating system
CN104994536A (en) * 2015-07-13 2015-10-21 苏州大学 Configuration method and portable configuration device oriented to WSCN (Wireless Sensor & Controller Node)
CN105721555A (en) * 2016-01-25 2016-06-29 英科信息技术(北京)有限公司 Operation system for Internet of things and terminal device of Internet of things
WO2016201974A1 (en) * 2015-06-15 2016-12-22 清华大学深圳研究生院 Operation control unit-based cross-protocol distributed cloud storage system and data management method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104168056A (en) * 2014-09-01 2014-11-26 绵阳灵通电讯设备有限公司 Satellite communication terminal based on Android operating system
WO2016201974A1 (en) * 2015-06-15 2016-12-22 清华大学深圳研究生院 Operation control unit-based cross-protocol distributed cloud storage system and data management method
CN104994536A (en) * 2015-07-13 2015-10-21 苏州大学 Configuration method and portable configuration device oriented to WSCN (Wireless Sensor & Controller Node)
CN105721555A (en) * 2016-01-25 2016-06-29 英科信息技术(北京)有限公司 Operation system for Internet of things and terminal device of Internet of things

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"固定优先级抢占调度算法下非周期任务实时性能研究";王沁等;《小型微型计算机***》;20110630;全文 *

Also Published As

Publication number Publication date
CN109361761A (en) 2019-02-19

Similar Documents

Publication Publication Date Title
US9703595B2 (en) Multi-core system with central transaction control
CN109361761B (en) Internet of things communication terminal operating system
CN103078895B (en) Multi-functional pair of serial server of a kind of EPA based on MCF52233 chip
US11288072B2 (en) Multi-threaded processor with thread granularity
CN1694556A (en) Method for maintaining wireless network response time while saving wireless adapter power
CN101957808B (en) Communication method among various CPUs (Central Processing Units), system and CPU
CN106162528B (en) LoRa signal and Bluetooth signal conversion module, conversion method and sender unit
CN106452833B (en) Data transmission method for RTU multi-protocol dynamic loading
CN110519374B (en) Edge computing method of ZigBee networked industrial control system and edge node thereof
US7260106B2 (en) Method and apparatus for managing energy usage of processors while executing protocol state machines
CN113518044B (en) EPA equipment
CN115996197B (en) Distributed computing flow simulation system and method with preposed flow congestion
CN104850527B (en) Communications protocol processor
US20060031588A1 (en) Distributing timers across processors
CN108063809B (en) Machine equipment data acquisition method and acquisition system
US8117356B1 (en) Direct memory access (DMA) transfer of network interface statistics
CN113553279B (en) RDMA communication acceleration set communication method and system
CN104468404B (en) A kind of buffer configuration method and device
CN207764789U (en) Bridge for seismic detector master station CPU and peripheral data transmission
CN111935032B (en) Data packet sending method and system
CN202870525U (en) Networked data acquisition apparatus applied to changing environment
CN101464844A (en) Control method and bus interface of RAM use right
CN110620735B (en) Dynamic load balancing telemetering method based on tabular configuration
CN110536467B (en) ZigBee networked industrial control system communication scheduling method and coordinator thereof
CN112637370A (en) Data processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant