Communication method and device, network system, vehicle and computer storage medium
By combining scheduling access strategies and competing access strategies in the in-vehicle communication network, the problems of increasing delays and inflexible emergency data transmission in the prior art are solved, and the effect of reducing bus load and data packet loss rate is achieved, and the need for emergency data transmission is achieved.
Patent Information
- Application Number
- CN202410869011.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2025-04-11
AI Technical Summary
The existing in-vehicle communication network has significantly increased latency under dense networks and high load conditions, and the packet loss rate will also increase, which cannot meet the needs of modules with high latency sensitivity. At the same time, the access method based on scheduling is not flexible enough to meet the transmission needs of emergency data.
The communication method combining scheduling access strategy and competition access strategy is adopted. When a node needs to send periodic signals, the bus is accessed based on the scheduling access strategy, and when a node needs to send event signals, the bus is accessed based on the competition access strategy.
The scheduling access strategy reduces conflicts between periodic signals and event signals, and reduces bus load and data packet loss rate; the competition access strategy makes up for the inflexibility of the scheduling access strategy to meet the urgent data transmission needs.
Smart Images

Figure CN119814488A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a communication method, device, network system, vehicle and computer storage medium. Background Art
[0002] With the continuous development of technologies such as mobile Internet, cloud computing and intelligent driving, intelligent networked vehicles are becoming the future trend of the automotive industry in the new era. The development of intelligent networked vehicles has led to an exponential increase in the number of ECUs (Electronic Control Units), which has put forward higher requirements for the transmission, processing and application capabilities of vehicle data, and brought more challenges to the development of in-vehicle communication networks.
[0003] In the related technologies, in-vehicle networks with CAN, LIN, and Ethernet as the mainstream, a single node signal access method is usually adopted, such as a contention-based access method or a scheduling-based access method. However, the contention-based signal access method will significantly increase the latency and packet loss rate in dense networks and high loads, and cannot meet the needs of modules with high latency sensitivity; while the scheduling-based access method can only rely on a fixed order for data transmission, which is not flexible enough and cannot meet the transmission needs of urgent data. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a communication method, device, network system, vehicle and computer storage medium, which can help to improve the awareness of returning recyclable containers, thereby reducing the pollution to the environment caused by containers being discarded or not recycled in time.
[0005] In order to solve the above technical problems, the first aspect of the present invention discloses a communication method for a communication network, wherein the communication network includes a plurality of nodes, and the plurality of nodes communicate via a bus. The method includes:
[0006] When the first node needs to access the bus to transmit a first signal, if the first signal is a periodic signal, based on a scheduling access strategy, the first node is connected to the bus to transmit the first signal, and / or, if the first signal is an event signal, based on a contention access strategy, the first node is connected to the bus to transmit the first signal.
[0007] As an optional implementation manner, in the first aspect of the present invention, before the first node is connected to the bus to transmit the first signal based on the scheduling access policy, the method further includes:
[0008] When receiving an access request sent by a second node regarding a second signal and the second signal is an event-type signal, based on a contention access strategy, accessing the second node to the bus to transmit the second signal;
[0009] After the transmission of the second signal is completed, the operation of connecting the first node to the bus to transmit the first signal based on the scheduling access strategy is performed.
[0010] As an optional implementation manner, in the first aspect of the present invention, the accessing the first node to the bus to transmit the first signal based on the scheduling access strategy includes:
[0011] According to a preset access sequence corresponding to the first signal and a preset access duration corresponding to the first signal, the first node is connected to the bus to transmit the first signal.
[0012] As an optional embodiment, in the first aspect of the present invention, the preset access order is predetermined based on the priority corresponding to the first signal and / or the transmission period corresponding to the first signal, and / or the preset access duration is predetermined based on the preset data amount corresponding to the first signal.
[0013] As an optional implementation, in the first aspect of the present invention, the operation of accessing the first node to the bus to transmit the first signal based on the scheduling access policy is performed only when the bus is in an idle state.
[0014] As an optional implementation manner, in the first aspect of the present invention, the accessing the first node to the bus to transmit the first signal based on the contention access strategy includes:
[0015] According to the priority corresponding to the first signal, the first node is connected to the bus to transmit the first signal.
[0016] As an optional implementation, in the first aspect of the present invention, the operation of accessing the first node to the bus to transmit the first signal based on the contention access strategy is performed only when the bus is in an idle state.
[0017] As an optional embodiment, in the first aspect of the present invention, the method further comprises:
[0018] If the bus is in a non-idle state, counting is performed based on a backoff counter, and when a counting result of the backoff counter satisfies a preset counting condition, the first node is connected to the bus to transmit the first signal.
[0019] As an optional implementation manner, in the first aspect of the present invention, the backoff counter starts counting after the bus enters the idle state from the non-idle state.
[0020] As an optional embodiment, in the first aspect of the present invention, the counting result includes the counting duration, and the preset counting condition includes the counting duration reaching the preset counting duration; and / or, the counting result includes the counting times, and the preset counting condition includes the counting times reaching the preset counting times.
[0021] A second aspect of the present invention discloses an electronic device for use in a communication network, wherein the communication network includes a plurality of nodes, and the plurality of nodes communicate via a bus, wherein the device includes:
[0022] An access module is used for, when a first node needs to access the bus to transmit a first signal, if the first signal is a periodic signal, based on a scheduling access strategy, accessing the first node to the bus to transmit the first signal, and / or, if the first signal is an event-type signal, based on a contention access strategy, accessing the first node to the bus to transmit the first signal.
[0023] As an optional embodiment, in the second aspect of the present invention, the access module is also used to connect the second node to the bus to transmit the first signal based on a scheduling access strategy, when the second node needs to access the bus to transmit the second signal and the second signal is an event-type signal, connect the second node to the bus to transmit the second signal based on a competitive access strategy; when the second signal is transmitted, the operation of connecting the first node to the bus to transmit the first signal based on the scheduling access strategy is executed.
[0024] As an optional implementation manner, in the second aspect of the present invention, the specific manner in which the access module accesses the first node to the bus to transmit the first signal based on the scheduling access strategy includes:
[0025] According to a preset access sequence corresponding to the first signal and a preset access duration corresponding to the first signal, the first node is connected to the bus to transmit the first signal.
[0026] As an optional embodiment, in the second aspect of the present invention, the preset access order is predetermined based on the priority corresponding to the first signal and / or the transmission period corresponding to the first signal, and / or the preset access duration is predetermined based on the preset data amount corresponding to the first signal.
[0027] As an optional implementation, in the second aspect of the present invention, the operation of accessing the first node to the bus to transmit the first signal based on the scheduling access strategy is performed by the access module when the bus is in an idle state.
[0028] As an optional implementation manner, in the second aspect of the present invention, the specific manner in which the access module accesses the first node to the bus to transmit the first signal based on a contention access strategy includes:
[0029] According to the priority corresponding to the first signal, the first node is connected to the bus to transmit the first signal.
[0030] As an optional implementation, in the second aspect of the present invention, the operation of accessing the first node to the bus to transmit the first signal based on the contention access strategy is performed by the access module only when the bus is in an idle state.
[0031] As an optional implementation, in the second aspect of the present invention, the device further includes:
[0032] A counting module, wherein the counting module is used to count based on a backoff counter when the bus is in a non-idle state;
[0033] The access module is further configured to connect the first node to the bus to transmit the first signal when the counting result of the backoff counter meets a preset counting condition.
[0034] As an optional implementation manner, in the second aspect of the present invention, the backoff counter starts counting after the bus enters an idle state.
[0035] As an optional embodiment, in the second aspect of the present invention, the counting result includes the counting duration, and the preset counting condition includes the counting duration reaching the preset counting duration; and / or, the counting result includes the counting times, and the preset counting condition includes the counting times reaching the preset counting times.
[0036] A third aspect of the present invention discloses another electronic device, the device comprising a processor, the processor being coupled to a memory;
[0037] The processor calls the executable program code stored in the memory to execute the communication method disclosed in the first aspect of the present invention.
[0038] A fourth aspect of the present invention discloses a network system, the system comprising a communication network, and the system further comprising the electronic device disclosed in the second aspect of the present invention or the third aspect of the present invention.
[0039] A fifth aspect of the present invention discloses a vehicle, the vehicle comprising the electronic device disclosed in the second aspect of the present invention or the third aspect of the present invention, or the vehicle comprising the network system disclosed in the fourth aspect of the present invention.
[0040] A fourth aspect of the present invention discloses a computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the communication method disclosed in the first aspect of the present invention.
[0041] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0042] The embodiment of the present invention is used for a communication network, the communication network includes a plurality of nodes, the plurality of nodes communicate through a bus, when a first node needs to access the bus to transmit a first signal, if the first signal is a periodic signal, based on a scheduling access strategy, the first node is accessed to the bus to transmit the first signal, and / or, if the first signal is an event signal, based on a competitive access strategy, the first node is accessed to the bus to transmit the first signal. It can be seen that by implementing the present invention, the periodic signal is accessed to the bus based on the scheduling access strategy. It can be seen that the implementation of the present invention combines the scheduling access strategy with the competitive access strategy, when the node needs to send a periodic signal, the bus is accessed based on the scheduling access strategy, and when the node needs to send an event signal, the bus is accessed based on the competitive access strategy; due to the periodic transmission characteristics of the periodic signal, the use of the scheduling access strategy can reduce the occurrence of conflicts between periodic signals and between periodic signals and event signals, thereby reducing the bus load and the data packet loss rate, and the event signal trigger time is uncertain, and the use of a competitive access method can make up for the shortcomings of the scheduling access strategy that is not flexible enough, and meet the transmission requirements of urgent data. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 It is a schematic diagram of the architecture of a communication network disclosed in an embodiment of the present invention;
[0045] Figure 2 It is a flow chart of a communication method disclosed in an embodiment of the present invention;
[0046] Figure 3 It is a flowchart of another communication method disclosed in an embodiment of the present invention;
[0047] Figure 4It is a flowchart of a scheduling access process disclosed in an embodiment of the present invention;
[0048] Figure 5 It is a schematic diagram of a transmission time slot of a periodic signal disclosed in an embodiment of the present invention;
[0049] Figure 6 It is a flowchart of a competitive access process disclosed in an embodiment of the present invention;
[0050] Figure 7 is a structural schematic diagram of an electronic device disclosed in an embodiment of the present invention;
[0051] Figure 8 is a schematic structural diagram of another electronic device disclosed in an embodiment of the present invention;
[0052] Fig. 9 It is a structural schematic diagram of a network system disclosed in an embodiment of the present invention;
[0053] Fig.10 is a structural schematic diagram of a vehicle disclosed in an embodiment of the present invention;
[0054] Fig.11 It is a structural schematic diagram of another vehicle disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0056] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.
[0057] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0058] The present invention discloses a communication method, device, network system, vehicle and computer storage medium, which can combine the scheduling access strategy and the competition access strategy. When a node needs to send a periodic signal, it accesses the bus based on the scheduling access strategy. When a node needs to send an event signal, it accesses the bus based on the competition access strategy. Due to the periodic transmission characteristics of the periodic signal, the scheduling access strategy can reduce the occurrence of conflicts between periodic signals and between periodic signals and event signals, thereby reducing the bus load and the data packet loss rate. The event signal trigger time is uncertain, and the competitive access method can make up for the shortcomings of the scheduling access strategy that is not flexible enough to meet the transmission requirements of urgent data. The following are detailed descriptions.
[0059] In order to better understand the present invention, the application scenarios of the present invention are described below:
[0060] like Figure 1 As shown, the present invention can be applied to a communication network, which may include multiple nodes, and the multiple nodes can communicate through a bus. The communication network can be applied to various scenarios of multi-device communication, such as vehicle-mounted communication scenarios, whole-house smart control scenarios, logistics communication scenarios, etc., which are not limited by the embodiments of the present invention.
[0061] Taking the vehicle communication scenario as an example, the vehicle communication network can be constructed based on the EEA (Electrical / Electronic Architecture) architecture. Under the EEA architecture, each ECU (Electronic Control Unit) node, domain controller, and central control platform are used as carriers to enable each ECU node to achieve information sharing and control coordination. Optionally, the vehicle communication network can be CAN (Controller Area Network), LIN (Local Interconnect Network), or Ethernet, etc. Optionally, the vehicle communication network can adopt the OSI (Open System Interconnect) model. The MAC (Media Access Control) layer in the OSI model is used to connect each ECU node to the vehicle communication network. The MAC layer can connect the ECU node to the vehicle communication network based on a scheduling access strategy or a competitive access strategy.
[0062] Embodiment 1
[0063] See also Figure 2 , Figure 2 is a flow chart of a communication method disclosed in an embodiment of the present invention. Figure 2 The communication method described can be applied in a communication network, which may include a plurality of nodes, and the plurality of nodes may communicate via a bus. Figure 2 As shown, the communication method may include the following operations:
[0064] 101. When the first node needs to access the bus to transmit a first signal, if the first signal is a periodic signal, based on a scheduling access strategy, the first node is connected to the bus to transmit the first signal, and / or, if the first signal is an event signal, based on a contention access strategy, the first node is connected to the bus to transmit the first signal.
[0065] by Figure 1 For example, there are 7 nodes on the bus that need to send signals, among which nodes 1, 2, and 3 transmit periodic signals, and the remaining nodes 4, 5, 6, and 7 transmit event signals. Therefore, when nodes 1, 2, and 3 need to send periodic signals, based on the scheduling access strategy, nodes 1, 2, and 3 are connected to the bus to transmit the corresponding periodic signals; when nodes 4, 5, 6, and 7 need to send event signals, based on the contention access strategy, nodes 4, 5, 6, and 7 are connected to the bus to transmit the corresponding event signals.
[0066] It can be seen that the implementation of the embodiment of the present invention combines the scheduling access strategy with the contention access strategy. When a node needs to send a periodic signal, it accesses the bus based on the scheduling access strategy. When a node needs to send an event signal, it accesses the bus based on the contention access strategy. Due to the periodic transmission characteristics of periodic signals, the use of a scheduling access strategy can reduce the occurrence of conflicts between periodic signals and between periodic signals and event signals, thereby reducing the bus load and the data packet loss rate. However, the triggering time of an event signal is uncertain. The use of a contention access method can make up for the inflexibility of the scheduling access strategy and meet the transmission needs of urgent data.
[0067] Optional, such as Figure 1 As shown, the first signal includes identification information (such as Figure 1 The identification information includes an ID in the first signal and data to be transmitted in the first signal, and the identification information can be used to distinguish whether the first signal is a periodic signal or an event signal, wherein the periodic signal is sent according to the set period, and the event signal is sent when a related event is triggered. The frame type of the first signal is related to the communication protocol of the communication network. Taking the CAN protocol as an example, the first signal, that is, the frame type of the CAN message may include a data frame type. Optionally, the frame type of the CAN message may also include one or more of a remote frame type, an error frame type, and an overload frame type. Among them, the CAN message whose frame type is a data frame type contains an arbitration field and a data field. Optionally, the CAN message whose frame type is a data frame type may also include a frame start and a control field. Among them, the arbitration field contains identification information ID, and the data field contains data to be transmitted. Optionally, the arbitration field may also include a remote transmission request. Among them, the identification information is used to identify the content of the CAN message, such as the signal type of the CAN message. It can be seen that the convenience of signal type identification of the signal sent by the node can be easily identified through the identification information.
[0068] Optionally, the scheduling access strategy may be a TDMA (Time division multiple access) access strategy, and / or the contention access strategy may be a CSMA / CA (Carrier Sense Multiple Access With Collision Avoidance) access strategy.
[0069] Optionally, the operation of accessing the first node to the bus to transmit the first signal based on the scheduling access strategy is performed only when the bus is in an idle state, which can reduce the occurrence of conflicts caused by multiple node accesses.
[0070] Further optionally, if the first signal is a periodic signal, when the bus is in a non-idle state, the bus is monitored until the bus is monitored to enter an idle state, and then the above-mentioned scheduling access strategy is performed to connect the first node to the bus to transmit the first signal. This ensures that the periodic signal can still transmit the signal when the bus is busy, thereby reducing the packet loss rate.
[0071] As an optional implementation manner, based on the scheduling access strategy, accessing the first node to the bus to transmit the first signal may include:
[0072] According to a preset access sequence corresponding to the first signal and a preset access duration corresponding to the first signal, the first node is connected to the bus to transmit the first signal.
[0073] It can be seen that in this way, when a node needs to transmit a periodic signal, the node can be connected to the bus according to the preset access order and preset access duration, so that the periodic signal is transmitted in an orderly manner, the conflict of node access is reduced, and the reliability and accuracy of signal transmission are improved.
[0074] Optionally, the preset access order is predetermined based on the priority corresponding to the first signal and / or the transmission period corresponding to the first signal, and / or the preset access duration is predetermined based on the preset data volume corresponding to the first signal. This can improve the transmission efficiency of signals with higher priority, match the transmission period of the periodic signal with its trigger period, and ensure that there is sufficient time to transmit the completion signal, further improving the accuracy and reliability of signal transmission.
[0075] In an optional embodiment, before accessing the first node to the bus to transmit the first signal based on the scheduling access policy, the method may further include:
[0076] When the second node needs to access the bus to transmit the second signal and the second signal is an event-type signal, based on the contention access strategy, access the second node to the bus to transmit the second signal;
[0077] After the second signal is transmitted, the above-mentioned operation based on the scheduling access strategy is performed to connect the first node to the bus to transmit the first signal.
[0078] It can be seen that the implementation of this optional embodiment can give priority to accessing the node corresponding to the contention type signal when a transmission conflict occurs between the periodic signal and the contention type signal, thereby giving priority to transmitting the contention type signal, thereby improving the timeliness of event type signal transmission.
[0079] Optionally, the operation of accessing the first node to the bus to transmit the first signal based on the contention access strategy is performed only when the bus is in an idle state, which can reduce the occurrence of access conflicts caused by multiple nodes accessing the bus at the same time.
[0080] As another optional implementation, based on the contention access strategy, accessing the first node to the bus to transmit the first signal may include:
[0081] According to the priority corresponding to the first signal, the first node is connected to the bus to transmit the first signal.
[0082] Optionally, the first signal includes a priority corresponding to the first signal. Taking the CAN protocol as an example, the first signal, that is, the identification information of the CAN message, can also be used to define the priority of sending the CAN message.
[0083] In this optional implementation, optionally, according to the priority corresponding to the first signal, connecting the first node to the bus to transmit the first signal may include:
[0084] When the third node in the communication network also needs to access the bus to transmit a third signal, according to the priority corresponding to the first signal and the priority corresponding to the third signal, the first node and the third node are connected to the bus in sequence in the order corresponding to the corresponding priorities to transmit the first signal and the third signal.
[0085] Further optionally, according to the priority corresponding to the first signal and the priority corresponding to the third signal, sequentially connecting the first node and the third node to the bus in an order corresponding to the corresponding priorities to transmit the first signal and the third signal may include:
[0086] If the priority corresponding to the first signal is higher than the priority corresponding to the third signal, the first node is first connected to the bus to transmit the first signal, and after the first signal is transmitted, the third node is then connected to the bus to transmit the third signal;
[0087] If the priority corresponding to the first signal is lower than the priority corresponding to the third signal, the third node is first connected to the bus to transmit the third signal, and after the third signal is transmitted, the first node is connected to the bus to transmit the first signal.
[0088] In this way, when multiple nodes need to be accessed, the corresponding nodes are accessed in sequence according to the priority of the signal, thereby reducing node access conflicts and improving the transmission efficiency of signals with higher priorities.
[0089] In this optional implementation, optionally, the priority of the event-type signal is higher than the priority of the periodic signal, that is, when both the periodic signal and the event-type signal need to be transmitted, the event-type signal is transmitted first, and when the event-type signal is completely transmitted, the periodic signal is transmitted.
[0090] In this optional implementation manner, optionally, if the first signal is an event-type signal, the method may further include:
[0091] If other nodes except the first node do not need to access the bus to transmit signals, the bus is monitored, and when the bus is still in an idle state after monitoring a preset monitoring time, the first node is connected to the bus to transmit the first signal.
[0092] It can be seen that in this way, when the bus is idle, the node is still connected to the bus after listening for a period of time, thereby avoiding the situation where the bus is busy when a signal with a higher priority needs to be transmitted.
[0093] In another optional embodiment, the method may further include:
[0094] If the bus is in a non-idle state, counting is performed based on the backoff counter, and when the counting result of the backoff counter meets a preset counting condition, the first node is connected to the bus to transmit the first signal.
[0095] Optionally, the counting is performed based on the backoff counter, and when the counting result of the backoff counter satisfies a preset counting condition, the operation of connecting the first node to the bus to transmit the first signal is performed only when the first signal is an event-type signal.
[0096] Optionally, the backoff counter starts counting after the bus enters the idle state from the non-idle state.
[0097] Further optionally, the counting result may include a counting duration, and the preset counting condition may include that the counting duration reaches a preset counting duration; and / or, the counting result may include a counting number, and the preset counting condition may include that the counting number reaches a preset counting number.
[0098] Further optionally, the preset count number is a random number selected from the contention window corresponding to the bus.
[0099] Still further optionally, counting based on a backoff counter may include:
[0100] A preset count number is written into the backoff counter for countdown, and the preset count condition includes the backoff counter counting down to zero.
[0101] It can be seen that when the bus is in a non-idle state, a backoff count is performed after entering the idle state, and after the count is completed, the node is connected to transmit the event-type signal, thereby reducing the transmission conflict between the event-type signals.
[0102] Embodiment 2
[0103] See also Figure 3 , Figure 3 FIG. 1 is a flow chart of another communication method disclosed in an embodiment of the present invention. Figure 3The communication method described can be applied in a communication network, which may include a plurality of nodes, and the plurality of nodes may communicate via a bus. Figure 3 As shown, the communication method may include the following operations:
[0104] 201. Detect whether there is a node that needs to access the bus to transmit a signal.
[0105] 202. When it is detected that the first node needs to access the bus to transmit a first signal, if the first signal is an event-type signal, step 203 is triggered; if the first signal is a periodic signal, step 204 is triggered.
[0106] 203. Enter the contention access process for the first node.
[0107] 204. Detect whether there is a second node that needs to access the bus to transmit a second signal and the second signal is an event-type signal. If the detection result of step 204 is no, trigger the execution of step 205. If the detection result of step 204 is yes, trigger the execution of step 206.
[0108] 205. Enter the scheduling access process of the first node.
[0109] 206. The first node adopts a backoff process and enters a contention access process of the second node.
[0110] 207. After step 206 is completed, execute step 205.
[0111] It can be seen that the implementation of the embodiment of the present invention combines the scheduling access strategy with the contention access strategy. When a node needs to send a periodic signal, it accesses the bus based on the scheduling access strategy. When a node needs to send an event signal, it accesses the bus based on the contention access strategy. Due to the periodic transmission characteristics of periodic signals, the use of a scheduling access strategy can reduce the occurrence of conflicts between periodic signals and between periodic signals and event signals, thereby reducing the bus load and the data packet loss rate. However, the triggering time of an event signal is uncertain. The use of a contention access method can make up for the inflexibility of the scheduling access strategy and meet the transmission needs of urgent data.
[0112] In an optional embodiment, if Figure 4 As shown, Figure 4 FIG. 1 is a flow chart of a scheduling access process disclosed in an embodiment of the present invention. Figure 4 As shown, the scheduling access process may include the following operations:
[0113] 301. Detect whether the bus is in an idle state. If it is detected that the bus is in a non-idle state, trigger the execution of step 302. If it is detected that the bus is in an idle state, trigger the execution of step 303.
[0114] 302. Monitor the bus until it is detected that the bus enters an idle state.
[0115] 303. According to a preset access sequence corresponding to the first signal and a preset access duration corresponding to the first signal, connect the first node to the bus to transmit the first signal.
[0116] It can be seen that this allows periodic signals to be transmitted when the bus is idle. Due to the periodic transmission characteristics of periodic signals and the relatively fixed data transmission volume, we adopt a scheduling access strategy based on a preset access order and a preset access duration. Compared with the competitive access strategy, it can reduce the occurrence of conflicts.
[0117] For the preset access sequence and preset access duration corresponding to the first signal in step 303, please refer to Figure 5 , Figure 5 FIG. 1 is a schematic diagram of a transmission time slot of a periodic signal disclosed in an embodiment of the present invention. Figure 5 As shown, assuming that there are signals of 9 nodes such as E1, E2, and E3 that need to be transmitted during the bus transmission time T, then according to the priority corresponding to the signal and the preset data volume of the signal, the preset access order and preset access duration corresponding to the signals of different nodes can be set. For example, according to the priority corresponding to the signal of each node, the preset access order of each node is from E1, E2, E3...E9, where E1 is allocated two time slots on the bus according to the size of its signal data volume, and E2 is allocated one time slot on the bus according to the size of its signal data volume. By using this method of preset access duration and preset access order, the aggravation of conflicts when multiple nodes access at the same time when the network load is high can be reduced. In this way, the transmission efficiency of signals with higher priority can be improved, and the transmission cycle of the periodic signal can be matched with its trigger cycle, and sufficient time is ensured to complete the transmission of the signal, further improving the accuracy and reliability of signal transmission.
[0118] In an optional embodiment, if Figure 6 As shown, Figure 6 FIG. 1 is a flow chart of a competitive access process disclosed in an embodiment of the present invention. Figure 6 As shown, the competitive access process may include the following operations:
[0119] 401: Detect whether the bus is in an idle state. If the bus is detected to be in an idle state, trigger the execution of step 402. If the bus is detected to be in a non-idle state, trigger the execution of step 405.
[0120] 402: Detect whether there is a third node that needs to access the bus to transmit a third signal. If the detection result is yes, trigger the execution of step 403; if the detection result is no, trigger the execution of step 404.
[0121] 403. According to the priority corresponding to the first signal and the priority corresponding to the third signal, the first node and the third node are connected to the bus in sequence according to the order corresponding to the corresponding priorities to transmit the first signal and the third signal.
[0122] That is, if the priority corresponding to the first signal is higher than the priority corresponding to the third signal, the first node is first connected to the bus to transmit the first signal, and then the third node is connected to the bus to transmit the third signal; if the priority corresponding to the third node is higher than the priority corresponding to the first node, the third node is first connected to the bus to transmit the third node, and then the first node is connected to the bus to transmit the first signal.
[0123] 404 . Monitor the bus, and when the bus is still in an idle state after monitoring a preset monitoring time, connect the first node to the bus to transmit a first signal.
[0124] 405. Execute the CSMA / CA backoff algorithm, select a random number from the contention window corresponding to the bus and write it into the backoff counter.
[0125] 406. Once it is detected that the bus enters the idle state, start timing based on the backoff counter. If the bus is in the non-idle state, freeze the backoff counter.
[0126] 407. When the backoff counter counts to 0, connect the first node to the bus to transmit the first signal.
[0127] It can be seen that when encountering event-type signals, a competitive access strategy is used to connect the node to the bus. Taking into account the uncertainty of the triggering time of the event-type signal, the bus can be monitored through the CSMA / CA conflict avoidance mechanism to achieve conflict avoidance and reduce the packet loss rate.
[0128] Embodiment 3
[0129] See also Figure 7 , Figure 7 is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. Figure 7 The electronic device described may be applied in a communication network, which may include a plurality of nodes, and the plurality of nodes may communicate via a bus. Figure 7 As shown, the communication method may include:
[0130] Access module 501 is used to connect the first node to the bus to transmit the first signal based on a scheduling access strategy when the first node needs to transmit the first signal, if the first signal is a periodic signal, and / or, if the first signal is an event signal, based on a contention access strategy, connect the first node to the bus to transmit the first signal.
[0131] It can be seen that the implementation of the embodiment of the present invention combines the scheduling access strategy with the contention access strategy. When a node needs to send a periodic signal, it accesses the bus based on the scheduling access strategy. When a node needs to send an event signal, it accesses the bus based on the contention access strategy. Due to the periodic transmission characteristics of periodic signals, the use of a scheduling access strategy can reduce the occurrence of conflicts between periodic signals and between periodic signals and event signals, thereby reducing the bus load and the data packet loss rate. However, the triggering time of an event signal is uncertain. The use of a contention access method can make up for the inflexibility of the scheduling access strategy and meet the transmission needs of urgent data.
[0132] In an optional embodiment, the access module 501 is also used to connect the second node to the bus to transmit the second signal based on a contention access strategy before connecting the first node to the bus to transmit the first signal based on a scheduling access strategy, when the second node needs to transmit the second signal and the second signal is an event-type signal; when the second signal is transmitted, the above-mentioned operation of connecting the first node to the bus to transmit the first signal based on the scheduling access strategy is executed again.
[0133] It can be seen that the implementation of this optional embodiment can give priority to accessing the node corresponding to the contention type signal when a transmission conflict occurs between the periodic signal and the contention type signal, thereby giving priority to transmitting the contention type signal, thereby improving the timeliness of event type signal transmission.
[0134] In another optional embodiment, the specific manner in which the access module 501 accesses the first node to the bus to transmit the first signal based on the scheduling access strategy may include:
[0135] According to a preset access sequence corresponding to the first signal and a preset access duration corresponding to the first signal, the first node is connected to the bus to transmit the first signal.
[0136] It can be seen that in this way, when a node needs to transmit a periodic signal, the node can be connected to the bus according to the preset access order and preset access duration, so that the periodic signal is transmitted in an orderly manner, the conflict of node access is reduced, and the reliability and accuracy of signal transmission are improved.
[0137] In another optional embodiment, the preset access order is predetermined based on the priority corresponding to the first signal and / or the transmission period corresponding to the first signal, and / or the preset access duration is predetermined based on the preset data volume corresponding to the first signal. In this way, the transmission efficiency of the signal with a higher priority can be improved, and the transmission period of the periodic signal can be matched with its trigger period, and sufficient time is ensured to transmit the completion signal, further improving the accuracy and reliability of signal transmission.
[0138] In another optional embodiment, the operation of accessing the first node to the bus to transmit the first signal based on the scheduling access strategy is performed by the access module 501 when the bus is in an idle state, which can reduce the occurrence of access conflicts caused by multiple nodes accessing the bus at the same time.
[0139] In yet another optional embodiment, the specific manner in which the access module 501 accesses the first node to the bus to transmit the first signal based on the contention access strategy may include:
[0140] According to the priority corresponding to the first signal, the first node is connected to the bus to transmit the first signal.
[0141] In this way, when multiple nodes need to be accessed, the corresponding nodes are accessed in sequence according to the priority of the signal, thereby reducing node access conflicts and improving the transmission efficiency of signals with higher priorities.
[0142] In another optional embodiment, based on the competitive access strategy, the operation of accessing the first node to the bus to transmit the first signal is performed by the access module 501 only when the bus is in an idle state, which can reduce the occurrence of access conflicts caused by multiple nodes accessing the bus at the same time.
[0143] In yet another optional embodiment, the device may further include:
[0144] A counting module 502, the counting module 502 is used for counting based on a backoff counter when the bus is in a non-idle state;
[0145] The access module 501 is further configured to access the first node to the bus to transmit the first signal when the counting result of the backoff counter meets a preset counting condition.
[0146] In yet another optional embodiment, the backoff counter starts counting after the bus enters the idle state from the non-idle state.
[0147] In another optional embodiment, the counting result may include a counting duration, and the preset counting condition may include the counting duration reaching a preset counting duration; and / or, the counting result may include a counting number, and the preset counting condition may include the counting number reaching a preset counting number.
[0148] It can be seen that when the bus is in a non-idle state, a backoff count is performed after entering the idle state, and after the count is completed, the node is connected to transmit the event-type signal, thereby reducing the transmission conflict between the event-type signals.
[0149] Embodiment 4
[0150] See also Figure 8 , Figure 8FIG. 1 is a schematic diagram of the structure of another electronic device disclosed in an embodiment of the present invention. Figure 8 As shown, the electronic device may include a processor 601, and the processor 601 is connected to a memory;
[0151] The processor 601 calls the executable program code stored in the memory to execute the steps of the communication method described in the first embodiment of the present invention or the second embodiment of the present invention.
[0152] Embodiment 5
[0153] See also Fig. 9 , Fig. 9 Schematic diagram of a network system disclosed in an embodiment of the present invention. Fig. 9 As shown, the network system includes a communication network, and the network system also includes the electronic device described in Embodiment 3 of the present invention or Embodiment 4 of the present invention.
[0154] Embodiment 6
[0155] See also Fig.10 , Fig.10 is a schematic diagram of the structure of a vehicle disclosed in an embodiment of the present invention, such as Fig.10 As shown, the vehicle may include the electronic device described in the third embodiment of the present invention or the fourth embodiment of the present invention.
[0156] Embodiment 7
[0157] Please see Fig.11 , Fig.11 is a schematic diagram of the structure of another vehicle disclosed in an embodiment of the present invention, such as Fig.11 As shown, the vehicle may include the network system described in Embodiment 5 of the present invention.
[0158] Embodiment 8
[0159] An embodiment of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the steps in the communication method described in the first embodiment of the present invention or the second embodiment of the present invention.
[0160] Embodiment 9
[0161] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps in the communication method described in Embodiment 1 or Embodiment 2.
[0162] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.
[0163] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, a magnetic disk storage, a magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0164] Finally, it should be noted that the communication method, device, vehicle network system, vehicle and medium disclosed in the embodiments of the present invention are only preferred embodiments of the present invention, which are only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A communication method, used in a communication network, characterized in that: The communication network includes a plurality of nodes, the plurality of nodes communicate via a bus, and the method includes: When the first node needs to access the bus to transmit a first signal, if the first signal is a periodic signal, based on a scheduling access strategy, the first node is connected to the bus to transmit the first signal, and / or, if the first signal is an event signal, based on a contention access strategy, the first node is connected to the bus to transmit the first signal.
2. The method according to claim 1, characterized in that Before accessing the first node to the bus to transmit the first signal based on the scheduling access strategy, the method further includes: When a second node needs to access the bus to transmit a second signal and the second signal is an event-type signal, based on a contention access strategy, access the second node to the bus to transmit the second signal; After the transmission of the second signal is completed, the operation of connecting the first node to the bus to transmit the first signal based on the scheduling access strategy is performed.
3. The method according to claim 1 or 2, characterized in that: The step of accessing the first node to the bus to transmit the first signal based on the scheduling access strategy includes: According to a preset access sequence corresponding to the first signal and a preset access duration corresponding to the first signal, the first node is connected to the bus to transmit the first signal.
4. The method according to claim 3, characterized in that The preset access order is predetermined based on the priority corresponding to the first signal and / or the transmission period corresponding to the first signal, and / or the preset access duration is predetermined based on the preset data amount corresponding to the first signal.
5. The method according to any one of claims 1 to 4, characterized in that The operation of accessing the first node to the bus to transmit the first signal based on the scheduling access policy is performed only when the bus is in an idle state.
6. The method according to any one of claims 1 to 5, characterized in that The step of accessing the first node to the bus to transmit the first signal based on a contention access strategy includes: According to the priority corresponding to the first signal, the first node is connected to the bus to transmit the first signal.
7. The method according to any one of claims 1 to 6, characterized in that The operation of accessing the first node to the bus to transmit the first signal based on the contention access strategy is performed only when the bus is in an idle state.
8. The method according to claim 7, characterized in that The method further comprises: If the bus is in a non-idle state, counting is performed based on a backoff counter, and when a counting result of the backoff counter satisfies a preset counting condition, the first node is connected to the bus to transmit the first signal.
9. The method according to claim 8, characterized in that The backoff counter starts counting after the bus enters an idle state from the non-idle state.
10. The method according to claim 9, characterized in that The counting result includes a counting duration, and the preset counting condition includes that the counting duration reaches a preset counting duration; and / or, the counting result includes a counting number, and the preset counting condition includes that the counting number reaches a preset counting number.
11. An electronic device, characterized in that: The apparatus includes a processor coupled to a memory; The processor calls the executable program code stored in the memory to execute the communication method according to any one of claims 1 to 10.
12. A network system, characterized in that: The system includes a communication network, and the system also includes the electronic device as claimed in claim 11.
13. A vehicle, characterized in that: The vehicle includes the electronic device according to claim 11 or the network system according to claim 12 .
14. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the communication method according to any one of claims 1 to 10.