Extensible communication method and device of UPP interface, computer equipment and storage medium

文档序号:1937193 发布日期:2021-12-07 浏览:18次 中文

阅读说明:本技术 Upp接口的可扩展通信方法、装置、计算机设备和存储介质 (Extensible communication method and device of UPP interface, computer equipment and storage medium ) 是由 梅文庆 李程 王成杰 邱岳烽 杨胜 李益 付建国 周斌 谭磊 史世友 于 2020-06-03 设计创作,主要内容包括:本发明提供一种UPP接口的可扩展通信方法、装置、计算机设备和存储介质,该方法包括接收或发送通信数据,所述通信数据具有数据帧,其中,所述数据帧具有预设帧结构,所述数据帧包括至少一个通信单元,每一所述通信单元包括用于标识设备的模块号头、用于标识端口的端口号头、用于标识应用的套接字号头以及通信数据。通过将数据帧设置为包含模块号头、端口号头、套接字号头以及通信数据的帧结构,能够实现包含模块、端口和套接字的层次化的通信功能;此外,通过模块、端口和套接字对对象进行抽象,增加通信单元(对象)变得更加容易,使得设备的扩展更为简易、便捷。(The invention provides an extensible communication method, an extensible communication device, a computer device and a storage medium of a UPP interface. By setting the data frame to a frame structure including a module number header, a port number header, a socket number header and communication data, a layered communication function including modules, ports and sockets can be realized; in addition, the objects are abstracted through the modules, the ports and the sockets, so that the addition of communication units (objects) is easier, and the expansion of the equipment is simpler and more convenient.)

1. A scalable communication method of a UPP interface, comprising:

the method comprises the steps of receiving or sending communication data, wherein the communication data is provided with a data frame, the data frame is provided with a preset frame structure, the data frame comprises at least one communication unit, and each communication unit comprises a module number head used for identifying equipment, a port number head used for identifying a port, a socket number head used for identifying an application and application data.

2. The method of claim 1, further comprising:

detecting whether the data frame is in a first registry when the communication data is received;

receiving the communication data when the data frame is in the first registry, and discarding the communication data when the data frame is not in the first registry.

3. The method of claim 2, wherein detecting whether the data frame is in a registry upon receiving the communication data further comprises:

and calling a protocol stack registration function, and performing coding registration according to the received data information to obtain the first registry.

4. The method of claim 1, further comprising:

acquiring the second registry when the communication data is sent;

generating a data queue according to the second registry;

and transmitting the communication data according to the sequence of the data queue.

5. The method of claim 4, wherein the step of obtaining the second registry when transmitting the communication data further comprises:

and calling a protocol stack registration function, and performing coding registration according to the transmitted data information to obtain the second registration table.

6. The method of any one of claims 1-5, further comprising:

acquiring the data frame;

detecting whether a plurality of same module number heads exist in the data frame, combining the plurality of same module number heads into a father node module number head when the plurality of same module number heads exist, and taking a port number head corresponding to the plurality of same module number heads as a child node of the father node module number head;

and whether a plurality of same port number heads exist in the parent node module number head or not is judged, when the plurality of same port number heads exist, the plurality of same port number heads are combined into a parent node port number head, and the socket number heads corresponding to the plurality of same port number heads are used as child nodes of the parent node port number head.

7. An extensible communication apparatus of a UPP interface, comprising:

the communication module is used for receiving or sending communication data, the communication data is provided with a data frame, the data frame is provided with a preset frame structure, the data frame comprises at least one communication unit, and each communication unit comprises a module number head used for identifying equipment, a port number head used for identifying a port, a socket number head used for identifying application and application data.

8. The apparatus of claim 7, further comprising:

the data frame acquisition module is used for acquiring the data frame;

the module number head merging module is used for detecting whether a plurality of same module number heads exist in the data frame, merging the plurality of same module number heads into a father node module number head when the plurality of same module number heads exist, and taking a port number head corresponding to the plurality of same module number heads as a child node of the father node module number head;

and the port number head merging module is used for merging a plurality of same port number heads into a parent node port number head when the same port number heads exist, and taking the socket number heads corresponding to the same port number heads as child nodes of the parent node port number head.

9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 6 when executing the computer program.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.

Technical Field

The invention relates to the technical field of an extensible communication protocol of a UPP interface of an OMAP (open unified protocol) processor, in particular to an extensible communication method and device of the UPP interface, computer equipment and a storage medium.

Background

Most of the controllers on the train use an omap (openmultimedia Application platform) processor from TI (Texas Instruments ), and the control real-time performance of the controller currently determines the accuracy of inversion and network-side control. Existing control periods are on the order of microseconds, while communication frequencies are typically below 100 MHz. The communication traffic needing to be processed in one control period needs tens to hundreds, namely, the communication needs to be transmitted tens to hundreds of times in the same control period, and the transmission frequency of 100MHz is close to the critical value of the microsecond control. Therefore, it is necessary to improve the efficiency and real-time performance of communication. In addition, because the code is changed frequently, the software reuse degree is low, the software versions are many, and the version management is difficult; when a device is newly added or expanded, the program architecture needs to be changed, which makes it difficult to expand the communication device.

Therefore, it is of practical significance to improve the real-time performance of communication and the reusability of codes as much as possible.

Disclosure of Invention

In view of the foregoing, it is desirable to provide a scalable communication method and apparatus for a UPP interface, a computer device, and a storage medium.

A extensible communication method of a UPP interface comprises the following steps:

the method comprises the steps of receiving or sending communication data, wherein the communication data is provided with a data frame, the data frame is provided with a preset frame structure, the data frame comprises at least one communication unit, and each communication unit comprises a module number head used for identifying equipment, a port number head used for identifying a port, a socket number head used for identifying an application and application data.

In one embodiment, further comprising:

detecting whether the data frame is in a first registry when the communication data is received;

receiving the communication data when the data frame is in the first registry, and discarding the communication data when the data frame is not in the first registry.

In one embodiment, said step of detecting whether said data frame is in a registry upon receiving said communication data further comprises:

and calling a protocol stack registration function, and performing coding registration according to the received data information to obtain the first registry.

In one embodiment, further comprising:

acquiring the second registry when the communication data is sent;

generating a data queue according to the second registry;

and transmitting the communication data according to the sequence of the data queue.

In one embodiment, before the step of acquiring the second registry when transmitting the communication data, the method further comprises:

and calling a protocol stack registration function, and performing coding registration according to the transmitted data information to obtain the second registration table.

In one embodiment, further comprising:

acquiring the data frame;

detecting whether a plurality of same module number heads exist in the data frame, combining the plurality of same module number heads into a father node module number head when the plurality of same module number heads exist, and taking a port number head corresponding to the plurality of same module number heads as a child node of the father node module number head;

and whether a plurality of same port number heads exist in the parent node module number head or not is judged, when the plurality of same port number heads exist, the plurality of same port number heads are combined into a parent node port number head, and the socket number heads corresponding to the plurality of same port number heads are used as child nodes of the parent node port number head.

An extensible communication device of a UPP interface, comprising:

the communication module is used for receiving or sending communication data, the communication data is provided with a data frame, the data frame is provided with a preset frame structure, the data frame comprises at least one communication unit, and each communication unit comprises a module number head used for identifying equipment, a port number head used for identifying a port, a socket number head used for identifying application and application data.

In one embodiment, further comprising:

the data frame acquisition module is used for acquiring the data frame;

the module number head merging module is used for detecting whether a plurality of same module number heads exist in the data frame, merging the plurality of same module number heads into a father node module number head when the plurality of same module number heads exist, and taking a port number head corresponding to the plurality of same module number heads as a child node of the father node module number head;

and the port number head merging module is used for merging a plurality of same port number heads into a parent node port number head when the same port number heads exist, and taking the socket number heads corresponding to the same port number heads as child nodes of the parent node port number head.

A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of:

the method comprises the steps of receiving or sending communication data, wherein the communication data is provided with a data frame, the data frame is provided with a preset frame structure, the data frame comprises at least one communication unit, and each communication unit comprises a module number head used for identifying equipment, a port number head used for identifying a port, a socket number head used for identifying an application and application data.

A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:

the method comprises the steps of receiving or sending communication data, wherein the communication data is provided with a data frame, the data frame is provided with a preset frame structure, the data frame comprises at least one communication unit, and each communication unit comprises a module number head used for identifying equipment, a port number head used for identifying a port, a socket number head used for identifying an application and application data.

By setting the data frame to be a frame structure containing a module number head, a port number head, a socket number head and application data, the scalable communication method, the scalable communication device, the computer equipment and the storage medium of the UPP interface can realize a hierarchical communication function containing modules, ports and sockets; in addition, the objects are abstracted through the modules, the ports and the sockets, so that the addition of communication units (objects) is easier, and the expansion of the equipment is simpler and more convenient.

Drawings

FIG. 1A is a flow diagram illustrating a method for extensible communication of UPP interfaces in one embodiment;

fig. 1B is a flowchart illustrating a method for extensible communication of a UPP interface according to another embodiment;

fig. 1C is a flowchart illustrating a method for extensible communication of a UPP interface according to another embodiment;

fig. 1D is a flowchart illustrating a method for extensible communication of the UPP interface in another embodiment;

fig. 1E is a flowchart illustrating a method for extensible communication of a UPP interface according to another embodiment;

fig. 1F is a flowchart illustrating a method for extensible communication of a UPP interface according to yet another embodiment;

FIG. 2 is a block diagram of an extensible communication device for the UPP interface in one embodiment;

FIG. 3 is a diagram of the internal structure of a computer device in one embodiment;

FIG. 4 is a schematic diagram of a communications unit in one embodiment;

FIG. 5 is a block diagram of a data frame in one embodiment;

FIG. 6 is a flow diagram illustrating a process for receiving communication data in one embodiment;

FIG. 7 is a flow diagram illustrating a process for sending communication data according to one embodiment;

FIG. 8 is a diagram illustrating merging of data frames in one embodiment.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

In an embodiment, as shown in fig. 1A, a scalable communication method of a UPP interface is provided, where the scalable communication method of a UPP interface in this embodiment is applicable to communication of an OMAP processor, and includes:

step 100, receiving or sending communication data, wherein the communication data comprises data frames.

The data frame has a preset frame structure, the data frame comprises at least one communication unit, and each communication unit comprises a module number head for identifying equipment, a port number head for identifying a port, a socket number head for identifying an application and application data.

In this embodiment, the receiving or sending of the communication data is a communication process of a UPP interface of the OMAP processor, and in a communication protocol of the UPP interface of the OMAP processor, data transmission is based on a three-layer model, and the three-layer model is divided into a physical interface layer, an MPS (Module-Port-Socket) protocol stack layer, and an application layer. Wherein the physical interface layer specifies the interpretation of the physical properties of the communication medium, such as electrical properties and signal exchange. The MPS protocol stack layer is responsible for the analysis of the protocol and the transmission and forwarding of data. The application layer provides application user usage. In this embodiment, the data frame operates at the MPS protocol stack layer, and the communication data may also be referred to as a communication signal.

Specifically, a three-level composite frame structure based on Module-Port-Socket is adopted in the data frame, wherein Module represents a Module number, Port represents a Port number, Socket represents a Socket number, the value of a Module number header in the data frame is the Module number, the value of a Port number header is the Port number, and the value of a Socket number header is the Socket number, and hierarchical addressing of a communication object can be realized through the three-level composite frame structure. The application layer does not need to pay attention to interfaces and communication links of a lower layer, communication data in the system can be obtained directly through encoding of the Module-Port-Socket, and each data frame is represented through the Module-Port-Socket, so that the communication efficiency is higher.

In this embodiment, as shown in fig. 4 and fig. 5, each Data frame includes a frame header and at least one communication unit, and a Data frame may be composed of a plurality of communication units, as shown in fig. 4, each communication unit includes a Module header (Module header), a Port header (Port header), a Socket header (Socket header), and application Data (Data), where the application Data is Data of an application that is actually transmitted.

A Module number (Module) is a primary functional unit, for example, the primary functional unit may be a device, so that the Module number may identify the device, and a Port number (Port) is a secondary functional unit, which may be used as a communication link extension, for example, different Port numbers are used to characterize different communication links. Socket number (Socket) is a three-level functional unit under a port through which the device realizes the expansion of specific applications. Therefore, through the module number, the port number and the socket number, the communication object can be addressed hierarchically, and the communication equipment, the communication port and the application realized on the port corresponding to the communication data are determined.

In the above embodiment, by setting the data frame to the frame structure including the module number header, the port number header, the socket number header, and the application data, a hierarchical communication function including modules, ports, and sockets can be realized; in addition, the objects are abstracted through the modules, the ports and the sockets, so that the addition of communication units (objects) is easier, and the expansion of the equipment is simpler and more convenient.

In one embodiment, as shown in fig. 5, the data frame further includes a CheckSum (CheckSum), and each data frame includes a CheckSum, which is located at the tail of the data frame, so that after receiving the application data, it can be detected whether the application data is erroneous or missing through the CheckSum check.

In one embodiment, as shown in fig. 1B, the method for extensible communication of the UPP interface further includes:

step 112, when the communication data is received, detecting whether the data frame is in a first registry;

step 114, receiving the communication data when the data frame is in the first registry, and discarding the communication data when the data frame is not in the first registry.

Specifically, the first registry is formed by summarizing protocol stacks according to registered (Module, Port, Socket) values, and the first registry records therein a Module number, a Port number, and a Socket number of a communication object to be received, and may also be referred to as a receiving registry. The communication data of the communication destination recorded in the first registry includes necessary data and valid data, whereas the communication data not recorded in the first registry is invalid or unnecessary data.

In this embodiment, in the process of receiving the communication data, it is first detected whether a data frame of the communication data is in the first registry, when the data frame is in the first registry, it indicates that the communication data corresponding to the data frame is valid data, the communication data is received, and when the data frame is not in the first registry, it indicates that the communication data is invalid data, it indicates that the communication data is not required, and therefore, the communication data is discarded. Therefore, the receiving of invalid data is avoided, the data processing efficiency is effectively improved, and the communication efficiency is improved.

In one embodiment, when receiving the communication data, analyzing the communication data to obtain a data frame of the communication data, obtaining a module number header, a port number header and a socket number header of the data frame, further obtaining a module number, a port number and a socket number of the data frame, and detecting whether the module number, the port number and the socket number of the data frame are in a first registry; receiving the communication data when the module number, the port number, and the socket number of the data frame are in the first registry, and discarding the communication data when the data frame is not in the first registry.

In this embodiment, whether the data frame exists in the first registry is detected by detecting whether the module number, the port number, and the socket number that are the same as the module number, the port number, and the socket number of the data frame exist in the first registry.

In one embodiment, as shown in fig. 1C, before the step of detecting whether the data frame is in the registry when the communication data is received, the method further includes: step 110, calling a protocol stack registration function, acquiring received data information, and performing coding registration according to the received data information to obtain the first registry.

In this embodiment, the user needs to use a corresponding registration mechanism to receive data when invoking the protocol. In this embodiment, the user calls the protocol stack registration function during initialization, performs registration of receiving data information, and performs different encoding registrations on (Module, Port, Socket).

Specifically, the received data information carries the module number, the port number, and the socket number of the communication object, and the protocol stack registration function is used to perform encoding registration on the module number, the port number, and the socket number in the received data information, so as to obtain a first registration table including the module number, the port number, and the socket number of the communication object. In this way, the first registry can be generated before the communication data is handed over to clarify the communication object, and information in the first registry can be added or deleted according to needs, so that the communication units (objects) are added more easily, and the expansion of the equipment is simpler and more convenient.

In one embodiment, as shown in fig. 1D, the method for extensible communication of the UPP interface further includes:

step 122, when the communication data is sent, acquiring the second registry;

step 124, generating a data queue according to the second registry; and transmitting the communication data according to the sequence of the data queue.

In this embodiment, the second registry is formed by summarizing protocol stacks according to registered (Module, Port, Socket) values, and the Module number, Port number, and Socket number of a communication object for data transmission are recorded in the second registry, which may also be referred to as a transmission registry. And analyzing the second registry to obtain a data queue, wherein the data queue records the sending sequence of the communication data. Therefore, the communication data can be transmitted in the order of the data queue through the second registry, so that the transmission of the communication data is more orderly.

In one embodiment, as shown in fig. 1E, before the step of acquiring the second registry when sending the communication data, the method further includes: and step 120, calling a protocol stack registration function, acquiring the sending data information, and performing coding registration according to the sending data information to obtain the second registration table.

In this embodiment, when invoking the protocol, the user needs to use a corresponding registration mechanism to send data. In this embodiment, the user calls the protocol stack registration function during initialization, performs registration of sending data information, and performs different encoding registrations on (Module, Port, Socket).

Specifically, the sending data information carries the module number, the port number, and the socket number of the communication object, and the protocol stack registration function is used to perform encoding registration on the module number, the port number, and the socket number in the sending data information, so as to obtain a second registration table including the module number, the port number, and the socket number of the communication object. Thus, different module numbers will be registered in order, different port numbers will be registered in order, and different socket numbers will be registered in order, thereby forming a data queue, which is recorded in the second registry. When data is sent, the data frame is sent according to the sequence of the module number, the port number and the socket number, corresponding application data is filled into the data frame according to the module number, the port number and the socket number, and a checksum is calculated and generated, so that a complete data frame is formed and sent.

It should be noted that, when registering in the second registry, a user queue is generated according to the user registration information, where the queue includes multiple (Module, Port, Socket) information, and when a user sends a fill (Module _ x, Port _ y, Socket _ z) data information, a bottom protocol stack performs a comparison, and if the data information is not (Module, Port, Socket) sent by the user registration, the data information is not sent, that is, when sending the data, the registry is checked, if the data to be sent is not (Module, Port, Socket) in the registry, the data to be sent is not (Socket), and when the data to be sent is in the registry, the application data is filled into a data frame corresponding to the Module number, the Port number, and the Socket number, and a checksum is calculated and generated, so that a complete data frame is formed and sent.

In order to save space resources and reduce the data amount of a single data frame, in an embodiment, as shown in fig. 1F, the scalable communication method of the UPP interface further includes:

step 130, when sending communication data, acquiring the data frame;

step 132, detecting whether a plurality of identical module number heads exist in the data frame, merging the plurality of identical module number heads into a parent node module number head when the plurality of identical module number heads exist, and using the port number heads corresponding to the plurality of identical module number heads as child nodes of the parent node module number head;

step 134, determine whether there are multiple same port number headers in the number headers of the parent node modules, merge the multiple same port number headers into a parent node port number header when there are multiple same port number headers, and use the socket number headers corresponding to the multiple same port number headers as child nodes of the parent node port number header.

In this embodiment, the data frame has a tree structure, where the frame header of the data frame is a parent node of each communication unit, and in one communication unit, the module number head is a parent node of a port number head, and the port number head is a parent node of the socket number head, so that a plurality of port number heads having the same module number head can be merged to the module number head of one parent node, and a plurality of socket number heads having the same port number head are merged to the port number head of one parent node, so that the module number head and the port number head of the data frame are effectively reduced, thereby reducing the length of the data frame, effectively saving space resources, and reducing the data amount of a single data frame.

For example, the data frame before merging includes (Module _1, Port _1, Socket _1), (Module _1, Port _2, Socket _2), and (Module _1, Port _2, Socket _3), and since the Module numbers of the three are the same, the Module _1 merged to the same parent node, and the Port numbers of (Module _1, Port _2, Socket _2) and (Module _1, Port _2, Socket _3) are both Port _2, so the Port numbers of the two can be merged, and the structure of the finally merged data frame is Module _ 1: ((Port _1, Socket _1), (Port _2 (Socket _2, Socket _3)))

The following is a specific example:

in this embodiment, the communication protocol of the UPP interface of the OMAP processor is based on a three-layer model, and the layered model is divided into three layers: physical interface layer, MPS protocol stack, application layer. Wherein the content of the first and second substances,

physical interface layer: an analysis of the physical characteristics of the communication medium, such as electrical characteristics and signal exchange, is specified.

MPS protocol stack: and the system is responsible for analyzing the protocol and transmitting and forwarding the data.

An application layer: application user usage is provided.

The following are the contents of the transport network layer and application layer protocols:

(1) physical layer

The OMAP UPP communication of TI company is a high-speed communication protocol, different speed modes are provided, in order to improve the communication speed, the setting is selected to be 37.5MHz and 16bit, and the double-edge mode can reach 70MHz, so that the communication speed is improved as much as possible.

(2) MPS component protocol stack

Component protocols are the core content of the present invention. The general 16-bit UPP uses words as minimum subdivision units, and the MPS protocol stack finely divides communication objects: the communication handle Socket is composed of UPP fields with certain characteristics, the communication Port end is composed of the Socket, and a specific communication object Module is composed of different Port segments.

The data segment adopts a three-level composite frame structure based on Module-Port-Socket, and can realize hierarchical addressing of communication objects. The application layer does not need to pay attention to interfaces and communication links of a lower layer, communication data in the system can be obtained directly through encoding of the Module-Port-Socket, and each data frame is represented through the Module-Port-Socket.

1) Module No: the Module number is a primary functional unit, which may be a device.

2) Port number: port belongs to the secondary functional unit, and can be used as a communication link expansion Port, for example, different Port numbers are used for representing different communication links.

3) Socket number: socket is a three-level functional unit under a Port, and the device realizes the expansion of specific application through the Port.

(3) Data frame:

as shown in FIG. 4, a communication unit comprises a Module head, Port head, Socket head, Data, and CheckSum.

As shown in fig. 5, one data frame may be composed of a plurality of communication units.

In this embodiment, a communication unit is defined by using a (Module, Port, Socket) three-dimensional vector as a data element, and the communication division is used to bring advantages in communication:

(a) the communication function of hierarchical modules, ports and sockets is realized;

(b) after the communication object is abstracted, adding communication units (objects) becomes easier;

the component protocol stack searches and matches data meeting the characteristics by depth-first search based on modules, ports and sockets and taking (modules, ports and sockets) three-dimensional vectors as a communication unit.

The following is a description of the process of acquisition of application data:

when a user calls a protocol, the user needs to use a corresponding registration mechanism to transmit and receive data, which specifically comprises the following steps:

please refer to fig. 6, the data receiving:

(a) when the user initializes, the user calls the protocol stack register function to register the received data information, and registers different codes for (Module, Port, Socket).

(b) The protocol stack collects the registered (Module, Port, Socket) values into a registry and receives data

(c) When data (Module _ x, Port _ y, Socket _ z) comes, judging whether the data is in the registry or not, and if the data is in the registry, receiving the data; if not, discarding;

please refer to fig. 7, in which:

(a) a user calls a protocol stack registration function during initialization, registers data information to be sent, and performs different coding registrations on modules, ports and sockets;

(b) when sending (Module, Port, Socket) data element registration, the protocol stack forms a data queue of (Module _1, Port _1, Socket _1) + (Module _2, Port _2, Socket _2) + (Module _3, Port _3, Socket _3) +. + - (Module _ n, Port _ n, Socket _ n) according to the registration information;

(c) and when a sending period comes, sending the current data according to the data queue.

(1) Performance optimization

When receiving data, monitoring in UPP interruption and responding to data reception in time; and when the data is transmitted, merging the data with the same dimension. For example, merge (Module _1, Port _1, Socket _1) + (Module _1, Port _2, Socket _2) + (Module _1, Port _2, Socket _3) data queues into Module _ 1: ((Port _1, Socket _1), (Port _2, (Socket _2, Socket _3))) tree structure. The data structure of the tree structure saves space resources.

As shown in fig. 8, in one example, the (Module _1, Port _1, Socket _1) + (Module _1, Port _2, Socket _2) data queues are merged into a Module _ 1: in another example, the data queues (Module _1, Port _1, Socket _2) are merged into a tree structure of Module _ 1: Port _1 (Socket _1, Socket _ 2).

In one embodiment, as shown in fig. 2, there is provided an extensible communication device of a UPP interface, which is applied to a controller communicating with an upper computer, including:

the communication module 200 is configured to receive or transmit communication data, where the communication data has a data frame, where the data frame has a preset frame structure, and the data frame includes at least one communication unit, and each communication unit includes a module number header for identifying a device, a port number header for identifying a port, a socket number header for identifying an application, and application data.

In one embodiment, the extensible communication device of the UPP interface further includes:

a data frame detection module, configured to detect whether the data frame is in a first registry when receiving the communication data;

a communication data processing module, configured to receive the communication data when the data frame is in the first registry, and discard the communication data when the data frame is not in the first registry.

In one embodiment, the extensible communication device of the UPP interface further includes:

and the first registry generation module is used for calling a protocol stack registration function and carrying out coding registration according to the received data information to obtain the first registry.

In one embodiment, the extensible communication device of the UPP interface further includes:

a second registry acquisition module, configured to acquire the second registry when the communication data is sent;

the data queue acquisition module is used for generating a data queue according to the second registry;

and the communication data sending module is used for sending the communication data according to the sequence of the data queue.

In one embodiment, the extensible communication device of the UPP interface further includes:

and the second registry generation module is used for calling a protocol stack registration function, and performing coding registration according to the transmitted data information to obtain the second registry.

In one embodiment, the extensible communication device of the UPP interface further includes:

the data frame acquisition module is used for acquiring the data frame;

the module number head merging module is used for detecting whether a plurality of same module number heads exist in the data frame, merging the plurality of same module number heads into a father node module number head when the plurality of same module number heads exist, and taking a port number head corresponding to the plurality of same module number heads as a child node of the father node module number head;

and the port number head merging module is used for merging a plurality of same port number heads into a parent node port number head when the same port number heads exist, and taking the socket number heads corresponding to the same port number heads as child nodes of the parent node port number head.

For specific limitations of the extensible communication device of the UPP interface, reference may be made to the above limitations of the extensible communication method of the UPP interface, which are not described herein again. The various modules in the extensible communication means of the above-described UPP interface may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.

In one embodiment, a computer device is provided, the computer device being a device comprising an OMAP processor. The internal structure thereof may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer equipment is used for connecting and communicating with an upper computer through a CAN. The computer program is executed by a processor to implement a scalable communication method of a UPP interface. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.

Those skilled in the art will appreciate that the architecture shown in fig. 3 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.

In one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program:

the method comprises the steps of receiving or sending communication data, wherein the communication data is provided with a data frame, the data frame is provided with a preset frame structure, the data frame comprises at least one communication unit, and each communication unit comprises a module number head used for identifying equipment, a port number head used for identifying a port, a socket number head used for identifying an application and application data.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

detecting whether the data frame is in a first registry when the communication data is received;

receiving the communication data when the data frame is in the first registry, and discarding the communication data when the data frame is not in the first registry.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

and calling a protocol stack registration function, and performing coding registration according to the received data information to obtain the first registry.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

acquiring the second registry when the communication data is sent;

generating a data queue according to the second registry;

and transmitting the communication data according to the sequence of the data queue.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

and calling a protocol stack registration function, and performing coding registration according to the transmitted data information to obtain the second registration table.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

acquiring the data frame;

detecting whether a plurality of same module number heads exist in the data frame, combining the plurality of same module number heads into a father node module number head when the plurality of same module number heads exist, and taking a port number head corresponding to the plurality of same module number heads as a child node of the father node module number head;

and whether a plurality of same port number heads exist in the parent node module number head or not is judged, when the plurality of same port number heads exist, the plurality of same port number heads are combined into a parent node port number head, and the socket number heads corresponding to the plurality of same port number heads are used as child nodes of the parent node port number head.

In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:

the method comprises the steps of receiving or sending communication data, wherein the communication data is provided with a data frame, the data frame is provided with a preset frame structure, the data frame comprises at least one communication unit, and each communication unit comprises a module number head used for identifying equipment, a port number head used for identifying a port, a socket number head used for identifying an application and application data.

In one embodiment, the computer program when executed by the processor further performs the steps of:

detecting whether the data frame is in a first registry when the communication data is received;

receiving the communication data when the data frame is in the first registry, and discarding the communication data when the data frame is not in the first registry.

In one embodiment, the computer program when executed by the processor further performs the steps of:

and calling a protocol stack registration function, and performing coding registration according to the received data information to obtain the first registry.

In one embodiment, the computer program when executed by the processor further performs the steps of:

acquiring the second registry when the communication data is sent;

generating a data queue according to the second registry;

and transmitting the communication data according to the sequence of the data queue.

In one embodiment, the computer program when executed by the processor further performs the steps of:

and calling a protocol stack registration function, and performing coding registration according to the transmitted data information to obtain the second registration table.

In one embodiment, the computer program when executed by the processor further performs the steps of:

acquiring the data frame;

detecting whether a plurality of same module number heads exist in the data frame, combining the plurality of same module number heads into a father node module number head when the plurality of same module number heads exist, and taking a port number head corresponding to the plurality of same module number heads as a child node of the father node module number head;

and whether a plurality of same port number heads exist in the parent node module number head or not is judged, when the plurality of same port number heads exist, the plurality of same port number heads are combined into a parent node port number head, and the socket number heads corresponding to the plurality of same port number heads are used as child nodes of the parent node port number head.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.

The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于BMC的串口路径选择方法、系统、终端及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!