Communication management method and apparatus, device, storage medium, and vehicle

By closing the communication between the protocol stack and the network card abstraction layer when the communication link is disconnected, and detecting upper-layer application events, the problems of data loss and resource waste in the existing technology are solved, and communication efficiency is improved.

WO2024199449A1PCT designated stage expired Publication Date: 2024-10-03BEIJING CO WHEELS TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/084841
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-31
Filing Date
2024-03-29
Publication Date
2024-10-03

AI Technical Summary

Technical Problem

In the existing technology, when the communication link is disconnected, the protocol stack continues to send data packets, resulting in data loss and resource waste, and reducing communication efficiency.

Method used

When the communication link is disconnected, close the communication between the protocol stack and the network card abstraction layer, detect whether there are communication events between the protocol stack and the upper-layer application, and close the protocol stack if there are no events to reduce data loss and Waste of resources.

Benefits of technology

By temporarily storing data packets and closing unnecessary communications, data loss and resource waste are reduced, and communication efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024084841_03102024_PF_FP_ABST
    Figure CN2024084841_03102024_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a communication management method and apparatus, a device, a storage medium, and a vehicle. The method comprises: receiving a first instruction sent by a network state management module, the first instruction being generated by the network state management module when a communication link is disconnected; in response to the first instruction, disconnecting the communication between a protocol stack and a network card abstraction layer; detecting whether a communication event is present between the protocol stack and an upper-layer application; and when no communication event is present, disconnecting the protocol stack. According to the communication management method provided by embodiments of the present application, the communication efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Communication management method, device, equipment, storage medium and vehicle

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on March 31, 2023 with application number 202310339755.3, and claims priority to the Chinese patent application filed with the China Patent Office on March 31, 2023 with application number 202310341106.7, the entire contents of which are incorporated by reference into the application. Technical Field

[0003] The present application belongs to the field of communication technology, and in particular relates to a communication management method, apparatus, device, storage medium and vehicle. Background Art

[0004] Typically, a network status management module may include five sub-states: OFFLINE, WAIT_TRCVLINK, WAIT_ONLINE, ONLINE, and WAIT_OFFLINE. Before receiving a communication request, the network status management module may be in the OFFLINE state. After receiving the communication request, the network card may be activated and enter the WAIT_TRCVLINK state, which is waiting for link activation. After the link state is ready, the WAIT_ONLINE state, which is waiting for protocol stack activation, may be entered. After the protocol stack is activated, the communication may enter the ONLINE state. If communication needs to be shut down, the protocol stack may be shut down. Waiting for the protocol stack to be shut down may correspond to the WAIT_OFFLINE state. The above-mentioned network status management method generally assumes that the link will not fail. However, in real life, reasons such as line aging, vehicle bumps, and traffic accidents may cause the communication link to be temporarily disconnected or even damaged.

[0005] However, in the prior art, even when the communication link is disconnected, the protocol stack is still sending and receiving data, which results in data loss and resource waste, thereby reducing communication efficiency.

[0006] Summary of the Invention

[0007] Embodiments of the present application provide a communication management method, apparatus, device, storage medium, and vehicle, which can improve communication efficiency.

[0008] In a first aspect, an embodiment of the present application provides a communication management method, the method comprising:

[0009] receiving a first instruction sent by a network status management module, where the first instruction is generated by the network status management module when a communication link is disconnected;

[0010] In response to the first instruction, shutting down the communication between the protocol stack and the network card abstraction layer;

[0011] Detecting whether there is a communication event between the protocol stack and the upper layer application;

[0012] In the absence of the communication event, the protocol stack is closed.

[0013] In a possible implementation, detecting whether a communication event occurs between the protocol stack and an upper-layer application includes:

[0014] querying socket states corresponding to a plurality of sockets between the protocol stack and the upper layer application according to a preset period;

[0015] When the plurality of socket states are all in the closed state, it is determined that the communication event does not exist.

[0016] In a possible implementation, detecting whether a communication event exists between the protocol stack and an upper-layer application further includes:

[0017] querying socket states corresponding to a plurality of sockets between the protocol stack and the upper layer application according to a preset period;

[0018] Get the number of times the socket status is queried;

[0019] When the number of queries reaches a preset number of queries and an open state exists among the plurality of socket states, querying a storage module of the protocol stack;

[0020] When the storage space of the storage module is full, it is determined that the communication event does not exist.

[0021] In a possible implementation, shutting down the protocol stack when the communication event does not exist includes:

[0022] In the absence of the communication event, generating a second instruction;

[0023] Sending the second instruction to the network status management module, where the second instruction is used to instruct the network status management module to enter a link activation waiting state;

[0024] Close the protocol stack.

[0025] In a second aspect, an embodiment of the present application provides a communication management method, the method comprising:

[0026] When the communication is in the on state, it receives the link status information sent by the network card abstraction layer;

[0027] generating a first instruction when the link status information indicates that the communication link is disconnected;

[0028] The first instruction is sent to the protocol stack, where the first instruction is used to instruct the protocol stack to close the communication between the protocol stack and the network card abstraction layer.

[0029] In a possible implementation, when the link status information indicates that the communication link is disconnected, generating a first instruction includes:

[0030] When the link status information indicates that the communication link is disconnected, the communication start state is switched to the communication buffer state, and the first instruction is generated.

[0031] In a possible implementation, after sending the first instruction to the protocol stack, the method further includes:

[0032] receiving a second instruction sent by the protocol stack, where the second instruction is generated by the protocol stack in the absence of a communication event;

[0033] In response to the second instruction, the communication buffer state is switched to the link activation waiting state.

[0034] In a possible implementation, after sending the first instruction to the protocol stack, the method further includes:

[0035] receiving a third instruction sent by the network card abstraction layer, where the third instruction is generated by the network card abstraction layer when the communication link is restored;

[0036] In response to the third instruction, the communication-on state is entered.

[0037] In a third aspect, an embodiment of the present application provides a communication management device, the device comprising:

[0038] a first receiving module, configured to receive a first instruction sent by a network status management module, where the first instruction is generated by the network status management module when a communication link is disconnected;

[0039] A first closing module, configured to close the communication between the protocol stack and the network card abstraction layer in response to the first instruction;

[0040] A detection module, configured to detect whether there is a communication event between the protocol stack and an upper layer application;

[0041] The second closing module is configured to close the protocol stack when the communication event does not exist.

[0042] In a fourth aspect, an embodiment of the present application provides a communication management device, the device comprising:

[0043] A second receiving module is used to receive link status information sent by the network card abstraction layer when the communication is in the open state;

[0044] A first generating module, configured to generate a first instruction when the link status information indicates that the communication link is disconnected;

[0045] The first sending module is configured to send the first instruction to the protocol stack, where the first instruction is used to instruct the protocol stack to close the communication between the protocol stack and the network card abstraction layer.

[0046] In a fifth aspect, an embodiment of the present application provides a device for locating the cause of an abnormality in an in-vehicle Ethernet network, comprising the following modules:

[0047] a detection module configured to, upon receiving a target communication request sent by the communication management module, sequentially detect whether the multiple communication nodes are abnormal according to an operation sequence of the multiple communication nodes corresponding to the target communication request, wherein the target communication request includes any one of a communication opening request and a communication closing request;

[0048] an execution module, configured to, for each communication node, return to executing an operation sequence of the multiple communication nodes corresponding to the target communication request, and sequentially detect whether the multiple communication nodes are abnormal, if the communication node is normal, until a first target communication node is abnormal or the target communication request is completed, where the first target communication node is any one of the multiple communication nodes;

[0049] A first generating module is used to generate abnormal information corresponding to the first target communication node when the first target communication node is abnormal;

[0050] The first sending module is used to send abnormal information to the diagnosis event management module.

[0051] In a sixth aspect, an embodiment of the present application provides an electronic device, the electronic device comprising: a processor and a memory storing computer program instructions;

[0052] When the processor executes the computer program instructions, the method in any one of the possible implementation methods of the first aspect, the second aspect and the third aspect is implemented.

[0053] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer program instructions. When the computer program instructions are executed by a processor, they implement any possible implementation method of the first, second and third aspects mentioned above.

[0054] In an eighth aspect, an embodiment of the present application provides a vehicle, the vehicle comprising at least one of the following:

[0055] The communication management device according to any one of the embodiments of the third aspect;

[0056] The communication management device according to any one of the embodiments of the fourth aspect;

[0057] The device for locating the cause of an abnormality in an in-vehicle Ethernet network according to any one of the embodiments of the fifth aspect;

[0058] The electronic device according to any one of the embodiments of the sixth aspect;

[0059] A computer-readable storage medium as in any embodiment of the seventh aspect.

[0060] In the communication management method, apparatus, device, storage medium, and vehicle of the embodiments of the present application, if the protocol stack continues to send data packets to the network card abstraction layer when the communication link is disconnected, data packet loss will result. Therefore, by shutting down communication between the protocol stack and the network card abstraction layer when the communication link is disconnected, data packets in the protocol stack can be temporarily stored within the protocol stack, thereby reducing the loss of data packets transmitted between the protocol stack and the network card abstraction layer. Since communication between the protocol stack and the network card abstraction layer has been shut down, if communication events still occur between the protocol stack and the upper-layer application, data transmitted from the upper-layer application to the protocol stack can be temporarily stored within the protocol stack. Thus, shutting down the protocol stack when there are no communication events between the protocol stack and the upper-layer application can reduce data loss between the protocol stack and the upper-layer application. On the other hand, if the protocol stack is not shut down when there are no communication events between the protocol stack and the upper-layer application, resources will be wasted. Therefore, shutting down the protocol stack when there are no communication events between the protocol stack and the upper-layer application can reduce resource waste while reducing data loss. Thus, the embodiments of the present application can reduce data loss and resource waste, thereby improving communication efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0062] FIG1 is a schematic diagram of the structure of a communication management system provided in an embodiment of the present application;

[0063] FIG2 is a flow chart of a communication management method provided in an embodiment of the present application;

[0064] FIG3 is a flow chart of another communication management method provided in an embodiment of the present application;

[0065] FIG4 is a flow chart of another communication management method provided in an embodiment of the present application;

[0066] FIG5 is a schematic diagram of a state transition provided in an embodiment of the present application;

[0067] FIG6 is a schematic diagram of another state transition provided in an embodiment of the present application;

[0068] FIG7 is a schematic diagram of another state transition provided in an embodiment of the present application;

[0069] FIG8 is a flow chart of a method for locating an abnormality cause according to an embodiment of the present application;

[0070] 9 is a schematic diagram of a process of requesting to activate a first communication node in a communication activation request process according to an embodiment of the present application;

[0071] FIG10 is a flow chart of a method for locating an abnormality cause of an in-vehicle Ethernet network according to an embodiment of the present application;

[0072] FIG11 is a schematic diagram of a process for normally starting Ethernet communication provided by an embodiment of the present application;

[0073] FIG12 is a flow chart of another method for locating the cause of an abnormality in an in-vehicle Ethernet network according to an embodiment of the present application;

[0074] 13 is a schematic structural diagram of a communication management device provided in an embodiment of the present application;

[0075] 14 is a schematic structural diagram of another communication management device provided in an embodiment of the present application;

[0076] FIG15 is a schematic structural diagram of a device for locating an abnormality cause of an in-vehicle Ethernet network according to an embodiment of the present application;

[0077] FIG16 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0078] In order to more clearly understand the above-mentioned objectives, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that, in the absence of conflict, the embodiments of the present application and the features therein can be combined with each other.

[0079] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application can also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present application, not all of the embodiments.

[0080] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a..." do not exclude the presence of other identical elements in the process, method, article or device that includes the elements.

[0081] As described in the background technology, in order to solve the problems of the existing technology, the embodiments of the present application provide a communication management method, device, equipment, storage medium and vehicle.

[0082] In an embodiment of the present application, the network status management module may include six sub-states, and the six sub-states and their corresponding conditions may be shown in Table 1 below.

[0083] Table 1

[0084] In Table 1, "ACTIVE" can indicate a normal operating state, and "DOWN" can indicate an abnormal operating state. In the communication link state, "ACTIVE" can specifically indicate a connected state, and "DOWN" can specifically indicate a disconnected state. In the network card state and transceiver state, "ACTIVE" can specifically indicate an open state, and "DOWN" can specifically indicate a closed state. Furthermore, in the protocol stack state, "ONLINE" can indicate an open state, and "OFFLINE" can indicate a closed state.

[0085] In addition, the embodiment of the present application provides a communication management system. The communication management system provided by the embodiment of the present application is introduced below.

[0086] Figure 1 shows a schematic diagram of the structure of a communication management system provided in an embodiment of the present application. As shown in Figure 1, the communication management system provided in an embodiment of the present application includes a first communication subsystem 11 and a second communication subsystem 12. Specifically, the first communication subsystem 11 may include a communication module 111, a network status management module 112, a network card abstraction layer 113, a protocol stack 114, a socket adaptation layer 115, and an upper-layer application 116. The first communication subsystem 11 and the second communication subsystem 12 can communicate via a communication link between the network card abstraction layers.

[0087] The following is an introduction to the communication management method provided in the embodiment of the present application.

[0088] Figure 2 shows a flow chart of a communication management method provided by an embodiment of the present application. As shown in Figure 2, the communication management method provided by an embodiment of the present application includes steps S210 to S290.

[0089] S210: When the network status management module is in a communication-enabled state, the network card abstraction layer monitors the state of the communication link.

[0090] Here, the network card abstraction layer may include a network card, a transceiver, and a communication link. The network card abstraction layer may monitor the status of the communication link. In addition, the network status management module may specifically be a network status management module.

[0091] S220: When the communication link is disconnected, the network card abstraction layer sends link status information indicating that the communication link is disconnected to the network status management module.

[0092] Here, after the communication is started, if the communication link is disconnected, the network card abstraction layer may notify the network status management module that the communication link has been disconnected.

[0093] S230: The network status management module switches from the communication start state to the communication buffer state and generates a first instruction.

[0094] Because the communication link is disconnected, if the protocol stack continues to send data packets to the network card abstraction layer, data packets will be lost. Therefore, to avoid data packet loss, a first instruction can be generated. The first instruction can be used to instruct the protocol stack to shut down communication between the protocol stack and the network card abstraction layer. In addition, because the communication link is disconnected, the network status management module can switch from a communication-enabled state to a communication buffered state.

[0095] S240: The network status management module sends a first instruction to the protocol stack.

[0096] S250: The protocol stack closes the communication between the protocol stack and the network card abstraction layer in response to the first instruction.

[0097] After the protocol stack closes the communication between the protocol stack and the network card abstraction layer, the protocol stack can switch from the open state to the buffered state.

[0098] S260: The protocol stack detects whether there is a communication event between the protocol stack and the upper layer application.

[0099] Here, even if the communication link is disconnected, data exchange may still occur between the protocol stack and the upper-layer application. If data exchange occurs between the protocol stack and the upper-layer application, it can be considered that a communication event has occurred between the protocol stack and the upper-layer application. The protocol stack and the upper-layer application can exchange data via multiple sockets. If the socket states corresponding to multiple sockets are all closed, it can be considered that no communication event has occurred between the protocol stack and the upper-layer application.

[0100] The protocol stack can also include a storage module. If communication between the protocol stack and the NIC abstraction layer is closed and a communication event occurs between the protocol stack and an upper-layer application, the protocol stack can temporarily store received data in the storage module. Therefore, if the storage module's storage space is full, it can be assumed that no communication event exists between the protocol stack and the upper-layer application.

[0101] As an example, detecting whether a communication event occurs between the protocol stack and the upper layer application may specifically be detecting whether a socket is closed and / or detecting whether a storage space in a storage module is full.

[0102] S270: If there is no communication event, close the protocol stack.

[0103] Here, shutting down the protocol stack while a communication event is present will result in data packet loss. Therefore, to reduce data packet loss, the protocol stack can be shut down if it has confirmed that there are no more communication events between the protocol stack and the upper-layer application. In other words, the protocol stack enters a shutdown state. On the other hand, if the protocol stack is not shut down even though there are no more communication events between the protocol stack and the upper-layer application, resources will be wasted. Therefore, shutting down the protocol stack when there are no more communication events between the protocol stack and the upper-layer application can reduce resource waste while also reducing data loss.

[0104] Thus, in the communication-on state, if the communication link is disconnected, by shutting down the communication between the protocol stack and the network card abstraction layer, the data packets in the protocol stack can be temporarily stored in the protocol stack, thereby reducing the loss of data packets transmitted between the protocol stack and the network card abstraction layer. Since the communication between the protocol stack and the network card abstraction layer has been shut down, if there is still a communication event between the protocol stack and the upper-layer application, the data transmitted to the protocol stack by the upper-layer application can be temporarily stored in the protocol stack. In this way, by shutting down the protocol stack when there is no communication event between the protocol stack and the upper-layer application, the loss of data transmitted between the protocol stack and the upper-layer application can be reduced. In addition, by shutting down the protocol stack, resource waste can be reduced. In this way, through the embodiments of the present application, data loss and resource waste can be reduced, thereby improving communication efficiency.

[0105] Figure 3 shows a flow chart of a communication management method applied to a protocol stack provided by an embodiment of the present application. As shown in Figure 3, the communication management method provided by an embodiment of the present application includes the following steps:

[0106] S310: Receive a first instruction sent by the network status management module, where the first instruction is generated by the network status management module when the communication link is disconnected;

[0107] S320, in response to the first instruction, closing the communication between the protocol stack and the network card abstraction layer;

[0108] S330, detecting whether there is a communication event between the protocol stack and the upper layer application;

[0109] S340: When there is no communication event, close the protocol stack.

[0110] In the communication management method of an embodiment of the present application, if the protocol stack continues to send data packets to the network card abstraction layer when the communication link is disconnected, data packet loss will result. Therefore, by shutting down the communication between the protocol stack and the network card abstraction layer when the communication link is disconnected, data packets in the protocol stack can be temporarily stored in the protocol stack, thereby reducing the loss of data packets transmitted between the protocol stack and the network card abstraction layer. Since the communication between the protocol stack and the network card abstraction layer has been shut down, if there are still communication events between the protocol stack and the upper-layer application, data transmitted to the protocol stack by the upper-layer application can be temporarily stored in the protocol stack. In this way, by shutting down the protocol stack when there are no communication events between the protocol stack and the upper-layer application, data loss between the protocol stack and the upper-layer application can be reduced. On the other hand, if the protocol stack is not shut down when there are no communication events between the protocol stack and the upper-layer application, resources will be wasted. Therefore, by shutting down the protocol stack when there are no communication events between the protocol stack and the upper-layer application, resource waste can be reduced while reducing data loss. In this way, through the embodiments of the present application, data loss and resource waste can be reduced, thereby improving communication efficiency.

[0111] The above steps of the method in the embodiment of the present application can be referred to the relevant description of the embodiment shown in Figure 2 above, and will not be elaborated here.

[0112] Based on this, in order to ensure that there is no data communication when the communication link is disconnected and avoid the loss of data packets, in some embodiments, when there is no communication event, shutting down the protocol stack may specifically include:

[0113] In the absence of a communication event, generating a second instruction;

[0114] Sending a second instruction to the network status management module, the second instruction is used to instruct the network status management module to enter a link activation waiting state;

[0115] Close the protocol stack.

[0116] Here, since the network status management module may be in a communication buffer state when a link is disconnected, the second instruction may be used to instruct the network status management module to switch from the link buffer state to the wait-for-link-activation state. Thus, in the absence of a communication event, the protocol stack may switch from the open state to the closed state, and the network status management module may switch from the link buffer state to the wait-for-link-activation state.

[0117] In this way, by sending a second instruction to the network status management module before the protocol stack enters the shutdown state, the network status management module can switch from the communication buffer state to the waiting link activation state when there is no communication event, thereby ensuring that there is no data communication when the communication link is disconnected, avoiding the loss of data packets.

[0118] Based on this, in order to accurately determine whether there is a communication event between the protocol stack and the upper layer application, in some embodiments, the above-mentioned detection of whether there is a communication event between the protocol stack and the upper layer application may specifically include:

[0119] Querying the socket states corresponding to the plurality of sockets between the protocol stack and the upper layer application according to a preset period;

[0120] When the multiple socket states are all in the closed state, it is determined that there is no communication event.

[0121] Here, the socket state can be either open or closed. Multiple sockets can exist between the protocol stack and the upper-layer application. If multiple sockets are closed in a query, it can be considered that no communication event has occurred. If a socket in the multiple sockets is open, it can be considered that a communication event has occurred. The socket can specifically be a socket in the protocol data unit (PDU) adaptation layer.

[0122] In addition, the preset period may be, for example, 300ms, 400ms, 500ms, etc., which is not limited here.

[0123] In this way, by querying the status of multiple sockets between the protocol stack and the upper-layer application, it is possible to accurately determine whether a communication event occurs between the protocol stack and the upper-layer application.

[0124] Based on this, in order to accurately determine whether there is a communication event between the protocol stack and the upper-layer application, in some embodiments, the above-mentioned detection of whether there is a communication event between the protocol stack and the upper-layer application may further include:

[0125] Querying the socket states corresponding to the plurality of sockets between the protocol stack and the upper layer application according to a preset period;

[0126] Get the number of times the socket status is queried;

[0127] When the number of queries reaches a preset number of queries and there is an open state in the plurality of socket states, querying the storage module of the protocol stack;

[0128] In a case where the storage space in the storage module is full, it is determined that there is no communication event.

[0129] Here, the preset query times can be, for example, 90 times, 100 times, 110 times, etc., again without limitation. Within the preset query times, if multiple sockets are closed, it can be considered that there is no communication event. If the query times have reached the preset query times and there are sockets in the open state, the storage module of the protocol stack can continue to be queried. If the storage space in the storage module is not full, it can be considered that there is still a communication event. Since if the storage space is full and the communication between the protocol stack and the network card abstraction layer is closed, the protocol stack and the upper-layer application cannot actually communicate normally, therefore, if the space in the storage module is full, it can be considered that there is no communication event.

[0130] In this way, by querying whether the storage space in the storage module is full, it is possible to accurately determine whether a communication event occurs between the protocol stack and the upper layer application.

[0131] Figure 4 shows a flow chart of a communication management method applied to a network management module provided in an embodiment of the present application. As shown in Figure 4, the communication management method provided in an embodiment of the present application includes the following steps:

[0132] S410, when the communication is in the on state, receiving link status information sent by the network card abstraction layer;

[0133] S420: If the link status information indicates that the communication link is disconnected, generate a first instruction;

[0134] S430: Send a first instruction to the protocol stack, where the first instruction is used to instruct the protocol stack to close the communication between the protocol stack and the network card abstraction layer.

[0135] The communication management method of an embodiment of the present application can temporarily store data packets in the protocol stack by sending a first instruction to the protocol stack to instruct the protocol stack to close the communication between the protocol stack and the network card abstraction layer when the communication link is disconnected, thereby reducing the loss of data packets and improving communication efficiency.

[0136] In some embodiments, the above S420 may specifically include:

[0137] When the link status information indicates that the communication link is disconnected, the communication start state is switched to the communication buffer state, and a first instruction is generated.

[0138] In addition, the other steps of the method in the embodiment of the present application can be found in the relevant description of the embodiment shown in Figure 2 above, and will not be described in detail here.

[0139] Based on this, in order to avoid data packet loss, in some embodiments, after the above S430, the following steps may be further included:

[0140] receiving a second instruction sent by the protocol stack, where the second instruction is generated by the protocol stack in the absence of a communication event;

[0141] In response to the second instruction, the communication buffer state is switched to the link activation waiting state.

[0142] In this way, by switching the network status management module from the communication buffer state to the link activation waiting state, it can be ensured that there is no data communication when the communication link is disconnected, thereby avoiding the loss of data packets.

[0143] Based on this, in order to ensure normal communication, in some embodiments, after the above S430, the following steps may be further included:

[0144] receiving a third instruction sent by the network card abstraction layer, where the third instruction is generated by the network card abstraction layer when the communication link is restored;

[0145] In response to the third instruction, the communication-on state is entered.

[0146] Here, after the network management module sends the first instruction to the protocol stack, if the network card abstraction layer detects that the communication link is restored, it can send link status information indicating that the communication link is restored to the network status management module, so that the network management module enters the communication start state.

[0147] As an example, if the communication link is restored while the protocol stack is detecting whether there is a communication event between the protocol stack and the upper-layer application, that is, while the protocol stack is in the buffering state, the network management module can switch from the communication buffering state to the communication-enabled state. After the network management module switches from the communication buffering state to the communication-enabled state, it can notify the protocol stack to stop detecting whether there is a communication event between the protocol stack and the upper-layer application, that is, it can notify the protocol stack to switch from the buffering state to the enabled state.

[0148] As another example, if the communication link is restored while the protocol stack has entered the shutdown state and the network status management module has entered the waiting link activation state, the network management module may switch from the waiting link activation state to the communication enabled state. After the network management module switches from the waiting link activation state to the communication enabled state, it may notify the protocol stack to switch from the shutdown state to the enabled state.

[0149] In this way, by entering the communication-on state when the communication link is restored, normal communication can be guaranteed.

[0150] Based on this, in some embodiments, after the above S430, the following steps may be further included:

[0151] receiving a fourth instruction sent by the communication module;

[0152] In response to the fourth instruction, the communication closed state is entered.

[0153] Here, if the communication module initiates a communication shutdown request when the communication link fails, the network status management module can first notify the network card abstraction layer to shut down the network card, then notify the protocol stack to shut down the protocol stack, and finally the network status management module enters the communication shutdown state.

[0154] It can be seen from the above embodiments that in the event of a communication link failure, the following three situations may occur: the link recovers after a brief failure (i.e., the network status management module switches from the waiting link activation state or the communication buffer state to the communication start state), the link fails to recover for a long time after the failure (i.e., the network status management module switches from the communication start state to the waiting link activation state), and a communication shutdown request is received after the link failure (i.e., the network status management module enters the communication shutdown state).

[0155] Based on this, in order to better describe the processing mechanisms for the above three different situations when the communication link is disconnected, some specific examples are given based on the above embodiments.

[0156] For example, based on the three scenarios described above, the transition diagrams between the six sub-states corresponding to the network state management module can be shown in Figure 5. Specifically, if the link fails and recovery continues, the state transition diagrams corresponding to the sockets in the network card abstraction layer, network state management module, network protocol stack, and PDU adaptation layer can be shown in Figure 6. If the link recovers after a brief failure, the state transition diagrams corresponding to the sockets in the network card abstraction layer, network state management module, network protocol stack, and PDU adaptation layer can be shown in Figure 7.

[0157] The above embodiment describes in detail the process in which the network status management module needs to interact with the network card abstraction layer and the protocol stack respectively, but lacks processing of abnormal events, which is not conducive to problem location in abnormal situations during Ethernet communication.

[0158] The network status management module of the embodiment of the present application also has the function of locating anomalies, as shown in FIG8 , including steps S810 - S840 .

[0159] S810. Upon receiving a target communication request sent by the communication management module, detect whether multiple communication nodes are abnormal in sequence according to the operation order of the multiple communication nodes corresponding to the target communication request. The target communication request includes any one of an open communication request and a close communication request.

[0160] The target communication request may be a communication opening request or a communication closing request. If the target communication request is a communication opening request, the operation order of the multiple communication nodes corresponding to the target communication request may be the order in which the multiple communication nodes are opened. If the target communication request is a communication closing request, the operation order of the multiple communication nodes corresponding to the target communication request may be the order in which the multiple communication nodes are closed. The multiple communication nodes may include a first communication node, a communication link, and a protocol stack. The first communication node may include a controller (i.e., a network card) and a transceiver.

[0161] As an example, in the process of turning on or off multiple communication nodes, each communication node may be detected in turn to see if it is abnormal.

[0162] S820. For each communication node, if there is no abnormality in the communication node, return to execute the operation sequence of multiple communication nodes corresponding to the target communication request, and detect whether the multiple communication nodes are abnormal in turn until the first target communication node is abnormal or the target communication request is completed. The first target communication node is any one of the multiple communication nodes.

[0163] The first target communication node may be an abnormal communication node. As an example, during the process of detecting multiple communication nodes according to the operation sequence of the multiple communication nodes corresponding to the target communication request, if no communication node is abnormal, the target communication process may continue to be executed and the multiple communication nodes may be detected for abnormalities. If a communication node is abnormal, the communication node may be determined as the first target communication node.

[0164] S830. When the first target communication node is abnormal, generate abnormal information corresponding to the first target communication node.

[0165] The abnormal information may include a fault description corresponding to the faulty communication node. The abnormal information may be generated in the form of a fault code.

[0166] As an example, the correspondence between the fault code and the fault description may be shown in Table 2.

[0167] Table 2

[0168] S840: Send abnormal information to the diagnostic event management module.

[0169] After generating the exception information, the network status management module may report the exception information to the diagnosis event management module so as to locate the cause of the exception through the exception information in the diagnosis event management module and perform exception processing.

[0170] Based on this, in order to avoid wasting resources, in some embodiments, after generating the abnormal information corresponding to the first target communication node, the following steps may be further included:

[0171] Send a communication interrupt request to the communication management module.

[0172] Here, after sending a communication interruption request to the communication management module, the communication management module can respond by sending a communication closure request to the network status management module. This allows the network status management module to execute the communication closure step. This means that by interrupting communication in the event of a communication node failure, resource waste can be avoided.

[0173] It should be noted that the order of sending the communication interruption request and sending the abnormal information is not limited.

[0174] The method for locating the cause of an abnormality in the vehicle Ethernet of the embodiment of the present application, in the process of executing the target communication request, that is, opening the communication request or closing the communication request, detects whether the multiple communication nodes are abnormal in sequence according to the operation order of the multiple communication nodes corresponding to the target communication request, and can quickly determine the communication node that caused the failure to open the communication or the failure to close the communication when a certain communication node is abnormal. By continuing to execute the target communication request and detecting whether the multiple communication nodes are abnormal when there is no abnormality in the communication node, it is possible to ensure that the target communication request is completed or determine the abnormal communication node when the target communication request cannot be completed. By generating and sending the abnormal information corresponding to the first target communication node to the diagnostic event management module when the first target communication node is abnormal, it is possible to quickly locate the cause of the abnormality when the Ethernet communication cannot be opened / closed normally for a long time, thereby improving the abnormality processing speed and improving the efficiency of Ethernet communication.

[0175] Based on this, in order to accurately determine whether the first communication node is abnormal, in some embodiments, the above S810 may specifically include:

[0176] Sending a first target request corresponding to the first communication node to the network card abstraction layer, where the first target request includes any one of a request to enable the first communication node and a request to disable the first communication node;

[0177] If no feedback information corresponding to the first target request is received within the first preset time period, it is determined that the first communication node is abnormal.

[0178] Here, if the target communication request is a communication start request, the first target request corresponding to the first communication node may include a controller start request and a transceiver start request. If the target communication request is a communication stop request, the first target request corresponding to the first communication node may include a controller stop request and a transceiver stop request.

[0179] As an example, when the first target request is a request to turn on the controller, the feedback information corresponding to the first target request may be controller ACTIVE. When the first target request is a request to turn off the controller, the feedback information corresponding to the first target request may be controller DOWN. When the first target request is a request to turn on the transceiver, the feedback information corresponding to the first target request may be transceiver ACTIVE. When the first target request is a request to turn off the transceiver, the feedback information corresponding to the first target request may be transceiver DOWN. In addition, the first preset time length may be, for example, 5s, 10s, 15s, etc., which are not limited here. If the feedback information corresponding to the first target request is not received within the first preset time length, it can be considered that the first communication node has failed to open or close, that is, it can be determined that the first communication node is abnormal. Specifically, the abnormal information corresponding to the first communication node may include fault codes 0x01, 0x02, 0x05 and 0x06.

[0180] In addition, as an example, when the network status management module receives the target communication request sent by the communication management module, it can send a first target request to the network card abstraction layer for the first communication node, and then wait for feedback information corresponding to the first target request.

[0181] Based on this, to ensure that the network card abstraction layer receives the first target request, as another example, the network status management module may send the first target request to the network card abstraction layer multiple times for the first communication node. Specifically, the network status management module may send the first target request corresponding to the first communication node to the network card abstraction layer at a first preset period. The first preset period may be, for example, 400ms, 500ms, 600ms, etc., and is not limited here.

[0182] In this way, by determining that the first communication node is abnormal when no feedback information corresponding to the first target request is received within the first preset time period, it is possible to accurately determine whether the first communication node is abnormal.

[0183] Based on this, in order to improve the success rate of opening or closing the first communication node, in some embodiments, sending the first target request corresponding to the first communication node to the network card abstraction layer may specifically include:

[0184] Sending a first target request corresponding to the first communication node to the network card abstraction layer according to a first preset period;

[0185] Based on this, when no feedback information corresponding to the first target request is received within the first preset time period, determining that the first communication node is abnormal may specifically include:

[0186] In a case where no feedback information corresponding to the first target request is received, obtaining a first sending count of the first target request;

[0187] When the first number of transmissions reaches the first preset number of transmissions and no feedback information corresponding to the first target request is received, it is determined that the first communication node is abnormal.

[0188] Here, the first preset period can be, for example, 400ms, 500ms, 600ms, etc., and the first preset number of transmissions can be, for example, 5 times, 6 times, 7 times, etc., which are not limited here. In addition, the product of the first preset period and the first preset number of transmissions can be no greater than the first preset duration.

[0189] As an example, as shown in FIG9 , take the request to turn on the controller during the communication request process as an example. The network status management module can send a request to turn on the controller to the Ethernet abstraction layer at intervals of 500ms. If the first preset number of transmissions is 5, then before the end of the 5 requests, if a notification of a successful request has been received, the next step of turning on the communication can be continued. If a request to turn on the controller has been sent 5 times in succession, and no information indicating that the controller has been turned on successfully has been received after the 5 requests have been completed, the network status management module can generate an exception message with a fault code of 0x01. In addition, as shown in FIG9 , after the network status management module generates the exception message with a fault code of 0x01, the exception message can be reported to the diagnostic event management module.

[0190] In this way, by sending the first target request corresponding to the first communication node to the network card abstraction layer multiple times in a row when no feedback information corresponding to the first target request is received, the success rate of opening or closing the first communication node can be improved.

[0191] Based on this, when the first communication node is a transceiver, in order to improve the comprehensiveness of locating the cause of the abnormality, in some embodiments, the above S810 may further specifically include:

[0192] When feedback information corresponding to the first target request is received within the first preset time period, determining that there is no abnormality in the transceiver;

[0193] If the link status information corresponding to the communication link sent by the network card abstraction layer is not received within the second preset time period, it is determined that the communication link is abnormal.

[0194] Here, the second preset duration may be, for example, 5s, 10s, 15s, etc. In addition, the second preset duration may be the same as or different from the first preset duration, which is not limited here.

[0195] As an example, during the communication startup process, after both the controller and transceiver are successfully turned on, the communication link can be automatically connected. Since the transceiver is turned on after the controller is turned on, after the transceiver is successfully turned on, the network status management module can wait to receive link status information sent by the network card abstraction layer. If the network status management module receives link status information indicating that the communication link is ACTIVE within the second preset time period, it can continue to execute the next step of starting communication. If it does not receive link status information, it can be determined that the communication link is abnormal. The abnormal information can include fault codes 0x03 and 0x07.

[0196] As another example, during the communication shutdown process, after both the controller and the transceiver are successfully shut down, the communication link can be automatically disconnected. Typically, the network status management module can receive link status information indicating that the communication link is DOWN within a second preset time period. After the network status management module receives the link status information indicating that the communication link is DOWN, the subsequent communication shutdown steps can be executed.

[0197] In this way, by determining that the communication link is abnormal when the communication link is not successfully connected during the process of starting communication, the comprehensiveness of locating the cause of the abnormality can be improved.

[0198] Based on this, in order to further improve the comprehensiveness of locating the cause of the abnormality, in some embodiments, the above S810 may further specifically include:

[0199] If there is no abnormality in the transceiver and the link status information is received within the second preset time period, sending a second target request to the protocol stack, where the second target request includes any one of a request to open the protocol stack and a request to close the protocol stack;

[0200] If no feedback information corresponding to the second target request is received within the third preset time period, it is determined that the protocol stack is abnormal.

[0201] Here, the second target request may include a request to open the protocol stack and a request to close the protocol stack. If the second target request is a request to open the protocol stack, the feedback information corresponding to the second target request may be a request to close the protocol stack, and the feedback information corresponding to the second target request may be a request to close the protocol stack. In addition, the third preset duration may be, for example, 5 seconds, 10 seconds, 15 seconds, etc. The third preset duration may be the same as or different from the first preset duration and / or the second preset duration, and is not limited here.

[0202] As an example, when the network status management module receives the communication link connection success signal from the network card abstraction layer, it may send a second target request to the protocol stack once, and then wait for feedback information corresponding to the second target request.

[0203] Based on this, to ensure that the protocol stack receives the second target request, as another example, the network status management module may send the first target request to the protocol stack multiple times. Specifically, the network status management module may send the second target request to the protocol stack at a second preset period. The second preset period may be, for example, 400ms, 500ms, 600ms, etc., and is not limited here. Furthermore, the second preset period may be the same as or different from the first preset period.

[0204] As an example, if no feedback information corresponding to the second target request is received within the third preset time period, it can be considered that the protocol stack has failed to be opened or closed, that is, it can be determined that the protocol stack is abnormal. Specifically, the abnormal information corresponding to the protocol stack may include fault codes 0x04 and 0x08.

[0205] In this way, by determining that the protocol stack is abnormal when no feedback information corresponding to the second target request is received within the third preset time period, the comprehensiveness of locating the cause of the abnormality can be further improved.

[0206] Based on this, in order to improve the success rate of opening or closing the protocol stack, in some embodiments, sending the second target request to the protocol stack may specifically include:

[0207] Sending a second target request to the protocol stack according to a second preset period;

[0208] Based on this, when no feedback information corresponding to the second target request is received within the third preset time period, determining that the protocol stack is abnormal may specifically include:

[0209] In a case where no feedback information corresponding to the second target request is received, obtaining a second number of sending times of the second target request;

[0210] When the second sending number reaches the second preset sending number and no feedback information corresponding to the second target request is received, it is determined that the protocol stack is abnormal.

[0211] Here, the second preset period can be, for example, 400ms, 500ms, 600ms, etc., and the second preset number of transmissions can be, for example, 5, 6, 7, etc., without limitation herein. The second preset period can be the same as or different from the first preset period. The second preset number of transmissions can be the same as or different from the first preset number of transmissions. Furthermore, the product of the second preset period and the second preset number of transmissions can be no greater than the third preset duration.

[0212] For a specific implementation, reference may be made to the above description of the example of requesting to start a controller during a communication request process, which will not be described in detail here.

[0213] In this way, by continuously sending the second target request to the protocol stack multiple times when no feedback information corresponding to the second target request is received, the success rate of opening or closing the protocol stack can be improved.

[0214] Since even if a communication node has been successfully enabled, it may still fail during the subsequent communication enabling process, in order to improve the accuracy of locating the cause of the abnormality, in some embodiments, after generating the abnormality information corresponding to the first target communication node and before sending the abnormality information to the diagnostic event management module, the following steps may be further included:

[0215] Acquire a status of a second target communication node, where the second target communication node is any one of the communication nodes that has been successfully started before the abnormal information is generated;

[0216] In a case where the state of the second target communication node indicates that the second target communication node is abnormal, abnormality information corresponding to the second target communication node is generated.

[0217] Here, if abnormal information corresponding to a transceiver has been generated, the second target communication node may be a controller. If fault information corresponding to a communication link has been generated, the second target communication node may be either a transceiver or a controller. If fault information corresponding to a protocol stack has been generated, the second target communication node may be either a transceiver, a controller, or a communication link.

[0218] As an example, if abnormal information corresponding to the communication link has been generated, the network status management module can check the controller (network card) and transceiver in turn to see if they are abnormal. If neither is abnormal, the network status management module can directly report the fault code 0x03 to the diagnostic event management module, that is, the link cannot be ACTIVE during the communication process. If there is an abnormality in the above-mentioned Ethernet peripherals (including controllers and transceivers) that causes the link information to be unable to be ACTIVE, the fault code reported by the network status management module may include 0x01 and / or 0x02. Among them, the order of checking whether the controller and transceiver are abnormal is not limited. In addition, checking whether the controller is abnormal can specifically be requesting the status information of the controller from the network card abstraction layer. If the status information is ACTIVE, the controller is normal. If the status information is DOWN, the controller is abnormal. Checking whether the transceiver is abnormal can specifically be requesting the status information of the transceiver from the network card abstraction layer. If the status information is ACTIVE, the transceiver is normal. If the status information is DOWN, the transceiver is abnormal.

[0219] As another example, as shown in Figure 10, if abnormal information corresponding to the protocol stack has been generated, the network status management module can sequentially check whether the controller (network card), transceiver and communication link are abnormal. If none of them are abnormal, the network status management module can directly report the fault code 0x04 (i.e., protocol stack abnormality) to the diagnostic event management module, that is, the protocol stack cannot be online during the communication process. If the above-mentioned Ethernet peripherals (including controllers, transceivers and communication links) have an abnormality that causes the protocol stack to be unable to be online, the fault codes reported by the network status management module may include 0x01 (i.e., controller abnormality) and / or 0x02 (i.e., transceiver abnormality) and / or 0x03 (i.e., communication link abnormality). Among them, the order of checking whether the controller, transceiver and communication link are abnormal is not limited. In addition, checking whether the communication link is abnormal can specifically be to request the status information of the communication link from the network card abstraction layer. If the status information is ACTIVE, the communication link is normal. If the status information is DOWN, the communication link is abnormal. In addition, the order in which protocol stack exceptions, controller exceptions, transceiver exceptions, and communication link exceptions are reported is not limited. That is, if multiple exception messages are generated, each exception message generated can be sent to the diagnostic event management module. Alternatively, after all checks are completed, multiple exception messages can be sent to the diagnostic event management module simultaneously. If there is only exception information corresponding to the protocol stack, the exception information can be sent to the diagnostic event management module after it is generated, or after all checks are completed.

[0220] In this way, by generating abnormality information corresponding to the target communication node when the state of the second target communication node indicates that the second target communication node is abnormal, the accuracy of locating the cause of the abnormality can be improved.

[0221] In some embodiments, a schematic diagram of a normal process of starting Ethernet communication may be shown in FIG11 , which may specifically include the following steps:

[0222] S121, the communication management module initiates an Ethernet communication start request to the network status management module;

[0223] S122. The network status management module initiates a request to the network card abstraction layer to start the controller (i.e., the network card) and the transceiver;

[0224] S123. The network status management module receives the controller status and the transceiver status. If both the controller and the transceiver are successfully turned on, the network status management module switches the sub-state to WAIT_TRCVLINK. In this state, the network status management module starts waiting for the monitored link status information.

[0225] S124. The network status management module receives the link status. After receiving the link status ACTIVE sent by the network card abstraction layer, the network status management module requests the protocol stack to be ONLINE. At this time, the network status management module switches the sub-state to WAIT_ONLINE. In this state, the network status management module must wait for the monitored protocol stack status information in the network protocol stack.

[0226] S125. The network status management module receives the protocol stack status. After the network status management module receives the protocol stack status ACTIVE (i.e., IP communication is available), the network status management module switches the sub-state to ONLINE.

[0227] S126: The network status management module notifies the communication management module that the communication is complete.

[0228] In S122, S123, S124, and S125, the network status management module needs to interact with the network card abstraction layer and the protocol stack, respectively. However, this lacks the ability to handle exceptions, hindering problem location when Ethernet communication fails to function properly. For example, if the controller in step 1 fails to open (due to hardware damage, for example), existing technologies do not report the error. This results in a delay in achieving full communication even though everything appears to be normal, and the cause of the problem cannot be quickly diagnosed.

[0229] Thus, in order to solve the problems of the prior art, the embodiments of the present application provide a method, device, equipment, storage medium and vehicle for locating the cause of an abnormality in an in-vehicle Ethernet.

[0230] The following first introduces the method for locating the cause of an in-vehicle Ethernet anomaly provided by an embodiment of the present application.

[0231] Figure 12 shows a flow chart of a method for locating the cause of an abnormality in an in-vehicle Ethernet network according to an embodiment of the present application. As shown in Figure 12, the method for locating the cause of an abnormality in an in-vehicle Ethernet network according to an embodiment of the present application includes steps S1210-S1240.

[0232] S1210. Upon receiving a target communication request sent by the communication management module, detect whether multiple communication nodes are abnormal in sequence according to the operation sequence of multiple communication nodes corresponding to the target communication request. The target communication request includes any one of an open communication request and a close communication request.

[0233] The target communication request may be a communication opening request or a communication closing request. If the target communication request is a communication opening request, the operation order of the multiple communication nodes corresponding to the target communication request may be the order in which the multiple communication nodes are opened. If the target communication request is a communication closing request, the operation order of the multiple communication nodes corresponding to the target communication request may be the order in which the multiple communication nodes are closed. The multiple communication nodes may include a first communication node, a communication link, and a protocol stack. The first communication node may include a controller (i.e., a network card) and a transceiver.

[0234] As an example, in the process of turning on or off multiple communication nodes, each communication node may be detected in turn to see if it is abnormal.

[0235] S1220. For each communication node, if there is no abnormality in the communication node, return to execute the operation sequence of multiple communication nodes corresponding to the target communication request, and detect whether the multiple communication nodes are abnormal in turn until the first target communication node is abnormal or the target communication request is completed. The first target communication node is any one of the multiple communication nodes.

[0236] The first target communication node may be an abnormal communication node. As an example, during the process of detecting multiple communication nodes according to the operation sequence of the multiple communication nodes corresponding to the target communication request, if no communication node is abnormal, the target communication process may continue to be executed and the multiple communication nodes may be detected for abnormalities. If a communication node is abnormal, the communication node may be determined as the first target communication node.

[0237] S1230. When the first target communication node is abnormal, generate abnormal information corresponding to the first target communication node.

[0238] The abnormal information may include a fault description corresponding to the faulty communication node. The abnormal information may be generated in the form of a fault code.

[0239] As an example, the correspondence between the fault code and the fault description can continue to refer to the above Table 2.

[0240] S1240. Send abnormal information to the diagnostic event management module.

[0241] After generating the exception information, the network status management module may report the exception information to the diagnosis event management module so as to locate the cause of the exception through the exception information in the diagnosis event management module and perform exception processing.

[0242] Based on this, in order to avoid wasting resources, in some embodiments, after generating the abnormal information corresponding to the first target communication node, the following steps may be further included:

[0243] Send a communication interrupt request to the communication management module.

[0244] Here, after sending a communication interruption request to the communication management module, the communication management module can respond by sending a communication closure request to the network status management module. This allows the network status management module to execute the communication closure step. This means that by interrupting communication in the event of a communication node failure, resource waste can be avoided.

[0245] It should be noted that the order of sending the communication interruption request and sending the abnormal information is not limited.

[0246] The method for locating the cause of an abnormality in the vehicle Ethernet of the embodiment of the present application, in the process of executing the target communication request, that is, opening the communication request or closing the communication request, detects whether the multiple communication nodes are abnormal in sequence according to the operation order of the multiple communication nodes corresponding to the target communication request, and can quickly determine the communication node that caused the failure to open the communication or the failure to close the communication when a certain communication node is abnormal. By continuing to execute the target communication request and detecting whether the multiple communication nodes are abnormal when there is no abnormality in the communication node, it is possible to ensure that the target communication request is completed or determine the abnormal communication node when the target communication request cannot be completed. By generating and sending the abnormal information corresponding to the first target communication node to the diagnostic event management module when the first target communication node is abnormal, it is possible to quickly locate the cause of the abnormality when the Ethernet communication cannot be opened / closed normally for a long time, thereby improving the abnormality processing speed and improving the efficiency of Ethernet communication.

[0247] Based on this, in order to accurately determine whether the first communication node is abnormal, in some embodiments, the above S1210 may specifically include:

[0248] Sending a first target request corresponding to the first communication node to the network card abstraction layer, where the first target request includes any one of a request to enable the first communication node and a request to disable the first communication node;

[0249] If no feedback information corresponding to the first target request is received within the first preset time period, it is determined that the first communication node is abnormal.

[0250] Here, if the target communication request is a communication start request, the first target request corresponding to the first communication node may include a controller start request and a transceiver start request. If the target communication request is a communication stop request, the first target request corresponding to the first communication node may include a controller stop request and a transceiver stop request.

[0251] As an example, when the first target request is a request to turn on the controller, the feedback information corresponding to the first target request may be controller ACTIVE. When the first target request is a request to turn off the controller, the feedback information corresponding to the first target request may be controller DOWN. When the first target request is a request to turn on the transceiver, the feedback information corresponding to the first target request may be transceiver ACTIVE. When the first target request is a request to turn off the transceiver, the feedback information corresponding to the first target request may be transceiver DOWN. In addition, the first preset time length may be, for example, 5s, 10s, 15s, etc., which are not limited here. If the feedback information corresponding to the first target request is not received within the first preset time length, it can be considered that the first communication node has failed to open or close, that is, it can be determined that the first communication node is abnormal. Specifically, the abnormal information corresponding to the first communication node may include fault codes 0x01, 0x02, 0x05 and 0x06.

[0252] In addition, as an example, when the network status management module receives the target communication request sent by the communication management module, it can send a first target request to the network card abstraction layer for the first communication node, and then wait for feedback information corresponding to the first target request.

[0253] Based on this, to ensure that the network card abstraction layer receives the first target request, as another example, the network status management module may send the first target request to the network card abstraction layer multiple times for the first communication node. Specifically, the network status management module may send the first target request corresponding to the first communication node to the network card abstraction layer at a first preset period. The first preset period may be, for example, 400ms, 500ms, 600ms, etc., and is not limited here.

[0254] In this way, by determining that the first communication node is abnormal when no feedback information corresponding to the first target request is received within the first preset time period, it is possible to accurately determine whether the first communication node is abnormal.

[0255] Based on this, in order to improve the success rate of opening or closing the first communication node, in some embodiments, sending the first target request corresponding to the first communication node to the network card abstraction layer may specifically include:

[0256] Sending a first target request corresponding to the first communication node to the network card abstraction layer according to a first preset period;

[0257] Based on this, when no feedback information corresponding to the first target request is received within the first preset time period, determining that the first communication node is abnormal may specifically include:

[0258] In a case where no feedback information corresponding to the first target request is received, obtaining a first sending count of the first target request;

[0259] When the first number of transmissions reaches the first preset number of transmissions and no feedback information corresponding to the first target request is received, it is determined that the first communication node is abnormal.

[0260] Here, the first preset period can be, for example, 400ms, 500ms, 600ms, etc., and the first preset number of transmissions can be, for example, 5 times, 6 times, 7 times, etc., which are not limited here. In addition, the product of the first preset period and the first preset number of transmissions can be no greater than the first preset duration.

[0261] As an example, please continue to refer to Figure 9, which takes the request to turn on the controller during the communication request process as an example. The network status management module can send a request to turn on the controller to the Ethernet abstraction layer at intervals of 500ms. If the first preset number of transmissions is 5, then before the end of the 5 requests, if a notification of a successful request has been received, the next step of turning on the communication can be continued. If a request to turn on the controller has been sent 5 times in succession, and no information indicating that the controller has been turned on successfully has been received after the 5 requests have been completed, the network status management module can generate an exception message with a fault code of 0x01. In addition, please continue to refer to Figure 9. After the network status management module generates an exception message with a fault code of 0x01, the exception message can be reported to the diagnostic event management module.

[0262] In this way, by sending the first target request corresponding to the first communication node to the network card abstraction layer multiple times in a row when no feedback information corresponding to the first target request is received, the success rate of opening or closing the first communication node can be improved.

[0263] Based on this, when the first communication node is a transceiver, in order to improve the comprehensiveness of locating the cause of the abnormality, in some embodiments, the above S1210 may further include:

[0264] When feedback information corresponding to the first target request is received within the first preset time period, determining that there is no abnormality in the transceiver;

[0265] If the link status information corresponding to the communication link sent by the network card abstraction layer is not received within the second preset time period, it is determined that the communication link is abnormal.

[0266] Here, the second preset duration may be, for example, 5s, 10s, 15s, etc. In addition, the second preset duration may be the same as or different from the first preset duration, which is not limited here.

[0267] As an example, during the communication startup process, after both the controller and transceiver are successfully turned on, the communication link can be automatically connected. Since the transceiver is turned on after the controller is turned on, after the transceiver is successfully turned on, the network status management module can wait to receive link status information sent by the network card abstraction layer. If the network status management module receives link status information indicating that the communication link is ACTIVE within the second preset time period, it can continue to execute the next step of starting communication. If it does not receive link status information, it can be determined that the communication link is abnormal. The abnormal information can include fault codes 0x03 and 0x07.

[0268] As another example, during the communication shutdown process, after both the controller and the transceiver are successfully shut down, the communication link can be automatically disconnected. Typically, the network status management module can receive link status information indicating that the communication link is DOWN within a second preset time period. After the network status management module receives the link status information indicating that the communication link is DOWN, the subsequent communication shutdown steps can be executed.

[0269] In this way, by determining that the communication link is abnormal when the communication link is not successfully connected during the process of starting communication, the comprehensiveness of locating the cause of the abnormality can be improved.

[0270] Based on this, in order to further improve the comprehensiveness of locating the cause of the abnormality, in some embodiments, the above S1210 may further specifically include:

[0271] If there is no abnormality in the transceiver and the link status information is received within the second preset time period, sending a second target request to the protocol stack, where the second target request includes any one of a request to open the protocol stack and a request to close the protocol stack;

[0272] If no feedback information corresponding to the second target request is received within the third preset time period, it is determined that the protocol stack is abnormal.

[0273] Here, the second target request may include a request to open the protocol stack and a request to close the protocol stack. If the second target request is a request to open the protocol stack, the feedback information corresponding to the second target request may be a request to close the protocol stack, and the feedback information corresponding to the second target request may be a request to close the protocol stack. In addition, the third preset duration may be, for example, 5 seconds, 10 seconds, 15 seconds, etc. The third preset duration may be the same as or different from the first preset duration and / or the second preset duration, and is not limited here.

[0274] As an example, when the network status management module receives the communication link connection success signal from the network card abstraction layer, it may send a second target request to the protocol stack once, and then wait for feedback information corresponding to the second target request.

[0275] Based on this, to ensure that the protocol stack receives the second target request, as another example, the network status management module may send the first target request to the protocol stack multiple times. Specifically, the network status management module may send the second target request to the protocol stack at a second preset period. The second preset period may be, for example, 400ms, 500ms, 600ms, etc., and is not limited here. Furthermore, the second preset period may be the same as or different from the first preset period.

[0276] As an example, if no feedback information corresponding to the second target request is received within the third preset time period, it can be considered that the protocol stack has failed to be opened or closed, that is, it can be determined that the protocol stack is abnormal. Specifically, the abnormal information corresponding to the protocol stack may include fault codes 0x04 and 0x08.

[0277] In this way, by determining that the protocol stack is abnormal when no feedback information corresponding to the second target request is received within the third preset time period, the comprehensiveness of locating the cause of the abnormality can be further improved.

[0278] Based on this, in order to improve the success rate of opening or closing the protocol stack, in some embodiments, sending the second target request to the protocol stack may specifically include:

[0279] Sending a second target request to the protocol stack according to a second preset period;

[0280] Based on this, when no feedback information corresponding to the second target request is received within the third preset time period, determining that the protocol stack is abnormal may specifically include:

[0281] In a case where no feedback information corresponding to the second target request is received, obtaining a second number of sending times of the second target request;

[0282] When the second sending number reaches the second preset sending number and no feedback information corresponding to the second target request is received, it is determined that the protocol stack is abnormal.

[0283] Here, the second preset period can be, for example, 400ms, 500ms, 600ms, etc., and the second preset number of transmissions can be, for example, 5, 6, 7, etc., without limitation herein. The second preset period can be the same as or different from the first preset period. The second preset number of transmissions can be the same as or different from the first preset number of transmissions. Furthermore, the product of the second preset period and the second preset number of transmissions can be no greater than the third preset duration.

[0284] For a specific implementation, reference may be made to the above description of the example of requesting to start a controller during a communication request process, which will not be described in detail here.

[0285] In this way, by continuously sending the second target request to the protocol stack multiple times when no feedback information corresponding to the second target request is received, the success rate of opening or closing the protocol stack can be improved.

[0286] Since even if a communication node has been successfully enabled, it may still fail during the subsequent communication enabling process, in order to improve the accuracy of locating the cause of the abnormality, in some embodiments, after generating the abnormality information corresponding to the first target communication node and before sending the abnormality information to the diagnostic event management module, the following steps may be further included:

[0287] Acquire a status of a second target communication node, where the second target communication node is any one of the communication nodes that has been successfully started before the abnormal information is generated;

[0288] In a case where the state of the second target communication node indicates that the second target communication node is abnormal, abnormality information corresponding to the second target communication node is generated.

[0289] Here, if abnormal information corresponding to a transceiver has been generated, the second target communication node may be a controller. If fault information corresponding to a communication link has been generated, the second target communication node may be either a transceiver or a controller. If fault information corresponding to a protocol stack has been generated, the second target communication node may be either a transceiver, a controller, or a communication link.

[0290] As an example, if abnormal information corresponding to the communication link has been generated, the network status management module can check the controller (network card) and transceiver in turn to see if they are abnormal. If neither is abnormal, the network status management module can directly report the fault code 0x03 to the diagnostic event management module, that is, the link cannot be ACTIVE during the communication process. If there is an abnormality in the above-mentioned Ethernet peripherals (including controllers and transceivers) that causes the link information to be unable to be ACTIVE, the fault code reported by the network status management module may include 0x01 and / or 0x02. Among them, the order of checking whether the controller and transceiver are abnormal is not limited. In addition, checking whether the controller is abnormal can specifically be requesting the status information of the controller from the network card abstraction layer. If the status information is ACTIVE, the controller is normal. If the status information is DOWN, the controller is abnormal. Checking whether the transceiver is abnormal can specifically be requesting the status information of the transceiver from the network card abstraction layer. If the status information is ACTIVE, the transceiver is normal. If the status information is DOWN, the transceiver is abnormal.

[0291] As another example, please continue to refer to Figure 10. If abnormal information corresponding to the protocol stack has been generated, the network status management module can sequentially check whether the controller (network card), transceiver and communication link are abnormal. If none of them are abnormal, the network status management module can directly report the fault code 0x04 (i.e., protocol stack abnormality) to the diagnostic event management module, that is, the protocol stack cannot be online during the communication process. If the above-mentioned Ethernet peripherals (including controllers, transceivers and communication links) have an abnormality that causes the protocol stack to be unable to be online, the fault codes reported by the network status management module may include 0x01 (i.e., controller abnormality) and / or 0x02 (i.e., transceiver abnormality) and / or 0x03 (i.e., communication link abnormality). Among them, the order of checking whether the controller, transceiver and communication link are abnormal is not limited. In addition, checking whether the communication link is abnormal can specifically be to request the status information of the communication link from the network card abstraction layer. If the status information is ACTIVE, the communication link is normal. If the status information is DOWN, the communication link is abnormal. In addition, the order in which protocol stack exceptions, controller exceptions, transceiver exceptions, and communication link exceptions are reported is not limited. That is, if multiple exception messages are generated, each exception message generated can be sent to the diagnostic event management module. Alternatively, after all checks are completed, multiple exception messages can be sent to the diagnostic event management module simultaneously. If there is only exception information corresponding to the protocol stack, the exception information can be sent to the diagnostic event management module after it is generated, or after all checks are completed.

[0292] In this way, by generating abnormality information corresponding to the target communication node when the state of the second target communication node indicates that the second target communication node is abnormal, the accuracy of locating the cause of the abnormality can be improved.

[0293] Based on the communication management method provided in the above embodiment, the present application also provides a specific implementation of a communication management device. Please refer to the following embodiment.

[0294] As shown in FIG13 , the communication management device 1300 provided in this embodiment of the present application includes the following modules:

[0295] A first receiving module 1310 is configured to receive a first instruction sent by the network status management module, where the first instruction is generated by the network status management module when the communication link is disconnected;

[0296] A first closing module 1320 is configured to close the communication between the protocol stack and the network card abstraction layer in response to the first instruction;

[0297] Detection module 1330, used to detect whether there is a communication event between the protocol stack and the upper layer application;

[0298] The second closing module 1340 is configured to close the protocol stack when no communication event occurs.

[0299] The communication management device 1300 is described in detail below.

[0300] In some embodiments, the detection module may specifically include:

[0301] A first query submodule is used to query the socket states corresponding to the plurality of sockets between the protocol stack and the upper layer application according to a preset period;

[0302] The first determining submodule is configured to determine that no communication event exists when the multiple socket states are all closed.

[0303] In some embodiments, the detection module may further include:

[0304] A second query submodule is used to query the socket states corresponding to the multiple sockets between the protocol stack and the upper layer application according to a preset period;

[0305] Get submodule, used to get the number of times the socket status is queried;

[0306] A third query submodule is used to query the storage module of the protocol stack when the number of queries reaches a preset number of times and there is an open state in the multiple socket states;

[0307] The second determining submodule is configured to determine that no communication event exists when the storage space of the storage module is full.

[0308] In some embodiments, the second closing module 1340 may specifically include:

[0309] A first generating submodule, configured to generate a second instruction when no communication event occurs;

[0310] a sending submodule, configured to send a second instruction to the network status management module, wherein the second instruction is configured to instruct the network status management module to enter a link activation waiting state;

[0311] Close the submodule for protocol stack.

[0312] In the communication management device of an embodiment of the present application, if the protocol stack continues to send data packets to the network card abstraction layer when the communication link is disconnected, data packet loss will result. Therefore, by shutting down the communication between the protocol stack and the network card abstraction layer when the communication link is disconnected, data packets in the protocol stack can be temporarily stored in the protocol stack, thereby reducing the loss of data packets transmitted between the protocol stack and the network card abstraction layer. Since the communication between the protocol stack and the network card abstraction layer has been shut down, if there are still communication events between the protocol stack and the upper-layer application, data transmitted to the protocol stack by the upper-layer application can be temporarily stored in the protocol stack. In this way, by shutting down the protocol stack when there are no communication events between the protocol stack and the upper-layer application, data loss between the protocol stack and the upper-layer application can be reduced. On the other hand, if the protocol stack is not shut down when there are no communication events between the protocol stack and the upper-layer application, resources will be wasted. Therefore, by shutting down the protocol stack when there are no communication events between the protocol stack and the upper-layer application, resource waste can be reduced while reducing data loss. In this way, the embodiments of the present application can reduce data loss and resource waste, thereby improving communication efficiency.

[0313] As shown in FIG14 , the communication management device 1400 provided in this embodiment of the present application includes the following modules:

[0314] The second receiving module 1410 is configured to receive link status information sent by the network card abstraction layer when the communication is in the on state;

[0315] A first generating module 1420 is configured to generate a first instruction when the link status information indicates that the communication link is disconnected;

[0316] The first sending module 1430 is configured to send a first instruction to the protocol stack, where the first instruction is used to instruct the protocol stack to close the communication between the protocol stack and the network card abstraction layer.

[0317] The communication management device 1400 is described in detail below.

[0318] In some embodiments, the generating module 1420 may specifically include:

[0319] The second generating submodule is configured to switch from the communication enabling state to the communication buffering state and generate a first instruction when the link status information indicates that the communication link is disconnected.

[0320] In some embodiments, the communication management device 1400 may further include:

[0321] A third receiving module is configured to receive a second instruction sent by the protocol stack after sending the first instruction to the protocol stack, where the second instruction is generated by the protocol stack in the absence of a communication event;

[0322] The switching module is configured to switch from a communication buffer state to a link activation waiting state in response to a second instruction.

[0323] In some embodiments, the communication management device 1400 may further include:

[0324] a fourth receiving module, configured to receive a third instruction sent by the network card abstraction layer after sending the first instruction to the protocol stack, where the third instruction is generated by the network card abstraction layer when the communication link is restored;

[0325] The entry module is configured to enter a communication-on state in response to a third instruction.

[0326] In some embodiments, the communication management device 1400 may further include:

[0327] a first detection module 1440 configured to, upon receiving a target communication request sent by the communication management module, sequentially detect whether the multiple communication nodes are abnormal according to the operation order of the multiple communication nodes corresponding to the target communication request, where the target communication request includes any one of a communication start request and a communication close request;

[0328] A first execution module 1450 is configured to, for each communication node, return to executing the operation sequence of the multiple communication nodes corresponding to the target communication request, and sequentially detect whether the multiple communication nodes are abnormal, if the communication node is normal, until the first target communication node is abnormal or the target communication request is completed, where the first target communication node is any one of the multiple communication nodes;

[0329] The second generating module 1460 is configured to generate abnormal information corresponding to the first target communication node when the first target communication node is abnormal;

[0330] The second sending module 1470 is configured to send abnormality information to the diagnosis event management module.

[0331] The communication management device 1400 is described in detail below.

[0332] In some embodiments, the detection module 1440 may specifically include:

[0333] A first sending submodule, configured to send a first target request corresponding to the first communication node to the network card abstraction layer, where the first target request includes any one of a request to enable the first communication node and a request to disable the first communication node;

[0334] The first determining submodule is configured to determine that the first communication node is abnormal if no feedback information corresponding to the first target request is received within a first preset time period.

[0335] In some embodiments, the first sending submodule may specifically include:

[0336] A first sending unit, configured to send a first target request corresponding to the first communication node to the network card abstraction layer according to a first preset period;

[0337] Based on this, the first determination submodule may specifically include:

[0338] A first acquiring unit, configured to acquire a first number of times the first target request is sent when no feedback information corresponding to the first target request is received;

[0339] The first determining unit is configured to determine that the first communication node is abnormal when the first sending number reaches a first preset sending number and no feedback information corresponding to the first target request is received.

[0340] In some embodiments, the first communication node is a transceiver, and the detection module 1440 may further include:

[0341] A second determining submodule is configured to determine that there is no abnormality in the transceiver when feedback information corresponding to the first target request is received within a first preset time period;

[0342] The third determining submodule is configured to determine that the communication link is abnormal if the link status information corresponding to the communication link sent by the network card abstraction layer is not received within a second preset time period.

[0343] In some embodiments, the detection module 1440 may further include:

[0344] A second sending submodule is configured to send a second target request to the protocol stack when there is no abnormality in the transceiver and link status information is received within a second preset time period, where the second target request includes any one of a request to open the protocol stack and a request to close the protocol stack;

[0345] The fourth determining submodule is configured to determine that the protocol stack is abnormal if no feedback information corresponding to the second target request is received within a third preset time period.

[0346] In some embodiments, the second sending submodule may specifically include:

[0347] A second sending unit, configured to send a second target request to the protocol stack according to a second preset period;

[0348] Based on this, the fourth determining submodule may specifically include:

[0349] A second acquiring unit, configured to acquire a second number of times the second target request is sent when no feedback information corresponding to the second target request is received;

[0350] The second determining unit is configured to determine that the protocol stack is abnormal if the second sending number reaches a second preset sending number and no feedback information corresponding to the second target request is received.

[0351] In some embodiments, the communication management device 1400 may further include:

[0352] an acquisition module, configured to, after generating abnormal information corresponding to the first target communication node and before sending the abnormal information to the diagnostic event management module, acquire a status of a second target communication node, the second target communication node being any one of the communication nodes that has been successfully enabled before the abnormal information is generated;

[0353] The second generating module is configured to generate abnormality information corresponding to the second target communication node when the state of the second target communication node indicates that the second target communication node is abnormal.

[0354] In some embodiments, the communication management device 1400 may further include:

[0355] The second sending module is configured to send a communication interruption request to the communication management module after generating abnormal information corresponding to the first target communication node.

[0356] The communication management device of an embodiment of the present application can temporarily store data packets in the protocol stack by sending a first instruction to the protocol stack to instruct the protocol stack to close the communication between the protocol stack and the network card abstraction layer when the communication link is disconnected, thereby reducing the loss of data packets and improving communication efficiency.

[0357] As shown in FIG15 , the vehicle-mounted Ethernet abnormality cause location device 1500 provided in an embodiment of the present application includes the following modules:

[0358] a second detection module 1510 configured to, upon receiving a target communication request sent by the communication management module, sequentially detect whether the multiple communication nodes are abnormal according to the operation order of the multiple communication nodes corresponding to the target communication request, where the target communication request includes any one of a communication start request and a communication close request;

[0359] The second execution module 1520 is configured to, for each communication node, return to executing the operation sequence of the multiple communication nodes corresponding to the target communication request if the communication node is normal, and sequentially detect whether the multiple communication nodes are abnormal, until the first target communication node is abnormal or the target communication request is completed, where the first target communication node is any one of the multiple communication nodes;

[0360] The third generating module 1530 is configured to generate abnormal information corresponding to the first target communication node when the first target communication node is abnormal;

[0361] The third sending module 1540 is configured to send abnormality information to the diagnosis event management module.

[0362] The following is a detailed description of the vehicle-mounted Ethernet abnormality cause location device 1500, as shown below:

[0363] In some embodiments, the detection module 1510 may specifically include:

[0364] A first sending submodule, configured to send a first target request corresponding to the first communication node to the network card abstraction layer, where the first target request includes any one of a request to enable the first communication node and a request to disable the first communication node;

[0365] The first determining submodule is configured to determine that the first communication node is abnormal if no feedback information corresponding to the first target request is received within a first preset time period.

[0366] In some embodiments, the first sending submodule may specifically include:

[0367] A first sending unit, configured to send a first target request corresponding to the first communication node to the network card abstraction layer according to a first preset period;

[0368] Based on this, the first determination submodule may specifically include:

[0369] A first acquiring unit, configured to acquire a first number of times the first target request is sent when no feedback information corresponding to the first target request is received;

[0370] The first determining unit is configured to determine that the first communication node is abnormal when the first sending number reaches a first preset sending number and no feedback information corresponding to the first target request is received.

[0371] In some embodiments, the first communication node is a transceiver, and the detection module 1510 may further include:

[0372] A second determining submodule is configured to determine that there is no abnormality in the transceiver when feedback information corresponding to the first target request is received within a first preset time period;

[0373] The third determining submodule is configured to determine that the communication link is abnormal if the link status information corresponding to the communication link sent by the network card abstraction layer is not received within a second preset time period.

[0374] In some embodiments, the detection module 1510 may further include:

[0375] A second sending submodule is configured to send a second target request to the protocol stack when there is no abnormality in the transceiver and link status information is received within a second preset time period, where the second target request includes any one of a request to open the protocol stack and a request to close the protocol stack;

[0376] The fourth determining submodule is configured to determine that the protocol stack is abnormal if no feedback information corresponding to the second target request is received within a third preset time period.

[0377] In some embodiments, the second sending submodule may specifically include:

[0378] A second sending unit, configured to send a second target request to the protocol stack according to a second preset period;

[0379] Based on this, the fourth determining submodule may specifically include:

[0380] A second acquiring unit, configured to acquire a second number of times the second target request is sent when no feedback information corresponding to the second target request is received;

[0381] The second determining unit is configured to determine that the protocol stack is abnormal if the second sending number reaches a second preset sending number and no feedback information corresponding to the second target request is received.

[0382] In some embodiments, the vehicle-mounted Ethernet abnormality cause location device 1500 may further include:

[0383] an acquisition module, configured to, after generating abnormal information corresponding to the first target communication node and before sending the abnormal information to the diagnostic event management module, acquire a status of a second target communication node, the second target communication node being any one of the communication nodes that has been successfully enabled before the abnormal information is generated;

[0384] The second generating module is configured to generate abnormality information corresponding to the second target communication node when the state of the second target communication node indicates that the second target communication node is abnormal.

[0385] In some embodiments, the vehicle-mounted Ethernet abnormality cause location device 1500 may further include:

[0386] The second sending module is configured to send a communication interruption request to the communication management module after generating abnormal information corresponding to the first target communication node.

[0387] The vehicle-mounted Ethernet abnormality cause location device of the embodiment of the present application, in the process of executing the target communication request, that is, the opening communication request or closing communication request, detects whether multiple communication nodes are abnormal in sequence according to the operation order of multiple communication nodes corresponding to the target communication request. In the case of an abnormality of a certain communication node, it is possible to quickly determine the communication node that caused the failure to open the communication or the failure to close the communication. By continuing to execute the target communication request and detecting whether multiple communication nodes are abnormal when there is no abnormality in the communication node, it is possible to ensure that the target communication request is completed or determine the abnormal communication node when the target communication request cannot be completed. By generating and sending abnormal information corresponding to the first target communication node to the diagnostic event management module when the first target communication node is abnormal, it is possible to quickly locate the cause of the abnormality when the Ethernet communication cannot be opened / closed normally for a long time, thereby improving the abnormality processing speed and improving the efficiency of Ethernet communication.

[0388] Based on the communication management method provided in the above embodiment, the embodiment of the present application further provides a specific implementation of an electronic device. Figure 16 shows a schematic diagram of an electronic device 1600 provided in the embodiment of the present application.

[0389] The electronic device 1600 may include a processor 1610 and a memory 1620 storing computer program instructions.

[0390] Specifically, the processor 1610 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0391] Memory 1620 may include a large capacity memory for data or instructions. By way of example and not limitation, memory 1620 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 1620 may include removable or non-removable (or fixed) media. Where appropriate, memory 1620 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, memory 1620 is a non-volatile solid-state memory.

[0392] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of the present application.

[0393] The processor 1610 implements any one of the communication management methods in the above embodiments by reading and executing computer program instructions stored in the memory 1620 .

[0394] In one example, the electronic device 1600 may further include a communication interface 1630 and a bus 1640. As shown in FIG16 , the processor 1610, the memory 1620, and the communication interface 1630 are connected via the bus 1640 and communicate with each other.

[0395] The communication interface 1630 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0396] Bus 1640 includes hardware, software or both, couples the parts of electronic equipment to each other.For example, but not limitation, bus can include accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 1640 can include one or more buses. Although the present application embodiment describes and shows specific bus, the application considers any suitable bus or interconnection.

[0397] Illustratively, the electronic device 1600 may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA).

[0398] The electronic device can execute the communication management method in the embodiment of the present application, thereby realizing the communication management method described in combination with Figures 2 to 10, the method for locating the cause of an abnormality in an in-vehicle Ethernet shown in Figures 11 to 12, the communication management device shown in Figures 13 and 14, and the device for locating the cause of an abnormality in an in-vehicle Ethernet shown in Figure 15.

[0399] In addition, in conjunction with the communication management method in the above embodiments, the present application embodiment may provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the communication management methods in the above embodiments is implemented.

[0400] In addition, an embodiment of the present application further provides a vehicle, which may include at least one of the following:

[0401] The communication management device according to any one of the embodiments of the third aspect;

[0402] The communication management device according to any one of the embodiments of the fourth aspect;

[0403] As in any one of the embodiments of the fifth aspect, the device for locating the cause of an abnormality in an in-vehicle Ethernet network;

[0404] The electronic device according to any one of the embodiments of the sixth aspect;

[0405] As the computer-readable storage medium in any embodiment of the seventh aspect, no further details will be given here.

[0406] It should be understood that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present application.

[0407] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0408] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps. In other words, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0409] Aspects of the present application have been described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed via the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. This processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It is also understood that each box in the block diagram and / or the flowchart and the combination of the boxes in the block diagram and / or the flowchart can also be implemented by the dedicated hardware that performs the specified function or action, or can be implemented by the combination of dedicated hardware and computer instructions.

[0410] The above description is only a specific embodiment of the present application. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the scope of protection of the present application.

Claims

1. A communication management method, characterized in that: include: receiving a first instruction sent by a network status management module, where the first instruction is generated by the network status management module when a communication link is disconnected; In response to the first instruction, closing the communication between the protocol stack and the network card abstraction layer; Detecting whether there is a communication event between the protocol stack and the upper layer application; In the absence of the communication event, the protocol stack is closed.

2. The method according to claim 1, characterized in that The detecting whether there is a communication event between the protocol stack and the upper layer application includes: querying socket states respectively corresponding to a plurality of sockets between the protocol stack and the upper layer application according to a preset period; When the plurality of socket states are all in the closed state, it is determined that the communication event does not exist.

3. The method according to claim 1, characterized in that The detecting whether there is a communication event between the protocol stack and the upper layer application also includes: querying socket states respectively corresponding to a plurality of sockets between the protocol stack and the upper layer application according to a preset period; Get the number of times the socket status is queried; When the number of queries reaches a preset number of queries and there is an open state among the plurality of socket states, querying a storage module of the protocol stack; When the storage space of the storage module is full, it is determined that the communication event does not exist.

4. The method according to claim 1, characterized in that In the absence of the communication event, closing the protocol stack includes: In the absence of the communication event, generating a second instruction; Sending the second instruction to the network status management module, where the second instruction is used to instruct the network status management module to enter a link activation waiting state; Close the protocol stack.

5. A communication management method, characterized in that: include: When the communication is in the on state, receiving the link status information sent by the network card abstraction layer; In a case where the link status information indicates that the communication link is disconnected, generating a first instruction; The first instruction is sent to the protocol stack, where the first instruction is used to instruct the protocol stack to close the communication between the protocol stack and the network card abstraction layer.

6. The method according to claim 5, characterized in that The generating a first instruction when the link status information indicates that the communication link is disconnected includes: When the link status information indicates that the communication link is disconnected, the communication start state is switched to the communication buffer state, and the first instruction is generated.

7. The method according to claim 6, characterized in that After sending the first instruction to the protocol stack, the method further includes: receiving a second instruction sent by the protocol stack, where the second instruction is generated by the protocol stack in the absence of a communication event; In response to the second instruction, the communication buffer state is switched to the link activation waiting state.

8. The method according to claim 6, characterized in that After sending the first instruction to the protocol stack, the method further includes: receiving a third instruction sent by the network card abstraction layer, wherein the third instruction is generated by the network card abstraction layer when the communication link is restored; In response to the third instruction, the communication on state is entered.

9. The method according to claim 8, characterized in that include: Upon receiving a target communication request sent by the communication management module, sequentially detecting whether the multiple communication nodes are abnormal according to the operation order of the multiple communication nodes corresponding to the target communication request, wherein the target communication request includes any one of a communication opening request and a communication closing request; For each of the communication nodes, if there is no abnormality in the communication node, return to execute the operation sequence of the multiple communication nodes corresponding to the target communication request, and sequentially detect whether the multiple communication nodes are abnormal, until the first target communication node is abnormal or the target communication request is completed, and the first target communication node is any one of the multiple communication nodes; In the case where the first target communication node is abnormal, generating abnormal information corresponding to the first target communication node; The abnormal information is sent to a diagnostic event management module.

10. The method according to claim 9, characterized in that The step of sequentially detecting whether the plurality of communication nodes are abnormal according to the operation sequence of the plurality of communication nodes corresponding to the target communication request comprises: Sending a first target request corresponding to the first communication node to the network card abstraction layer, wherein the first target request includes any one of a request to open the first communication node and a request to close the first communication node; When no feedback information corresponding to the first target request is received within a first preset time period, it is determined that the first communication node is abnormal.

11. The method according to claim 10, characterized in that The sending a first target request corresponding to the first communication node to the network card abstraction layer includes: Sending the first target request corresponding to the first communication node to the network card abstraction layer according to a first preset period; In the case where no feedback information corresponding to the first target request is received within a first preset time period, determining that the first communication node is abnormal includes: In a case where no feedback information corresponding to the first target request is received, obtaining a first sending number of the first target request; When the first sending number reaches a first preset sending number and no feedback information corresponding to the first target request is received, it is determined that the first communication node is abnormal.

12. The method according to claim 10, characterized in that The first communication node is a transceiver, and the detecting whether the multiple communication nodes are abnormal in sequence according to the operation sequence of the multiple communication nodes corresponding to the target communication request further includes: In the case where feedback information corresponding to the first target request is received within the first preset time period, determining that there is no abnormality in the transceiver; When the link status information corresponding to the communication link sent by the network card abstraction layer is not received within the second preset time period, it is determined that the communication link is abnormal.

13. The method according to claim 12, characterized in that The step of sequentially detecting whether the plurality of communication nodes are abnormal according to the operation sequence of the plurality of communication nodes corresponding to the target communication request further comprises: If there is no abnormality in the transceiver and the link status information is received within the second preset time period, sending a second target request to the protocol stack, wherein the second target request includes any one of a request to start the protocol stack and a request to close the protocol stack; If no feedback information corresponding to the second target request is received within a third preset time period, it is determined that the protocol stack is abnormal.

14. The method according to claim 13, characterized in that The sending the second target request to the protocol stack includes: Sending the second target request to the protocol stack according to a second preset period; When no feedback information corresponding to the second target request is received within a third preset time period, determining that the protocol stack is abnormal includes: In a case where no feedback information corresponding to the second target request is received, obtaining a second number of times the second target request is sent; When the second sending number reaches a second preset sending number and feedback information corresponding to the second target request is not received, it is determined that the protocol stack is abnormal.

15. The method according to claim 9, characterized in that After generating the abnormal information corresponding to the first target communication node and before sending the abnormal information to the diagnostic event management module, the method further includes: Acquire a state of a second target communication node, where the second target communication node is any one of the communication nodes that have been successfully started before the abnormal information is generated; In a case where the state of the second target communication node indicates that the second target communication node is abnormal, abnormality information corresponding to the second target communication node is generated.

16. The method according to claim 9, characterized in that After generating the abnormal information corresponding to the first target communication node, the method further includes: A communication interruption request is sent to the communication management module.

17. A method for locating the cause of abnormality in an in-vehicle Ethernet, characterized in that: The in-vehicle Ethernet performs communication through the communication management method described in any one of claims 5 to 16, including: Upon receiving a target communication request sent by the communication management module, sequentially detecting whether the multiple communication nodes are abnormal according to the operation order of the multiple communication nodes corresponding to the target communication request, wherein the target communication request includes any one of a communication opening request and a communication closing request; For each of the communication nodes, if there is no abnormality in the communication node, return to execute the operation sequence of the multiple communication nodes corresponding to the target communication request, and sequentially detect whether the multiple communication nodes are abnormal, until the first target communication node is abnormal or the target communication request is completed, and the first target communication node is any one of the multiple communication nodes; In the case where the first target communication node is abnormal, generating abnormal information corresponding to the first target communication node; The abnormal information is sent to a diagnostic event management module.

18. A communication management device, characterized in that: The device comprises: A first receiving module, configured to receive a first instruction sent by a network status management module, wherein the first instruction is generated by the network status management module when a communication link is disconnected; A first closing module, configured to close the communication between the protocol stack and the network card abstraction layer in response to the first instruction; A detection module, used to detect whether there is a communication event between the protocol stack and the upper layer application; The second closing module is used to close the protocol stack when the communication event does not exist.

19. A communication management device, characterized in that: The device comprises: A second receiving module is used to receive link status information sent by the network card abstraction layer when the communication is in the on state; A generating module, configured to generate a first instruction when the link status information indicates that the communication link is disconnected; The sending module is used to send the first instruction to the protocol stack, where the first instruction is used to instruct the protocol stack to close the communication between the protocol stack and the network card abstraction layer.

20. A device for locating abnormal causes of vehicle-mounted Ethernet, characterized in that: The in-vehicle Ethernet performs communication through the communication management device according to claim 19, and the device includes: a detection module, configured to detect whether the plurality of communication nodes are abnormal in sequence according to the operation sequence of the plurality of communication nodes corresponding to the target communication request when receiving the target communication request sent by the communication management module, wherein the target communication request includes any one of a communication opening request and a communication closing request; an execution module, for each of the communication nodes, when the communication node is normal, returning to execute the operation sequence of the multiple communication nodes corresponding to the target communication request, and sequentially detecting whether the multiple communication nodes are abnormal, until the first target communication node is abnormal or the target communication request is completed, the first target communication node being any one of the multiple communication nodes; A first generating module, configured to generate abnormal information corresponding to the first target communication node when the first target communication node is abnormal; The first sending module is used to send the abnormal information to the diagnosis event management module.

21. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the communication management method as described in any one of claims 1-4, 5-16 or 17 is implemented.

22. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the communication management method as described in any one of claims 1-4, 5-16 or 17 is implemented.

23. A vehicle, characterized in that: Include at least one of the following: The communication management device as claimed in claim 18; The communication management device as claimed in claim 19; The device for locating the cause of abnormality in an in-vehicle Ethernet as claimed in claim 20; The electronic device as claimed in claim 21; The computer readable storage medium of claim 22.

Citation Information

Patent Citations

  • Method of data reliable transmission with user datagram protocol (UDP) in communication network

    CN103036904A

  • Multi-mode communication method and operating system based on FirefoxOS

    CN113825258A

  • Fault diagnosis method and system and storage medium

    CN114760225A

  • Large file transmission method based on full user mode QUIC protocol

    CN115801770A

  • Server providing access to a plurality of functions of a multifunction peripheral in a network

    US6581098B1