Communication method and device, electronic equipment, storage medium and chip
By using a token mechanism and interrupt handling service in inter-core communication to form a chained sending logic, the problems of low efficiency and high latency in inter-core communication are solved, and a high-efficiency, low-latency communication process is achieved.
Patent Information
- Application Number
- CN202410536630.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2025-10-31
AI Technical Summary
Existing technologies suffer from low communication efficiency and high latency in inter-core communication, especially in high-priority tasks and interrupt blocking scenarios, making it difficult to meet the application scenarios that require high communication efficiency and low latency.
By placing messages to be transmitted into a sending queue, obtaining a token for access, sending the message, and initiating an interrupt handling service upon receiving an acknowledgment signal, the system continues to hold the token and send the remaining messages, forming a chained sending logic to reduce latency and improve efficiency.
It achieves seamless connection between two adjacent messages, minimizes latency, improves communication efficiency, and meets the requirements of high communication efficiency and low latency.
Smart Images

Figure CN120881002A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, and in particular to a communication method and apparatus, electronic device, storage medium and chip. Background Technology
[0002] To ensure that messages are read completely and correctly, the sender must receive an acknowledgment signal (ACK) from the receiver before it can send the next message. This method requires sending messages serially, one by one, which results in low communication efficiency.
[0003] To address the issue of low communication efficiency, inter-core communication (IPC) typically provides multiple programmable mailboxes, each with its own independent control register space. Each mailbox has an independent send queue to buffer messages, supporting scenarios where multiple tasks concurrently use the same mailbox for message transmission. Communication is controlled by a message sending task (thread), which checks all mailboxes for pending messages. If any mailbox has a message to send and successfully obtains a send token, it retrieves a message from its send queue and executes the send. However, this send interface only adds the message to the send queue and notifies the message sending task; the actual sending action is performed by the message sending task. The token is released and the message sending task is notified in the ACK interrupt service routine.
[0004] While the above method improves communication efficiency to some extent by completing the communication process through message sending tasks, the message sending tasks may be blocked by other high-priority tasks and interrupts, and there may be a possibility that they cannot be scheduled for a long time. Therefore, it still cannot meet the application scenarios that require high communication efficiency and low latency. Summary of the Invention
[0005] This disclosure provides a communication method, apparatus, electronic device, storage medium, and chip. Its main objective is to achieve high communication efficiency and low latency in application scenarios.
[0006] According to a first aspect of this disclosure, a communication method is provided, comprising:
[0007] The message to be transmitted is placed in the sending queue of the sending channel, and it is determined whether the token required to send the message to be transmitted can be obtained; the token is used to represent the usage rights of the sending channel.
[0008] If the token is obtained, the message to be transmitted is read from the sending queue and sent based on the token;
[0009] Upon receiving an acknowledgment signal from the recipient of the message to be transmitted, the interrupt handling service is initiated, the token is held, and the remaining messages to be transmitted in the transmission queue are sent based on the token, and then the interrupt handling service is exited.
[0010] In some embodiments, initiating the interruption handling service, continuing to hold the token, and sending the remaining messages to be transmitted in the sending queue based on the token includes:
[0011] The system initiates the interrupt handling service and determines whether there are any unsent messages to be transmitted in the sending queue.
[0012] If it is determined that there is an unsent message to be transmitted in the sending queue, then the token is held and another unsent message to be transmitted in the sending queue is sent.
[0013] If it is determined that there are no unsent messages to be transmitted in the sending queue, the token is released and the interrupt handling service is exited.
[0014] In some embodiments, reading from the sending queue and sending the message to be transmitted based on the token includes:
[0015] The read message to be transmitted is written into the data register of the programmable mailbox corresponding to the chip, and the one-hot encoded value corresponding to the interrupt thread is written into the transmit register to generate an interrupt signal to notify the receiver; wherein, the chip includes at least one programmable mailbox, and each programmable mailbox corresponds to a transmit queue;
[0016] The startup interrupt handling service includes:
[0017] Write the mailbox number of the programmable mailbox into the interrupt status register corresponding to the interrupt thread and trigger an interrupt to enter the interrupt handling service.
[0018] In some embodiments, obtaining the token includes:
[0019] Obtain the semaphore or atom of the channel, and define the semaphore or atom as the token; wherein, the channel is the channel between the sender and receiver of the message to be transmitted.
[0020] According to a second aspect of this disclosure, a communication device is provided, comprising:
[0021] The first sending unit is used to put the message to be transmitted into the sending queue of the sending channel;
[0022] A determining unit is used to determine whether a token required to send the message to be transmitted can be obtained; the token is used to represent the access rights to the sending channel;
[0023] The second sending unit is used to read from the sending queue and send the message to be transmitted based on the token if the token is obtained;
[0024] The processing unit is configured to, upon receiving an acknowledgment signal from the recipient of the message to be transmitted, initiate an interruption processing service, continue to hold the token, send the remaining messages to be transmitted in the transmission queue based on the token, and exit the interruption processing service.
[0025] In some embodiments, the processing unit is further configured to:
[0026] The system initiates the interrupt handling service and determines whether there are any unsent messages to be transmitted in the sending queue.
[0027] If it is determined that there is an unsent message to be transmitted in the sending queue, then the token is held and another unsent message to be transmitted in the sending queue is sent.
[0028] If it is determined that there are no unsent messages to be transmitted in the sending queue, the token is released and the interrupt handling service is exited.
[0029] In some embodiments, the second transmitting unit is further configured to:
[0030] The read message to be transmitted is written into the data register of the programmable mailbox corresponding to the chip, and the one-hot encoded value corresponding to the interrupt thread is written into the transmit register to generate an interrupt signal to notify the receiver; wherein, the chip includes at least one programmable mailbox, and each programmable mailbox corresponds to a transmit queue;
[0031] The processing unit is further configured to:
[0032] Write the mailbox number of the programmable mailbox into the interrupt status register corresponding to the interrupt thread and trigger an interrupt to enter the interrupt handling service.
[0033] In some embodiments, the apparatus further includes:
[0034] An acquisition unit is used to acquire the semaphore or atom of the channel and define the semaphore or atom as the token; wherein the channel is the channel between the sender and receiver of the message to be transmitted.
[0035] According to a third aspect of this disclosure, an electronic device is provided, comprising:
[0036] At least one processor; and
[0037] A memory communicatively connected to the at least one processor; wherein,
[0038] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect above.
[0039] According to a fourth aspect of this disclosure, a chip is provided, including one or more interfaces and one or more processors; the interfaces are configured to receive signals from a memory of an electronic device and send the signals to the processors, the signals including computer instructions stored in the memory, which, when executed by the processors, cause the electronic device to perform the method described in any one of the first aspects.
[0040] According to a fifth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are configured to cause the computer to perform the method described in the first aspect above.
[0041] According to a sixth aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in the first aspect above.
[0042] The communication method, apparatus, electronic device, and storage medium provided in this disclosure place the message to be transmitted into the transmission queue of the transmission channel, determine whether a token required to send the message to be transmitted can be obtained; the token is used to represent the usage rights of the transmission channel; if the token is obtained, the message to be transmitted is read from the transmission queue and sent based on the token; after receiving an acknowledgment signal returned by the recipient of the message to be transmitted, an interrupt handling service is started, the token is held, and the remaining messages to be transmitted in the transmission queue are sent based on the token, and the interrupt handling service is exited. Compared with related technologies, the embodiments of this application start the interrupt handling service after completing the transmission of one piece of data to be transmitted, and send the next piece of data to be transmitted based on the token that is still held, so as to achieve seamless connection between two adjacent messages, forming a "chain-like" transmission logic, so as to minimize latency and improve communication efficiency.
[0043] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0044] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0045] Figure 1This is a flowchart illustrating a communication method provided in an embodiment of the present disclosure;
[0046] Figure 2 This is a schematic diagram of the transmission logic in the prior art;
[0047] Figure 3 A flowchart illustrating another communication method provided in an embodiment of this disclosure;
[0048] Figure 4 This is a schematic diagram of the structure of a communication device provided in an embodiment of the present disclosure;
[0049] Figure 5 This is a schematic diagram of another communication device provided in an embodiment of the present disclosure;
[0050] Figure 6 A schematic block diagram of an electronic device provided in an embodiment of this disclosure;
[0051] Figure 7 This disclosure provides a schematic diagram of a chip structure. Detailed Implementation
[0052] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0053] The following description, with reference to the accompanying drawings, describes communication methods, apparatus, electronic devices, storage media, and chips according to embodiments of the present disclosure. Figure 1 This is a flowchart illustrating a communication method provided in an embodiment of the present disclosure.
[0054] like Figure 1 As shown, this method is applied to a chip or mailbox hardware module, and includes the following steps:
[0055] Step 101: Place the message to be transmitted into the transmission queue of the transmission channel, and determine whether the token required to send the message to be transmitted can be obtained; the token is used to represent the usage rights of the transmission channel.
[0056] This application applies to inter-core communication / inter-process communication (IPC), referring to scenarios where different processor cores / processes exchange messages and share resources. IPC is implemented in hardware through an IPC module (IPCM), and the IPCM described in the embodiments of this application includes, but is not limited to, a mailbox hardware module / chip.
[0057] An IPCM typically provides multiple programmable mailboxes, each with its own independent control register space, including source registers, destination registers, transmit registers, data registers, interrupt status registers, and mask registers. It supports multiple interrupt signals, IPCMINT. For example, the ARM PL320 can support 32 programmable mailboxes and 32 interrupt signals, and seven 32-bit data registers. However, this application's embodiments do not specifically limit the above examples.
[0058] The message to be transmitted described in the embodiments of this application includes, but is not limited to, mailbox messages. This message interruption mechanism allows software to set a set of control registers and associated interrupt settings to establish a communication channel between two processor cores and to achieve lightweight data communication by sharing data registers and triggering interrupt notifications.
[0059] In some embodiments, a separate sending queue (ring-buffer) is set up for each programmable mailbox to buffer messages, in order to support scenarios where multiple tasks concurrently use the same programmable mailbox to transmit messages. This application embodiment applies to the sender of the message to be transmitted, which calls the sending interface to place the message (or task) to be transmitted into the sending queue of the sending channel (programmable mailbox).
[0060] This application embodiment adopts a "try-to-transmit mechanism (mbox_try_transmit())", that is, after determining that there is a message to be transmitted in the transmission queue, it attempts to send the message to be transmitted, that is, it attempts to obtain the token required to send the message to be transmitted. The token is the access permission of the transmission channel. If the token is obtained, step 102 is executed.
[0061] In this embodiment of the application, the message is sent directly in the called sending interface in order to complete the message sending in the current task, thereby avoiding the time overhead and uncertainty introduced by task or interruption context switching, as well as scheduling and querying.
[0062] Step 102: If the token is obtained, the message to be transmitted is read from the sending queue and sent based on the token.
[0063] The sender reads the message to be transmitted from the transmission queue and sends the message based on the token until it receives an ACK signal from the receiver of the message to be transmitted, which is the completion process of sending a message.
[0064] In some embodiments, to ensure the reliability of data transmission, the programmable mailbox is not allowed to send other messages during the period when a message is sent; that is, the sending permission of the programmable mailbox needs to be locked.
[0065] Step 103: After receiving the confirmation signal returned by the recipient of the message to be transmitted, start the interruption handling service, continue to hold the token, send the remaining messages to be transmitted in the sending queue based on the token, and exit the interruption handling service.
[0066] After the sender completes a message transmission and receives an acknowledgment signal from the receiver, it initiates an interrupt handling service. During the interrupt handling service, the token is not released immediately. Instead, it first checks whether there are other unsent messages in the transmission queue. The purpose is to "maintain" the right to use the token as much as possible and continue to use the token to send messages in the transmission queue, thereby improving communication efficiency and reducing latency.
[0067] If the message queue is empty, meaning there are no messages to be transmitted, then the interrupt handling service will be terminated.
[0068] To facilitate understanding of the communication efficiency improvement described in the embodiments of this application, as follows: Figure 2 As shown, Figure 2 This is a schematic diagram of the transmission logic in the prior art. Figure 2 As can be seen, there is a certain delay between any two messages, which may be long or short. This embodiment attempts to send the next message during the ACK interrupt handling service, achieving seamless connection between adjacent messages and forming a "chain-like" sending logic to minimize latency.
[0069] The communication method disclosed herein places the message to be transmitted into the transmission queue of a transmission channel, determines whether a token required to send the message can be obtained, and the token represents the access permission of the transmission channel. If the token is obtained, the message to be transmitted is read from the transmission queue and sent based on the token. After receiving an acknowledgment signal from the recipient of the message to be transmitted, an interrupt handling service is initiated, the token is held, and the remaining messages to be transmitted in the transmission queue are sent based on the token, and the interrupt handling service is exited. Compared with related technologies, this embodiment of the application initiates an interrupt handling service after completing the transmission of one piece of data to be transmitted, and sends the next piece of data to be transmitted based on the token held, achieving seamless connection between two adjacent messages, forming a "chain-like" transmission logic to minimize latency and improve communication efficiency.
[0070] Please see Figure 3 , Figure 3 Another communication method is also provided, including:
[0071] Step 201: Place the message to be transmitted into the sending queue of the sending channel.
[0072] Step 202: Attempt to send the data to be transmitted.
[0073] Step 203: Determine whether a token required to send the message to be transmitted can be obtained; the token is used to represent the access rights to the sending channel.
[0074] If the token is obtained, proceed to step 204; if it is determined that the token has not been obtained, proceed to step 208.
[0075] In some embodiments, the chip IPCM includes at least one programmable mailbox, the programmable mailboxes are independent of each other, and each programmable mailbox corresponds to a transmission queue. Each programmable mailbox has a unique token. When obtaining the token, it can be implemented in the following ways, but is not limited to: obtaining the semaphore or atom of the channel and customizing the semaphore or atom as the token. Wherein, the channel is the channel between the sender and receiver of the message to be transmitted.
[0076] In practical applications, each channel corresponds to a control block (structure). This control block sets a variable as a token. This variable can be in the form of a semaphore or an atomic value. Semaphores and atomic values are specific implementation methods, using a non-blocking method to acquire and release semaphores. Further optimization is possible by using atomic values to implement the token function.
[0077] Step 204: Read the message to be transmitted from the sending queue and send it based on the token;
[0078] Step 205: Control the entry into the interrupt handling service and determine whether there are any unsent messages to be transmitted in the sending queue.
[0079] If it is determined that there are unsent messages to be transmitted in the sending queue, then step 206 is executed; if it is determined that there are no unsent messages to be transmitted in the sending queue, then step 207 is executed.
[0080] Step 206: Continue sending one message that has not yet been sent in the sending queue.
[0081] The queue follows the first-in, first-out (FIFO) principle. After sending a message to be transmitted for one day based on a token, the next message to be transmitted is read and sent from the sending queue in FIFO order.
[0082] In the ACK interrupt handling service, the next message to be transmitted is attempted to be sent, so as to achieve seamless connection between two adjacent messages and form a "chain" sending logic to minimize latency.
[0083] Step 207: Release the token and exit the interrupt handling service.
[0084] Release the token so that other sending channels can use it to complete communication.
[0085] Step 208: Monitor whether the token has timed out.
[0086] In some embodiments, if obtaining a token fails, it indicates that the programmable mailbox is currently sending a message and has not yet received an ACK. Scenarios where sending errors may occur may arise; therefore, it is necessary to monitor the duration of token occupancy.
[0087] The token's holding time is an empirical value, which can be set to 50 milliseconds, 10 milliseconds, etc., according to actual needs. This application embodiment does not limit the specific duration. As a feasible method in this embodiment, a timer can be used to monitor whether the token has timed out. Specifically, this embodiment does not limit the specific implementation method of the monitoring.
[0088] To further improve communication efficiency, once a token timeout is detected, the data to be sent in the sending queue is read "immediately" and the message to be transmitted is sent out, so as to make full use of the gap while waiting for ACK to perform other tasks, thereby improving communication efficiency.
[0089] If the timeout occurs, proceed to step 204; otherwise, proceed to step 209.
[0090] As one possible implementation of this application embodiment, the read message to be transmitted is written into the data register of the programmable mailbox corresponding to the chip, and the single-hot encoded value corresponding to the interrupt thread is written into the transmit register to generate an interrupt signal to notify the receiver. After receiving the acknowledgment signal returned by the receiver of the message to be transmitted, the mailbox number of the programmable mailbox is written into the interrupt status register corresponding to the interrupt thread, and an interrupt is triggered to enter the interrupt handling service.
[0091] Each programmable mailbox has an independent control register space, including source register, destination register, transmit register, data register, interrupt status register, mask register, etc., and supports multiple interrupt signals IPCMINT.
[0092] Taking the example of sending a message from sender Core0 to receiver Core1, assume that Core0 occupies a programmable mailbox (such as programmable mailbox 3), write 0x02 and 0x01 (the one-hot encoded values corresponding to IPCMINT[1] and IPCMINT[0]) to the source register and destination register of the programmable mailbox respectively, and enable interrupts IPCMINT[0] and IPCMINT[1] through the mask register. Among them, IPCMINT[1] and IPCMINT[0] are connected to the interrupt controllers of Core0 and Core1 respectively, associated with specific interrupt numbers and bound to interrupt handling services.
[0093] The message to be transmitted is written to a set of data registers, and 0x01 is written to the transmit register (to generate an interrupt signal to notify the receiver); IPCM writes the mailbox number to the interrupt status register IPCMMIS[0] corresponding to IPCMINT[0] and triggers the IPCMINIT[0] interrupt. Core1 is interrupted and enters the interrupt handling service. It reads the mailbox number in the status register IPCMMIS[0] to determine which (or which) programmable mailbox the interrupt comes from, then reads the (set of) data registers of the corresponding programmable mailbox, and writes 0x02 to its transmit register to trigger the acknowledgment interrupt (ACK) in reverse. Core0 is interrupted by the acknowledgment message, and the operation is completed.
[0094] Step 209: Return to the enqueue state.
[0095] The above embodiment illustrates the communication process of one programmable mailbox as an example. When multiple programmable mailboxes communicate in parallel, they use the above communication method to complete communication with each other.
[0096] Corresponding to the communication method described above, the present invention also proposes a communication device. Since the device embodiments of the present invention correspond to the method embodiments described above, details not disclosed in the device embodiments can be referred to in the method embodiments described above, and will not be repeated here.
[0097] Figure 4 This is a schematic diagram of the structure of a communication device provided in an embodiment of the present disclosure, such as... Figure 4 As shown, it includes:
[0098] The first sending unit 31 is used to put the message to be transmitted into the sending queue of the sending channel;
[0099] The determining unit 32 is used to determine whether a token required to send the message to be transmitted can be obtained; the token is used to represent the access rights of the sending channel.
[0100] The second sending unit 33 is used to read from the sending queue and send the message to be transmitted based on the token if the token is obtained;
[0101] The processing unit 34 is configured to, upon receiving an acknowledgment signal returned by the recipient of the message to be transmitted, initiate an interruption processing service, continue to hold the token, send the remaining messages to be transmitted in the sending queue based on the token, and exit the interruption processing service.
[0102] The communication device provided in this disclosure places the message to be transmitted into the transmission queue of the transmission channel and determines whether a token required to send the message can be obtained. The token represents the access permission of the transmission channel. If the token is obtained, the message to be transmitted is read from the transmission queue and sent based on the token. After receiving an acknowledgment signal from the recipient of the message to be transmitted, an interrupt handling service is initiated, the token is held, and the remaining messages to be transmitted in the transmission queue are sent based on the token. The interrupt handling service is then exited. Compared with related technologies, this embodiment of the application initiates an interrupt handling service after completing the transmission of one piece of data to be transmitted, and sends the next piece of data to be transmitted based on the token held. This achieves seamless connection between two adjacent messages, forming a "chain-like" transmission logic to minimize latency and improve communication efficiency.
[0103] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 5 As shown, the processing unit 34 is also used for:
[0104] The system initiates the interrupt handling service and determines whether there are any unsent messages to be transmitted in the sending queue.
[0105] If it is determined that there is an unsent message to be transmitted in the sending queue, then the token is held and another unsent message to be transmitted in the sending queue is sent.
[0106] If it is determined that there are no unsent messages to be transmitted in the sending queue, the token is released and the interrupt handling service is exited.
[0107] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 5 As shown, the second transmitting unit 32 is further configured to:
[0108] The read message to be transmitted is written into the data register of the programmable mailbox corresponding to the chip, and the one-hot encoded value corresponding to the interrupt thread is written into the transmit register to generate an interrupt signal to notify the receiver; wherein, the chip includes at least one programmable mailbox, and each programmable mailbox corresponds to a transmit queue;
[0109] The processing unit 34 is further configured to:
[0110] Write the mailbox number of the programmable mailbox into the interrupt status register corresponding to the interrupt thread and trigger an interrupt to enter the interrupt handling service.
[0111] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 5 As shown, the device further includes:
[0112] The acquisition unit 35 is used to acquire the semaphore or atomic quantity of the channel and define the semaphore or atomic quantity as the token; wherein, the channel is the channel between the sender and receiver of the message to be transmitted.
[0113] It should be noted that the foregoing explanation of the method embodiments also applies to the apparatus of the embodiments of this disclosure, and the principle is the same. Therefore, the embodiments of this disclosure are not limited thereto.
[0114] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0115] Figure 6 A schematic block diagram of an example electronic device 400 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0116] like Figure 6As shown, device 400 includes a computing unit 401, which can perform various appropriate actions and processes based on a computer program stored in ROM (Read-Only Memory) 402 or a computer program loaded from storage unit 408 into RAM (Random Access Memory) 403. RAM 403 may also store various programs and data required for the operation of device 400. The computing unit 401, ROM 402, and RAM 403 are interconnected via bus 404. I / O (Input / Output) interface 405 is also connected to bus 404.
[0117] Multiple components in device 400 are connected to I / O interface 405, including: input unit 406, such as keyboard, mouse, etc.; output unit 407, such as various types of monitors, speakers, etc.; storage unit 408, such as disk, optical disk, etc.; and communication unit 409, such as network card, modem, wireless transceiver, etc. Communication unit 409 allows device 400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0118] The computing unit 401 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, CPUs (Central Processing Units), GPUs (Graphics Processing Units), various special-purpose AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, DSPs (Digital Signal Processors), and any suitable processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above, such as communication methods. For example, in some embodiments, the communication method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by the computing unit 401, one or more steps of the methods described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the aforementioned communication method by any other suitable means (e.g., by means of firmware).
[0119] In cases where the electronic device can be a chip or a chip system, the chip or chip system can be... Figure 6 The computing unit 401 shown may also be other chips or chip systems that are independent of the computing unit 401 but have data interaction relationships. The specific embodiments of this application do not limit this.
[0120] See also Figure 7 The diagram shows the structure of the chip. Figure 7 The chip shown includes a processor 501 and an interface 502. There can be one or more processors 501, and multiple interfaces 502.
[0121] Optionally, the chip also includes a memory 503 for storing necessary computer programs and data.
[0122] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application-Specific Standard Products), SOCs (System-on-Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0123] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0124] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0125] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0126] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include LANs (Local Area Networks), WANs (Wide Area Networks), the Internet, and blockchain networks.
[0127] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.
[0128] It's important to note that artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily include computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graph technologies.
[0129] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0130] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A communication method, characterized in that, include: The message to be transmitted is placed in the transmission queue of the transmission channel, and it is determined whether the token required to send the message to be transmitted can be obtained. The token is used to indicate the user permission for the sending channel; If the token is obtained, the message to be transmitted is read from the sending queue and sent based on the token; Upon receiving an acknowledgment signal from the recipient of the message to be transmitted, the interrupt handling service is initiated, the token is held, and the remaining messages to be transmitted in the transmission queue are sent based on the token, and then the interrupt handling service is exited.
2. The method according to claim 1, characterized in that, The process of initiating the interrupt handling service, continuing to hold the token, and sending the remaining messages to be transmitted in the sending queue based on the token includes: The system initiates the interrupt handling service and determines whether there are any unsent messages to be transmitted in the sending queue. If it is determined that there is an unsent message to be transmitted in the sending queue, then the token is held and another unsent message to be transmitted in the sending queue is sent. If it is determined that there are no unsent messages to be transmitted in the sending queue, the token is released and the interrupt handling service is exited.
3. The method according to claim 1, characterized in that, After determining whether the token required to send the message to be transmitted can be obtained, the method includes: If it is determined that the token has not been obtained, monitor whether the token has timed out; After determining that the token has timed out, the message to be transmitted is read from the sending queue and sent based on the token.
4. The method according to claim 1, characterized in that, The step of reading the message to be transmitted from the sending queue and sending it based on the token includes: The read message to be transmitted is written into the data register of the programmable mailbox corresponding to the chip, and the one-hot encoded value corresponding to the interrupt thread is written into the transmit register to generate an interrupt signal to notify the receiver; wherein, the chip includes at least one programmable mailbox, and each programmable mailbox corresponds to a transmit queue; The startup interrupt handling service includes: Write the mailbox number of the programmable mailbox into the interrupt status register corresponding to the interrupt thread and trigger an interrupt to enter the interrupt handling service.
5. The method according to claim 4, characterized in that, Obtaining the token includes: Obtain the semaphore or atom of the channel, and define the semaphore or atom as the token; wherein, the channel is the channel between the sender and receiver of the message to be transmitted.
6. A communication device, characterized in that, include: The first sending unit is used to put the message to be transmitted into the sending queue of the sending channel; A determining unit is used to determine whether a token required to send the message to be transmitted can be obtained; The token is used to indicate the access rights to the sending channel; The second sending unit is used to read from the sending queue and send the message to be transmitted based on the token if the token is obtained; The processing unit is configured to, upon receiving an acknowledgment signal from the recipient of the message to be transmitted, initiate an interruption processing service, continue to hold the token, send the remaining messages to be transmitted in the transmission queue based on the token, and exit the interruption processing service.
7. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
8. A chip, characterized in that, It includes one or more interfaces and one or more processors; the interfaces are used to receive signals from the memory of an electronic device and send the signals to the processors, the signals including computer instructions stored in the memory, which, when executed by the processors, cause the electronic device to perform the method of any one of claims 1-5.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-5.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method according to any one of claims 1-5.
Citation Information
Cited By
Wavefront distributor, chip and computer equipment
CN121524129A