Vehicle-to-ground communication simulation methods, devices, electronic equipment and storage media
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-24
- Publication Date
- 2026-08-14
AI Technical Summary
[0004]上述现有技术在处理协议切换时,将协议的共性通信阶段与协议特有的交互逻辑强绑定,导致协议切换必定引发通信阶段的全局复位与状态丢失
通过设置包含应用状态层、公共状态层和协议特有状态层的三层状态机,从而将两种通信协议的共性逻辑与差异性逻辑在结构层面解耦,为协议切换时的状态独立管控奠定架构基础。通过在协议切换过程中保持公共状态层不变而仅更新应用状态层和协议特有状态层,从而避免了协议切换导致的通信阶段全局复位,保留了两种通信协议共用的通信阶段信息。通过在切换前提取当前激活协议的安全参数并将安全参数迁移至目标协议,从而维持了协议切换过程中安全上下文的连续性,避免了安全参数丢失或不一致引发的连接建立失败。通过停止第一协议适配器并启动第二协议适配器的有序交替方式完成协议切换,从而规避了双协议适配器并行运行带来的资源冲突和报文交叉风险。通过上述技术手段的协同配合,从而实现了铁路信号安全协议-I通信协议与铁路信号安全协议-II通信协议之间的平滑切换。
Smart Images

Figure CN122579201A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of rail transit communication simulation technology, and in particular to a vehicle-to-ground communication simulation method, device, electronic equipment, and storage medium. Background Technology
[0002] In urban rail transit signaling systems, different lines may use different vehicle-to-ground communication protocols. When a train crosses lines, the onboard equipment and ground equipment must be able to switch between different protocols. To ensure the safety and reliability of actual operation, it is necessary to simulate and verify the compatibility of trains using different communication protocols and the protocol switching process in a laboratory environment.
[0003] Existing vehicle-to-ground communication simulation testing technologies typically handle multi-protocol switching logic by resetting the entire state. When faced with a protocol switching scenario, existing technologies mainly disconnect the underlying communication link of the currently active protocol, clear all current running state machines, and destroy the security context information of the current protocol before restarting the target protocol's communication process. After the target protocol starts, both communicating parties need to go through the complete initialization process from scratch, including handshake, authentication, and key negotiation, to establish a completely new vehicle-to-ground communication connection.
[0004] The aforementioned existing technologies, when handling protocol switching, strongly bind the common communication phases of the protocols with the protocol-specific interaction logic, inevitably causing a global reset and loss of state of the communication phases during protocol switching. During this process, the original common communication phase information is completely erased, and security context information cannot be effectively continued, resulting in significant communication gaps and security parameter breaks during protocol switching, making it impossible to achieve smooth switching between different communication protocols for vehicle-to-ground communication. Summary of the Invention
[0005] This invention provides a vehicle-to-ground communication simulation method, device, electronic device, and storage medium to overcome the shortcomings of the prior art and achieve smooth switching between different communication protocols.
[0006] This invention provides a vehicle-to-ground communication simulation method, comprising the following steps: The states of each layer in the three-layer state machine of the simulation system are initialized. The three-layer state machine includes an application state layer, a common state layer that defines the common states of communication protocols, and a protocol-specific state layer that defines the specific states of each communication protocol. A connection is established with the peer device through the first protocol adapter corresponding to the current activation protocol. After the connection is successfully established, the common state layer and the application state layer are updated to the connected state, and the protocol-specific state layer is updated to the stable state corresponding to the current activation protocol. During data transmission, in response to a received protocol switching command, the security parameters of the currently active protocol are extracted; Update the state of the application state layer to the switching state, keep the state of the common state layer unchanged, and stop the data transmission of the first protocol adapter; Activate the second protocol adapter corresponding to the target protocol, and migrate the security parameters from the currently active protocol to the target protocol; A connection is established with the peer device through the second protocol adapter. After the connection is successfully established, the unique state of the target protocol in the protocol-specific state layer is updated to a stable state, and the state of the application state layer is updated to a connected state.
[0007] According to a vehicle-to-ground communication simulation method provided by the present invention, the step of migrating the security parameters from the currently active protocol to the target protocol includes: Extract the current key and current serial number from the security parameters of the current activation protocol; Compare the key management mechanisms of the current activation protocol with those of the target protocol; If the current activation protocol and the target protocol use the same key management mechanism, then the current key will be directly migrated to the target key of the target protocol; If the current activation protocol and the target protocol use different key management mechanisms, then the key negotiation process of the target protocol is triggered to dynamically obtain the target key; The current sequence number is migrated to the target sequence number of the target protocol, or the target sequence number is reinitialized in the context of the target protocol.
[0008] According to a vehicle-to-ground communication simulation method provided by the present invention, after responding to a received protocol switching command and before extracting the security parameters of the currently active protocol, the method further includes: Check whether the current state of the common state layer is a connected state or a data transmission state; Check for any pending data packets; Verify the validity of the security parameters of the current activation protocol, including checking whether the key is within its validity period and whether the serial number is within the valid range; Verify the validity of the protocol switching command; If the above checks and verifications pass, then proceed with the step of extracting the security parameters of the current activation protocol.
[0009] According to the vehicle-to-ground communication simulation method provided by the present invention, before updating the state of the application state layer to the state of transition, the method further includes: Save the state data of the currently active protocol in the current application state layer, the common state layer, and the protocol-specific state layer.
[0010] According to the vehicle-to-ground communication simulation method provided by the present invention, after updating the specific state of the target protocol in the protocol-specific state layer to a stable state, the method further includes: Verify the protocol switching result; If the protocol switching result verification fails, then stop running the second protocol adapter; Based on the state data and the security parameters, the application state layer, the common state layer, and the protocol-specific state layer are restored to their states before the protocol switch. Restart the first protocol adapter.
[0011] According to the vehicle-to-ground communication simulation method provided by the present invention, the verification of the protocol switching result includes: Perform state transition integrity verification to check whether the application state layer has sequentially gone through the connected state, the switching state, and returned to the connected state during the protocol switching process; Perform timing constraint verification to check whether the protocol switching time is within the preset allowable range; Perform a security parameter consistency verification to check whether the switched security parameters are valid and conform to the specifications of the target protocol; Perform data integrity verification to check for data loss or duplication during protocol switching; When the state transition integrity verification, the timing constraint verification, the security parameter consistency verification, and the data integrity verification all pass, the protocol switchover is confirmed to be successful.
[0012] The present invention also provides a vehicle-to-ground communication simulation device, comprising the following modules: An initialization module is used to initialize the states of each layer in the three-layer state machine of the simulation system. The three-layer state machine includes an application state layer, a common state layer that defines the common states of communication protocols, and a protocol-specific state layer that defines the states specific to each communication protocol. The initial connection establishment module is used to establish a connection with the peer device through the first protocol adapter corresponding to the currently active protocol. After the connection is successfully established, the common state layer and the application state layer are updated to the connected state, and the protocol-specific state layer is updated to the stable state corresponding to the currently active protocol. The security parameter extraction module is used to extract the security parameters of the currently active protocol in response to a received protocol switching command during data transmission. The switching control module is used to update the state of the application state layer to the switching state, keep the state of the common state layer unchanged, and stop the data transmission of the first protocol adapter. The parameter migration module is used to activate the second protocol adapter corresponding to the target protocol and migrate the security parameters from the currently active protocol to the target protocol. The target connection establishment module is used to establish a connection with the peer device through the second protocol adapter. After the connection is successfully established, the target protocol's unique state in the protocol-specific state layer is updated to a stable state, and the application state layer is updated to a connected state.
[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the vehicle-to-ground communication simulation method as described above.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the vehicle-to-ground communication simulation method as described above.
[0015] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the vehicle-to-ground communication simulation method as described above.
[0016] In summary, one or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: By setting up a three-layer state machine comprising an application state layer, a common state layer, and a protocol-specific state layer, the common and differential logics of the two communication protocols are decoupled at the structural level, laying the architectural foundation for independent state management during protocol switching. By keeping the common state layer unchanged and only updating the application state layer and protocol-specific state layer during protocol switching, a global reset of the communication phase caused by protocol switching is avoided, preserving the communication phase information shared by both protocols. By extracting the security parameters of the currently active protocol before switching and migrating these parameters to the target protocol, the continuity of the security context during protocol switching is maintained, avoiding connection establishment failures caused by lost or inconsistent security parameters. Protocol switching is completed through an orderly alternation of stopping the first protocol adapter and starting the second protocol adapter, thus avoiding resource conflicts and message cross-talk risks caused by the parallel operation of dual protocol adapters. Through the coordinated use of the above technical means, a smooth switch between the Railway Signal Safety Protocol-I and the Railway Signal Safety Protocol-II communication protocols is achieved. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the simulation system structure provided by the present invention.
[0019] Figure 2 This is a schematic diagram of the three-layer state machine module provided by the present invention.
[0020] Figure 3 This is a flowchart illustrating the vehicle-to-ground communication simulation method provided by the present invention.
[0021] Figure 4 This is a schematic diagram of the vehicle-to-ground communication simulation device provided by the present invention.
[0022] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0024] It should be noted that in the description of this invention, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. The terms "upper," "lower," etc., indicating orientation or positional relationships according to the accompanying drawings, are only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the system or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0025] The terms "first," "second," etc., used in this invention are used to distinguish similar objects, not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class, without limiting the number of objects; for example, a first object can be one or more. Furthermore, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0026] The following is combined with Figures 1 to 5 This invention describes the vehicle-to-ground communication simulation method, apparatus, electronic device, storage medium, and computer program product provided by the present invention.
[0027] Before introducing the technical solutions of the embodiments of this application, the execution subject and operating environment of the embodiments of this application will be described first. The execution subject of the vehicle-to-ground communication simulation method described in this application is a simulation processor. The simulation processor runs a vehicle-to-ground communication simulation system, which consists of an on-board equipment model and a ground equipment model. The on-board equipment model is a simulation model of real on-board signaling equipment. The ground equipment model is a simulation model of real ground equipment or the real ground equipment itself. The real ground equipment includes area controllers and train control servers. The vehicle-to-ground communication simulation system communicates internally through the on-board equipment model and the ground equipment model, or interacts with external real ground equipment through the on-board equipment model.
[0028] The Railway Safety Protocol (RSSP) is a standard system for railway signaling safety communication protocols in China, used to ensure the security, reliability, and availability of data transmission between safety-related devices in railway signaling systems. The application scenario involved in this application is as follows: In an urban rail transit signaling system renovation project, existing lines simultaneously operate trains using both the RSSP-I and RSSP-II communication protocols, and ground equipment needs to be compatible with both protocols. To verify the compatibility of the ground equipment with trains using both communication protocols, a simulation processor simulates the vehicle-to-ground communication process between onboard and ground equipment in a laboratory environment, and simulates and verifies the process of switching from the RSSP-II to the RSSP-I communication protocol.
[0029] To support the smooth switching and verification functions of dual protocols in the above application scenarios, refer to Figure 1 , Figure 1 This is a schematic diagram of the simulation system structure provided by the present invention. (Refer to...) Figure 2 , Figure 2This is a schematic diagram of the three-layer state machine module provided by the present invention. Figure 1 and Figure 2 As shown, the vehicle-to-ground communication simulation system running on the simulation processor includes eight core logic modules: a three-layer state machine module, a protocol adaptation module, a timing-accurate simulation module, a safety parameter holding module, a protocol switching control module, a simulation verification module, a simulation configuration and monitoring module, and a human-machine interaction module. The three-layer state machine module includes an application state layer, a common state layer, and protocol-specific state layers (RSSP-I specific state layer and RSSP-II specific state layer).
[0030] Reference Figure 3 , Figure 3 This is a flowchart illustrating the vehicle-to-ground communication simulation method provided by the present invention, as shown below. Figure 3 As shown, based on the above system architecture, the simulation processor controls the vehicle-to-ground communication simulation system to execute a vehicle-to-ground communication simulation method, which includes the following steps: Step 110: Initialize the states of each layer in the three-layer state machine of the simulation system.
[0031] The simulation processor starts the simulation configuration and monitoring module. This module configures the simulation scenario and monitors the simulation process. The scenario configuration unit within the simulation configuration and monitoring module configures the simulation scenario, including line parameters, channel parameters, and protocol parameters. The real-time monitoring unit monitors the simulation process's status, packet flow, and performance metrics in real time. The logging unit records detailed logs of the simulation process for subsequent analysis.
[0032] During startup, the simulation processor controls the three-layer state machine module to initialize the states of each layer in the three-layer state machine. The three-layer state machine module manages state transitions during protocol switching. The three-layer state machine module includes an application state layer, a common state layer, and a protocol-specific state layer.
[0033] The application state layer manages the application-level states of the simulation system. These states include disconnected, connected, in transition, and error states. The application state layer reflects the communication connectivity status of the simulation system as observed from an overall perspective.
[0034] The common state layer defines states shared by both RSSP-I and RSSP-II communication protocols. These states include initialization, connection establishment, connected, data transmission, timing correction, shutdown, and error states. Each state in the common state layer is identified by a unique state number.
[0035] The protocol-specific state layers define the unique states for both the RSSP-I and RSSP-II communication protocols. The RSSP-I protocol's unique states include the idle state, the waiting-for-handshake-message state, the master-slave mode state, the slave-slave mode state, the delayed feedback processing state, and the waiting-for-timing-correction-response state. The RSSP-II protocol's unique states include the idle state, the waiting-for-connection-establishment-request state, the authentication phase state, the key negotiation state, and the connection-established state. The three-layer state machine module manages the protocol switching process through unified state transition rules. During switching, the common state layer remains unchanged, while the protocol-specific state layers and security parameters are saved. After the switching is complete, the protocol-specific state layers are restored.
[0036] During initialization, the simulation processor controls the three-layer state machine module to set the application state layer to the disconnected state, the common state layer to the initialized state, and both the RSSP-I and RSSP-II communication protocol-specific states in the protocol-specific state layer to the idle state. The simulation processor also sets the initial activation protocol according to the scenario configuration unit. In the above application scenario, the simulation processor sets the initial activation protocol to the RSSP-II communication protocol.
[0037] Step 120: Establish a connection with the peer device through the first protocol adapter corresponding to the currently activated protocol.
[0038] The simulation processor invokes the protocol adaptation module. This module masks the differences between the RSSP-I and RSSP-II communication protocols, providing a unified simulation interface for the upper layers. The module includes an RSSP-I protocol adapter implementing RSSP-I communication protocol functionality, an RSSP-II protocol adapter implementing RSSP-II communication protocol functionality, and a protocol selector. The protocol selector activates the corresponding protocol adapter based on the simulation scenario configuration or runtime operation.
[0039] In the above application scenario, the currently active protocol is the RSSP-II communication protocol. Therefore, the protocol selector determines the first protocol adapter as the RSSP-II protocol adapter. The RSSP-II protocol adapter implements the message encapsulation, message decapsulation, authentication, key checking, and security verification functions of the RSSP-II communication protocol. The simulation processor establishes a communication connection with the peer device by performing authentication and key negotiation procedures according to the RSSP-II communication protocol specifications through the RSSP-II protocol adapter.
[0040] In another implementation, the currently active protocol is the RSSP-I communication protocol, and the first protocol adapter is an RSSP-I protocol adapter. The RSSP-I protocol adapter implements the message encapsulation, message decapsulation, timing control, and security verification functions of the RSSP-I communication protocol.
[0041] After a successful connection establishment, the simulation processor controls the three-layer state machine module to update the state of the common state layer from the connection established state to the connected state, and the state of the application state layer from the disconnected state to the connected state. Simultaneously, the simulation processor updates the protocol-specific state layers to the stable state corresponding to the currently active protocol.
[0042] Step 130: During data transmission, in response to the received protocol switching instruction, extract the security parameters of the currently active protocol.
[0043] After the connection is successfully established, the simulation processor enters the data transmission process. During data transmission, the simulation processor calls the timing-accurate simulation module. The timing-accurate simulation module accurately reproduces the timing and channel characteristics of real vehicle-to-ground communication in the simulation environment, making the simulation environment closer to the real scenario and improving the reliability of the test results.
[0044] The precise timing simulation module includes a channel characteristic simulation unit, a timing control unit, and a clock synchronization unit. The channel characteristic simulation unit constructs a channel model based on real-world line data and simulates the uncertainties of the wireless channel. Real-world line data includes delay distribution data, packet loss rate data, and jitter characteristic data. The timing control unit precisely controls the transmission and reception times of protocol messages and timeout determination, ensuring that the simulation timing is consistent with the real-world scenario. The clock synchronization unit implements clock synchronization within the simulation system, ensuring time consistency between simulation nodes.
[0045] During data transmission, the simulation processor receives a protocol switching command from the human-machine interface module. The human-machine interface module provides a user interface, including a battlefield map interface, a communication device interface, and a message packet preset interface. In response to the protocol switching command, the simulation processor calls the security parameter retention module to retrieve the security parameters of the currently active protocol. The security parameter retention module maintains the continuity and validity of the security parameters during the protocol switching process. The security parameter storage unit within the security parameter retention module stores the security parameters of the currently active protocol, including the key, sequence number, timestamp, and security context.
[0046] Step 140: Update the application state layer to the switching state, keep the common state layer unchanged, and stop the data transmission of the first protocol adapter.
[0047] After extracting the security parameters, the simulation processor controls the protocol switching control module to manage the entire protocol switching process. The state saving unit within the protocol switching control module saves the state and security parameters of the currently active protocol before switching. Subsequently, the simulation processor updates the application state layer to the switching state through the three-layer state machine module. While updating the application state layer, the three-layer state machine module maintains the state of the common state layer unchanged. The protocol switching unit within the protocol switching control module executes the protocol switching operation, stopping data transmission from the first protocol adapter, but maintaining the physical connection between the first protocol adapter and the peer device.
[0048] Step 150: Start the second protocol adapter corresponding to the target protocol and migrate the security parameters from the currently active protocol to the target protocol.
[0049] The protocol switching unit starts the second protocol adapter corresponding to the target protocol and initializes the second protocol adapter to an idle state.
[0050] Subsequently, the simulation processor invokes the parameter migration unit within the security parameter holding module. According to protocol compatibility rules, the parameter migration unit migrates the security parameters from the currently active protocol to the target protocol. The parameter migration unit converts the RSSP-II communication protocol key and sequence number stored in the security parameter storage unit into security parameters in RSSP-I communication protocol format. The parameter verification unit within the security parameter holding module verifies the validity of the migrated security parameters, ensuring that the data conversion process does not violate the security constraints of the target protocol.
[0051] Step 160: Establish a connection with the peer device through the second protocol adapter, and update the state of the protocol-specific state layer and the application state layer after the connection is successfully established.
[0052] The simulation processor invokes the connection establishment unit within the protocol switching control module. After the switch, the connection establishment unit establishes a connection for the target protocol. The simulation processor then performs the handshake and mode confirmation process required by the target protocol with the peer device via the second protocol adapter. After successful connection establishment, the switching verification unit within the protocol switching control module verifies the success of the switch, including state transition integrity, timing constraints, security parameter consistency, and data integrity. In another implementation, if verification fails, the recovery unit within the protocol switching control module restores the simulation system to its state before the switch.
[0053] After successful verification, the simulation processor updates the target protocol's unique state in the protocol-specific state layer to a stable state using a three-layer state machine module. In the above application scenario, the simulation processor updates the RSSP-I communication protocol's unique state to either master mode or slave mode. Simultaneously, the simulation processor updates the application state layer to a connected state, thus completing the protocol switch. After the switch, the simulation processor also calls the simulation verification module to perform formal verification of the protocol switch process. The simulation verification module includes a state transition verification unit, a timing constraint verification unit, and a security verification unit, which comprehensively verify the integrity of intermediate states, the timing constraint of the maximum switch time, and key security, respectively.
[0054] The vehicle-to-ground communication simulation system and its execution method disclosed in this application introduce a three-layer state machine architecture comprising an application state layer, a common state layer, and a protocol-specific state layer. During protocol switching, only the protocol-specific and application state layers are transitioned while the common state layer is frozen, achieving decoupling and differentiated control between different vehicle-to-ground communication protocols. Combined with a safety parameter migration mechanism, this solution not only avoids global communication reset and context loss caused by cross-protocol switching, ensuring the continuity of safety parameters, but also greatly improves the system stability and test realism of dual-protocol compatibility testing, filling the technical gap in the rail transit field for high-precision simulation verification of smooth dual-protocol switching processes. Furthermore, the three-layer state machine architecture of this invention has good scalability, allowing for easy integration with other railway communication protocols to build a more universal vehicle-to-ground communication simulation platform.
[0055] Based on the foregoing embodiments, the following provides a detailed description of the pre-switch check process performed by the simulation processor after responding to the received protocol switching command and before extracting the security parameters of the currently active protocol.
[0056] Upon receiving a protocol switching command, the simulation processor invokes the switching condition checking unit within the protocol switching control module to perform pre-switching checks. Only after the switching condition checking unit confirms that all checks have passed does the simulation processor proceed to extract the security parameters of the currently active protocol. The pre-switching checks include the following four checks and verification operations.
[0057] The first check operation is: the switching condition check unit checks whether the current state of the common state layer is a connected state or a data transmission state.
[0058] The connected and data transmission states indicate that the simulation system is currently in a stable communication phase, with both communicating parties having established a connection and operating normally. If the current state of the common state layer is neither connected nor data transmission, it indicates that the simulation system is currently in an unstable state such as initialization, connection establishment, timing correction, shutdown, or error state. Performing protocol switching in an unstable state will lead to uncertainty in state transitions.
[0059] The second check operation is: switch the condition check unit to check whether there are any pending data packets.
[0060] The switching condition checking unit queries the send and receive buffers of the first protocol adapter to confirm whether there are any data packets that have not yet been sent or received. If there are pending data packets, the switching condition checking unit waits for the first protocol adapter to complete the processing of all pending data packets before continuing to perform subsequent checks, or refuses to perform protocol switching if the waiting time exceeds a preset timeout threshold.
[0061] The third verification operation is: the switching condition check unit verifies the validity of the security parameters of the currently active protocol.
[0062] The validity verification of security parameters includes checking whether the key is within its validity period and whether the serial number is within its valid range. The switching condition check unit reads the key validity period information of the currently activated protocol from the security parameter storage unit and compares it with the current time to confirm whether the key is valid. Simultaneously, the switching condition check unit reads the serial number value of the currently activated protocol and compares it with the valid range specified by the current activation protocol to confirm whether the serial number is within its valid range. If the key has expired or the serial number is outside its valid range, the switching condition check unit refuses to perform the protocol switch and records the reason for the refusal through the log recording unit.
[0063] The fourth verification operation is: the validity of the switching condition check unit verification protocol switching instruction.
[0064] The validity verification of protocol switching commands includes checking the command format and timing. The switching condition checking unit parses the data structure of the protocol switching command to confirm whether it contains a complete command header, target protocol identifier, and verification field. The switching condition checking unit also checks whether the timing of the protocol switching command issuance is within the allowed switching window period.
[0065] If all four checks and verifications pass, the switching condition checking unit returns a switching permission signal to the simulation processor, and the simulation processor executes the step of extracting the security parameters of the currently active protocol. If any of the four checks and verifications fail, the switching condition checking unit refuses to perform the protocol switching and records the reason for the refusal and the specific check that failed through the logging unit in the simulation configuration and monitoring module.
[0066] By performing four checks and verifications on the stability of the common state layer, the data packets to be processed, the validity of security parameters, and the validity of the switching command in sequence before the protocol switching is executed, the switching condition checking unit constructs a complete pre-switching condition verification link. This ensures that the simulation system only starts the protocol switching process when the communication state is stable, the data processing is completed, the security parameters are valid, and the switching command is legal. This effectively prevents risks such as state chaos, data loss, or security parameter failure caused by executing the protocol switching when the switching conditions are not met.
[0067] Based on the foregoing embodiments, the following provides a detailed description of the state data saving process performed by the simulation processor before updating the state of the application state layer to the state in transition.
[0068] Before the simulation processor completes the extraction of security parameters and prepares to enter the transition phase of protocol switching, it calls the state saving unit within the protocol switching control module to perform a state data saving operation. The state saving unit saves the state data of the currently active protocol in the application state layer, the common state layer, and the protocol-specific state layer.
[0069] The state storage unit first saves the current state data of the application state layer. In the above application scenario, the current state of the application state layer is the connection state, and the state storage unit stores the state identifier of the connection state into the state data cache area of the protocol switching control module.
[0070] The state saving unit then saves the current state data of the common state layer. In the above application scenario, the current state of the common state layer is the data transmission state. The state saving unit stores the state number of the data transmission state and the associated context information into the state data cache area of the protocol switching control module. The state number of the common state layer is a unique identifier assigned to each state in the common state layer by the three-layer state machine module using a unified numbering system.
[0071] The state storage unit then saves the state data of the currently active protocol in the protocol-specific state layer. In the above application scenario, the currently active protocol is the RSSP-II communication protocol, and the unique state of the RSSP-II communication protocol in the protocol-specific state layer is the connection established state. The state storage unit stores the status identifier of the connection established state and the associated protocol context information into the state data cache area of the protocol switching control module. In another embodiment, the currently active protocol is the RSSP-I communication protocol, and the unique state of the RSSP-I communication protocol in the protocol-specific state layer is the master mode state. The state storage unit stores the status identifier of the master mode state and the associated protocol context information into the state data cache area of the protocol switching control module.
[0072] The state data saved by the state saving unit covers complete state snapshots of each layer in the three-layer state machine. The state data and the security parameters stored in the security parameter storage unit in the security parameter holding module together constitute the complete field information of the system before the protocol switch.
[0073] Based on the foregoing embodiments, the following provides a detailed description of the specific process of migrating security parameters from the current activation protocol to the target protocol.
[0074] The simulation processor invokes the parameter migration unit within the security parameter retention module to perform the security parameter migration operation. The parameter migration unit first extracts the current key and current sequence number from the security parameters of the currently active protocol.
[0075] The current key is the encryption key used by the currently active protocol during communication. It is generated during the connection establishment phase through key negotiation or pre-configuration and remains effective throughout data transmission. The current sequence number is an incremental number assigned to each message by the currently active protocol during data transmission. This sequence number is maintained synchronously between the communicating parties to prevent message replay attacks and out-of-order message transmission. In the above application scenario, the parameter migration unit extracts the current key and current sequence number of the RSSP-II communication protocol from the secure parameter storage unit.
[0076] The parameter migration unit then compares the key management mechanisms of the currently active protocol with those of the target protocol. The key management mechanism defines the rules and procedures for generating, distributing, updating, and destroying keys in the communication protocol. The RSSP-I communication protocol uses a pre-shared key-based key management mechanism, where both communicating parties pre-configure the same key before establishing a connection. The RSSP-II communication protocol uses a dynamic key negotiation-based key management mechanism, where both communicating parties dynamically generate session keys through authentication and key negotiation processes during connection establishment.
[0077] If the current activation protocol and the target protocol use the same key management mechanism, the parameter migration unit will directly migrate the current key to the target key of the target protocol.
[0078] Direct migration refers to the parameter migration unit assigning the value and format of the current key to the key storage space of the target protocol without conversion, so that the target protocol can directly use the migrated target key for security verification after the connection is established.
[0079] In one implementation, when the simulation system simulates a switching scenario between two lines that both use the RSSP-I communication protocol but have different configuration parameters, since both the source and target protocols are RSSP-I communication protocols and use the same key management mechanism based on pre-shared keys, the parameter migration unit directly migrates the current key to the target key.
[0080] If the current activation protocol and the target protocol use different key management mechanisms, the parameter migration unit triggers the key negotiation process of the target protocol to dynamically obtain the target key.
[0081] In the above application scenario, the currently active protocol is the RSSP-II communication protocol, and the target protocol is the RSSP-I communication protocol. The RSSP-II communication protocol uses a key management mechanism based on dynamic key negotiation, while the RSSP-I communication protocol uses a key management mechanism based on pre-shared keys. The key management mechanisms of the two communication protocols are different. The parameter migration unit triggers the key negotiation process of the RSSP-I communication protocol, which obtains the target key based on the pre-configured key information.
[0082] In another implementation, when the target protocol is the RSSP-II communication protocol, the parameter migration unit triggers the RSSP-II communication protocol authentication and key negotiation process, and the two communicating parties generate the target key through dynamic negotiation.
[0083] After completing key migration or key negotiation, the parameter migration unit processes the current sequence number. The parameter migration unit either migrates the current sequence number to the target sequence number of the target protocol or reinitializes the target sequence number within the context of the target protocol.
[0084] When the target protocol supports the continued use of the source protocol's sequence number, the parameter migration unit directly assigns the value of the current sequence number to the target protocol's sequence number storage space, so that the target protocol continues to increment from the current sequence number value, maintaining the continuity of the message count.
[0085] When the target protocol does not support the continued use of the source protocol's sequence number, or when there are differences in the sequence number encoding rules of the two communication protocols, the parameter migration unit reinitializes the target sequence number to the initial value specified by the target protocol within the context of the target protocol.
[0086] After the parameter migration unit completes key migration and sequence number processing, the parameter verification unit within the security parameter retention module verifies the validity of the migrated target key and target sequence number. The parameter verification unit checks whether the length and format of the target key conform to the specifications of the target protocol and whether the target sequence number is within the valid range allowed by the target protocol. When the parameter verification unit confirms that the migrated security parameters are valid, the security parameter migration process is complete.
[0087] Based on the above embodiments, the following provides a detailed description of the handover result verification and failure recovery process performed by the simulation processor after updating the target protocol's unique state in the protocol-specific state layer to a stable state.
[0088] After the simulation processor completes the connection establishment of the target protocol and updates the unique state of the target protocol in the protocol-specific state layer to a stable state, it calls the switching verification unit in the protocol switching control module to verify the protocol switching result.
[0089] The switching verification unit comprehensively verifies the protocol switching results from dimensions such as state transition integrity, timing constraints, security parameter consistency, and data integrity. In the above application scenario, the switching verification unit verifies whether the process of the simulation system switching from the RSSP-II communication protocol to the RSSP-I communication protocol meets the predetermined verification standards.
[0090] If the protocol switchover is verified to be successful, the simulation processor updates the application state layer to a connected state and begins data transmission using the target protocol. The logging unit within the simulation configuration and monitoring module records log information indicating a successful protocol switchover.
[0091] If the protocol switching result verification fails, the simulation processor performs the following recovery operation: The simulation processor first stops running the second protocol adapter. In the above application scenario, the simulation processor stops running the RSSP-I protocol adapter, terminating the connection and data exchange between the RSSP-I protocol adapter and the peer device.
[0092] The simulation processor then restores the application state layer, common state layer, and protocol-specific state layer to their states before the protocol switch, based on the state data stored in the state saving unit and the security parameters stored in the security parameter storage unit.
[0093] The simulation processor reads the application state layer state data, common state layer state data, and the state data of the currently active protocol in the protocol-specific state layer from the state data cache area of the protocol switching control module before the protocol switching, and restores the states of the application state layer, common state layer, and protocol-specific state layer to the connection states saved before the protocol switching.
[0094] In the above application scenario, the simulation processor restores the RSSP-II communication protocol's unique state in the protocol-specific state layer to the established connection state. Simultaneously, the simulation processor reads the security parameters saved before the protocol switch from the security parameter storage unit, restoring the key, sequence number, timestamp, and security context of the currently active protocol to their values before the switch.
[0095] After restoring the states and security parameters of each layer of the three-layer state machine, the simulation processor restarts the first protocol adapter.
[0096] In the above application scenario, the simulation processor restarts the RSSP-II protocol adapter, which then resumes data transmission with the peer device based on the restored security parameters. The logging unit within the simulation configuration and monitoring module records log information about protocol switching failures, including the reason for the failure and the specific dimensions of the failed verification.
[0097] In one implementation, after restoring to the state before the protocol switch, the emulation processor may re-initiate the protocol switch based on the operator's instructions. In another implementation, after restoring to the state before the protocol switch, the emulation processor may abandon the protocol switch and continue to use the currently active protocol for data transmission.
[0098] Based on the above embodiments, the following provides a detailed description of the specific process by which the simulation processor verifies the protocol switching results.
[0099] The simulation processor calls the switching verification unit in the simulation verification module and the protocol switching control module to verify the protocol switching results from four dimensions.
[0100] The first verification dimension is state transition integrity verification. The state transition verification unit within the simulation verification module checks whether the application state layer sequentially goes through the connected state, the switching state, and returns to the connected state during the protocol switching process.
[0101] The state transition verification unit reads the state change records of the application state layer during the protocol switching process from the log recording unit, arranges each state change record in chronological order, and compares each state change record with the predefined state transition sequence. The predefined state transition sequence requires that the application state layer state strictly transitions in the order of connected state to switching state and then back to connected state. Skipping the switching state and directly transitioning from connected state to connected state is not allowed, nor are unexpected state paths such as transitioning from switching state to error state and then back to connected state allowed.
[0102] The second verification dimension is timing constraint verification. The timing constraint verification unit in the simulation verification module checks whether the protocol switching time is within the preset allowable range.
[0103] The timing constraint verification unit reads the protocol switching start time and protocol switching completion time from the log recording unit. The protocol switching start time is the moment when the application state layer changes from the connected state to the switching state, and the protocol switching completion time is the moment when the application state layer changes from the switching state to the connected state.
[0104] The timing constraint verification unit calculates the time difference between the protocol handover start time and the protocol handover completion time, and compares this time difference with the preset maximum handover time. The preset maximum handover time is configured by the scenario configuration unit according to the safety requirements of the railway signaling system. If the time difference exceeds the preset maximum handover time, the timing constraint verification unit determines that the timing constraint verification has failed and records the specific timeout value.
[0105] The third verification dimension is the consistency verification of security parameters. The security verification unit within the simulation verification module checks whether the switched security parameters are valid and conform to the specifications of the target protocol.
[0106] The security verification unit reads the target key and target sequence number currently used by the target protocol after the switch from the second protocol adapter, and compares the target key and target sequence number with the key format requirements, key length requirements, and valid sequence number range defined in the target protocol specification. The security verification unit also checks whether the generation method of the target key conforms to the key management process specified by the target protocol, and confirms that the target key has not been tampered with and is within its validity period.
[0107] The fourth verification dimension is data integrity verification. The switching verification unit checks for data loss or duplication during the protocol switching process.
[0108] The handover verification unit reads the sequence number of the last successfully sent real-time security data packet before the protocol handover and the sequence number of the first successfully sent real-time security data packet after the protocol handover from the log recording unit, and compares the two sequence numbers for continuity. If there is a gap between the two sequence numbers, the handover verification unit determines that data loss occurred during the protocol handover. If there is an overlap between the two sequence numbers, the handover verification unit determines that data duplication occurred during the protocol handover. The handover verification unit also verifies that the packet content has not been corrupted during the protocol handover by checking the digest value of the packet content.
[0109] When the state transition integrity verification, timing constraint verification, security parameter consistency verification, and data integrity verification all pass, the simulation processor confirms that the protocol switch is successful. If any one of the above four verification dimensions fails, the simulation processor determines that the protocol switch has failed and executes the operation of stopping the second protocol adapter and restoring the state before the switch.
[0110] By comprehensively verifying the protocol switching results from four dimensions—state transition integrity, timing constraints, safety parameter consistency, and data integrity—the simulation verification module constructs a multi-dimensional verification system covering the entire protocol switching process. This system not only verifies the final result of the protocol switching but also verifies the intermediate processes and transition timing of the protocol switching. It meets the stringent requirements of Safety Integrity Level 4 (SIL4) for the correctness of protocol switching in railway signaling systems, thereby improving the credibility and authority of the simulation test results.
[0111] Reference Figure 4 , Figure 4 This is a schematic diagram of the vehicle-to-ground communication simulation device provided by the present invention. The device includes: An initialization module is used to initialize the states of each layer in the three-layer state machine of the simulation system. The three-layer state machine includes an application state layer, a common state layer that defines the common states of communication protocols, and a protocol-specific state layer that defines the states specific to each communication protocol. The initial connection establishment module is used to establish a connection with the peer device through the first protocol adapter corresponding to the currently active protocol. After the connection is successfully established, the common state layer and the application state layer are updated to the connected state, and the protocol-specific state layer is updated to the stable state corresponding to the currently active protocol. The security parameter extraction module is used to extract the security parameters of the currently active protocol in response to a received protocol switching command during data transmission. The switching control module is used to update the state of the application state layer to the switching state, keep the state of the common state layer unchanged, and stop the data transmission of the first protocol adapter. The parameter migration module is used to activate the second protocol adapter corresponding to the target protocol and migrate the security parameters from the currently active protocol to the target protocol. The target connection establishment module is used to establish a connection with the peer device through the second protocol adapter. After the connection is successfully established, the target protocol's unique state in the protocol-specific state layer is updated to a stable state, and the application state layer is updated to a connected state.
[0112] It should be noted that the vehicle-to-ground communication simulation device provided by the present invention can execute the vehicle-to-ground communication simulation method of any of the above embodiments during specific operation, which will not be elaborated in this embodiment.
[0113] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 5As shown, the electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communications interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute the vehicle-to-ground communication simulation method provided in the above embodiments.
[0114] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0115] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by the computer, the computer is able to execute the vehicle-to-ground communication simulation method provided in the above embodiments.
[0116] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the vehicle-to-ground communication simulation method provided in the above embodiments.
[0117] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0118] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A vehicle-to-ground communication simulation method, characterized in that, include: The states of each layer in the three-layer state machine of the simulation system are initialized. The three-layer state machine includes an application state layer, a common state layer that defines the common states of communication protocols, and a protocol-specific state layer that defines the specific states of each communication protocol. A connection is established with the peer device through the first protocol adapter corresponding to the current activation protocol. After the connection is successfully established, the common state layer and the application state layer are updated to the connected state, and the protocol-specific state layer is updated to the stable state corresponding to the current activation protocol. During data transmission, in response to a received protocol switching command, the security parameters of the currently active protocol are extracted; Update the state of the application state layer to the switching state, keep the state of the common state layer unchanged, and stop the data transmission of the first protocol adapter; Activate the second protocol adapter corresponding to the target protocol, and migrate the security parameters from the currently active protocol to the target protocol; A connection is established with the peer device through the second protocol adapter. After the connection is successfully established, the unique state of the target protocol in the protocol-specific state layer is updated to a stable state, and the state of the application state layer is updated to a connected state.
2. The vehicle-to-ground communication simulation method according to claim 1, characterized in that, The step of migrating the security parameters from the currently active protocol to the target protocol includes: Extract the current key and current serial number from the security parameters of the current activation protocol; Compare the key management mechanisms of the current activation protocol with those of the target protocol; If the current activation protocol and the target protocol use the same key management mechanism, then the current key will be directly migrated to the target key of the target protocol; If the current activation protocol and the target protocol use different key management mechanisms, then the key negotiation process of the target protocol is triggered to dynamically obtain the target key; The current sequence number is migrated to the target sequence number of the target protocol, or the target sequence number is reinitialized in the context of the target protocol.
3. The vehicle-to-ground communication simulation method according to claim 1, characterized in that, Before extracting the security parameters of the currently active protocol after responding to the received protocol switching instruction, the method further includes: Check whether the current state of the common state layer is a connected state or a data transmission state; Check for any pending data packets; Verify the validity of the security parameters of the current activation protocol, including checking whether the key is within its validity period and whether the serial number is within the valid range; Verify the validity of the protocol switching command; If the above checks and verifications pass, then proceed with the step of extracting the security parameters of the current activation protocol.
4. The vehicle-to-ground communication simulation method according to claim 1, characterized in that, Before updating the application state layer to the transition state, the following steps are also included: Save the state data of the currently active protocol in the current application state layer, the common state layer, and the protocol-specific state layer.
5. The vehicle-to-ground communication simulation method according to claim 4, characterized in that, After updating the specific state of the target protocol in the protocol-specific state layer to a stable state, the method further includes: Verify the protocol switching result; If the protocol switching result verification fails, then stop running the second protocol adapter; Based on the state data and the security parameters, the application state layer, the common state layer, and the protocol-specific state layer are restored to their states before the protocol switch. Restart the first protocol adapter.
6. The vehicle-to-ground communication simulation method according to claim 5, characterized in that, The verification of the protocol switching result includes: Perform state transition integrity verification to check whether the application state layer has sequentially gone through the connected state, the switching state, and returned to the connected state during the protocol switching process; Perform timing constraint verification to check whether the protocol switching time is within the preset allowable range; Perform a security parameter consistency verification to check whether the switched security parameters are valid and conform to the specifications of the target protocol; Perform data integrity verification to check for data loss or duplication during protocol switching; When the state transition integrity verification, the timing constraint verification, the security parameter consistency verification, and the data integrity verification all pass, the protocol switchover is confirmed to be successful.
7. A vehicle-to-ground communication simulation device, characterized in that, include: An initialization module is used to initialize the states of each layer in the three-layer state machine of the simulation system. The three-layer state machine includes an application state layer, a common state layer that defines the common states of communication protocols, and a protocol-specific state layer that defines the states specific to each communication protocol. The initial connection establishment module is used to establish a connection with the peer device through the first protocol adapter corresponding to the currently active protocol. After the connection is successfully established, the common state layer and the application state layer are updated to the connected state, and the protocol-specific state layer is updated to the stable state corresponding to the currently active protocol. The security parameter extraction module is used to extract the security parameters of the currently active protocol in response to a received protocol switching command during data transmission. The switching control module is used to update the state of the application state layer to the switching state, keep the state of the common state layer unchanged, and stop the data transmission of the first protocol adapter. The parameter migration module is used to activate the second protocol adapter corresponding to the target protocol and migrate the security parameters from the currently active protocol to the target protocol. The target connection establishment module is used to establish a connection with the peer device through the second protocol adapter. After the connection is successfully established, the target protocol's unique state in the protocol-specific state layer is updated to a stable state, and the application state layer is updated to a connected state.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the vehicle-to-ground communication simulation method as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the vehicle-to-ground communication simulation method as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the vehicle-to-ground communication simulation method as described in any one of claims 1 to 6.