Communication control methods and devices

CN117742197BActive Publication Date: 2026-08-14BEIJING JINGWEI HIRAIN TECH CO INC
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-24
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0005]本申请实施例提供了一种通信的控制方法及装置,能够解决现有的MCU的负载率低的问题

Benefits of technology

[0044]第五方面,本申请实施例提供了一种计算机程序产品,所述计算机程序产品包括计算机程序指令,所述计算机程序指令被处理器执行时实现如上的通信的控制方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117742197B_ABST
    Figure CN117742197B_ABST
Patent Text Reader

Abstract

This application discloses a communication control method and apparatus. The method includes: acquiring a working identifier of a first controller, the working identifier representing the working state of the first controller; acquiring a command to be executed based on the working identifier, the command to be executed instructing adjustment of the working state of a second controller; splitting the command to be executed into at least one asynchronous command based on the working identifier, and updating the working identifier after splitting; and sending at least one asynchronous command to the second controller based on the working identifier to adjust the working state of the second controller. During the time interval between the transmission times of any two adjacent asynchronous commands, the first controller can be used to execute a second control operation, which is a control operation other than the first control operation corresponding to the command to be executed. According to the embodiments of this application, the load rate of the first controller can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of automotive electronics technology, and in particular relates to a communication control method and device. Background Technology

[0002] Vehicles typically include multiple MCUs (Microcontroller Units), which are usually responsible for controlling the entire vehicle's electronic systems, including those involved in optical displays. The DLPC (Digital Light Processing Controller) in a vehicle primarily controls the optical projection system.

[0003] During communication between the MCU and DLPC, the MCU is responsible for transmitting the user's relevant control commands to the DLPC. The DLPC then uses this data to control the brightness and on / off state of different lights.

[0004] In related technologies, the communication between the MCU and DLPC is synchronous. That is, the MCU sends instructions to the DLPC, the DLPC executes the corresponding operation, and feeds back the result to the MCU, which then proceeds to the next step. This process, where the MCU waits too long for the instruction processing result, leads to low MCU load. Summary of the Invention

[0005] This application provides a communication control method and apparatus that can solve the problem of low load rate of existing MCUs.

[0006] In a first aspect, embodiments of this application provide a communication control method, the method comprising:

[0007] Obtain the working identifier of the first controller, which is used to characterize the working state of the first controller;

[0008] The instruction to be executed is obtained according to the working identifier, and the instruction to be executed is used to instruct the adjustment of the working state of the second controller;

[0009] The instruction to be executed is split into at least one asynchronous instruction based on the work identifier, and the work identifier is updated after the split;

[0010] The at least one asynchronous instruction is sent sequentially to the second controller according to the working identifier, thereby adjusting the working state of the second controller;

[0011] In the time interval between the sending times of any two adjacent asynchronous instructions, the first controller can be used to execute a second control operation, which is a control operation other than the first control operation corresponding to the instruction to be executed.

[0012] In some embodiments, obtaining the instruction to be executed based on the work identifier includes:

[0013] When the working identifier is a first working identifier, detect whether there is at least one first instruction in the instruction queue, wherein the first working identifier is used to indicate that the working state of the first controller is idle;

[0014] If at least one first instruction is detected in the instruction queue, the first instruction with the highest execution priority among the at least one first instruction is taken out of the instruction queue and determined as the instruction to be executed.

[0015] In some embodiments, splitting the instruction to be executed into at least one asynchronous instruction based on the work identifier, and updating the work identifier after splitting, includes:

[0016] If the work identifier is the first work identifier and there is an instruction to be executed taken from the instruction queue, the instruction to be executed is split into at least one asynchronous instruction with a sequential order.

[0017] The working identifier is updated to a second working identifier, wherein the second working identifier is used to indicate that the working state of the first controller is working.

[0018] In some embodiments, after splitting the instruction to be executed into at least one asynchronous instruction with a sequential order, the method further includes:

[0019] The first asynchronous instruction is sent to the second controller, wherein the first asynchronous instruction is the first asynchronous instruction in a sequence of at least one asynchronous instruction.

[0020] In some embodiments, sending the at least one asynchronous instruction to the second controller according to the work identifier includes:

[0021] When the working state is the second working state, it is determined whether the feedback result corresponding to the second asynchronous instruction is received within a first time period after the sending time of the second asynchronous instruction, wherein the second asynchronous instruction is the asynchronous instruction that has been sent to the second controller most recently among the at least one asynchronous instruction;

[0022] If the feedback result is received within the first duration after the sending time, the next asynchronous instruction in the at least one asynchronous instruction that follows the second asynchronous instruction is sent to the second controller.

[0023] In some embodiments, after determining whether a feedback result corresponding to the second asynchronous instruction has been received within a first time period after the sending time of the second asynchronous instruction, the method further includes:

[0024] If the feedback result is not received within the first time period after the sending time, the working identifier is updated to a third working identifier, wherein the third working identifier is used to indicate that the working state of the first controller is busy;

[0025] Until the feedback result corresponding to the second asynchronous instruction is received, the working identifier is updated to the second working identifier, and the next asynchronous instruction in the at least one asynchronous instruction that follows the second asynchronous instruction in sequence is sent to the second controller.

[0026] In some embodiments, sending the at least one asynchronous instruction to the second controller includes:

[0027] Obtain the function corresponding to the third asynchronous instruction, wherein the third asynchronous instruction is any one of the at least one asynchronous instructions;

[0028] The first operation corresponding to the function is executed, and the first operation is used to send the third asynchronous instruction to the second controller.

[0029] In some embodiments, after sending the at least one asynchronous instruction to the second controller, the method further includes:

[0030] If a first error is detected during the asynchronous instruction sending process, the working identifier is updated to the fourth working identifier;

[0031] Stop sending the at least one asynchronous instruction to the second controller, and report the first error, which is a communication breakdown between the first controller and the second controller.

[0032] In some embodiments, after sending the at least one asynchronous instruction to the second controller, the method further includes:

[0033] If a second error is detected during the asynchronous instruction sending process, the working identifier will be updated to the fifth identifier;

[0034] A recovery command is sent to the second controller. The recovery command is used to control the recovery of the second error, which is that the sent asynchronous command has an error.

[0035] Secondly, embodiments of this application provide a communication control device, the device comprising:

[0036] The first acquisition module is used to acquire the working identifier of the first controller, the working identifier being used to characterize the working state of the first controller;

[0037] The second acquisition module is used to acquire an instruction to be executed based on the working identifier, the instruction to be executed being used to instruct the adjustment of the working state of the second controller;

[0038] A splitting module is used to split the instruction to be executed into at least one asynchronous instruction according to the work identifier, and update the work identifier after splitting;

[0039] The sending module is used to send the at least one asynchronous instruction to the second controller sequentially according to the working identifier, so as to adjust the working state of the second controller;

[0040] In the time interval between the sending times of any two adjacent asynchronous instructions, the first controller can be used to execute a second control operation, which is a control operation other than the first control operation corresponding to the instruction to be executed.

[0041] Thirdly, embodiments of this application provide a communication control device, the device including: a processor and a memory storing computer program instructions;

[0042] The above communication control method is implemented when the processor executes computer program instructions.

[0043] Fourthly, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement the above-described communication control method.

[0044] Fifthly, embodiments of this application provide a computer program product, the computer program product including computer program instructions, which, when executed by a processor, implement the above-described communication control method.

[0045] In this application, the first controller can be an MCU. The first controller can read a working identifier and obtain the instruction to be executed based on the working identifier. Then, it can split the instruction to be executed into at least one asynchronous instruction and send the at least one asynchronous instruction asynchronously to the second controller to adjust the working state of the second controller. In this way, a whole instruction can be split into asynchronous instructions, and a large synchronous communication can be converted into at least one small asynchronous communication. After each asynchronous communication is completed, there is no need to wait for the feedback result of the asynchronous communication, but other tasks or operations can be executed. In this way, the control operations of other tasks can be interspersed between the control operations corresponding to the instruction to be executed, thereby enabling the MCU to complete multi-threaded tasks in parallel, improving the working efficiency and task load rate of the MCU. Attached Figure Description

[0046] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is a flowchart illustrating a communication control method provided in an embodiment of this application;

[0048] Figure 2 This is a schematic diagram of the communication control method provided in an embodiment of this application;

[0049] Figure 3 This is a schematic diagram of the identifier update of a communication control method provided in an embodiment of this application;

[0050] Figure 4 This is a schematic diagram of the hardware structure of a communication control device provided in an embodiment of this application;

[0051] Figure 5 This is a schematic diagram of the structure of a communication control device provided in an embodiment of this application. Detailed Implementation

[0052] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples of this application.

[0053] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0054] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The embodiments will now be described in detail with reference to the accompanying drawings.

[0055] In the current DLPC control scheme, synchronous communication is used between the MCU and the DLPC, and the MCU waits for the DLPC to process the communication commands.

[0056] The current communication control method between MCU and DLPC has the following shortcomings:

[0057] Synchronous communication control methods result in low MCU load rates, especially for DLPC instructions with long execution cycles. The process of the MCU waiting for the instruction processing result hinders the operation of other tasks in the MCU, and it is even necessary to ensure that the MCU is not reset during the waiting time, which greatly reduces the real-time performance and software reliability of MCU task processing.

[0058] Specifically, in order to solve the problems of the prior art, embodiments of this application provide a communication control method and apparatus. The communication control method provided in the embodiments of this application will be described first below.

[0059] Figure 1 A flowchart illustrating a communication control method according to an embodiment of this application is shown. The method includes the following steps:

[0060] S110, Obtain the working identifier of the first controller, the working identifier being used to characterize the working state of the first controller.

[0061] In this embodiment, the first controller can be an MCU, and the second controller can be a DLPC. The first controller has a working identifier that can be adjusted in real time. This working identifier can be updated in real time based on the working status of the first controller, which can be idle, working, busy, or error.

[0062] S120, Obtain the instruction to be executed according to the working identifier, the instruction to be executed is used to indicate the adjustment of the working state of the second controller.

[0063] In this embodiment, the instruction to be executed is a user-sent instruction used to adjust the working state of the second controller. The first controller can receive the instruction to be executed, process it according to specific rules, and send the processed instruction to the second controller. After receiving the instruction to be executed, the second controller executes the first control operation corresponding to the instruction to adjust the working state of the second controller.

[0064] S130, the instruction to be executed is split into at least one asynchronous instruction according to the work identifier, and the work identifier is updated after the split.

[0065] In this embodiment, after the first controller obtains the instruction to be executed, it can split the instruction into at least one asynchronous instruction. Each asynchronous instruction corresponds to a sub-operation that can be performed independently. Each asynchronous instruction can be sent asynchronously by the first controller to the second controller. In addition, the asynchronous instruction needs to conform to the communication protocol and instruction format of the second controller.

[0066] Because the first controller communicates with the second controller by sending asynchronous instructions, there is no communication between the first and second controllers before the instructions to be executed are split. The working status of the first controller, as indicated by the work flag, is idle. After splitting, the work flag can be updated to show that the working status of the first controller is active.

[0067] S140, according to the working identifier, the at least one asynchronous instruction is sent sequentially to the second controller to adjust the working state of the second controller;

[0068] In the time interval between the sending times of any two adjacent asynchronous instructions, the first controller can be used to execute a second control operation, which is a control operation other than the first control operation corresponding to the instruction to be executed.

[0069] In this embodiment, after splitting the instruction to be executed into at least one asynchronous instruction, the at least one asynchronous instruction can be sent to the second controller respectively.

[0070] During the specific transmission process, the first controller needs to select a suitable communication interface and transmit an asynchronous instruction from the communication interface to the second controller each time. After receiving the asynchronous instruction, the second controller can either execute the sub-operation corresponding to the asynchronous instruction and feed back the execution result of the sub-operation to the first controller, or the second controller can save the execution result of the sub-operation and wait for the first controller to read the saved execution result of the sub-operation through the communication interface.

[0071] After the asynchronous instruction transmission is completed, the first controller can perform other tasks or operations, such as processing other sensor data, executing control algorithms, and responding to user input, without waiting for the execution result of the asynchronous instruction.

[0072] After receiving the execution result corresponding to the asynchronous instruction, the first controller can send the next asynchronous instruction to the second controller in the same way as described above, until all asynchronous instructions have been transmitted to the second controller.

[0073] In this embodiment, the first controller can be an MCU. The first controller can read the working identifier and obtain the instruction to be executed based on the working identifier. Then, it splits the instruction to be executed into at least one asynchronous instruction and sends the at least one asynchronous instruction to the second controller asynchronously to adjust the working state of the second controller. In this way, a whole instruction can be split into asynchronous instructions, and a large synchronous communication can be converted into at least one small asynchronous communication. After each asynchronous communication is completed, there is no need to wait for the feedback result of the asynchronous communication, but other tasks or operations can be executed. In this way, the control operations of other tasks can be interspersed between the control operations corresponding to the instruction to be executed, thereby enabling the MCU to complete multi-threaded tasks in parallel, improving the working efficiency and task load rate of the MCU.

[0074] As an optional embodiment, the above-described S120 may include:

[0075] When the working identifier is a first working identifier, detect whether there is at least one first instruction in the instruction queue, wherein the first working identifier is used to indicate that the working state of the first controller is idle;

[0076] If at least one first instruction is detected in the instruction queue, the first instruction with the highest execution priority among the at least one first instruction is taken out of the instruction queue and determined as the instruction to be executed.

[0077] In this embodiment, during the communication control process between the first controller and the second controller, the first controller can be periodically controlled to execute target operations. That is, only one of multiple target operations is executed in each cycle. After completing one target operation, the first controller can execute other tasks or operations until the next cycle, when it will execute one of the multiple target operations again.

[0078] The target operation includes: querying the working identifier of the first terminal; if the working identifier of the first terminal is the first working identifier, it is considered that the first controller is idle and there is no instruction to be executed from the instruction queue. Further, it can be determined whether there is at least one first instruction in the instruction queue of the first controller. If there is at least one first instruction in the instruction queue, then a dequeue operation can be performed, that is, the first instruction with the highest execution priority is selected from the instruction queue, and this first instruction is designated as the instruction to be executed. The function traversal and initialization are then completed, and the process can jump to execute other tasks or operations while waiting for the next cycle. If there is no first instruction in the instruction queue, then other tasks or operations can be executed directly, waiting for the next cycle.

[0079] As an optional embodiment, the above-described S130 includes:

[0080] When the work identifier is the first work identifier and there is an instruction to be executed taken from the instruction queue, the instruction to be executed is split into at least one asynchronous instruction with a sequential order, wherein the first work identifier is used to characterize the working state of the first controller as idle;

[0081] The working identifier is updated to a second working identifier, wherein the second working identifier is used to indicate that the working state of the first controller is working.

[0082] As an optional embodiment, after splitting the instruction to be executed into at least one asynchronous instruction with a sequential order, the method further includes:

[0083] The first asynchronous instruction is sent to the second controller, wherein the first asynchronous instruction is the first asynchronous instruction in a sequence of at least one asynchronous instruction.

[0084] In this embodiment, during the communication control of the first controller to the second controller, the first controller can be periodically controlled to perform target operations. That is, only one of multiple target operations is performed in each cycle.

[0085] The target operation further includes: querying the working identifier of the first terminal; if the working identifier of the first terminal is the first working identifier, then further querying whether there is an instruction to be executed retrieved from the instruction queue. If so, it indicates that the dequeue operation of the previous cycle has been completed, and the working identifier can be updated from the first working identifier to the second working identifier, which means that the first controller is working. Then, the target operation also includes splitting the dequeue instructions to be executed into at least one asynchronous instruction with a sequential order within this cycle, and sending the first asynchronous instruction, which is the first in the order of the at least one asynchronous instruction, to the second controller.

[0086] After the first asynchronous instruction is sent to the second controller, the target operation within this cycle has been completed. The first controller does not need to wait for the feedback result of the first asynchronous instruction and can execute other tasks or operations for the remaining time of this cycle, waiting for the next cycle.

[0087] As an optional embodiment, the above-described S140 may include:

[0088] When the working state is the second working state, it is determined whether the feedback result corresponding to the second asynchronous instruction is received within a first time period after the sending time of the second asynchronous instruction, wherein the second asynchronous instruction is the asynchronous instruction that has been sent to the second controller most recently among the at least one asynchronous instruction;

[0089] If the feedback result is received within the first duration after the sending time, the next asynchronous instruction in the at least one asynchronous instruction that follows the second asynchronous instruction is sent to the second controller.

[0090] As an optional embodiment, after determining whether a feedback result corresponding to the second asynchronous instruction has been received within a first time period after the sending time of the second asynchronous instruction, the method further includes:

[0091] If the feedback result is not received within the first time period after the sending time, the working identifier is updated to a third working identifier, wherein the third working identifier is used to indicate that the working state of the first controller is busy;

[0092] Until the feedback result corresponding to the second asynchronous instruction is received, the working identifier is updated to the second working identifier, and the next asynchronous instruction in the at least one asynchronous instruction that follows the second asynchronous instruction in sequence is sent to the second controller.

[0093] In this embodiment, during the communication control process between the first controller and the second controller, the first controller can be periodically controlled to execute target operations. That is, only one of multiple target operations is executed in each cycle. Specifically, the execution cycle of the target operation can be determined as a first duration, meaning that the target operation can be executed once every first duration.

[0094] The target operation further includes: querying the working identifier of the first terminal; if the working identifier of the first terminal is the second working identifier, it can be considered that the first controller is working, meaning that there was an asynchronous instruction in the previous cycle for which no corresponding feedback result was received. In this case, it is necessary to further determine whether the feedback result of the most recent second asynchronous instruction sent to the second controller has been received. If the feedback result of the second asynchronous instruction is received, it is determined whether there are any asynchronous instructions following the second asynchronous instruction. If there are, the next asynchronous instruction following the second asynchronous instruction can be sent to the second controller in chronological order. If there are no asynchronous instructions following the second asynchronous instruction, the working identifier of the first controller can be updated to the first working identifier.

[0095] If no feedback result is received from the second asynchronous instruction, it is assumed that the second controller has not yet completed the sub-operation corresponding to the second asynchronous instruction. Therefore, the first controller does not send any instructions to the second controller in the current cycle, and the first controller waits for the next cycle to continue determining whether a feedback result has been received.

[0096] Once the feedback result corresponding to the second asynchronous instruction is received, the working identifier can be updated to the second working identifier, and then the next asynchronous instruction after the second asynchronous instruction can be sent to the second controller.

[0097] As an optional embodiment, sending the at least one asynchronous instruction to the second controller includes:

[0098] Obtain the function corresponding to the third asynchronous instruction, wherein the third asynchronous instruction is any one of the at least one asynchronous instructions;

[0099] The first operation corresponding to the function is executed, and the first operation is used to send the third asynchronous instruction to the second controller.

[0100] In this embodiment, the first controller contains a pre-set function mapping table. The function mapping table stores the mapping relationship between each instruction and a function. In a set of mapping relationships, a function is a code function used to implement the function of its corresponding instruction. The function of an instruction can be implemented by calling the function corresponding to each instruction.

[0101] Therefore, in sending the third asynchronous instruction, it is necessary to first obtain the function corresponding to the third asynchronous instruction, and then call that function. By calling that function, the target operation corresponding to that function is executed, thereby sending the third asynchronous instruction to the second controller.

[0102] As an optional embodiment, after sending the at least one asynchronous instruction to the second controller, the method further includes:

[0103] If a first error is detected during the asynchronous instruction sending process, the working identifier is updated to the fourth working identifier;

[0104] Stop sending the at least one asynchronous instruction to the second controller, and report the first error, which is a communication breakdown between the first controller and the second controller.

[0105] In this embodiment, during the communication control of the first controller to the second controller, the first controller can be periodically controlled to perform target operations. That is, only one of multiple target operations is performed in each cycle.

[0106] The target operation further includes: if a first error is detected during the transmission of an asynchronous command, the working identifier can be updated to a fourth working identifier. The fourth working identifier indicates that the first controller has encountered an unrecoverable error, and the first error is reported, awaiting operator intervention. For example, the first error could be a disconnection in communication between the first and second controllers.

[0107] As an optional embodiment, after sending the at least one asynchronous instruction to the second controller, the method further includes:

[0108] If a second error is detected during the asynchronous instruction sending process, the working identifier will be updated to the fifth identifier;

[0109] A recovery command is sent to the second controller. The recovery command is used to control the recovery of the second error, which is that the sent asynchronous command has an error.

[0110] In this embodiment, the target operation further includes: if a second error is detected during the transmission of the asynchronous instruction, the working identifier can be updated to a fifth working identifier. The fifth working identifier indicates that the first controller's working state has encountered an error that can be attempted to recover from, and an attempt is being made to recover from the second error. For example, the second error could be an error in the previously transmitted asynchronous instruction.

[0111] As an optional embodiment, if an asynchronous instruction has been sent to the second controller, and no feedback result is received for that asynchronous instruction within a subsequent cycle, the step corresponding to that asynchronous instruction is considered to be in a busy state. If the duration of the busy state exceeds a preset cycle threshold, a second error is considered to have occurred in the transmission process of the asynchronous instruction. If the duration of the second error exceeds a preset duration threshold, a first error is considered to have occurred in the transmission process of the asynchronous instruction. The second error can be a general error, and the first error can be a fatal error.

[0112] As another optional embodiment, the first controller is an MCU and the second controller is a DLPC. The first controller includes, for example, Figure 2 The five modules shown are: task setting module 11, asynchronous main function module 12, instruction queue module 13, mapping table module 14, and state machine module 15.

[0113] The task setting module 11 generates tasks for the first controller, specifically receiving the first instruction corresponding to the task and saving the received instruction to the first controller. The instruction queue module 13 saves the first instruction to the instruction queue and retrieves instructions to be executed sequentially from the instruction queue according to their priority. The mapping table module 14 saves the first instruction entry point and calls the corresponding function of the first instruction. This function splits the first instruction into at least one asynchronous instruction. After each task is executed, a task callback function is called to indicate the success or failure of the previous task. The state machine module 15 updates the state flag based on the state of the first controller. The asynchronous main function module 12 executes a target operation within each cycle.

[0114] As an optional embodiment, in the state adjustment task of the second controller, the state identifier is updated as follows: Figure 3 As shown. At the start of a task, the status flag is the first status flag, meaning that the first controller is in an idle state; if there is a pending instruction dequeued from the instruction queue during a certain period, the status flag is updated to the second status flag, meaning that the first controller enters the working state.

[0115] When the status identifier is the second status identifier, if a task execution failure is detected, the status identifier is updated to the fifth status identifier, which means that there is a general error in the first controller; if a feedback result of the previous asynchronous instruction is not received for more than one cycle, the status identifier can be updated to the third status identifier, which means that the first controller is in a busy state; if the task is completed, the status identifier is updated to the first status identifier.

[0116] When the status flag is the third status flag, if the feedback result of the previous asynchronous instruction is received, the status flag will be updated to the second status flag. If the third status flag exceeds a preset time, the status flag will be updated to the fifth status flag.

[0117] When the status flag is the fifth status flag, if the error is successfully cleared, the status flag is updated to the first status flag. If the duration of the error exceeds the duration threshold, the status flag is updated to the fourth status flag, which means that there is a fatal error in the first controller.

[0118] If a fatal error is recovered when the status flag is the fourth status flag, the status flag will be updated to the first status flag.

[0119] Based on the communication control method provided in the above embodiments, this application also provides specific implementations of the communication control device. Please refer to the following embodiments.

[0120] First see Figure 4 The communication control device 400 provided in this application embodiment includes the following modules:

[0121] The first acquisition module 401 is used to acquire the working identifier of the first controller, the working identifier being used to characterize the working state of the first controller;

[0122] The second acquisition module 402 is used to acquire an instruction to be executed based on the working identifier, the instruction to be executed being used to instruct the adjustment of the working state of the second controller;

[0123] The splitting module 403 is used to split the instruction to be executed into at least one asynchronous instruction according to the work identifier, and update the work identifier after splitting;

[0124] The sending module 404 is used to send the at least one asynchronous instruction to the second controller sequentially according to the working identifier, so as to adjust the working state of the second controller;

[0125] In the time interval between the sending times of any two adjacent asynchronous instructions, the first controller can be used to execute a second control operation, which is a control operation other than the first control operation corresponding to the instruction to be executed.

[0126] The first controller, which can be an MCU, reads a working identifier and obtains the instruction to be executed based on the identifier. It then breaks down the instruction into at least one asynchronous instruction and sends this asynchronous instruction to the second controller to adjust its operating state. In this way, a single instruction can be broken down into asynchronous instructions, transforming a large synchronous communication into at least one smaller asynchronous communication. After each asynchronous communication is completed, there is no need to wait for feedback; other tasks or operations can be executed immediately. This allows control operations for other tasks to be interspersed between the control operations corresponding to the instruction to be executed, enabling the MCU to complete multi-threaded tasks in parallel, thus improving the MCU's efficiency and workload.

[0127] As one implementation of this application, the second acquisition module 402 may further include:

[0128] The detection unit is used to detect whether there is at least one first instruction in the instruction queue when the working identifier is a first working identifier, wherein the first working identifier is used to indicate that the working state of the first controller is idle;

[0129] The retrieval unit is configured to, when detecting that at least one first instruction exists in the instruction queue, retrieve the first instruction with the highest execution priority from the instruction queue and determine the first instruction with the highest execution priority as the instruction to be executed.

[0130] As one implementation of this application, the above-mentioned splitting module 403 may further include:

[0131] A splitting unit is used to split the instruction to be executed into at least one asynchronous instruction with a sequential order when the work identifier is a first work identifier and there is an instruction to be executed taken from the instruction queue.

[0132] An update unit is used to update the working identifier to a second working identifier, wherein the second working identifier is used to indicate that the working state of the first controller is working.

[0133] As one implementation of this application, the control device 400 for the above communication may further include:

[0134] The first sending unit is used to send a first asynchronous instruction to the second controller, wherein the first asynchronous instruction is the first asynchronous instruction in a sequence of at least one asynchronous instruction.

[0135] As one implementation of this application, the sending module 404 may further include:

[0136] The judgment unit is used to determine, when the working state is the second working state, whether the feedback result corresponding to the second asynchronous instruction has been received within a first time period after the sending time of the second asynchronous instruction, wherein the second asynchronous instruction is the asynchronous instruction that has been sent to the second controller most recently among the at least one asynchronous instruction;

[0137] The second sending unit is configured to send the next asynchronous instruction in the at least one asynchronous instruction that follows the second asynchronous instruction in sequence to the second controller when the feedback result is received within the first time period after the sending time.

[0138] As one implementation of this application, the sending module 404 is further used for:

[0139] If the feedback result is not received within the first time period after the sending time, the working identifier is updated to a third working identifier, wherein the third working identifier is used to indicate that the working state of the first controller is busy;

[0140] Until the feedback result corresponding to the second asynchronous instruction is received, the working identifier is updated to the second working identifier, and the next asynchronous instruction in the at least one asynchronous instruction that follows the second asynchronous instruction in sequence is sent to the second controller.

[0141] As one implementation of this application, the sending module 404 is further used for:

[0142] Obtain the function corresponding to the third asynchronous instruction, wherein the third asynchronous instruction is any one of the at least one asynchronous instructions;

[0143] The first operation corresponding to the function is executed, and the first operation is used to send the third asynchronous instruction to the second controller.

[0144] As one implementation of this application, the control device 400 for communication is further used for:

[0145] If a first error is detected during the asynchronous instruction sending process, the working identifier is updated to the fourth working identifier;

[0146] Stop sending the at least one asynchronous instruction to the second controller, and report the first error, which is a communication breakdown between the first controller and the second controller.

[0147] As one implementation of this application, the control device 400 for communication is further used for:

[0148] If a second error is detected during the asynchronous instruction sending process, the working identifier will be updated to the fifth identifier;

[0149] A recovery command is sent to the second controller. The recovery command is used to control the recovery of the second error, which is that the sent asynchronous command has an error.

[0150] The communication control device provided in this embodiment of the invention can implement the various steps in the above method embodiments, and will not be repeated here to avoid repetition.

[0151] Figure 5 A schematic diagram of the hardware structure of the communication control device provided in an embodiment of this application is shown.

[0152] The control device for communication may include a processor 501 and a memory 502 storing computer program instructions.

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

[0154] Memory 502 may include mass storage for data or instructions. For example, and not limitingly, memory 502 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 502 may include removable or non-removable (or fixed) media. Where appropriate, memory 502 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 502 is non-volatile solid-state memory.

[0155] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to one aspect of this disclosure.

[0156] The processor 501 implements any of the communication control methods described in the above embodiments by reading and executing computer program instructions stored in the memory 502.

[0157] In one example, the communication control device may further include a communication interface 503 and a bus 510. For example, Figure 5 As shown, the processor 501, memory 502, and communication interface 503 are connected through bus 510 and complete communication with each other.

[0158] The communication interface 503 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0159] Bus 510 includes hardware, software, or both, that couples components of a communication control device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 510 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.

[0160] The control device for this communication can be based on the above embodiments, thereby realizing the control method and apparatus that combine the above communication.

[0161] Furthermore, in conjunction with the communication control methods described in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the communication control methods described in the above embodiments and achieve the same technical effect. To avoid repetition, further details are omitted here. The aforementioned computer-readable storage medium may include non-transitory computer-readable storage media, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, etc., and is not limited thereto.

[0162] In addition, this application also provides a computer program product, including computer program instructions, which, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.

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

[0164] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

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

[0166] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus, and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0167] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A communication control method, characterized in that, The method is applied to a first controller, and the method includes: Obtain the working identifier of the first controller, which is used to characterize the working state of the first controller; When the working identifier is a first working identifier, an instruction to be executed is obtained according to the working identifier. The instruction to be executed is used to instruct the adjustment of the working state of the second controller. The first working identifier is used to indicate that the working state of the first controller is idle. When the working identifier is the first working identifier and there is an instruction to be executed retrieved from the instruction queue, the instruction to be executed is split into at least one asynchronous instruction according to the working identifier, and the working identifier is updated to the second working identifier after splitting; the second working identifier is used to characterize the working state of the first controller as working; When the working identifier is the second working identifier, the at least one asynchronous instruction is sent sequentially to the second controller according to the working identifier to adjust the working state of the second controller; In the time interval between the sending times of any two adjacent asynchronous instructions, the first controller can be used to execute a second control operation, which is a control operation other than the first control operation corresponding to the instruction to be executed.

2. The communication control method according to claim 1, characterized in that, When the work identifier is a first work identifier, obtaining the instruction to be executed based on the work identifier includes: When the working identifier is a first working identifier, detect whether there is at least one first instruction in the instruction queue, wherein the first working identifier is used to indicate that the working state of the first controller is idle; If at least one first instruction is detected in the instruction queue, the first instruction with the highest execution priority among the at least one first instruction is taken out of the instruction queue and determined as the instruction to be executed.

3. The communication control method according to claim 1, characterized in that, When the working identifier is a first working identifier and there are instructions to be executed retrieved from the instruction queue, the step of splitting the instructions to be executed into at least one asynchronous instruction according to the working identifier, and updating the working identifier to a second working identifier after splitting, includes: If the work identifier is the first work identifier and there is an instruction to be executed taken from the instruction queue, the instruction to be executed is split into at least one asynchronous instruction with a sequential order. The working identifier is updated to a second working identifier, wherein the second working identifier is used to indicate that the working state of the first controller is working.

4. The communication control method according to claim 3, characterized in that, After splitting the instruction to be executed into at least one asynchronous instruction with a sequential order, the method further includes: The first asynchronous instruction is sent to the second controller, wherein the first asynchronous instruction is the first asynchronous instruction in a sequence of at least one asynchronous instruction.

5. The communication control method according to claim 1, characterized in that, When the working identifier is a second working identifier, sending the at least one asynchronous instruction sequentially to the second controller according to the working identifier includes: When the working identifier is the second working identifier, it is determined whether a feedback result corresponding to the second asynchronous instruction is received within a first time period after the sending time of the second asynchronous instruction, wherein the second asynchronous instruction is the asynchronous instruction that has been sent to the second controller most recently among the at least one asynchronous instruction; If the feedback result is received within the first duration after the sending time, the next asynchronous instruction in the at least one asynchronous instruction that follows the second asynchronous instruction is sent to the second controller.

6. The communication control method according to claim 5, characterized in that, After determining whether a feedback result corresponding to the second asynchronous instruction has been received within a first time interval after the sending time of the second asynchronous instruction, the method further includes: If the feedback result is not received within the first time period after the sending time, the working identifier is updated to a third working identifier, wherein the third working identifier is used to indicate that the working state of the first controller is busy; Until the feedback result corresponding to the second asynchronous instruction is received, the working identifier is updated to the second working identifier, and the next asynchronous instruction in the at least one asynchronous instruction that follows the second asynchronous instruction in sequence is sent to the second controller.

7. The communication control method according to claim 1, characterized in that, Sending the at least one asynchronous instruction to the second controller includes: Obtain the function corresponding to the third asynchronous instruction, wherein the third asynchronous instruction is any one of the at least one asynchronous instructions; The first operation corresponding to the function is executed, and the first operation is used to send the third asynchronous instruction to the second controller.

8. The communication control method according to claim 1, characterized in that, After sending the at least one asynchronous instruction to the second controller, the method further includes: If a first error is detected during the asynchronous instruction sending process, the working identifier is updated to the fourth working identifier; Stop sending the at least one asynchronous instruction to the second controller, and report the first error, which is a communication breakdown between the first controller and the second controller.

9. The communication control method according to claim 1, characterized in that, After sending the at least one asynchronous instruction to the second controller, the method further includes: If a second error is detected during the asynchronous instruction sending process, the working identifier will be updated to the fifth working identifier; A recovery command is sent to the second controller. The recovery command is used to control the recovery of the second error, which is that the sent asynchronous command has an error.

10. A communication control device, characterized in that, The device includes: The first acquisition module is used to acquire the working identifier of the first controller, the working identifier being used to characterize the working state of the first controller; The second acquisition module is used to acquire an instruction to be executed based on the first working identifier when the working identifier is the first working identifier. The instruction to be executed is used to instruct the adjustment of the working state of the second controller. The first working identifier is used to indicate that the working state of the first controller is idle. The splitting module is used to split the instruction to be executed into at least one asynchronous instruction according to the work identifier when the work identifier is a first work identifier and there is an instruction to be executed taken from the instruction queue, and update the work identifier to a second work identifier after splitting; the second work identifier is used to indicate that the working state of the first controller is working; The sending module is configured to, when the working identifier is the second working identifier, sequentially send the at least one asynchronous instruction to the second controller according to the working identifier, thereby adjusting the working state of the second controller; In the time interval between the sending times of any two adjacent asynchronous instructions, the first controller can be used to execute a second control operation, which is a control operation other than the first control operation corresponding to the instruction to be executed.

Citation Information

Patent Citations

  • Asynchronous communication processing method and device and storage medium

    CN113094305A

  • Hardware multithreading systems and methods

    US20060117316A1