CN111290346A - Synchronous blocking state machine based on real-time operating system for railway communication equipment - Google Patents

Synchronous blocking state machine based on real-time operating system for railway communication equipment Download PDF

Info

Publication number
CN111290346A
CN111290346A CN201811498572.1A CN201811498572A CN111290346A CN 111290346 A CN111290346 A CN 111290346A CN 201811498572 A CN201811498572 A CN 201811498572A CN 111290346 A CN111290346 A CN 111290346A
Authority
CN
China
Prior art keywords
layer
functional
scheduling
operating system
thread
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.)
Pending
Application number
CN201811498572.1A
Other languages
Chinese (zh)
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.)
CRSC Communication and Information Group Shanghai Co Ltd
Original Assignee
CRSC Communication and Information Group Shanghai 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 CRSC Communication and Information Group Shanghai Co Ltd filed Critical CRSC Communication and Information Group Shanghai Co Ltd
Priority to CN201811498572.1A priority Critical patent/CN111290346A/en
Publication of CN111290346A publication Critical patent/CN111290346A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/418Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM]
    • G05B19/4185Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM] characterised by the network communication
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/33Director till display
    • G05B2219/33139Design of industrial communication system with expert system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Manufacturing & Machinery (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Train Traffic Observation, Control, And Security (AREA)

Abstract

The invention relates to a synchronous blocking state machine based on a real-time operating system for railway communication equipment, which comprises a hardware layer, a driving layer, a scheduling layer and a functional layer, wherein the hardware layer, the driving layer, the scheduling layer and the functional layer are sequentially connected; the hardware layer is used for responding hardware interruption and data acquisition of the equipment; the driving layer is used for processing the data and the acquired information by creating a driving thread and converting the data into contents required by the scheduling layer; the scheduling layer is used for dividing functional modules for equipment requirements, and each functional module establishes a scheduling thread; the functional layer is used for representing the current system state by creating a functional thread. Compared with the prior art, the method has the advantages of greatly improving the development efficiency and the like.

Description

Synchronous blocking state machine based on real-time operating system for railway communication equipment
Technical Field
The invention relates to the field of railway communication equipment design and software architecture, in particular to a synchronous blocking state machine based on a real-time operating system for railway communication equipment.
Background
With the rapid development of rail transit, the application of communication technology in the field of railway service is increasing. Railway communication equipment generally has higher concurrency and real-time requirements, and has the requirements of data acquisition, user interaction response and the like while maintaining a communication protocol with corresponding equipment. However, in order to ensure stable operation, the railway communication equipment generally adopts an embedded system equipped with a real-time operating system. Embedded systems typically have small memories and are programmed in low-level languages or even directly to operate hardware registers. Compared with a common PC and an industrial personal computer system, the portability related to hardware is poor, the layering difficulty of a software structure is high, and the existing traditional software design structure and method are difficult to be directly used for the embedded system.
Disclosure of Invention
The present invention is directed to overcoming the above-mentioned drawbacks of the prior art and providing a synchronous blocking state machine based on a real-time operating system for railway communication equipment.
The purpose of the invention can be realized by the following technical scheme:
a synchronous blocking state machine based on a real-time operating system for railway communication equipment comprises a hardware layer, a driving layer, a scheduling layer and a functional layer, wherein the hardware layer, the driving layer, the scheduling layer and the functional layer are sequentially connected;
the hardware layer is used for responding hardware interruption and data acquisition of the equipment;
the driving layer is used for processing the data and the acquired information by creating a driving thread and converting the data into contents required by the scheduling layer;
the scheduling layer is used for dividing functional modules for equipment requirements, and each functional module establishes a scheduling thread;
the functional layer is used for representing the current system state by creating a functional thread.
Preferably, the hardware layer adopts hardware interrupt of an embedded system. With the highest real-time performance.
Preferably, the hardware layer only performs basic conversion on data and information, does not perform service-level processing on the data, and forwards the original data to the driver layer.
Preferably, the driver layer performs packet assembling, checking and error correcting operations on the received single byte information according to a communication protocol, and forwards the received data to the scheduling layer.
Preferably, the scheduling layer adopts an event-driven model, and the event is derived from the logic drive of the functional layer or the data drive of the driving layer.
Preferably, if the functional layer logic has a plurality of states or has delay and thread synchronization requirements, the scheduling layer establishes a functional thread and completes logic control in the functional thread, and in the logic control process, if conditional jump is performed, the functional thread is blocked until the jump condition is achieved to enter the next state.
Preferably, the scheduling layer is further provided with a central scheduling thread for unified management and possible overall synchronization requirements of the functional modules. If each functional module of the equipment is independent, a central scheduling thread can not be designed.
Preferably, the driver layer, the scheduling layer and the functional layer all use operating system threads as main bodies, and therefore, the layers all interact in a communication mode among the operating system threads. Such as semaphores, mailboxes, events, message queues, etc.
Compared with the prior art, the invention has the following advantages:
1. the invention adopts independent threads of the operating system in the horizontal direction (required function division) and the vertical direction (system structure hierarchy division), and has high independence and low coupling degree. The method is suitable for splitting of modules, facilitates secondary development and development of similar equipment, is also suitable for transplantation on different embedded platforms, and greatly improves development efficiency. In addition, if some modules are wrong in operation, the range of influencing other modules is limited, and the operation stability is improved.
2. The invention adopts a brand-new synchronous blocking structure at the functional layer and the scheduling layer. The current system state is represented by the position of the functional thread operation, and a programmer does not need to manually manage the flag bit. The program is close to the sequential thinking mode of people when running, and the programming and modifying difficulty of the complex logic equipment is further reduced.
Drawings
FIG. 1 is a block diagram of a synchronous block state machine;
FIG. 2 is a hardware layer software flow diagram;
FIG. 3 is a driver layer software flow diagram;
FIG. 4 is a software flow diagram of the dispatch layer and functional layers.
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 some, not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, shall fall within the scope of protection of the present invention.
Fig. 1 shows a software structure diagram of a railway communication device after the synchronous blocking state machine according to the present invention is used, and the software structure is divided into a hardware layer, a driver layer, a scheduling layer and a functional layer according to the relevant features of the present invention. The design is then performed layer by layer, according to aspects of the present invention.
In this example, the embedded device needs to invoke four types of interrupt devices and one type of polling device. Wherein the hardware layer interrupt service function may be designed according to the flow chart shown in fig. 2. Because the hardware interrupt has priority higher than any operating system thread, the invention is based on the software structure of the real-time operating system, is not suitable for carrying out excessive operation in the interrupt, otherwise the real-time performance of the operating system can be broken. Only one semaphore is released to the driver layer in the interrupt service function.
FIG. 3 illustrates a flow diagram of a typical driver layer thread. The thread starts by first initializing the hardware used and then waiting for the semaphore for the interrupt service function. And after receiving the corresponding semaphore, performing read-write operation on corresponding hardware, and performing packaging, verification and error correction operation according to the received data. And finally, transmitting the grouped data packets to a scheduling layer for use.
Fig. 4 shows an example of synchronous blocking by the scheduling layer and the functional layer. The right side of the picture is a scheduling thread, and the left side of the picture is a functional thread which is started after the scheduling thread receives certain information of the driving layer. The functional thread firstly carries out functional logic 1, and then a thread sleep function of an operating system is called in a delay process, so that the functional thread does not participate in scheduling for a period of time to achieve the effect of functional delay. And (4) running the functional logic 2 after delaying, and then locking by a system synchronous lock to wait for the continuous running after the signal of the thread unlocking is dispatched. After receiving the unlock signal of the dispatch thread, the functional thread continues to run functional logic 3.
It can be seen that the invention has a certain independence in different levels, and the writing process of the functional logic program is consistent with the thinking of human beings, and the example embodies all the advantages and innovativeness of the invention.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A synchronous blocking state machine based on a real-time operating system for railway communication equipment is characterized by comprising a hardware layer, a driving layer, a scheduling layer and a functional layer, wherein the hardware layer, the driving layer, the scheduling layer and the functional layer are sequentially connected;
the hardware layer is used for responding hardware interruption and data acquisition of the equipment;
the driving layer is used for processing the data and the acquired information by creating a driving thread and converting the data into contents required by the scheduling layer;
the scheduling layer is used for dividing functional modules for equipment requirements, and each functional module establishes a scheduling thread;
the functional layer is used for representing the current system state by creating a functional thread.
2. The synchronous block state machine for railway communication equipment based on real-time operating system as claimed in claim 1, wherein the hardware layer employs hardware interrupt of embedded system.
3. The synchronous block state machine based on real-time operating system for railway communication equipment as claimed in claim 1, wherein said hardware layer performs only basic conversion on data and information, does not perform service-level processing on data, and forwards original data to the driver layer.
4. The synchronous jam state machine based on real-time operating system for railway communication equipment as claimed in claim 1, wherein the driver layer performs packet grouping, checking and error correcting operations on the received single byte information according to the communication protocol, and forwards the received data to the dispatching layer.
5. The synchronous block state machine based on the real-time operating system for the railway communication equipment as claimed in claim 1, wherein the scheduling layer adopts an event-driven model, and the event is derived from the logic drive of the functional layer or the data drive of the driving layer.
6. The synchronous blocking state machine for railway communication equipment based on real-time operating system as claimed in claim 5, wherein if the functional layer logic has multiple states or there is a delay, thread synchronization requirement, the scheduling layer establishes a functional thread and completes logic control in the functional thread, and during the logic control, if there is a conditional jump, the functional thread is blocked until the jump condition is reached to enter the next state.
7. The synchronous blocking state machine based on the real-time operating system for railway communication equipment as claimed in claim 5, wherein the scheduling layer is further provided with a central scheduling thread for unified management and possible overall synchronization requirements of each functional module.
8. The synchronous block state machine based on the real-time operating system for the railway communication equipment as claimed in claim 1, wherein the driving layer, the scheduling layer and the functional layer all use the operating system thread as the main body, so that each layer interacts by using the communication mode between the operating system threads.
CN201811498572.1A 2018-12-08 2018-12-08 Synchronous blocking state machine based on real-time operating system for railway communication equipment Pending CN111290346A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811498572.1A CN111290346A (en) 2018-12-08 2018-12-08 Synchronous blocking state machine based on real-time operating system for railway communication equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811498572.1A CN111290346A (en) 2018-12-08 2018-12-08 Synchronous blocking state machine based on real-time operating system for railway communication equipment

Publications (1)

Publication Number Publication Date
CN111290346A true CN111290346A (en) 2020-06-16

Family

ID=71024741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811498572.1A Pending CN111290346A (en) 2018-12-08 2018-12-08 Synchronous blocking state machine based on real-time operating system for railway communication equipment

Country Status (1)

Country Link
CN (1) CN111290346A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112284437A (en) * 2020-10-15 2021-01-29 歌尔光学科技有限公司 Layered logic control method, device, equipment and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112284437A (en) * 2020-10-15 2021-01-29 歌尔光学科技有限公司 Layered logic control method, device, equipment and readable storage medium

Similar Documents

Publication Publication Date Title
US9432135B2 (en) Interface device and method for exchanging user data
CN103729329B (en) Intercore communication device and method
US20160139965A1 (en) Method and apparatus for a hierarchical synchronization barrier in a multi-node system
Dantam et al. The ach library: A new framework for real-time communication
Dantam et al. Robust and efficient communication for real-time multi-process robot software
CN102567111A (en) Method, system and terminal device capable of calling asynchronous procedure
CN103888441A (en) Information transmitting method between application and protocol stack and processing device
Li et al. Time-triggered switch-memory-switch architecture for time-sensitive networking switches
Maier et al. Time-triggered architecture: A consistent computing platform
CN103019823A (en) Message queue method for realizing communication between VxWorks and Qt
CN111899501A (en) Remote control method for switch in distribution network automation master station substation
CN111478839B (en) Physical bus and operating system decoupled distributed aviation communication system
CN116545953A (en) Terminal Ethernet scheduling method, system, storage medium and computer
CN111290346A (en) Synchronous blocking state machine based on real-time operating system for railway communication equipment
CN101604270A (en) ARINC429 communication redundancy method based on vxworks operating system
WO2021135699A1 (en) Decision scheduling customization method and device based on information flow
Chabrol et al. Deterministic Distributed Safety-Critical Real-Time Systems within the Oasis Approach.
CN113067761A (en) Linear token data bus simulation platform based on OPNET
CN112232523A (en) Domestic artificial intelligence computing equipment
CN108234260B (en) Task synchronization method based on ARINC659 bus
CN209460633U (en) Synchronization blocked state machine for railway communication equipment
Dantam et al. Multiprocess communication and control software for humanoid robots
Franks Simulating layered queueing networks with passive resources.
Nigro et al. A modular approach to real time programming using actors and Java
US8631176B2 (en) Asynchronous communications technique

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