Communication processing method and device, communication transmission system, equipment and medium

By using ring message queue and state machine mechanism in the communication processing method, multi-frame data transmission and reverse communication are realized across core transmission, solving the problem that one-way pipeline is difficult to support multi-frame transmission, and improving the stability and accuracy of data transmission.

CN119583471APending Publication Date: 2025-03-07CHINA AUTOMOTIVE INNOVATION CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411645845.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

In the prior art, the transmission form of one-way pipelines is difficult to effectively support multi-frame transmission of the transmission layer, and there is a lack of effective feedback and confirmation mechanisms.

Method used

By introducing a ring message queue and a state machine mechanism in the communication processing method, data transmission is performed between the first transceiver and the second transceiver, and the state switching of the state machine reflects the working state, realizing multi-frame data transmission and reverse communication transmitted across cores.

Benefits of technology

The problem that one-way pipeline is difficult to support multi-frame transmission is solved, reverse communication from the second transceiver to the first transceiver and the order and integrity of multi-frame data are realized, and the stability and accuracy of data transmission are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119583471A_ABST
    Figure CN119583471A_ABST
Patent Text Reader

Abstract

The invention provides a communication processing method and device, a communication transmission system, equipment and a medium, and the method comprises the steps: obtaining a first state machine and a second state machine, the first state machine being used for recording a first working state of a first transceiver; the second state machine is used for recording a second working state of the second transceiver; a first target interface is called to transmit data to the annular message queue, the first target interface is a target communication interface in at least one communication interface of the first transceiver and the annular message queue, and the first target interface is determined according to the first working state and / or the second working state; and based on at least one of the first working state, the second working state and the first target interface, controlling the first working state recorded by the first state machine to perform state switching, thereby solving the problem that a one-way pipeline lacks an effective feedback and confirmation mechanism for multi-frame transmission, and meeting the requirement of multi-frame transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technology, and in particular to a communication processing method, apparatus, communication transmission system, equipment and medium. Background Art

[0002] In vehicle embedded systems, more and more Electronic Control Units (ECUs) use multi-core system development software frameworks, such as the Automotive Open System Architecture (AUTOSAR).

[0003] Multi-core systems improve system performance by splitting the communication stack among multiple cores, enabling them to provide better concurrent processing capabilities than single-core systems. For large domain controllers, a large number of sent and received messages brings huge load pressure to the system. Reasonable segmentation of the communication stack can effectively improve the controller performance.

[0004] The common communication stack segmentation protocol is to allocate the upper layer module to one core and the lower layer module to another core, and implement cross-core data transmission through a unidirectional pipe. However, the unidirectional pipe transmission form is difficult to effectively support multi-frame transmission at the transport layer. Summary of the invention

[0005] In order to solve the problem that the transmission form of a unidirectional pipe in the prior art is difficult to effectively support multi-frame transmission of the transport layer, the present disclosure provides a communication processing method, apparatus, communication transmission system, device and medium, which are as follows:

[0006] In a first aspect, an embodiment of the present disclosure provides a communication processing method, which is applied to a first transceiver as a transmitting end, and the first transceiver performs data transmission with a second transceiver through a ring message queue, including:

[0007] Acquire a first state machine and a second state machine, wherein the first state machine is used to record a first working state of the first transceiver; and the second state machine is used to record a second working state of the second transceiver;

[0008] Calling a first target interface to transmit data to the ring message queue, the first target interface being a target communication interface in at least one communication interface between the first transceiver and the ring message queue, and the first target interface being determined according to the first working state and / or the second working state;

[0009] Based on at least one of the first working state, the second working state and the first target interface, the first working state recorded by the first state machine is controlled to perform state switching.

[0010] In some possible embodiments, the first transceiver is used to divide the data to be transmitted into at least one data frame, each data frame in the at least one data frame has a corresponding transmission order;

[0011] Calling the first target interface to transmit data to the ring message queue includes:

[0012] Calling the first target interface;

[0013] Data frames corresponding to the transmission sequence are determined in sequence from at least one data frame, and sent to the ring message queue through the first target interface.

[0014] In some possible embodiments, the communication processing method further includes:

[0015] Get the storage space status of the ring message queue;

[0016] Based on at least one of the first working state, the second working state, and the first target interface, controlling the first working state recorded by the first state machine to switch the state includes:

[0017] Based on at least one of the first working state, the second working state, the first target interface and the storage space state, the first working state recorded by the first state machine is controlled to perform state switching.

[0018] In some possible embodiments, based on at least one of the first working state, the second working state, the first target interface, and the storage space state, controlling the first working state recorded by the first state machine to switch the state includes:

[0019] When the storage space state represents that the storage space of the ring message queue receives all the data to be transmitted sent by the first transceiver, controlling the first working state recorded by the first state machine to switch to a completion state;

[0020] Or, when the storage space state represents that the storage space of the ring message queue receives part of the data to be transmitted sent by the first transceiver, the first working state recorded by the first state machine is controlled to switch to the ongoing state.

[0021] In some possible embodiments, based on at least one of the first working state, the second working state, and the first target interface, controlling the first working state recorded by the first state machine to switch the state includes:

[0022] When the first working state is in progress or completed, and the first target interface is a data sending cancellation interface, controlling the first working state recorded by the first state machine to switch to a terminated state;

[0023] Or, when the second working state is a failure state or a completion state and the first target interface is a confirmation sending end interface, the first working state recorded by the first state machine is controlled to switch to an idle state.

[0024] In some possible embodiments, the communication interface between the first transceiver and the ring message queue includes at least one of a start data transmission interface, a copy data transmission interface, a cancel data transmission interface, and a confirmation transmission end interface;

[0025] and / or, the first working state includes at least one of an ongoing state, an idle state, a terminated state, a completed state, and a failed state;

[0026] And / or, the second working state includes at least one of an ongoing state, an idle state, a terminated state, a completed state, and a failed state.

[0027] In a second aspect, an embodiment of the present disclosure provides a communication processing method, which is applied to a second transceiver as a receiving end, and the second transceiver performs data transmission with the first transceiver through a ring message queue, including:

[0028] Acquire a first state machine and a second state machine, wherein the first state machine is used to record a first working state of the first transceiver; and the second state machine is used to record a second working state of the second transceiver;

[0029] Calling a second target interface to transmit data to the annular message queue, where the second target interface is a target communication interface in at least one communication interface between the second transceiver and the annular message queue, and the second target interface is determined according to the first working state and / or the second working state;

[0030] Based on at least one of the first working state, the second working state and the second target interface, the second working state recorded by the second state machine is controlled to perform state switching.

[0031] In some possible embodiments, the second transceiver is used to divide the data to be transmitted into at least one data frame, and each data frame in the at least one data frame has a corresponding transmission order;

[0032] Calling the second target interface to transmit data to the ring message queue includes:

[0033] Calling the second target interface;

[0034] Data frames are received from the ring message queue in sequence through the second target interface to obtain at least one data frame, and each data frame in the at least one data frame has a corresponding transmission sequence.

[0035] In a third aspect, an embodiment of the present disclosure provides a communication processing device, which is applied to a first transceiver as a transmitting end, and the first transceiver performs data transmission with a second transceiver through a ring message queue, including:

[0036] A first acquisition module, used to acquire a first state machine and a second state machine, the first state machine is used to record a first working state of the first transceiver; the second state machine is used to record a second working state of the second transceiver;

[0037] A first transmission module, used for calling a first target interface to transmit data to the ring message queue, the first target interface being a target communication interface in at least one communication interface between the first transceiver and the ring message queue, and the first target interface being determined according to the first working state and / or the second working state;

[0038] The first switching module is used to control the first working state recorded by the first state machine to perform state switching based on at least one of the first working state, the second working state and the first target interface.

[0039] In some possible embodiments, the first transceiver is used to divide the data to be transmitted into at least one data frame, each data frame in the at least one data frame has a corresponding transmission order;

[0040] The first transmission module is used for:

[0041] Calling the first target interface;

[0042] Data frames corresponding to the transmission sequence are determined in sequence from at least one data frame, and sent to the ring message queue through the first target interface.

[0043] In some possible embodiments, the communication processing device further includes:

[0044] The third acquisition module is used to acquire the storage space status of the ring message queue.

[0045] The first switching module is used for:

[0046] Based on at least one of the first working state, the second working state, the first target interface and the storage space state, the first working state recorded by the first state machine is controlled to perform state switching.

[0047] In some possible embodiments, the first switching module is used to:

[0048] When the storage space state indicates that the annular message queue receives all the data to be transmitted sent by the first transceiver, the first working state recorded by the first state machine is controlled to switch to the completion state

[0049] Or, when the storage space state represents that the annular message queue receives part of the data to be transmitted sent by the first transceiver, the first working state recorded by the first state machine is controlled to switch to the ongoing state.

[0050] In some possible embodiments, the first switching module is used to:

[0051] When the first working state is in progress or completed, and the first target interface is a data sending cancellation interface, controlling the first working state recorded by the first state machine to switch to a terminated state;

[0052] Or, when the second working state is a failure state or a completion state and the first target interface is a confirmation sending end interface, the first working state recorded by the first state machine is controlled to switch to an idle state.

[0053] In some possible embodiments, the communication interface between the first transceiver and the ring message queue includes at least one of a start data transmission interface, a copy data transmission interface, a cancel data transmission interface, and a confirmation transmission end interface;

[0054] In some possible embodiments, the first working state includes at least one of an ongoing state, an idle state, a terminated state, a completed state, and a failed state;

[0055] In some possible embodiments, the second working state includes at least one of an ongoing state, an idle state, a terminated state, a completed state, and a failed state.

[0056] In a fourth aspect, an embodiment of the present disclosure provides a communication processing device, which is applied to a second transceiver as a receiving end, and the second transceiver performs data transmission with the first transceiver through a ring message queue, including:

[0057] A second acquisition module, used to acquire a first state machine and a second state machine, the first state machine is used to record a first working state of the first transceiver; the second state machine is used to record a second working state of the second transceiver;

[0058] A second transmission module, used for calling a second target interface to transmit data to the ring message queue, the second target interface is a target communication interface in at least one communication interface between the second transceiver and the ring message queue, and the first target interface is determined according to the first working state and / or the second working state;

[0059] The second switching module is used to control the second working state recorded by the second state machine to perform state switching based on at least one of the first working state, the second working state and the second target interface.

[0060] In some possible embodiments, the first transceiver is used to divide the data to be transmitted into at least one data frame, each data frame in the at least one data frame has a corresponding transmission order;

[0061] The second transmission module is used for:

[0062] Calling the second target interface;

[0063] Data frames are received from the ring message queue in sequence through the second target interface to obtain at least one data frame, and each data frame in the at least one data frame has a corresponding transmission sequence.

[0064] In a fifth aspect, an embodiment of the present disclosure provides a communication transmission system, the communication transmission system comprising a first transceiver, a second transceiver and a routing component;

[0065] The routing component is connected between the first transceiver and the second transceiver, and a circular message queue is loaded in the routing component for the first transceiver and the second transceiver to perform data transmission;

[0066] The first transceiver performs data transmission according to any communication processing method in the first aspect;

[0067] And / or, the second transceiver performs data transmission according to any communication processing method as described in the second aspect.

[0068] In a sixth aspect, an embodiment of the present disclosure provides an electronic device, wherein a computer includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement a communication processing method as described in any one of the first aspect or the second aspect.

[0069] In the seventh aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or at least one program is loaded and executed by a processor to implement a communication processing method as described in any one of the first aspect or the second aspect.

[0070] The embodiments of the present disclosure provide a communication processing method, apparatus, communication transmission system, device, and medium, which have the following technical effects:

[0071] In the process of communication data transmission, the second state machine and the first target interface are used as external events that can trigger the state switching of the first state machine, so that the first transceiver can reflect the working state of the second transceiver during the state switching process of the first state machine. Feedback from the second transceiver to the first transceiver is realized during the state switching process of the first state machine, solving the problem of the lack of effective feedback and confirmation mechanism for multi-frame transmission in the unidirectional channel, and meeting the requirements of multi-frame transmission.

[0072] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present disclosure or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0074] Figure 1 is a schematic diagram of an application environment provided by an exemplary embodiment of the present disclosure;

[0075] Figure 2 is a first flow chart of a communication processing method provided by an exemplary embodiment of the present disclosure;

[0076] Figure 3 is a schematic diagram of the structure of a ring message queue provided by an exemplary embodiment of the present disclosure;

[0077] Figure 4 is a schematic diagram of an AUTOSAR framework provided by an exemplary embodiment of the present disclosure;

[0078] Figure 5 is a second flow chart of a communication processing method provided by an exemplary embodiment of the present disclosure;

[0079] Figure 6 is a third flow chart of a communication processing method provided by an exemplary embodiment of the present disclosure;

[0080] Figure 7 is a fourth flow chart of a communication processing method provided by an exemplary embodiment of the present disclosure;

[0081] Figure 8 is a first structural schematic diagram of a communication processing device provided by an exemplary embodiment of the present disclosure;

[0082] Fig. 9is a second structural schematic diagram of a communication processing device provided by an exemplary embodiment of the present disclosure;

[0083] Fig.10 It is a structural schematic diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0084] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.

[0085] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0086] See also Figure 1 , Figure 1 1 is a schematic diagram of an application environment provided by an embodiment of the present disclosure, the schematic diagram includes a first transceiver 101, a second transceiver 102 and a routing component 103, wherein the routing component 103 can determine a communication strategy according to the working state of the first transceiver 101 and the working state of the second transceiver 102. The first transceiver 101 can be a transceiver as a transmitter, and the second transceiver 102 can be a transceiver as a receiver. The routing component 103 is connected between the first transceiver 101 and the second transceiver 102, and a circular message queue 103 is loaded in the routing component 103 for the first transceiver 101 and the second transceiver 102 to perform data transmission.

[0087] Specifically, the routing component 103 obtains a first state machine and a second state machine, the first state machine is used to record the first working state of the first transceiver; the second state machine is used to record the second working state of the second transceiver; the first target interface is called to transmit data to the ring message queue, the first target interface is the target communication interface in at least one communication interface between the first transceiver and the ring message queue, and the first target interface is determined according to the first working state and / or the second working state; based on the first working state, the second working state and at least one of the first target interface, the first working state recorded by the first state machine is controlled to switch states.

[0088] In the disclosed embodiment, Figure 1 The first transceiver 101 and the second transceiver 102 shown can be two complete computing engines (processing cores) integrated on a multi-core processor, and can belong to two different single-core processors or two different multi-core processors. A multi-core processor refers to two or more complete computing engines integrated in one processor. Furthermore, the first transceiver 101 and the second transceiver 102 can also be other computer terminals with the same processor, or similar computing devices. Furthermore, the first transceiver 101 or the second transceiver 102 can be replaced by a server system, a computing platform or a server cluster including multiple servers. The routing component 103 can be a message queue middleware, a gateway, a PDUR (PDU Router, protocol data unit routing component), and the like.

[0089] In some possible embodiments, the first transceiver 101 and the second transceiver 102 may be two complete computing engines (cores) integrated on a multi-core processor. According to a common communication stack partitioning protocol, a processing module of a preset category is usually allocated to the processing core where the first transceiver 101 is located, and another processing module of a preset category is allocated to the processing core where the second transceiver 102 is located. A communication connection is established between the two processing cores through the first transceiver 101 and the second transceiver 102, so that cross-core communication can be achieved between processing modules in different cores.

[0090] In some possible embodiments, the first transceiver 101 may be a transmitting end when sending data, and may be a receiving end when receiving data. The second transceiver 102 may be a transmitting end when sending data, and may be a receiving end when receiving data.

[0091] The following describes a specific embodiment of a communication processing method disclosed in the present invention. Figure 2It is a flow chart of a communication processing method provided by an embodiment of the present disclosure. This specification provides method operation steps such as the embodiment or flow chart, but more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the order of many steps and does not represent the only execution order. When the actual system or server product is executed, it can be executed in the order of the method shown in the embodiment or the figure or in parallel (for example, in a parallel processor or multi-threaded processing environment).

[0092] Specific as Figure 2 As shown, the communication processing method includes:

[0093] S201. Obtain a first state machine and a second state machine.

[0094] The ring message queue provided in this embodiment can be found in Figure 3 , the ring message queue can serve as a shared cache between the first transceiver and the second transceiver.

[0095] A circular message queue is a special queue structure that uses a fixed-size storage space to store data and manages the entry and exit of data through a circular transmission method. A circular message queue can be configured with any number of queue nodes, each of which occupies a small storage node in the storage space, and each queue node can store at most one data frame. Figure 3 A circular message queue with 12 queue nodes is shown, in which three data frames are stored. 1 is the head of the queue, and the data frames stored in it are first dequeued and sent to the receiving end, followed by 1 and 2 in order.

[0096] For a circular message queue, it has a read end and a write end, the write end is connected to the send end, and the read end is connected to the receive end, IN in the figure represents the write end, and OUT represents the read end. The send end in this embodiment is the first transceiver 101, and the receive end is the second transceiver 102.

[0097] In addition, since the receiving end and the transmitting end can be converted to each other, taking the first transceiver as an example, it is a transmitting end when it needs to send data and a receiving end when it receives data. Therefore, for the ring message queue, the reading end and the writing end can be converted according to the conversion of the transmitting end and the receiving end. The receiving end and the transmitting end, as well as the reading end and the writing end in this embodiment are all convenient terms, and this embodiment is not limited to the above definition.

[0098] In order to determine the communication transmission strategy for the working states of the first transceiver and the second transceiver during data communication, a first state machine is set to record the first working state of the first transceiver and a second state machine is set to record the second working state of the second transceiver.

[0099] The first state machine can be located in the first transceiver or in the routing component; the second state machine can be located in the second transceiver or in the routing component, and there is no particular limitation on this. However, since the routing component can provide a common storage space, the first state machine and the second state machine are usually located in the routing component.

[0100] As an abstract mathematical model, the state machine records the transitions of the system between different states. The state machine enters an initial state at initialization, and then decides whether to switch states based on external events and the current state. During the switching process, signals can be output and specific operations can be performed. After the state switch, the system enters the next state and waits for the condition for the next state switch to occur.

[0101] In the setting of the first state machine, the second state machine and the first target interface are used as external events that can trigger the first state machine to switch states, and the specific switching is described in step S203. Here, it is briefly described that the second working state recorded by the second state machine is set as an external event, with the purpose of making the first state machine and the second state machine mutually guard conditions (Guard Condition) to complete the state machine switching. Mutual guard conditions simply mean that the state change of a state machine may depend on a specific state of another state machine as a triggering condition (external event). Through this setting, the first transceiver can be triggered according to the second working state of the second transceiver to switch from the state of the first state machine. For the first transceiver to perform data transmission, the second working state of the second transceiver as the receiving end can be quickly and accurately grasped, and the data transmission situation can be known according to the second working state. According to the data transmission situation, the communication strategy is customized to improve the stability and accuracy of data transmission.

[0102] Since the data transmitted in this embodiment is usually not limited to single-frame data, but also includes multi-frame data, the transmission of multi-frame data usually relies on the receiver to confirm (ACK) each frame to ensure data integrity. The traditional unidirectional pipeline cannot realize the reverse communication from the second transceiver to the first transceiver. The first transceiver cannot obtain information on whether the frame is successfully received, nor can it confirm whether the frame is lost or an error occurs during the transmission process. In this embodiment, a first state machine for recording the first working state of the first transceiver and a second state machine for recording the second working state of the second transceiver are set, and the second state machine is used as the state switching trigger condition of the first state machine. For example, one of the trigger conditions for the working state recorded by the first state machine to switch from the ongoing state to the completed state is that the working state recorded by the second state machine is the completed state. In such a process, if the second transceiver does not successfully receive the corresponding data, the first state machine will not be able to switch to the completed state. Then, the communication strategy can be determined according to the working state recorded by the first state machine, such as whether it is necessary to stop sending data, whether it is necessary to resend data, etc.

[0103] By setting the first state machine and the second state machine as guard conditions for each other, the working state of the second transceiver recorded by the second state machine can be used as a trigger condition for the first state machine. Reverse communication from the second transceiver to the first transceiver is achieved during the state switching process of the first state machine, providing a confirmation mechanism for the sender during the transmission of multiple frames of data.

[0104] In some possible embodiments, the first state machine includes at least one of the following states: an ongoing state (ONGOING), an idle state (IDLE), a terminated state (TERMINATED), a completed state (COMPLETED) and a failed state (FAILED); DLE is the initial state, ONGOING and TERMINATED are intermediate states, and COMPLETED and FAILED are end states.

[0105] In some possible embodiments, the second working state includes at least one of the following states: an ongoing state (ONGOING), an idle state (IDLE), a terminated state (TERMINATED), a completed state (COMPLETED), and a failed state (FAILED; DLE is an initial state, ONGOING and TERMINATED are intermediate states, and COMPLETED and FAILED are end states.

[0106] S202: Call the first target interface to transmit data to the ring message queue.

[0107] The first target interface is a target communication interface in at least one communication interface between the first transceiver and the ring message queue. The first transceiver communicates with the ring message queue by calling the communication interface.

[0108] The communication interface between the first transceiver and the ring message queue includes at least one of the following communication interfaces: start sending data interface PduR_ <uptp>Transmit(), copy and send data interface PduR_ <lotp>CopyTxData(), cancel sending data interface PduR_ <lotp>TxConfirmation(), confirm the end of sending interface PduR_ <uptp>CancelTransmit().

[0109] The words in angle brackets (<>) are abstract pronouns for upper and lower layer processing modules. <lotp>represents a lower-layer processing module, which is a functional module in the processing core of the receiving end. The lower-layer processing module can be understood as a second transceiver, or a functional module connected to the second transceiver and transmitting data via the second transceiver; <uptp>It represents the upper layer processing module, which is a functional module in the processing core of the transmitting end. The upper layer processing module can be understood as the first transceiver, or can be understood as a functional module connected to the first transceiver and transmitting data via the first transceiver.

[0110] In addition, after the specific configuration is completed, the above communication interface will be instantiated into a specific interface name. For example, when the upper layer processing module is CanTp, the sending data interface PduR_ <uptp>The name of Transmit() is instantiated as PduR_CanTPTransmit().

[0111] In addition to the corresponding first target interface being determined by the upper layer processing module, different first target interfaces can also be used as external events to trigger different state switching of the first state machine, and different first working states of the first state machine can trigger different communication transmission strategies. Specifically, different communication transmission strategies can be determined according to the first working state and / or the second working state, and the corresponding first target interface can be selected from multiple communication interfaces for different communication transmission strategies.

[0112] Based on the above-mentioned upper-layer processing module and lower-layer processing module, the traditional communication processing method cannot support multi-frame transmission, or the multi-frame transmission method adopted is in the form of inter-core interruption, which requires locking the processing core. In this way, on the one hand, the inter-core interruption will cause the processing core of the second transceiver to adopt specific operations, such as context switching or cache refresh, which will interrupt the operation being processed by the processing core of the second transceiver, increase the burden on the processing core, and affect system performance; on the other hand, the locking operation will cause deadlock or lock contention problems, increase system complexity and bring additional overhead to the system.

[0113] See also Figure 4 Taking the AUTOSAR framework as an example, in order to balance multi-frame transmission and system performance, the traditional communication processing method often uses a common strategy to allocate the AUTOSAR communication protocol stack modules to multiple cores. The processing modules that are strongly related to the bus protocol are placed on one processing core, and the processing modules that are slightly related to the bus protocol are placed on another processing core, and then the two parts are connected together through the routing component. In the CAN (Controller Area Network) bus, processing modules such as CanDrv (Controller Area Network Driver), CanNm (Controller Area Network Neighborhood Management), CanIf (Controller Area Network Interface), CanSM (Controller Area Network Status Management), and CanTp (Controller Area Network Transmission Protocol) are allocated to one processing core, and processing modules such as Com (Communication Manager) and Dcm (Diagnostic Communication Manager) are placed on another processing core. However, according to the AUTOSAR specification, the lower layer processing module of the CanTp processing module must be the CanIf processing module, and the Dcm processing module needs to be highly bound to the Dem (Diagnostic Event Manager) processing module and must also run on the same processing core.

[0114] In the communication processing method provided in this embodiment, since the state switching of the first state machine can be triggered by the second working state port of the second state machine as an external event, the working state of the second transceiver can be referred to in the process of selecting the communication strategy of the first transceiver, and the corresponding communication strategy can be selected, without taking the form of inter-core interrupt to lock the second transceiver. At the same time, the communication protocol stack is more flexibly divided, multi-core load balancing is more effectively achieved, and the overall system performance is improved.

[0115] In addition, the communication processing method provided in this embodiment is generally applied to the first transceiver, and the specific execution steps of the method can be executed by the first transceiver or by the routing component. When the routing component executes the above method, in order to obtain the working status recorded by the first state machine and the second state machine, and follow up the communication transmission process, the routing component will be set to poll the first working state of the first state machine or the second working state of the second state machine through a polling interface. At the same time, the polling interface can also drive the first transceiver or the second transceiver to call the corresponding communication interface for communication according to the state of the first state machine. For example, the polling interface in this embodiment can be PduR_Mainfunction().

[0116] For the communication interface provided in the above embodiment, the corresponding call result can also be fed back during the calling process of the first transceiver for query by the polling interface. For example, the first transceiver calls the start-up data transmission interface PduR_ <uptp>When Transmit() fails, E=not_OK will be written in the start data transmission interface, which means that the first transceiver fails to call the start data transmission interface. At this time, the routing component will determine the next stage of communication strategy based on the feedback result.

[0117] In some possible embodiments, multi-frame transmission is usually required in common application scenarios of the first transceiver and the second transceiver. For example, in video streaming transmission, in order to reduce delay and ensure smooth playback, a large file is divided into multiple data frames for transmission.

[0118] In addition to controlling the state switching of the first state machine through the first working state of the first transceiver, the second working state of the second transceiver, and the first target interface, this embodiment can also effectively support the transmission of multiple frames of data. Specifically:

[0119] The first transceiver is used to divide the data to be transmitted into at least one data frame, and each data frame in the at least one data frame has a corresponding transmission order. On this basis, see Figure 5 , step S202 includes:

[0120] S2021. Call the first target interface.

[0121] S2022. Determine data frames corresponding to a transmission order from at least one data frame in sequence, and send them to the ring message queue through the first target interface.

[0122] In some possible embodiments, the data to be transmitted includes PDU (Protocol Data Unit) data, and PDU data refers to the basic data unit transmitted in a certain layer of protocol (such as network layer, data link layer, etc.). The size of PDU data depends on the specific protocol and network requirements, but in many scenarios, PDU data may be larger than the maximum carrying capacity of a single physical frame (such as Ethernet frame or CAN bus frame). Therefore, in some network protocols, such as CAN (Controller Area Network) bus, LIN (Local Interconnect Network) bus or TCP / IP (Transmission Control Protocol / Internet Protocol), a single PDU data may not be transmitted through a single frame. At this time, it is necessary to divide a PDU data into multiple data frames for multi-frame transmission. Common application scenarios of multi-frame transmission include: network layered structure, automotive bus communication, wireless communication protocol, etc.

[0123] In addition, the data to be transmitted is not limited to PDU data, and can be selected according to actual conditions.

[0124] The ring message queue used in this embodiment can, first of all, utilize the transmission characteristics of the ring message queue, that is, the first-in-first-out data structure. The data transmitted by the first transceiver through the ring message queue can be sent to the second transceiver in the first-in-first-out order, which can maintain the sequentiality and integrity of the transmission of multi-frame data and effectively reduce the risk of disorder in the transmission process of multi-frame data. Secondly, the ring message queue can provide a certain buffer area to store data, effectively utilize space, and avoid congestion problems that occur during the dequeue process. For example, if the transmission speed of the first transceiver exceeds the processing speed of the second transceiver, it may cause data loss or increased delay. The use of a ring message queue can effectively achieve flow control.

[0125] The state switching form of the first state machine provided in this embodiment, specifically, takes the second working state of the second transceiver recorded by the second state machine as a partial condition for the state switching, which can meet the needs of the confirmation mechanism during the transmission of multiple frames of data, that is, determines whether the second transceiver has received the corresponding data frame according to the second working state of the second transceiver. This state will be directly reflected in the state switching of the first state machine. During the communication transmission process, the corresponding communication strategy can be selected according to the state switching of the first state machine to meet the needs of multi-frame data transmission.

[0126] S203: Based on at least one of the first working state, the second working state and the first target interface, control the first working state recorded by the first state machine to perform state switching.

[0127] According to the above description, in the state switching of the first state machine, the first target interface and the second working state are used as external events to trigger the state switching. In addition to the first working state currently recorded by the first state machine, the second state machine and the first target interface will also trigger the switching of different states. In this embodiment, the state switching of the first state machine is determined according to the second working state of the second state machine and the first target interface called by the first transceiver.

[0128] The triggering conditions for the state transition mentioned in step S203 are listed below, but are not limited thereto. At the same time, the triggering conditions provided in this embodiment can be freely combined, specifically:

[0129] When the first working state is in progress or completed, and the first target interface is a data sending cancellation interface, the first working state recorded by the first state machine is controlled to switch to a terminated state.

[0130] Or, when the second working state is a failure state or a completion state and the first target interface is a confirmation sending end interface, the first working state recorded by the first state machine is controlled to switch to an idle state.

[0131] On the basis of the above embodiment, the state switching of the first state machine may also be triggered according to the storage space state of the storage space (Buffer) in the ring message queue, and the communication processing method further includes:

[0132] Gets the storage space status of the ring message queue.

[0133] Step S203 also includes:

[0134] Based on at least one of the first working state, the second working state, the first target interface and the storage space state, the first working state recorded by the first state machine is controlled to perform state switching.

[0135] Specific:

[0136] When the storage space state represents that the storage space of the ring message queue receives all the data to be transmitted sent by the first transceiver, controlling the first working state recorded by the first state machine to switch to a completion state;

[0137] Or, when the storage space state represents that the storage space of the ring message queue receives part of the data to be transmitted sent by the first transceiver, the first working state recorded by the first state machine is controlled to switch to the ongoing state.

[0138] Generally speaking, the ring message queue can receive all the data to be transmitted from the first transceiver only when the remaining storage space is greater than or equal to the amount of data to be transmitted, otherwise it can only receive part of the data to be transmitted. When the storage space status indicates that there is no remaining storage space, the ring message queue cannot receive the data to be transmitted sent by the first transceiver.

[0139] The above embodiment is described below through a specific implementation method:

[0140] First, when the first working state recorded by the first state machine is an idle state.

[0141] Under the premise that the second working state idle state is recorded in the second state machine, if the first transceiver calls PduR_ <uptp>Transmit() (start sending data interface), at this time, when the storage space status of the ring message queue indicates that the storage space of the ring message queue can receive all the data to be transmitted, all the data to be transmitted are directly copied, and the first state machine switches to the completed state; when the storage space status of the ring message queue indicates that the storage space of the ring message queue can receive part of the data to be transmitted, the first state machine switches to the in-progress state; if the storage space status indicates that the storage space of the ring message queue has no remaining storage space, the first state machine stays in the idle state.

[0142] Second, when the first working state recorded by the first state machine is in progress.

[0143] On the premise that the second working state recorded by the second state machine is an idle state or an ongoing state. If the first transceiver calls the communication interface PduR_ <uptp>_CopyTxData() (copy the send data interface) and pass it through the communication interface PduR_ <uptp>_CopyTxData() copies the data to be transmitted. At this time, when the storage space status of the ring message queue indicates that there is no remaining storage space in the storage space of the ring message queue and the data to be transmitted has not been completely copied, the first state machine stays in the ongoing state; when the storage space status of the ring message queue indicates that the data to be transmitted has been completely copied, the first state machine switches to the completed state. If the first transceiver calls the communication interface PduR_ <uptp>When _CopyTxData() fails, the first state machine switches to the failure state.

[0144] Third, when the first working state recorded by the first state machine is an unfinished state.

[0145] On the premise that the second working state recorded by the second state machine is an idle state, an ongoing state, or a failed state. If the first transceiver calls the communication interface PduR_ <uptp>When CancelTransmit() (cancels the data transmission interface), the first state machine should directly switch to the termination state.

[0146] On the premise that the second working state recorded by the second state machine is completed. The first transceiver calls the communication interface PduR_ <uptp>CancelTransmit(), the routing component shall send a <uptp>CancelTransmit() returns a message that the calling interface failed, and the first state machine remains in the completed state.

[0147] On the premise that the second working state recorded by the second state machine is completed. The first transceiver calls the communication interface PduR_ <uptp>_TpTxConfirmation(), the routing component shall send a TpTxConfirmation to PduR_ <uptp>_TpTxConfirmation() returns a message indicating that the communication interface has been successfully called, and the first state machine switches to the idle state.

[0148] Under the premise that the second working state recorded by the second state machine is idle state or in progress or failed state, the first transceiver calls the communication interface PduR_ <uptp>CancelTransmit(), the routing component shall send a <uptp>CancelTransmit() returns a message that the interface call is successful, and the first state machine switches to the termination state.

[0149] Fourth, when the first working state recorded by the first state machine is a termination state.

[0150] On the premise that the second working state recorded by the second state machine is a failure or completion state, the first transceiver calls PduR_ <uptp>_TpTxConfirmation() (confirmation reception end interface), the routing component should send a TpTxConfirmation() to PduR_ <uptp>_TpTxConfirmation() returns a message indicating that the interface call failed, and the first state machine switches to the idle state.

[0151] Fifth, when the first working state recorded by the first state machine is a failure state.

[0152] On the premise that the second working state recorded by the second state machine is a failure state. The first transceiver calls the communication interface <uptp>_TpTxConfirmation(), the routing component shall send a TpTxConfirmation to PduR_ <uptp>_TpTxConfirmation() returns a message indicating that the interface call failed, and the first state machine switches to the idle state.

[0153] An exemplary embodiment of the present disclosure also provides a communication processing method. Figure 6 , applied to a second transceiver as a receiving end, the second transceiver performs data transmission with the first transceiver through a ring message queue, including:

[0154] S601: Acquire a first state machine and a second state machine.

[0155] For the description of the first state machine, the second state machine, and the ring message queue, please refer to the previous embodiment and will not be repeated here.

[0156] In order to determine the communication transmission strategy for the working states of the first transceiver and the second transceiver during data communication, a first state machine is set to record the first working state of the first transceiver and a second state machine is set to record the second working state of the second transceiver.

[0157] In the setting of the second state machine, the first state machine and the second target interface are used as external events that can trigger the second state machine to switch states. The specific content will be explained later. Here, it is briefly explained that the first state machine is set as an external event. The purpose is to make the first state machine and the second state machine guard each other (GuardCondition) to complete the state machine switching. In simple terms, the state change of a state machine may depend on a specific state of another state machine as a trigger condition (external event). Through this setting, the second transceiver can switch from the state of the second state machine. For the second transceiver to perform data transmission, it can quickly and accurately grasp the first working state of the first transceiver as the transmitter. According to the first working state, the data transmission situation can be known, and the communication strategy can be customized according to the data transmission situation to improve the stability and accuracy of data transmission.

[0158] Since the data transmitted in this embodiment is usually not limited to single-frame data, but also includes multi-frame data, the transmission of multi-frame data usually relies on the receiver to confirm (ACK) each frame to ensure data integrity. The traditional unidirectional pipeline cannot realize the reverse communication from the second transceiver to the first transceiver. The first transceiver cannot obtain information on whether the frame is successfully received, nor can it confirm whether the frame is lost or an error occurs during the transmission process. In this embodiment, a first state machine for recording the working state of the first transceiver and a second state machine for recording the working state of the second transceiver are set, and the first state machine is used as a trigger condition for the state switching of the second state machine. For example, one of the trigger conditions for the working state recorded by the second state machine to switch from the idle state to the progress state is that the working state recorded by the first state machine is the completion state. In such a process, if the first transceiver fails to send the corresponding data successfully, the second state machine will not be able to switch to the progress state, and the second transceiver can determine whether it needs to receive the corresponding data, etc.

[0159] S602: Call the second target interface to transmit data to the ring message queue.

[0160] The second target interface is a target communication interface in at least one communication interface between the second transceiver and the ring message queue, and the second target interface is determined according to the first working state and / or the second working state; the second transceiver communicates with the ring message queue by calling the communication interface.

[0161] The communication interface between the first transceiver and the ring message queue includes at least one of the following communication interfaces: start receiving data interface PduR_ <lotp>StartOfReception()Copy the receive data interface PduR_ <lotp>CopyRxData(), cancel receiving data interface PduR_ <lotp>TpRxIndication(), confirm the end of receiving interface PduR_ <uptp>CancelReceive().

[0162] The words in angle brackets (<>) are abstract pronouns for upper and lower layer processing modules. <lotp>represents a lower-layer processing module, which is a functional module in the processing core of the receiving end. The lower-layer processing module can be understood as a second transceiver, or a functional module connected to the second transceiver and transmitting data via the second transceiver; <uptp>It represents the upper layer processing module, which is a functional module in the processing core of the transmitting end. The upper layer processing module can be understood as the first transceiver, or can be understood as a functional module connected to the first transceiver and transmitting data via the first transceiver.

[0163] In addition to the corresponding first target interface being determined by the lower layer processing module, different second target interfaces can also be used as external events to trigger different state switching of the second state machine, and different second working states of the second state machine can trigger different communication transmission strategies. Specifically, different communication transmission strategies can be determined according to the first working state and / or the second working state, and the corresponding second target interface can be selected from multiple communication interfaces for different communication transmission strategies.

[0164] In the communication processing method provided in this embodiment, since the state switching of the second state machine can be triggered by the first working state of the first state machine as an external event, the working state of the second transceiver can be referred to in the process of selecting the communication strategy of the first transceiver, and the corresponding communication strategy can be selected without taking the form of inter-core interruption. At the same time, the communication protocol stack is more flexibly divided, multi-core load balancing is more effectively achieved, and the overall system performance is improved.

[0165] In addition, the communication processing method provided in this embodiment is generally applied to the second transceiver, and the specific execution steps of the method can be executed by the second transceiver or by the routing component. When the routing component executes the above method, in order to obtain the working status recorded by the first state machine and the second state machine, and follow up on the communication transmission process. The routing component will be set to poll the first working state of the first state machine or the second working state of the second state machine through a polling interface. At the same time, the polling interface can also drive the first transceiver or the second transceiver to call the corresponding communication interface for communication according to the working state of the second state machine. For example, the polling interface in this embodiment can be PduR_Mainfunction().

[0166] For the above communication interface, the second transceiver may also provide a corresponding feedback message of the calling result during the calling process for the polling interface to query.

[0167] In addition to controlling the state switching of the second state machine through the first working state of the first transceiver, the second working state of the second transceiver, and the second target interface, this embodiment can also effectively support the transmission of multiple frames of data. Specifically:

[0168] The first transceiver is used to divide the data to be transmitted into at least one data frame, and each data frame in the at least one data frame has a corresponding transmission order. On this basis, see Figure 7 , step S602 includes:

[0169] S6021. Call the second target interface.

[0170] S6022. Receive data frames from the ring message queue in sequence through the second target interface to obtain at least one data frame.

[0171] Wherein, each data frame in at least one data frame has a corresponding transmission sequence.

[0172] In some possible embodiments, the data to be transmitted includes PDU (Protocol Data Unit) data, and PDU data refers to the basic data unit transmitted in a certain layer of protocol (such as network layer, data link layer, etc.). The size of PDU data depends on the specific protocol and network requirements, but in many scenarios, PDU data may be larger than the maximum carrying capacity of a single physical frame (such as Ethernet frame or CAN bus frame). Therefore, in some network protocols, such as CAN bus, LIN bus or TCP / IP, a single PDU data may not be transmitted through a single frame. At this time, the PDU data needs to be divided into multiple frames for multi-frame transmission. Common application scenarios of multi-frame transmission include: network layered structure, automotive bus communication, and wireless communication protocol.

[0173] The ring message queue used in this embodiment can utilize the transmission characteristics of the ring message queue, that is, the first-in-first-out data structure. The data transmitted by the first transceiver through the ring message queue can be sent to the second transceiver in a first-in-first-out order, thereby maintaining the sequentiality and integrity of the transmission of multiple frames of data and effectively reducing the risk of disorder in the transmission process of multiple frames of data.

[0174] The data to be transmitted in this embodiment is not limited to PDU data, and can be specifically selected according to actual conditions.

[0175] S603: Based on at least one of the first working state, the second working state and the second target interface, control the second working state recorded by the second state machine to perform state switching.

[0176] According to the above description, in the state switching of the second state machine, the second target interface and the first working state are used as external events to trigger the state switching. In addition to the first working state currently recorded by the second state machine, the first state machine and the second target interface will also trigger the switching of different states. In this embodiment, the state switching of the second state machine is determined according to the first working state of the first state machine and the second target interface called by the second transceiver.

[0177] The triggering conditions for the state transition mentioned in step S603 are listed below, but are not limited thereto. At the same time, the triggering conditions provided in this embodiment can be freely combined, specifically:

[0178] When the second working state is in progress, the first working state is in termination state, and the second target interface is a cancel interface for receiving data, the second working state recorded by the second state machine is controlled to switch to termination state.

[0179] Or, when the second working state is in progress and the second target interface is a confirmed reception end interface, the second working state recorded by the second state machine is controlled to switch to a completed state.

[0180] Or, when the second working state is the termination state and the second target interface is a confirmation reception end interface, the second working state recorded by the second state machine is controlled to switch to a failure state.

[0181] In addition, when the second working state recorded by the second state machine is a completion state or a failure state, the sending process of the entire system ends, waiting for the first transceiver to perform a dequeue operation, and switching the first state machine and the second state machine to an idle state.

[0182] Based on the above embodiment, the state switching of the first state machine may also be triggered according to the storage space state (Buffer) of the ring message queue. The communication processing method further includes: obtaining the storage space state of the ring message queue.

[0183] Step S603 also includes:

[0184] Based on at least one of the first working state, the second working state, the second target interface and the storage space state, the second working state recorded by the second state machine is controlled to perform state switching.

[0185] Specific:

[0186] When the storage space state indicates that the annular message queue has received all the data to be transmitted sent by the first transceiver, the second working state recorded by the second state machine is controlled to switch to a completion state.

[0187] Or, when the storage space state represents that the annular message queue receives part of the data to be transmitted sent by the first transceiver, the second working state recorded by the second state machine is controlled to switch to the ongoing state.

[0188] Generally speaking, the ring message queue can receive all the data to be transmitted from the first transceiver and send it to the second transceiver only when the remaining storage space is greater than or equal to the amount of data to be transmitted. Otherwise, it can only receive part of the data to be transmitted. When the storage space status indicates that there is no remaining storage space, the ring message queue cannot receive the data to be transmitted sent by the first transceiver and send it to the second transceiver.

[0189] The above embodiment is described below through a specific implementation method:

[0190] First, when the second working state recorded by the second state machine is the initial state.

[0191] Under the premise that the first working state recorded by the first state machine is in progress. When PduR_Mainfunction() (polling interface) drives the second transceiver to receive data, it is necessary to first check whether the storage space state of the ring message queue indicates that the storage space of the ring message queue can receive all the data to be transmitted. If not, the second state machine stays in the idle state; otherwise, the second transceiver calls PduR_ <lotp>_Transmit() (starts receiving data interface), when the interface is successfully called, the second state machine switches to the in-progress state; otherwise, the second state machine switches to the failed state.

[0192] On the premise that the first working state recorded by the first state machine is the completed state. When the PduR_Mainfunction() polling interface drives the second transceiver to receive data, the second transceiver calls PduR_ <lotp>_Transmit(), if the interface is called successfully, the second state machine switches to the in-progress state; otherwise, the second state machine switches to the failed state.

[0193] Second, when the second working state recorded by the second state machine is in progress.

[0194] On the premise that the first working state recorded by the first state machine is in progress or completed. If the second transceiver calls PduR_ <lotp>CopyTxData() (copy receiving data interface), if there is data to be read in the ring message queue, the second transceiver receives the data sent by the ring message queue and stays in the ongoing state.

[0195] Under the premise that the first working state is a failure or termination state, if the second transceiver calls PduR_ <lotp>CopyTxData, the routing component shall send a <lotp>CopyTxData() returns a message that data writing fails, and the second state machine remains in the ongoing state.

[0196] Under the premise that the first working state is the termination state, if the second transceiver calls PduR_ <lotp>_CancelTransmit() (cancel the data transmission interface), the second state machine switches to the termination state. <lotp>TxConfirmation() (confirmation reception end interface), the routing component should send a TxConfirmation() to PduR_ <lotp>If TxConfirmation() receives a message that the interface call is successful, the second state machine switches to the completion state; otherwise, the second state machine switches to the failure state.

[0197] Third, when the second working state recorded by the second state machine is the termination state.

[0198] When the second transceiver calls PduR_ <lotp>When TxConfirmation() is called, the second state machine switches to the failure state.

[0199] Fourthly, when the second working state recorded by the second state machine is a failure state.

[0200] The sending process of the entire system is completed, waiting for the first transceiver to perform a dequeue operation, and switching the first state machine and the second state machine to an idle state.

[0201] In some possible embodiments, a process of data transmission between the first transceiver and the second transceiver via a ring message queue is briefly summarized as follows:

[0202] When the first transceiver has a data transmission request, it calls PduR_ <uptp>The Transmit() interface requests the routing component to send data. The routing component copies the data to its internal circular message queue in the call context. When the routing component completes writing the data, it calls PduR_ <lotp>The _Transmit() interface triggers a data transmission request to the second transceiver. After successfully receiving the request, the second transceiver periodically calls PduR_ <lotp>The CopyTxData() interface requests to copy data from the routing component. When all data is copied, the second transceiver will call back PduR_ <lotp>TxConfirmation() notifies the routing component that the data has been successfully sent. When the second transceiver has received the data, the routing component calls PduR_ <uptp>_TxConfirmation() notifies the first transceiver that the data has been sent successfully, and a cross-core communication transmission process is completed.

[0203] An exemplary embodiment of the present disclosure further provides a communication processing device, see Figure 8 , applied to a first transceiver as a transmitting end, the first transceiver performs data transmission with a second transceiver through a ring message queue, including:

[0204] The first acquisition module 81 is used to acquire a first state machine and a second state machine, wherein the first state machine is used to record a first working state of the first transceiver; and the second state machine is used to record a second working state of the second transceiver.

[0205] The first transmission module 82 is used to call the first target interface to transmit data to the ring message queue. The first target interface is a target communication interface in at least one communication interface between the first transceiver and the ring message queue. The first target interface is determined according to the first working state and / or the second working state.

[0206] The first switching module 83 is used to control the first working state recorded by the first state machine to switch the state based on at least one of the first working state, the second working state and the first target interface.

[0207] In some possible embodiments, the first transceiver is used to divide the data to be transmitted into at least one data frame, and each data frame in the at least one data frame has a corresponding transmission order.

[0208] The first transmission module 82 is used for:

[0209] Call the first target interface.

[0210] Data frames corresponding to the transmission sequence are determined in sequence from at least one data frame, and sent to the ring message queue through the first target interface.

[0211] In some possible embodiments, the communication processing device further includes:

[0212] The third acquisition module is used to acquire the storage space status of the ring message queue.

[0213] The first switching module 83 is used for:

[0214] Based on at least one of the first working state, the second working state, the first target interface and the storage space state, the first working state recorded by the first state machine is controlled to perform state switching.

[0215] In some possible embodiments, the first switching module 83 is used to:

[0216] When the storage space state indicates that the annular message queue has received all the data to be transmitted sent by the first transceiver, the first working state recorded by the first state machine is controlled to switch to a completion state.

[0217] Or, when the storage space state represents that the annular message queue receives part of the data to be transmitted sent by the first transceiver, the first working state recorded by the first state machine is controlled to switch to the ongoing state.

[0218] In some possible embodiments, the first switching module 83 is used to:

[0219] When the first working state is in progress or completed, and the first target interface is a data sending cancellation interface, the first working state recorded by the first state machine is controlled to switch to a terminated state.

[0220] Or, when the second working state is a failure state or a completion state and the first target interface is a confirmation sending end interface, the first working state recorded by the first state machine is controlled to switch to an idle state.

[0221] In some possible embodiments, the communication interface between the first transceiver and the ring message queue includes at least one of a start data transmission interface, a copy data transmission interface, a cancel data transmission interface, and a confirmation transmission end interface.

[0222] In some possible embodiments, the first working state includes at least one of an ongoing state, an idle state, a terminated state, a completed state, and a failed state.

[0223] In some possible embodiments, the second working state includes at least one of an ongoing state, an idle state, a terminated state, a completed state, and a failed state.

[0224] An exemplary embodiment of the present disclosure further provides a communication processing device, see Fig. 9 , applied to a second transceiver as a receiving end, the second transceiver performs data transmission with the first transceiver through a ring message queue, including:

[0225] The second acquisition module 91 is used to acquire a first state machine and a second state machine, wherein the first state machine is used to record a first working state of the first transceiver; and the second state machine is used to record a second working state of the second transceiver.

[0226] The second transmission module 92 is used to call the second target interface to transmit data to the ring message queue, the second target interface is the target communication interface in at least one communication interface between the second transceiver and the ring message queue, and the first target interface is determined according to the first working state and / or the second working state.

[0227] The second switching module 93 is used to control the second working state recorded by the second state machine to perform state switching based on at least one of the first working state, the second working state and the second target interface.

[0228] In some possible embodiments, the first transceiver is used to divide the data to be transmitted into at least one data frame, and each data frame in the at least one data frame has a corresponding transmission order.

[0229] The second transmission module 92 is used for:

[0230] Call the second target interface.

[0231] Data frames are received from the ring message queue in sequence through the second target interface to obtain at least one data frame, and each data frame in the at least one data frame has a corresponding transmission sequence.

[0232] The device and method embodiments in the disclosed embodiments are based on the same disclosed concept.

[0233] An exemplary embodiment of the present disclosure provides a communication transmission system. Figure 1 , a communication transmission system includes a first transceiver, a second transceiver and a routing component.

[0234] The routing component is connected between the first transceiver and the second transceiver, and a circular message queue is loaded in the routing component for the first transceiver and the second transceiver to perform data transmission;

[0235] The first transceiver performs data transmission according to any one of the communication processing methods in the above embodiments;

[0236] In some possible embodiments, the second transceiver performs data transmission according to any one of the communication processing methods in the above embodiments.

[0237] An exemplary embodiment of the present disclosure provides an electronic device, such as Fig.10 As shown, the electronic device 1000 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1010 (the processor 1010 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1030 for storing data, and one or more storage media 1020 (such as one or more mass storage devices) for storing application programs 1023 or data 1022. Among them, the memory 1030 and the storage medium 1020 can be short-term storage or permanent storage. The storage medium 1020 stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the above method.

[0238] Furthermore, the CPU 1010 may be configured to communicate with the storage medium 1020 to execute a series of instruction operations in the storage medium 1020 on the electronic device 1000. The electronic device 1000 may also include one or more power supplies 1060, one or more wired or wireless network interfaces 1050, one or more input and output interfaces 1040, and / or one or more operating systems 1021, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0239] The input / output interface 1040 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the electronic device 1000. In one example, the input / output interface 1040 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 1040 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0240] It can be understood by those skilled in the art that Fig.10 The structure shown is for illustration only and does not limit the structure of the above electronic device. Fig.10 More or fewer components as shown, or with Fig.10 Different configurations are shown.

[0241] An embodiment of the present disclosure also provides a computer-readable storage medium, which can be set in a server to store at least one instruction, at least one program, a code set or an instruction set related to a method in the method embodiment, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the above method.

[0242] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0243] It should be noted that the above-mentioned sequence of the embodiments of the present disclosure is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0244] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0245] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0246] The above are only preferred embodiments of the present disclosure and are not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.< / uptp> < / lotp> < / lotp> < / lotp> < / uptp> < / lotp> < / lotp> < / lotp> < / lotp> < / lotp> < / lotp> < / lotp> < / lotp> < / lotp> < / uptp> < / lotp> < / uptp> < / lotp> < / lotp> < / lotp> < / uptp> < / uptp> < / uptp> < / uptp> < / uptp> < / uptp> < / uptp> < / uptp> < / uptp> < / uptp> < / uptp> < / uptp> < / uptp> < / uptp> < / uptp> < / uptp> < / uptp> < / uptp> < / lotp> < / uptp> < / lotp> < / lotp> < / uptp>

Claims

1. A communication processing method, characterized in that: Applied to a first transceiver as a transmitting end, the first transceiver performs data transmission with a second transceiver through a ring message queue, including: Acquire a first state machine and a second state machine, wherein the first state machine is used to record a first working state of the first transceiver; and the second state machine is used to record a second working state of the second transceiver; Calling a first target interface to transmit data to the ring message queue, where the first target interface is a target communication interface in at least one communication interface between the first transceiver and the ring message queue, and the first target interface is determined according to the first working state and / or the second working state; Based on at least one of the first working state, the second working state and the first target interface, the first working state recorded by the first state machine is controlled to perform state switching.

2. The communication processing method according to claim 1, characterized in that: The first transceiver is used to divide the data to be transmitted into at least one data frame, each data frame in the at least one data frame has a corresponding transmission order; The calling of the first target interface to transmit data to the ring message queue includes: Calling the first target interface; The data frames corresponding to the transmission sequence are determined in sequence from the at least one data frame, and are sent to the ring message queue through the first target interface.

3. The communication processing method according to claim 1, wherein: The communication processing method further includes: Obtaining the storage space status of the ring message queue; The controlling the first working state recorded by the first state machine to switch the state based on at least one of the first working state, the second working state and the first target interface includes: Based on at least one of the first working state, the second working state, the first target interface, and the storage space state, the first working state recorded by the first state machine is controlled to perform state switching.

4. The communication processing method according to claim 3, characterized in that: The controlling the first working state recorded by the first state machine to switch the state based on at least one of the first working state, the second working state, the first target interface, and the storage space state includes: When the storage space state indicates that the storage space of the ring message queue receives all the data to be transmitted sent by the first transceiver, controlling the first working state recorded by the first state machine to switch to a completion state; Or, when the storage space state represents that the storage space of the ring message queue receives part of the data to be transmitted sent by the first transceiver, the first working state recorded by the first state machine is controlled to switch to an ongoing state.

5. The communication processing method according to claim 1, wherein: The controlling the first working state recorded by the first state machine to switch the state based on at least one of the first working state, the second working state and the first target interface includes: When the first working state is in progress or completed, and the first target interface is a data sending cancellation interface, controlling the first working state recorded by the first state machine to switch to a terminated state; Or, when the second working state is a failure state or a completion state, and the first target interface is a confirmation sending end interface, the first working state recorded by the first state machine is controlled to switch to an idle state.

6. The communication processing method according to claim 1, characterized in that: The communication interface between the first transceiver and the ring message queue includes at least one of a start data transmission interface, a copy data transmission interface, a cancel data transmission interface, and a confirmation transmission end interface; and / or, the first working state includes at least one of an ongoing state, an idle state, a terminated state, a completed state, and a failed state; And / or, the second working state includes at least one of an ongoing state, an idle state, a terminated state, a completed state and a failed state.

7. A communication processing method, characterized in that: The method is applied to a second transceiver as a receiving end, wherein the second transceiver performs data transmission with the first transceiver through a ring message queue, including: Acquire a first state machine and a second state machine, wherein the first state machine is used to record a first working state of the first transceiver, and the second state machine is used to record a second working state of the second transceiver; Calling a second target interface to transmit data to the annular message queue, where the second target interface is a target communication interface in at least one communication interface between the second transceiver and the annular message queue, and the second target interface is determined according to the first working state and / or the second working state; Based on at least one of the first working state, the second working state and the second target interface, the second working state recorded by the second state machine is controlled to perform state switching.

8. The communication processing method according to claim 7, characterized in that: The first transceiver is used to divide the data to be transmitted into at least one data frame, each data frame in the at least one data frame has a corresponding transmission order; The calling of the second target interface to transmit data to the ring message queue includes: Calling the second target interface; Data frames are received from the ring message queue in sequence through the second target interface to obtain at least one data frame, and each data frame in the at least one data frame has a corresponding transmission order.

9. A communication processing device, characterized in that: Applied to a first transceiver as a transmitting end, the first transceiver performs data transmission with a second transceiver through a ring message queue, including: A first acquisition module, used to acquire a first state machine and a second state machine, wherein the first state machine is used to record a first working state of the first transceiver; and the second state machine is used to record a second working state of the second transceiver; A first transmission module, used for calling a first target interface to transmit data to the annular message queue, wherein the first target interface is a target communication interface in at least one communication interface between the first transceiver and the annular message queue, and the first target interface is determined according to a first working state and / or a second working state; A first switching module is configured to control the first working state recorded by the first state machine to switch the state based on at least one of the first working state, the second working state and the first target interface.

10. A communication processing device, characterized in that: The method is applied to a second transceiver as a receiving end, wherein the second transceiver performs data transmission with the first transceiver through a ring message queue, including: A second acquisition module, used to acquire a first state machine and a second state machine, wherein the first state machine is used to record a first working state of the first transceiver; and the second state machine is used to record a second working state of the second transceiver; a second transmission module, configured to call a second target interface to transmit data to the annular message queue, wherein the second target interface is a target communication interface in at least one communication interface between the second transceiver and the annular message queue, and the first target interface is determined according to the first working state and / or the second working state; A second switching module is configured to control the second working state recorded by the second state machine to switch state based on at least one of the first working state, the second working state and the second target interface.

11. A communication transmission system, characterized in that: The communication transmission system includes a first transceiver, a second transceiver and a routing component; The routing component is connected between the first transceiver and the second transceiver, and a circular message queue is loaded in the routing component for the first transceiver and the second transceiver to perform data transmission; The first transceiver performs data transmission according to the communication processing method according to any one of claims 1 to 6; And / or, the second transceiver performs data transmission according to the communication processing method according to any one of claims 7-8.

12. An electronic device, characterized in that: The computer includes a processor and a memory, and the memory stores at least one instruction, at least one program, a code set or an instruction set. The at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the communication processing method as described in any one of claims 1-6 or claims 7-8.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the communication processing method according to any one of claims 1-6 or claims 7-8.