Communication flow control method, device, equipment and medium

By setting the thread scheduling component in the communication control node to detect the normality of the scheduling cycle and performing data discarding when an exception is detected, the buffer overflow problem caused by scheduling cycle deviation in the autonomous driving system is solved, and the system availability and stability are achieved.

CN119653516APending Publication Date: 2025-03-18IMOTION AUTOMOTIVE TECH (SUZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When the autonomous driving system switches different modes, the scheduling period in communication management deviates from the preset value, causing buffer overflow, affecting communication between applications, and causing the system to be unavailable.

Method used

By setting up a thread scheduling component in the communication control node, the normality of the scheduling cycle is detected. If a scheduling exception is detected, the data blocks in the preset position are discarded based on the information carried in the target message to ensure the stability of data communication.

Benefits of technology

Data flow control in the case of scheduling abnormalities is realized, buffer overflow is avoided, and system availability and stability are guaranteed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119653516A_ABST
    Figure CN119653516A_ABST
Patent Text Reader

Abstract

The invention discloses a communication flow control method and device, equipment and a medium, relates to the technical field of communication, and is applied to a communication control node, the communication control node establishes communication connection with a sending end node and a receiving end node, and the receiving end node is internally provided with a thread scheduling component. Comprising the following steps: storing a data block sent by a sending end node in a current scheduling period to a preset position; obtaining a target message sent by the receiving end node based on a detection result after the receiving end node detects the current scheduling period by using the thread scheduling component to obtain the detection result; the detection result is normal scheduling or scheduling delay or scheduling skipping; if the target message represents that the current scheduling is normal, taking out a corresponding data block from a preset position and sending the data block to a receiving end node; and if the target message represents that the current scheduling is abnormal, discarding the corresponding number of data blocks in the preset position based on the information carried in the target message. Communication flow control of the whole system can be realized to ensure availability and stability of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a communication flow control method, device, equipment and medium. Background Art

[0002] After implementing execution management based on AUTOSAR AP (AUTOSAR Adaptive Platform, where AUTOSAR stands for AUTomotive Open System Architecture, which represents the open system architecture for automotive software. This is an industry standard that aims to define an open, scalable and standardized architecture for automotive electronic software), when the autonomous driving system switches between different modes, such as driving mode and parking mode, it will dynamically adjust the scheduling priorities specific to driving and parking.

[0003] For example, in order to prioritize the needs of key functions in driving mode, such as vehicle driving control and safety monitoring, the system will automatically allocate major resources to driving-related applications to ensure the driver's control of the vehicle and driving safety, while the priority of parking-related applications will be reduced to avoid them occupying too many resources and affecting driving functions. In this way, for centralized communication management, such as shared memory communication, the actual scheduling cycle of communication threads between different processes will deviate from the preset value, resulting in buffer overflow, which in turn affects communication between applications and causes system unavailability.

[0004] In summary, how to implement communication flow control of the entire system to ensure the availability and stability of the system is a problem that needs to be solved. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a communication flow control method, device, equipment and medium, which can realize the communication flow control of the entire system to ensure the availability and stability of the system. The specific scheme is as follows:

[0006] In a first aspect, the present application discloses a communication flow control method, which is applied to a communication control node, wherein the communication control node establishes communication connections with a sending node and a receiving node respectively, and a thread scheduling component is provided inside the receiving node, and the method comprises:

[0007] Storing the data blocks sent by the sending node in the current scheduling period to a preset location;

[0008] Obtaining a target message sent by the receiving end node; wherein the target message is a message sent by the receiving end node based on the detection result after the receiving end node detects the current scheduling period using the thread scheduling component and obtains the detection result; the detection result is any one of normal scheduling, delayed scheduling, and skipped scheduling;

[0009] If the target message is used to indicate that the current scheduling is normal, then taking out the corresponding data block from the preset position and sending it to the receiving end node;

[0010] If the target message is used to characterize the current scheduling abnormality, a corresponding number of data blocks in the preset position are discarded based on the information carried in the target message.

[0011] Optionally, the process in which the receiving end node detects the current scheduling period based on the thread scheduling component includes:

[0012] Obtaining the current system time and determining whether the current system time is consistent with the expected scheduling time; the expected scheduling time is calculated based on the end time of the previous scheduling period and the preset scheduling period;

[0013] If the current system time is consistent with the expected scheduling time, it is determined that the current scheduling is normal, and a target message for indicating that the current scheduling is normal is sent to the communication control node;

[0014] If the current system time is inconsistent with the expected scheduling time, it is determined whether there is a scheduling skip event in the current scheduling period based on the time difference between the current system time and the expected scheduling time. If so, the current scheduling is determined to be abnormal, and a target message for characterizing the current scheduling abnormality is sent to the communication control node.

[0015] Optionally, judging whether there is a scheduling skip event in the current scheduling period based on the time difference between the current system time and the expected scheduling time includes:

[0016] Calculate the time difference between the current system time and the expected scheduling time, and determine whether the time difference is greater than the preset scheduling period;

[0017] If the time difference is greater than the preset scheduling period, it is determined that there is a scheduling skip event in the current scheduling period; if the time difference is not greater than the preset scheduling period, it is determined that there is no scheduling skip event in the current scheduling period and there is a scheduling delay event.

[0018] Optionally, obtaining the target message sent by the receiving node includes:

[0019] If the current scheduling period is scheduled normally, obtaining the target message sent by the receiving end node at the expected scheduling time, so as to take out the corresponding data block from the preset position and send it to the receiving end node;

[0020] If there is a scheduling delay event in the current scheduling period, the target message sent by the receiving node at the current system time is obtained to take out the corresponding data block from the preset position and send it to the receiving node; the current system time is later than the expected scheduling time.

[0021] Optionally, the preset location includes a first queue for receiving data of the sending end node, a second queue for storing data to be sent to the receiving end node, and a third queue for storing data that has been sent to the receiving end node;

[0022] Accordingly, storing the data block sent by the transmitting node in the current scheduling period to a preset location includes:

[0023] receiving, in the current scheduling period, data blocks sent by the transmitting end node using the first queue, and copying the data blocks stored in the first queue to the second queue for storage;

[0024] Correspondingly, after taking out the corresponding data block from the preset position and sending it to the receiving end node, the method further includes:

[0025] copying the data blocks in the second queue that have been sent to the receiving end to the third queue;

[0026] After obtaining the data release instruction sent by the receiving end node, the data blocks stored in the third queue are released; wherein the data release instruction is an instruction sent by the receiving end node to the communication control node after completing processing of the obtained data blocks.

[0027] Optionally, the discarding a corresponding number of data blocks in the preset position based on the information carried in the target message includes:

[0028] Determine a message carried in the target message for indicating the number of scheduling cycle skips;

[0029] The data blocks corresponding to the number of times the scheduling cycle is skipped stored in the first queue, the second queue and the third queue are discarded respectively according to the storage order of the data blocks from first to last.

[0030] Optionally, the process of discarding a corresponding number of data blocks in the preset position based on the information carried in the target message further includes:

[0031] If a message sent by the receiving node indicating that scheduling has returned to normal is received, the step of discarding a corresponding number of data blocks in the preset position based on the information carried in the target message is stopped.

[0032] In a second aspect, the present application discloses a communication flow control device, which is applied to a communication control node, wherein the communication control node establishes communication connections with a sending end node and a receiving end node respectively, and a thread scheduling component is provided inside the receiving end node, and the device comprises:

[0033] A data storage module, used for storing the data blocks sent by the sending end node in the current scheduling period to a preset location;

[0034] A message acquisition module, used to acquire a target message sent by the receiving end node; wherein the target message is a message sent by the receiving end node based on the detection result after the receiving end node detects the current scheduling period using the thread scheduling component and obtains the detection result; the detection result is any one of normal scheduling, delayed scheduling and skipped scheduling;

[0035] A data sending module, configured to fetch a corresponding data block from the preset position and send the data block to the receiving node if the target message is used to indicate that the current scheduling is normal;

[0036] The data discarding module is used to discard a corresponding number of data blocks in the preset position based on the information carried in the target message if the target message is used to characterize the current scheduling abnormality.

[0037] In a third aspect, the present application discloses an electronic device, comprising:

[0038] Memory, used to store computer programs;

[0039] The processor is used to execute the computer program to implement the steps of the communication flow control method disclosed above.

[0040] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the communication flow control method disclosed above are implemented.

[0041] It can be seen that the present application discloses a communication flow control method applied to a communication control node, wherein the communication control node establishes communication connections with a sending node and a receiving node respectively, and a thread scheduling component is arranged inside the receiving node, and firstly stores the data block sent by the sending node in the current scheduling period to a preset position; obtains the target message sent by the receiving node; wherein the target message is a message sent by the receiving node based on the detection result after the receiving node detects the current scheduling period by using the thread scheduling component and obtains the detection result; the detection result is any one of normal scheduling, delayed scheduling and skipped scheduling; if the target message is used to characterize that the current scheduling is normal, the corresponding data block is taken out from the preset position and sent to the receiving node; if the target message is used to characterize that the current scheduling is abnormal, the corresponding number of data blocks in the preset position are discarded based on the information carried in the target message.

[0042] Beneficial effects: The scheme in the present application is applied to the communication control node in the system, and the communication control node is used to undertake functions such as data transfer, data management and flow control coordination in the system. Specifically, the communication control node establishes communication connections with the sending node and the receiving node respectively, and a thread scheduling component is set inside the receiving node. First, the communication control node stores the data block sent by the sending node in the current scheduling period to a preset position, and obtains the target message sent by the receiving node. The receiving node detects the current scheduling period based on the thread scheduling component set inside it, so as to send a target message to the communication control node based on the detection result after the detection is completed, which is used to characterize the current scheduling as normal or abnormal; wherein the detection result is any one of normal scheduling, delayed scheduling and skipped scheduling. If the target message received by the communication control node is used to characterize that the current scheduling is normal, the corresponding data block is taken out from the preset position and sent to the receiving node so that normal data communication can be carried out between the sending node and the receiving node. If the target message received by the communication control node is used to characterize that the current scheduling is abnormal, the corresponding number of data blocks in the preset position are discarded based on the information carried in the target message, thereby ensuring that in the event of abnormal scheduling, the data accumulation and overflow caused by the untimely processing of the receiving node can be released in time, thereby ensuring the stability of communication, avoiding the impact of problems such as message overflow on the communication of the entire system, and ensuring the availability and stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0044] Figure 1 A flow chart of a communication flow control method disclosed in this application;

[0045] Figure 2 A timing diagram of a scheduling cycle disclosed in this application;

[0046] Figure 3 A schematic diagram of a scheduling delay and scheduling skip disclosed in this application;

[0047] Figure 4 A schematic diagram of a communication process disclosed in this application;

[0048] Figure 5 A schematic diagram of the structure of a communication flow control device disclosed in this application;

[0049] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. 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 making creative work are within the scope of protection of the present invention.

[0051] After the execution management is currently implemented based on Autosar AP, when the autonomous driving system switches between different modes, the scheduling priorities specific to driving and parking are dynamically adjusted. As a result, for centralized communication management, such as shared memory communication, the actual scheduling period for communication threads between different processes will deviate from the preset value, resulting in buffer overflow, which in turn affects communication between applications and causes the system to be unavailable. To this end, a communication flow control method, device, equipment, and medium are provided, which can realize the communication flow control of the entire system to ensure the availability and stability of the system.

[0052] See also Figure 1 As shown, an embodiment of the present application discloses a communication flow control method, which is applied to a communication control node, wherein the communication control node establishes communication connections with a sending end node and a receiving end node respectively, and a thread scheduling component is provided inside the receiving end node. The method includes:

[0053] Step S11: storing the data blocks sent by the sending node in the current scheduling period to a preset location.

[0054] In this embodiment, the function of the communication control node is first introduced. The communication control node is used in the system to undertake functions such as data transfer, data management and flow control coordination. Specifically, the communication control node establishes communication connections with the sending node and the receiving node respectively, and a thread scheduling component is set inside the receiving node.

[0055] Among them, the sending node and the receiving node will communicate with each other. During normal communication, the sending node will obtain the data block from the shared memory pool and increase its reference count, and then send the data block to the communication control node for storage, and then forward the data to the receiving node. Therefore, first, the communication control node will store the data block sent by the sending node in the current scheduling period to the preset location.

[0056] Step S12: Obtain a target message sent by the receiving node; wherein the target message is a message sent by the receiving node based on the detection result after the receiving node detects the current scheduling cycle using the thread scheduling component and obtains the detection result; the detection result is any one of normal scheduling, delayed scheduling and skipped scheduling.

[0057] In this embodiment, the communication control node also needs to obtain the target message sent by the receiving node. Specifically, the receiving node will detect the current scheduling cycle based on the thread scheduling component set internally, so as to send a target message to the communication control node based on the detection result after the detection is completed, which is used to characterize the current scheduling as normal or abnormal; wherein the detection result is specifically any one of normal scheduling, delayed scheduling and skipped scheduling. Specifically, when the communication is normal, the receiving node will periodically poll the data blocks stored in the communication control node, so as to actively discover the newly arrived data blocks and take them away in time for processing. Therefore, when the scheduling is normal, the target message can also be understood as a polling request sent by the receiving node.

[0058] In a specific implementation, the process by which the receiving end node detects the current scheduling cycle based on the thread scheduling component includes: obtaining the current system time, and determining whether the current system time is consistent with the expected scheduling time; the expected scheduling time is calculated based on the end time of the previous scheduling cycle and the preset scheduling cycle; if the current system time is consistent with the expected scheduling time, then the current scheduling is determined to be normal, and a target message used to characterize the normal current scheduling is sent to the communication control node; if the current system time is inconsistent with the expected scheduling time, then based on the time difference between the current system time and the expected scheduling time, it is determined whether there is a scheduling skip event in the current scheduling cycle; if so, then the current scheduling is determined to be abnormal, and a target message used to characterize the abnormal current scheduling is sent to the communication control node.

[0059] First of all, it should be pointed out that this embodiment introduces a time-driven thread scheduling component in each process, which can predict the next scheduling time according to the system time. At the same time, this application sets a variable scheduling period to ensure that the scheduling time of each thread is stable as a fixed period. Figure 2 As shown, Figure 2 The timing diagram describes the time-driven activation and activation cycle and delay of communication threads and application threads of different applications. The diagram includes the scheduling and alignment of communication threads and application threads of multiple applications (application A, application B, application C) on the time grid. Among them, the time grid is activated according to a fixed period. For example, threads with a period of 20ms, 50ms, and 100ms will be activated at the corresponding time point. Each activation moment, such as period 1 and period 2, represents a time point in ms.

[0060] according to Figure 2It can be seen that the scheduling period of the communication thread of application A is 20ms; the scheduling period of the communication thread of application B is 20ms, and the initial delay is 10ms; the scheduling period of the communication thread of application C is 20ms, and it starts late; the scheduling period of the application thread of application A is 50ms; the scheduling period of the application thread of application B is 100ms, and the delay is 20ms. It can be understood that each application thread and communication thread has an initial activation. For example, the communication thread of application A and the communication thread of application B are triggered at the beginning, and the activation will be triggered on time based on the time period or delay, while the communication thread of application B and the application thread of application B have delays, which will affect their subsequent activation moments. For example, the initial delay of the communication thread of application B is 10ms, causing its activation time to be slightly delayed than the expected time point. And in the case of delay, it can still follow the time grid alignment, such as the application thread of application B is delayed by 20ms, but it can be aligned with the communication thread of application A at the 20ms, thereby ensuring that all activation tasks are aligned in a unified time grid, which reflects that the thread scheduling component can effectively ensure the stability of the scheduling time when processing tasks with different cycles and delays. Furthermore, when tasks are delayed, time drift occurs, for example, the scheduling drift of the application B communication thread at 50ms reflects its 10ms delay relative to the application A communication thread.

[0061] Therefore, according to Figure 2 The settings in can detect abnormalities in the current scheduling cycle. Specifically, the receiving node needs to obtain the current system time and determine whether the current system time is consistent with the expected scheduling time. Among them, the expected scheduling time can be calculated based on the end time of the previous scheduling cycle and the preset scheduling cycle. For example, assuming that the end of the previous scheduling cycle is 100ms, and the scheduling cycle is 20ms, then the expected scheduling time should be 100ms+20ms, that is, 120ms. This embodiment determines whether the current scheduling cycle is normal by judging whether the current system time is consistent with the expected scheduling time.

[0062] In a specific embodiment, if the current system time is consistent with the expected scheduling time, that is, the current system time is also 120ms, then it is determined that the current scheduling is normal, and a target message for indicating that the current scheduling is normal is sent to the communication control node.

[0063] In another specific embodiment, if the current system time is inconsistent with the expected scheduling time, for example, assuming that the current system time is 130ms, which is later than the expected scheduling time, it is further determined whether there is a scheduling skip event in the current scheduling period based on the time difference between the current system time and the expected scheduling time. If there is a scheduling skip event, the current scheduling is determined to be abnormal, and a target message for characterizing the current scheduling abnormality is sent to the communication control node.

[0064] In a specific implementation, the above-mentioned determination of whether there is a scheduling skip event in the current scheduling period based on the time difference between the current system time and the expected scheduling moment includes: calculating the time difference between the current system time and the expected scheduling moment, and determining whether the time difference is greater than the preset scheduling period; if the time difference is greater than the preset scheduling period, it is determined that there is a scheduling skip event in the current scheduling period, and if the time difference is not greater than the preset scheduling period, it is determined that there is no scheduling skip event in the current scheduling period, and there is a scheduling delay event. That is, the present application needs to determine whether the time difference between the previous system time and the expected scheduling moment is greater than the preset scheduling period. If the time difference is greater than the preset scheduling period, it means that the current delay time has exceeded a complete period, so it is determined that there is a scheduling skip event in the current scheduling period. If the time difference is not greater than the preset scheduling period, it is determined that although there is no scheduling skip event in the current scheduling period, since it is later than the expected scheduling moment, there is currently a scheduling delay event.

[0065] Therefore, the above scheme can detect the situation of scheduling delay or scheduling skipping, such as Figure 3 As shown, Figure 3 The scheduling period of the task is 20ms, but due to exceeding the time budget or other reasons, the task is delayed at some moments, such as period 2 and period 5, and there is a scheduling skip in period 4.

[0066] Specifically, the above-mentioned obtaining of the target message sent by the receiving end node includes: if the current scheduling period is scheduled normally, obtaining the target message sent by the receiving end node at the expected scheduling time, so as to take out the corresponding data block from the preset position and send it to the receiving end node; if there is a scheduling delay event in the current scheduling period, obtaining the target message sent by the receiving end node at the current system time, so as to take out the corresponding data block from the preset position and send it to the receiving end node; the current system time is later than the expected scheduling time.

[0067] First of all, it should be pointed out that for the sending end node and the communication control node, although there may be a scheduling delay, the data processing and storage mechanism in the communication control node remains normal. The data stored in the preset position needs to wait for the receiving end node to process according to the adjusted scheduling time, and the sending end node, because it does not perceive the delay of the receiving end node, will continue to interact with the communication control node at its original rhythm under the normal communication mechanism, including continuing to send new data blocks. Therefore, under normal communication conditions, the sending end node will send the corresponding data block to the communication control node in each scheduling period, and the communication control node will temporarily store it. If the current scheduling period is scheduled normally, the target message sent by the receiving end node at the expected scheduling time is obtained to retrieve the corresponding data block from the preset position and send it to the receiving end node. If there is a scheduling delay event in the current scheduling period, the target message sent by the receiving end node at the current system time is obtained to retrieve the corresponding data block from the preset position and send it to the receiving end node, and the current system time here is later than the expected scheduling time.

[0068] Step S13: If the target message is used to indicate that the current scheduling is normal, the corresponding data block is taken out from the preset position and sent to the receiving end node.

[0069] In this embodiment, if the target message received by the communication control node is used to indicate that the current scheduling is normal, the corresponding data block is taken out from the preset position and sent to the receiving end node, so that normal data communication is performed between the sending end node and the receiving end node.

[0070] Step S14: If the target message is used to characterize the current scheduling abnormality, a corresponding number of data blocks in the preset position are discarded based on the information carried in the target message.

[0071] In this embodiment, if the target message received by the communication control node is used to characterize the current scheduling abnormality, a corresponding number of data blocks in the preset position are discarded based on the information carried in the target message, thereby ensuring that in the event of a scheduling abnormality, the data accumulation and overflow caused by the untimely processing of the receiving node can be released in time, thereby ensuring the stability of communication, avoiding the impact of problems such as message overflow on the entire system communication, and ensuring the availability and stability of the system.

[0072] It can be seen that the scheme in the present application is applied to the communication control node in the system, and the communication control node is used in the system to undertake functions such as data transfer, data management and flow control coordination. Specifically, the communication control node establishes communication connections with the sending node and the receiving node respectively, and a thread scheduling component is set inside the receiving node. First, the communication control node stores the data block sent by the sending node in the current scheduling period to a preset position, and obtains the target message sent by the receiving node. The receiving node detects the current scheduling period based on the thread scheduling component set inside it, so as to send a target message to the communication control node based on the detection result after the detection is completed, which is used to characterize the current scheduling as normal or abnormal; wherein the detection result is any one of normal scheduling, delayed scheduling and skipped scheduling. If the target message received by the communication control node is used to characterize that the current scheduling is normal, the corresponding data block is taken out from the preset position and sent to the receiving node so that normal data communication can be carried out between the sending node and the receiving node. If the target message received by the communication control node is used to characterize that the current scheduling is abnormal, the corresponding number of data blocks in the preset position are discarded based on the information carried in the target message, thereby ensuring that in the event of abnormal scheduling, the data accumulation and overflow caused by the untimely processing of the receiving node can be released in time, thereby ensuring the stability of communication, avoiding the impact of problems such as message overflow on the communication of the entire system, and ensuring the availability and stability of the system.

[0073] In a specific embodiment, the above-mentioned preset position specifically includes a first queue for receiving data from the sending end node, a second queue for storing data to be sent to the receiving end node, and a third queue for storing data that has been sent to the receiving end node; accordingly, storing the data block sent by the sending end node in the current scheduling period to the preset position includes: using the first queue to receive the data block sent by the sending end node in the current scheduling period, and copying the data block stored in the first queue to the second queue for storage; accordingly, after taking out the corresponding data block from the preset position and sending it to the receiving end node, it also includes: copying the data block that has been sent to the receiving end in the second queue to the third queue; after obtaining the data release instruction sent by the receiving end node, releasing the data block stored in the third queue; wherein the data release instruction is an instruction sent by the receiving end node to the communication control node after completing processing the obtained data block.

[0074] like Figure 4As shown, the above process is explained by taking the sending node as application A and the receiving node as application B as an example. First, a module for receiving data from application A and a module for sending data to application B are set in the communication control node, which specifically involves a first queue for receiving data from application A, a second queue for storing data to be sent to application B, and a third queue for storing data that has been sent to application B. Specifically, when the communication control node calls the update function through the interface, the data is copied from the first queue to the second queue, and application B can obtain the data it wants to take from the second queue; when the communication control node calls the cleanup function through the interface, the data is copied from the second queue to the third queue, and the communication control node releases the data block from the third queue only after application B has finished using the data. Among them, when application B has finished using the data, it will notify the communication control node and application A through the release reference count function that the data has been used up and can be released normally, and the corresponding number of references will be released.

[0075] When the priority of application B is lowered, application B cannot process the data in the second queue in time, resulting in accumulation until overflow. At the same time, the data that application B has taken away cannot be processed in time, resulting in the number of references in the third queue not being released in time, causing the data blocks maintained in application A to continue to increase until no new data blocks can be obtained. Therefore, when the priority of application B is lowered, resulting in the sending of a scheduling skip event, the application needs to release the data blocks stored in the communication control node in time.

[0076] Specifically, the above-mentioned discarding of a corresponding number of data blocks in the preset position based on the information carried in the target message includes: determining the message carried in the target message for representing the number of scheduling cycle skipping times; discarding the number of data blocks corresponding to the number of scheduling cycle skipping times stored in the first queue, the second queue and the third queue respectively according to the storage order of the data blocks from first to last. That is, when sending a scheduling skip event, application B can report the number of skipped scheduling times, that is, the number of scheduling cycle skipping times, to the communication control node through the ReportMissingCounter() interface, and the communication control node calls the DropData() interface according to the obtained number to notify the internal related modules of the number of data blocks that need to be discarded. Specifically, application B can determine the number of scheduling cycle skipping times based on the integer multiple relationship between the time difference between the current system time and the expected scheduling moment and the preset scheduling cycle, such as Figure 3 As shown, cycle 4 should be triggered at the expected scheduling time 70ms, but assuming that the current system time is 95ms, the time difference is 25ms, which is twice the scheduling cycle 20ms, which means that the number of currently skipped scheduling cycles is 1.

[0077] In addition, when discarding data blocks, the data blocks corresponding to the number of skipped times of the scheduling cycle stored in the first queue, the second queue and the third queue need to be discarded according to the storage order of the data blocks from first to last. That is, the earliest corresponding number of data blocks need to be discarded from the first queue according to the sequenceno of the data blocks, so as to ensure that no more data blocks are forwarded to application B; the earliest corresponding number of data blocks need to be discarded from the second queue according to the sequenceno of the data blocks, so as to reduce the data blocks that application B needs to process; the corresponding number of data blocks need to be released from the third queue according to the sequenceno of the data blocks, so as to ensure that the data blocks that are not processed by application B in time are released in time, so as to ensure that the data blocks in application A can be released in time.

[0078] Furthermore, the above process of discarding a corresponding number of data blocks in the preset position based on the information carried in the target message also includes: if a message sent by the receiving node is received to indicate that the scheduling has returned to normal, then the step of discarding a corresponding number of data blocks in the preset position based on the information carried in the target message is stopped. That is, when application B restores normal scheduling priority, application B can report the number of times scheduling has not been skipped to the communication control node through ReportMissingCounter(), indicating that the current scheduling has returned to normal, and the communication control node stops the above operation.

[0079] Through the above solution, the communication control node realizes the flow control of the subsequent application A sending message data, and at the same time promptly releases the message data that could not be released in time due to the untimely processing of application B, thereby ensuring the stability of communication and preventing message overflow from affecting the communication of the entire system.

[0080] See also Figure 5 As shown, the embodiment of the present application discloses a communication flow control device, which is applied to a communication control node, wherein the communication control node establishes communication connections with a sending end node and a receiving end node respectively, and a thread scheduling component is provided inside the receiving end node. The device includes:

[0081] The data storage module 11 is used to store the data blocks sent by the sending node in the current scheduling period to a preset location;

[0082] The message acquisition module 12 is used to acquire the target message sent by the receiving end node; wherein the target message is a message sent by the receiving end node based on the detection result after the thread scheduling component detects the current scheduling period and obtains the detection result; the detection result is any one of normal scheduling, delayed scheduling and skipped scheduling;

[0083] A data sending module 13, configured to fetch a corresponding data block from the preset position and send the data block to the receiving node if the target message is used to indicate that the current scheduling is normal;

[0084] The data discarding module 14 is configured to discard a corresponding number of data blocks in the preset position based on information carried in the target message if the target message is used to characterize the current scheduling abnormality.

[0085] It can be seen that the scheme in the present application is applied to the communication control node in the system, and the communication control node is used in the system to undertake functions such as data transfer, data management and flow control coordination. Specifically, the communication control node establishes communication connections with the sending node and the receiving node respectively, and a thread scheduling component is set inside the receiving node. First, the communication control node stores the data block sent by the sending node in the current scheduling period to a preset position, and obtains the target message sent by the receiving node. The receiving node detects the current scheduling period based on the thread scheduling component set inside it, so as to send a target message to the communication control node based on the detection result after the detection is completed, which is used to characterize the current scheduling as normal or abnormal; wherein the detection result is any one of normal scheduling, delayed scheduling and skipped scheduling. If the target message received by the communication control node is used to characterize that the current scheduling is normal, the corresponding data block is taken out from the preset position and sent to the receiving node so that normal data communication can be carried out between the sending node and the receiving node. If the target message received by the communication control node is used to characterize that the current scheduling is abnormal, the corresponding number of data blocks in the preset position are discarded based on the information carried in the target message, thereby ensuring that in the event of abnormal scheduling, the data accumulation and overflow caused by the untimely processing of the receiving node can be released in time, thereby ensuring the stability of communication, avoiding the impact of problems such as message overflow on the communication of the entire system, and ensuring the availability and stability of the system.

[0086] Since the embodiments of the device part correspond to the embodiments of the method part, the embodiments of the device part refer to the description of the embodiments of the method part, which will not be described here. In addition, the invention has the same beneficial effects as the communication flow control method mentioned above.

[0087] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the communication flow control method performed by the electronic device disclosed in any of the aforementioned embodiments.

[0088] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0089] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0090] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.

[0091] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the communication flow control method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data received by the electronic device and transmitted from an external device, the data 223 can also include data collected by its own input and output interface 25, etc.

[0092] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the communication flow control method steps disclosed in any of the aforementioned embodiments are implemented.

[0093] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0094] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0095] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a compact disc read-only memory (CD-ROM), or any other form of storage medium known in the art.

[0096] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including 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 including the elements.

[0097] The communication flow control method, device, equipment and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A communication flow control method, characterized in that: Applied to a communication control node, the communication control node establishes communication connections with a sending end node and a receiving end node respectively, and a thread scheduling component is provided inside the receiving end node, the method comprises: Storing the data blocks sent by the sending node in the current scheduling period to a preset location; Obtaining a target message sent by the receiving end node; wherein the target message is a message sent by the receiving end node based on the detection result after the receiving end node detects the current scheduling period using the thread scheduling component and obtains the detection result; the detection result is any one of normal scheduling, delayed scheduling, and skipped scheduling; If the target message is used to indicate that the current scheduling is normal, then taking out the corresponding data block from the preset position and sending it to the receiving end node; If the target message is used to characterize the current scheduling abnormality, a corresponding number of data blocks in the preset position are discarded based on the information carried in the target message.

2. The communication flow control method according to claim 1, characterized in that: The process of the receiving end node detecting the current scheduling period based on the thread scheduling component includes: Obtaining the current system time and determining whether the current system time is consistent with the expected scheduling time; the expected scheduling time is calculated based on the end time of the previous scheduling cycle and the preset scheduling cycle; If the current system time is consistent with the expected scheduling time, it is determined that the current scheduling is normal, and a target message for indicating that the current scheduling is normal is sent to the communication control node; If the current system time is inconsistent with the expected scheduling time, it is determined whether there is a scheduling skip event in the current scheduling period based on the time difference between the current system time and the expected scheduling time. If so, the current scheduling is determined to be abnormal, and a target message used to characterize the current scheduling abnormality is sent to the communication control node.

3. The communication flow control method according to claim 2, characterized in that: The determining whether there is a scheduling skip event in the current scheduling period based on the time difference between the current system time and the expected scheduling time includes: Calculate the time difference between the current system time and the expected scheduling time, and determine whether the time difference is greater than the preset scheduling period; If the time difference is greater than the preset scheduling period, it is determined that there is a scheduling skip event in the current scheduling period; if the time difference is not greater than the preset scheduling period, it is determined that there is no scheduling skip event in the current scheduling period and there is a scheduling delay event.

4. The communication flow control method according to claim 3, characterized in that: The obtaining of the target message sent by the receiving node comprises: If the current scheduling period is scheduled normally, obtaining the target message sent by the receiving end node at the expected scheduling time, so as to take out the corresponding data block from the preset position and send it to the receiving end node; If there is a scheduling delay event in the current scheduling period, the target message sent by the receiving node at the current system time is obtained to take out the corresponding data block from the preset position and send it to the receiving node; the current system time is later than the expected scheduling time.

5. The communication flow control method according to any one of claims 1 to 4, characterized in that: The preset location includes a first queue for receiving data of the sending end node, a second queue for storing data to be sent to the receiving end node, and a third queue for storing data that has been sent to the receiving end node; Accordingly, storing the data block sent by the transmitting node in the current scheduling period to a preset location includes: receiving data blocks sent by the transmitting node using the first queue in the current scheduling period, and copying the data blocks stored in the first queue to the second queue for storage; Correspondingly, after taking out the corresponding data block from the preset position and sending it to the receiving end node, the method further includes: copying the data blocks in the second queue that have been sent to the receiving end to the third queue; After obtaining the data release instruction sent by the receiving end node, the data blocks stored in the third queue are released; wherein the data release instruction is an instruction sent by the receiving end node to the communication control node after completing processing of the obtained data blocks.

6. The communication flow control method according to claim 5, characterized in that: The discarding of a corresponding number of data blocks in the preset position based on the information carried in the target message includes: Determine a message carried in the target message for indicating the number of scheduling cycle skipping times; The data blocks corresponding to the number of times the scheduling cycle is skipped stored in the first queue, the second queue and the third queue are discarded respectively according to the storage order of the data blocks from first to last.

7. The communication flow control method according to claim 5, characterized in that: The process of discarding a corresponding number of data blocks in the preset position based on the information carried in the target message also includes: If a message sent by the receiving node indicating that scheduling has returned to normal is received, the step of discarding a corresponding number of data blocks in the preset position based on the information carried in the target message is stopped.

8. A communication flow control device, characterized in that: Applied to a communication control node, the communication control node establishes communication connections with a sending end node and a receiving end node respectively, and a thread scheduling component is provided inside the receiving end node. The device comprises: A data storage module, used for storing the data blocks sent by the sending end node in the current scheduling period to a preset location; A message acquisition module, used to acquire a target message sent by the receiving end node; wherein the target message is a message sent by the receiving end node based on the detection result after the receiving end node detects the current scheduling period using the thread scheduling component and obtains the detection result; the detection result is any one of normal scheduling, delayed scheduling and skipped scheduling; A data sending module, configured to fetch a corresponding data block from the preset position and send the data block to the receiving node if the target message is used to indicate that the current scheduling is normal; The data discarding module is used to discard a corresponding number of data blocks in the preset position based on the information carried in the target message if the target message is used to characterize the current scheduling abnormality.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the communication flow control method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the communication flow control method as described in any one of claims 1 to 7 are implemented.