Communication synchronization method, processor system, chip, board card and device

By using an asynchronous inter-core communication handshake synchronization method with two-end mutual matching, the problems of low synchronization efficiency and high channel occupancy in inter-core communication are solved, achieving efficient inter-core communication and improving system performance.

CN122240552APending Publication Date: 2026-06-19BEIJING TSINGMICRO INTELLIGENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING TSINGMICRO INTELLIGENT TECH CO LTD
Filing Date
2026-02-14
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing inter-core communication synchronization mechanisms are inefficient in multi-core and many-core processor systems, resulting in additional latency and high central processing unit resource consumption, which affects the overall system efficiency and throughput.

Method used

An asynchronous inter-core communication handshake synchronization method with two-end mutual matching is adopted. The synchronization status is indicated in the handshake information, which reduces the number of handshake synchronization messages sent, thereby achieving asynchronous communication synchronization and reducing communication delay and channel occupation.

Benefits of technology

It improves the efficiency of inter-core communication, reduces the number of handshake synchronization message transmissions, reduces communication latency and channel occupancy, and enhances the overall system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122240552A_ABST
    Figure CN122240552A_ABST
Patent Text Reader

Abstract

This application discloses a communication synchronization method, processor system, chip, board, and device. The method includes: when a first communication terminal is in a first state, the first communication terminal determines that it has not received a first handshake message indicating a first synchronization state sent by a second communication terminal, and sends a second handshake message indicating a first synchronization state to the second communication terminal; when the first communication terminal determines that it has received a third handshake message indicating a first synchronization state sent by the second communication terminal, the first communication terminal determines that handshake synchronization with the second communication terminal has been completed, and sends a fourth handshake message indicating a second synchronization state to the second communication terminal; the second synchronization state indicates that the second communication terminal and the first communication terminal have completed handshake synchronization. This method can effectively reduce the number of handshake synchronization messages sent, improve communication efficiency, and reduce communication latency and channel occupancy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a communication synchronization method, processor system, chip, board, and device. Background Technology

[0002] Currently, multi-core and many-core processors are widely used in high-performance computing, artificial intelligence, and other fields, and efficient inter-core collaboration has become the key to improving overall computing power. In such systems, cores executing different tasks often need to communicate data and synchronize their states to ensure the correctness and continuity of computation.

[0003] Existing inter-core communication synchronization mechanisms typically require multiple interactions between the communicating parties before data transmission to achieve consistency in the ready state. However, with the continuous growth of computational task complexity and system scale, the above approach has the following problems in actual operation: First, the synchronization process itself may introduce significant additional latency, especially in large-scale distributed computing scenarios, where this latency is further amplified; second, its implementation often requires consuming the processing resources of the central processing unit to manage the synchronization state, thereby crowding out the processing power and bandwidth originally used for core computing tasks, reducing the overall efficiency and throughput of the system.

[0004] There is currently no effective solution to the problems of low synchronization efficiency and high channel occupancy in inter-core communication. Summary of the Invention

[0005] The purpose of this application is to provide a communication synchronization method, processor system, chip, board, and device to solve the problems of low efficiency and high channel occupancy in inter-core communication synchronization.

[0006] To solve the above-mentioned technical problems, the first aspect of this specification provides a communication synchronization method, including: When the first communication terminal is in the first state, the first communication terminal determines that it has not received the first handshake information indicating the first synchronization state sent by the second communication terminal, and sends the second handshake information indicating the first synchronization state to the second communication terminal; the first state is used to characterize that the corresponding communication terminal is in a state of waiting to communicate with the peer communication terminal, and the first synchronization state characterizes that the second communication terminal and the first communication terminal have not completed the handshake synchronization. When the first communication terminal determines that it has received the third handshake information indicating the first synchronization state sent by the second communication terminal, the first communication terminal determines that it has completed the handshake synchronization with the second communication terminal, and sends the fourth handshake information indicating the second synchronization state to the second communication terminal; the second synchronization state indicates that the second communication terminal and the first communication terminal have completed the handshake synchronization.

[0007] In some embodiments of this specification, after the first communication terminal is in the first state, the following is also included: The first communication terminal confirms that it has received the first handshake message; The first communication terminal determines that it has completed a handshake synchronization with the second communication terminal, and the second communication terminal sends a fifth handshake message indicating the second synchronization state.

[0008] In some embodiments of this specification, the third handshake information is sent to the first communication terminal after the second communication terminal is in the first state and the second communication terminal determines that it has not received the second handshake information sent by the first communication terminal.

[0009] In some embodiments of this specification, the third handshake information is sent from the second communication terminal to the first communication terminal when the second communication terminal is in the first state after the second communication terminal receives and discards the second handshake information while in the second state. The second state is used to indicate that the corresponding communication end is not in a state of waiting to communicate with the other end.

[0010] In some embodiments of this specification, after the first communication terminal sends second handshake information indicating a first synchronization state to the second communication terminal, the method further includes: The first communication terminal determines that it has received the sixth handshake information indicating the second synchronization state sent by the second communication terminal; the sixth handshake information is sent by the second communication terminal to the first communication terminal in response to the second handshake information when the second communication terminal determines that it has received the second handshake information, the second communication terminal is in the first state and the second communication terminal has not sent the third handshake information to the first communication terminal; The first communication terminal determines that it has completed handshake synchronization with the second communication terminal, and sends a seventh handshake message indicating the second synchronization state to the second communication terminal.

[0011] In some embodiments of this specification, after the first communication terminal sends second handshake information indicating a first synchronization state to the second communication terminal, the method further includes: The first communication terminal determines that it has received the eighth handshake information indicating the second synchronization state sent by the second communication terminal; the eighth handshake information is sent by the second communication terminal to the first communication terminal in response to the second handshake information after the second communication terminal determines that it has received the second handshake information, the second communication terminal is in the first state, and the second communication terminal has sent the third handshake information to the first communication terminal; The first communication terminal discards the eighth handshake information.

[0012] In some embodiments of this specification, the method further includes the following steps before the first communication terminal is in the first state: When the first communication terminal is in the second state, and the first communication terminal determines that it has received the ninth handshake information indicating the first synchronization state sent by the second communication terminal, the ninth handshake information is discarded; the second state is used to characterize that the corresponding communication terminal is not in a state of waiting to communicate with the peer communication terminal.

[0013] In some embodiments of this specification, after the first communication terminal determines that it has completed handshake synchronization with the second communication terminal, the method further includes: The first communication terminal ends the handshake synchronization with the second communication terminal, and discards the tenth handshake information upon receiving the tenth handshake information from the second communication terminal.

[0014] In some embodiments of this specification, the communication synchronization between the first communication terminal and the second communication terminal is inter-core communication synchronization.

[0015] A second aspect of this specification provides a processor system, including a central processing unit and a communication controller, wherein the communication controller includes a communication instruction parsing unit, a status register, and a handshake control unit; The central processing unit is used to generate and send communication instructions to the communication instruction parsing unit, and the communication instructions are used to instruct the communication controller to communicate with the peer processor system. The communication instruction parsing unit is used to parse the received communication instruction and store the parsing result as communication status information in the status register; The handshake control unit is configured to: obtain communication status information from the status register, and when it is determined based on the communication status information that the processor system is in a first state and that it has not received first handshake information indicating a first synchronization state from the peer processor system, send second handshake information indicating a first synchronization state to the peer processor system. The first state indicates that the processor system is in a state of waiting to communicate with the peer processor system, and the first synchronization state indicates that the processor system and the peer processor system have not completed handshake synchronization. When it is determined that a third handshake information indicating a first synchronization state has been received from the peer processor system, determine that handshake synchronization with the peer processor system has been completed, and send fourth handshake information indicating a second synchronization state to the peer processor system. The second synchronization state indicates that the processor system and the peer processor system have completed handshake synchronization.

[0016] In some embodiments of this specification, the handshake control unit includes a first handshake control subunit and a second handshake control subunit; When the processor system acts as the source of communication data during data communication, the processor system completes handshake synchronization with the peer processor system through the first handshake control subunit; when the processor system acts as the source of communication data during data communication, the processor system completes handshake synchronization with the peer processor system through the second handshake control subunit.

[0017] In some embodiments of this specification, the status register is used to store device information of the peer processor system, the synchronization status between the processor system and the peer processor system, and the communication status between the processor system and the peer processor system.

[0018] A third aspect of this specification provides a chip that integrates at least one of the processor systems described in the second aspect above.

[0019] This specification provides a board in its fourth aspect, which includes the chip described in the third aspect above.

[0020] This specification provides a fifth aspect of an electronic device, including the board described in the fourth aspect above.

[0021] Based on the communication synchronization method, processor system, chip, board, and device provided in the embodiments of this specification, when the first communication terminal is in a first state, if the first communication terminal determines that it has not received the first handshake information indicating the first synchronization state sent by the second communication terminal, it sends a second handshake information indicating the first synchronization state to the second communication terminal. The first state is used to characterize that the corresponding communication terminal is in a state of waiting to communicate with the peer communication terminal, and the first synchronization state indicates that the second communication terminal and the first communication terminal have not completed handshake synchronization. Furthermore, when the first communication terminal determines that it has received the third handshake information indicating the first synchronization state sent by the second communication terminal, the first communication terminal determines that it has completed handshake synchronization with the second communication terminal, and sends a fourth handshake information indicating the second synchronization state to the second communication terminal. The second synchronization state indicates that the second communication terminal and the first communication terminal have completed handshake synchronization. Through the above method, the synchronization state indicated in the handshake information can indicate whether handshake synchronization has been achieved between the first communication terminal and the second communication terminal, reducing the number of handshake synchronization messages sent. In addition, during the handshake synchronization process, the first communication terminal and the second communication terminal can perform asynchronous communication synchronization, that is, both the first communication terminal and the second communication terminal can send handshake information indicating the first synchronization state or the second synchronization state, which can reduce communication delay. Therefore, the first and second communication ends do not need to perform frequent handshake synchronization communication. Each communication end sends at most two handshake messages indicating different synchronization states, which can effectively reduce the number of handshake synchronization messages sent and improve communication efficiency. At the same time, the reduction in the number of handshake synchronization messages sent can further reduce communication delay and channel occupation. Attached Figure Description

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

[0023] Figure 1 The diagram shown is a schematic of a communication handshake method provided in one embodiment; Figure 2 The diagram shown is a schematic of a communication handshake method provided in one embodiment; Figure 3 The diagram shown is a schematic representation of a communication synchronization method provided in an embodiment of this specification. Figure 4 The diagram shown is a schematic of the handshake protocol message format provided in the embodiments of this specification; Figure 5 The diagram shown is a schematic representation of a communication synchronization method provided in an embodiment of this specification. Figure 6 The diagram shown is a schematic representation of a communication synchronization method provided in an embodiment of this specification. Figure 7 The diagram shown is a schematic representation of a communication synchronization method provided in an embodiment of this specification. Figure 8 The diagram shown is a schematic representation of a communication synchronization method provided in an embodiment of this specification. Figure 9 The diagram shown is a schematic representation of a communication synchronization method provided in an embodiment of this specification. Figure 10 The diagram shown is a schematic of an asynchronous inter-core communication handshake synchronization method for mutual matching between two ends provided in an embodiment of this specification. Figure 11 The diagram shown is a schematic representation of a first type of application scenario provided in the embodiments of this specification. Figure 12 The diagram shown is a schematic representation of a second type of application scenario provided in the embodiments of this specification. Figure 13 The diagram shown is a schematic representation of a third type of application scenario provided in the embodiments of this specification. Figure 14 The diagram shown is a schematic representation of a fourth type of application scenario provided in the embodiments of this specification. Figure 15 The diagram shown is a schematic representation of the fifth type of application scenario provided in the embodiments of this specification; Figure 16The diagram shown is a schematic representation of the sixth type of application scenario provided in the embodiments of this specification; Figure 17 The diagram shown is a schematic of a processor system provided in an embodiment of this specification; Figure 18 The diagram shown is a schematic of a communication controller provided in an embodiment of this specification; Figure 19 The diagram shown is a schematic of a handshake synchronization method based on a communication controller provided in an embodiment of this specification. Detailed Implementation

[0024] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0025] It should be noted that the information and data related to users involved in the embodiments of this specification are all information and data authorized by the user or fully authorized by the relevant parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with relevant laws, regulations, and standards, and necessary confidentiality measures have been taken. They do not violate public order and good morals, and corresponding operation entry points are provided for users or relevant parties to choose to authorize or refuse.

[0026] It should also be noted that in the embodiments of this specification, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.

[0027] To facilitate understanding of the communication synchronization method in the embodiments of this specification, the technical terms involved in the following embodiments will be explained below.

[0028] Shared memory architecture: Multiple cores share a common external memory, and each core can access the data in this memory.

[0029] Dataflow architecture: Each core's storage is private, and data needs to be moved from one core's memory to another core's memory in order for data to be accessed by multiple cores (communication behavior).

[0030] Producer: The data producer in a data flow architecture, that is, the source of data communication in a data flow architecture.

[0031] Consumer: The data consumer in a data flow architecture, that is, the destination when communicating data in a data flow architecture.

[0032] Communication handshake: When two cores transmit data, the producer and consumer cores need to synchronize to ensure that both ends are ready and matched successfully before data transmission can begin. Otherwise, memory scrambling and other behaviors may occur, leading to calculation errors.

[0033] As mentioned earlier, efficient inter-core collaboration is crucial for improving overall computing power in fields such as high-performance computing and artificial intelligence. Taking the training and inference process of large models as an example, memory access bottlenecks are a significant performance limiting factor. Compared to traditional shared memory architectures (such as GPUs (Graphics Processing Units)), dataflow architectures can effectively solve the memory access bottleneck problem by transferring data between multiple cores in a producer-consumer model, reducing access to memory (DDR (Double Data Rate Synchronous Dynamic Random-Access Memory) and HBM (High Bandwidth Memory)). However, multiple cores generally execute asynchronously, and the time when the producer prepares data is different from the time when the consumer is ready to receive data. Therefore, during inter-core communication, a handshake synchronization is required between the producer and consumer to ensure the correctness of data transmission. Taking the producer issuing a handshake communication request as an example... Figure 1 As shown in 'a', the consumer's memory is ready, but the producer is not ready at this time. The consumer is in a waiting state until the producer's data is ready. The producer initiates a handshake communication. After the two parties communicate and match, synchronization is completed, and the producer begins to send data. Figure 1 As shown in b, the producer's data is ready first, and the producer initiates a handshake communication. However, at this time, the consumer's memory is not ready. Synchronization is completed after both parties communicate and match, and the producer begins sending data. With the increasing number of parameters in large models, the scale of equipment required for training and inference is also gradually increasing, leading to a rapid increase in the handshake latency between cores on different cards, especially for cross-node and cross-server inter-core communication, where the latency has reached the hundreds of microseconds or even milliseconds. The handshake synchronization latency of inter-core communication in dataflow architectures accounts for a significantly larger proportion of the overall communication latency, especially for small-volume data communication during inference.

[0034] Currently, most multi-core communication handshake mechanisms based on dataflow architectures use CPU (Central Processing Unit) software for handshake synchronization. This approach has two drawbacks: 1) Only when the producer or consumer sends a handshake communication request, if the other party is not ready, it keeps retransmitting until the other party is ready, at which point a match is achieved and the formal communication process begins; 2) Using CPU software for handshake matching requires frequent CPU intervention, consuming CPU resources and affecting the execution of other computational and memory access instructions, resulting in low overall system efficiency. For example... Figure 2 As shown in Figure a, after the producer core's data is ready, it sends a handshake matching protocol message to the consumer core via the CPU. If the consumer core's memory is not ready after the first message is sent, and it cannot receive the producer core's data, then the consumer core returns a matching failure signal to the producer core. Upon receiving this signal, the producer core re-initiates the handshake matching protocol message. Matching only succeeds when the consumer core's memory is ready and it receives the producer core's handshake matching protocol message, at which point the formal data transfer process begins. Conversely, refer to... Figure 2 As shown in Figure b, if the consumer core initiates a handshake request to the producer core, and the producer core's data is not ready until later, the consumer core needs to send multiple handshake protocol messages to the producer core. In practical applications where the ready times of the producer and consumer differ significantly, the single-end handshake matching mechanism implemented in this software requires either the producer or consumer core to repeatedly send handshake protocol messages, resulting in substantial communication overhead. Furthermore, this software implementation requires frequent CPU intervention, preventing the CPU from simultaneously handling other tasks (such as computational tasks), severely impacting overall system performance.

[0035] To address the aforementioned issues, this specification provides a communication synchronization method that enables asynchronous inter-core communication handshake synchronization through mutual matching between two ends. This reduces the number of handshake protocol message communications, handshake synchronization delay, and message channel occupancy. This communication synchronization method can be implemented via CPU software or other hardware within the processor system. For example, the proposed handshake synchronization mechanism can be implemented using a state machine and a small amount of register resources, thereby decoupling the CPU and improving both communication and CPU efficiency.

[0036] The communication synchronization method provided in the embodiments of this specification will be described below with reference to the accompanying drawings. It is understood that the first communication terminal and the second communication terminal mentioned below may each include a computing core / engine (hereinafter referred to as a core). The first communication terminal and the second communication terminal may reside on the same chip, or on different chips of the same electronic device, or on chips of different electronic devices, or on different nodes in a service cluster, etc. Furthermore, the first communication terminal may be a data producer in the data flow framework, and the second communication terminal may be a data consumer in the data flow framework; or, the first communication terminal may be a data consumer in the data flow framework, and the second communication terminal may be a data producer in the data flow framework.

[0037] Figure 3 The diagram illustrates a communication synchronization method provided in an embodiment of this specification. While this specification provides method operation steps or apparatus structures as shown in the following embodiments or figures, the method or apparatus may include more or fewer operation steps or module units, either combined or without inventive effort, based on conventional methods or without requiring creative work. In steps or structures where there is no logically necessary causal relationship, the execution order of these steps or the module structure of the apparatus is not limited to the execution order or module structure shown in the embodiments or figures of this specification. When the method or module structure is applied in actual devices, servers, or terminal products, it can be executed sequentially or in parallel according to the method or module structure shown in the embodiments or figures (e.g., parallel processor systems or multi-threaded processing environments, even including distributed processing and server cluster implementation environments). Figure 3 As shown, it may include: S301: When the first communication terminal is in the first state, the first communication terminal determines that it has not received the first handshake information indicating the first synchronization state sent by the second communication terminal, and sends the second handshake information indicating the first synchronization state to the second communication terminal; the first state is used to characterize that the corresponding communication terminal is in a state of waiting to communicate with the peer communication terminal, and the first synchronization state characterizes that the second communication terminal and the first communication terminal have not completed the handshake synchronization.

[0038] It can be understood that the first communication terminal being in the first state indicates that the first communication terminal is ready, that is, the corresponding communication terminal (e.g., the first communication terminal) is in a state of waiting to communicate with the other end communication terminal (e.g., the other end communication terminal). For example, when the first communication terminal is a data producer, the first communication terminal being in the first state means that the data (data to be communicated and transmitted) of the first communication terminal is ready; when the first communication terminal is a data consumer, the first communication terminal being in the first state means that the memory of the first communication terminal is ready.

[0039] It is understood that the handshake information sent by the first and second communication terminals in the embodiments of this specification may include information indicating the synchronization status of the corresponding communication terminals. For example, the first synchronization status in the first handshake information, the first synchronization status in the second handshake information, the first synchronization status in the third handshake information, the second synchronization status in the fourth handshake information, etc. Based on the synchronization status in the handshake information, it can be determined whether the corresponding communication terminal has completed handshake synchronization with the peer (i.e., the communication terminal that is synchronizing data with the current communication terminal). Specifically, incomplete handshake synchronization can be characterized by the first synchronization status, and completed handshake synchronization can be characterized by the second synchronization status.

[0040] In some embodiments of this specification, the handshake information can be a handshake protocol message, which may include a flag bit representing the synchronization state. Furthermore, different values ​​can represent different synchronization states; for example, the flag bit can be 1 bit, and "0" can represent the first synchronization state, and "1" can represent the second synchronization state.

[0041] Furthermore, the handshake protocol message may also include the communication role field of the corresponding communicating end (e.g., whether it is a data producer or a data consumer), the peer chip ID, the peer core ID, the memory address for sending or receiving data, and the amount of data sent or received. For example, the format of the handshake protocol message can be as follows: Figure 4 As shown, the Producer or Consumer represents the communication role information, and whether it has matched indicates the synchronization status. The peer chip ID is the peer chip ID. Each part of the handshake protocol message can occupy at least one bit, which can be determined based on the total length of the handshake protocol message and the length of the corresponding fields in each part. Setting a flag bit representing the synchronization status in the handshake protocol message allows the peer to quickly determine the synchronization status of the communication end that sent the handshake protocol message after receiving it, that is, whether it has successfully matched with the peer. This can reduce the number of handshake synchronization communications and improve handshake synchronization efficiency.

[0042] It is understood that the first communication terminal determining that it has not received the first handshake information indicating the first synchronization state sent by the second communication terminal specifically means that the first communication terminal, after being ready (i.e., after the first communication terminal enters the first state), has not received the first handshake information indicating the first synchronization state sent by the second communication terminal. The first communication terminal can determine the synchronization state indicated in the handshake information sent to the second communication terminal based on whether or not it has received the first handshake information. Specifically, if the first communication terminal determines that it has not received the first handshake information indicating the first synchronization state, it indicates that the second communication terminal is not yet ready, or is ready but has not yet sent the handshake information indicating the first synchronization state to the first communication terminal, or the second communication terminal is ready and has sent the handshake information indicating the first synchronization state to the first communication terminal, but the first communication terminal has not received the handshake information. Regardless of whether the second communication terminal is in any of the above three situations, since the first communication terminal is already ready, it does not need to wait for the handshake information sent by the second communication terminal and can send the second handshake information indicating the first synchronization state to the second communication terminal to reduce communication delay.

[0043] S302: When the first communication terminal determines that it has received the third handshake information indicating the first synchronization state sent by the second communication terminal, the first communication terminal determines that it has completed the handshake synchronization with the second communication terminal, and sends the fourth handshake information indicating the second synchronization state to the second communication terminal; the second synchronization state indicates that the second communication terminal and the first communication terminal have completed the handshake synchronization.

[0044] It is understandable that the third handshake information can be received by the first communication terminal after sending the second handshake information to the second communication terminal. Specifically, the third handshake information can be sent by the second communication terminal before receiving the second handshake information, or it can be sent by the second communication terminal after receiving the second handshake information and determining that the second communication terminal is ready.

[0045] That is, the second communication end can be ready before receiving the second handshake information. However, since the second handshake information has not been received, the second communication end can initiate communication synchronization with the first communication end without waiting, which is the aforementioned third handshake information.

[0046] Alternatively, the second communication terminal receives the second handshake information, but because it is not yet ready, it discards the second handshake information and sends the aforementioned third handshake information to the first communication terminal once it is ready. In this process, the first communication terminal does not need to send handshake information indicating the first synchronization state to the second communication terminal multiple times; it only needs to wait for the second communication terminal to be ready before it actively sends the aforementioned third handshake information to the first communication terminal. This reduces the number of communications and improves communication efficiency.

[0047] Furthermore, after receiving the third handshake information, the first communication terminal can determine that it and the second communication terminal have completed handshake synchronization. The first communication terminal can then mark itself as matched (or synchronized) and send a fourth handshake message indicating a second synchronization state to the second communication terminal, thus indicating that the first communication terminal has successfully matched with it. Since the second communication terminal received the second handshake information before receiving the fourth handshake message, and can complete its handshake synchronization with the first communication terminal based on this second handshake message, and return handshake information indicating a second synchronization state to the first communication terminal, the second communication terminal can ignore the fourth handshake message, and the first communication terminal can ignore the handshake information indicating a second synchronization state returned by the second communication terminal. In the aforementioned communication synchronization process between the first and second communication terminals, each communication terminal sends at most two handshake messages indicating the synchronization state, reducing the number of handshake synchronization communications, improving communication efficiency, and reducing channel occupancy.

[0048] In the embodiments of this specification, the synchronization state indicated in the handshake information can indicate whether handshake synchronization has been achieved between the first and second communication ends, reducing the number of handshake synchronization messages sent. Furthermore, during the handshake synchronization process, the first and second communication ends can perform asynchronous communication synchronization; that is, both the first and second communication ends can send handshake information indicating either a first or second synchronization state, reducing communication latency. Therefore, the first and second communication ends do not need to perform frequent handshake synchronization communications; each communication end sends at most two handshake messages indicating different synchronization states, effectively reducing the number of handshake synchronization messages sent and improving communication efficiency. Simultaneously, the reduction in the number of handshake synchronization messages further reduces communication latency and channel occupancy.

[0049] In some embodiments of this specification, after the first communication terminal is in the first state, the method further includes: the first communication terminal determining that it has received the first handshake message; the first communication terminal determining that it has completed handshake synchronization with the second communication terminal, and the second communication terminal sending fifth handshake information indicating a second synchronization state.

[0050] It is understood that after determining that it is ready, the first communication terminal can receive the first handshake information indicating the first synchronization state sent by the second communication terminal before sending handshake information to the second communication terminal. For example, it can send a handshake protocol message carrying an "unmatch" flag. Then, the first communication terminal can directly perform handshake synchronization based on this first handshake information and mark itself as matched. At this time, the first communication terminal can send the fifth handshake information indicating the second synchronization state to the second communication terminal, for example, sending a handshake protocol message carrying a "match" flag. Further, after sending the fifth handshake information, the first communication terminal can receive the handshake synchronization process from the second communication terminal and begin data communication with the second communication terminal, i.e., sending or receiving data. In this embodiment, both the first and second communication terminals only need to send handshake information once. (Reference) Figure 5 As shown, the communication synchronization method in the embodiments of this specification may include the following steps: S501: The first communication terminal is in the first state and is ready to send handshake information to the second communication terminal.

[0051] S502: The first communication terminal determines that it has received the first handshake message indicating the first synchronization state sent by the second communication terminal.

[0052] It can be understood that the first handshake message indicating the first synchronization state sent by the second communication terminal in step S502 is received after the first communication terminal enters the first state.

[0053] S503: The first communication terminal responds to the first handshake information, determines that it has completed the handshake synchronization with the second communication terminal, and sends the fifth handshake information indicating the second synchronization state to the second communication terminal.

[0054] In some embodiments of this specification, the third handshake information is sent to the first communication terminal after the second communication terminal is in the first state and the second communication terminal determines that it has not received the second handshake information sent by the first communication terminal.

[0055] That is, in this embodiment of the specification, when the second communication terminal is in the first state and the second communication terminal determines that it has not received the second handshake information sent by the first communication terminal, it can send the aforementioned third handshake information to the first communication terminal. Furthermore, after sending the aforementioned second handshake information to the second communication terminal and determining that it has received the aforementioned third handshake information, the first communication terminal can complete the handshake synchronization with the second communication terminal and can mark the second communication terminal as matched. Further, when the first communication terminal completes the handshake synchronization with the second communication terminal and confirms that it has not received the handshake information indicating the second synchronization state sent by the second communication terminal, it can send the aforementioned fourth handshake information indicating the second synchronization state to the second communication terminal. In this embodiment, both the first and second communication terminals need to send handshake information twice. (Refer to...) Figure 6 As shown, the communication synchronization method in the embodiments of this specification may include the following steps: S601: The first communication terminal is in the first state and is ready to send handshake information to the second communication terminal.

[0056] S602: The first communication terminal determines that it has not received the first handshake message indicating the first synchronization state sent by the second communication terminal.

[0057] It is understandable that in step S602, the determination that the first handshake message indicating the first synchronization state sent by the second communication terminal was not received means that the first communication terminal did not receive it after entering the first state.

[0058] S603: The first communication terminal sends a second handshake message indicating the first synchronization state to the second communication terminal.

[0059] S604: The second communication terminal is in the first state and is ready to send handshake information to the first communication terminal.

[0060] S605: The second communication terminal determines that it has not received the indication of the first synchronization state and the second handshake information sent by the first communication terminal.

[0061] S606: The second communication terminal sends a third handshake message indicating the first synchronization state to the first communication terminal.

[0062] S607: In response to the third handshake information, the first communication terminal determines that it has completed the handshake synchronization with the second communication terminal, and when it determines that it has not received the handshake information indicating the second synchronization state sent by the second communication terminal, it sends the fifth handshake information indicating the second synchronization state to the second communication terminal.

[0063] It is understood that in the embodiments of this specification, the second communication terminal may be ready before or after the first communication terminal. As long as the first communication terminal sends the second handshake information and receives the third handshake information before receiving the handshake information indicating the second synchronization state sent by the second communication terminal, it is included in the communication synchronization scenario in the embodiments of this specification. Furthermore, although both the first and second communication terminals send two handshake messages at this time, the second handshake information of both is invalid and does not require processing.

[0064] In some embodiments of this specification, after the first communication terminal sends second handshake information indicating a first synchronization state to the second communication terminal, the method further includes: the first communication terminal determining that it has received sixth handshake information indicating a second synchronization state sent by the second communication terminal; the sixth handshake information is sent by the second communication terminal to the first communication terminal in response to the second handshake information when the second communication terminal determines that it has received the second handshake information, the second communication terminal is in a first state and the second communication terminal has not sent the third handshake information to the first communication terminal; the first communication terminal determines that it has completed handshake synchronization with the second communication terminal and sends seventh handshake information indicating a second synchronization state to the second communication terminal.

[0065] It is understood that the third handshake information in the embodiments of this specification is sent by the second communication terminal to the first communication terminal after determining that it is in the first state and has not received the second handshake information sent by the first communication terminal. However, in the embodiments of this specification, the second communication terminal, after being ready (i.e., in the first state), has received the aforementioned second handshake information sent by the first communication terminal before sending the third handshake information. Therefore, it can directly complete the handshake synchronization based on the second handshake information and mark the second communication terminal as matched. Since the second communication terminal has not yet sent handshake information to the first communication terminal, it can respond to the second handshake information by sending a fourth handshake information indicating the second synchronization state to the first communication terminal. In this embodiment, both the first and second communication terminals only need to send handshake information once. (Refer to...) Figure 7 As shown, the communication synchronization method in the embodiments of this specification may include the following steps: S701: The first communication terminal is in the first state and is ready to send handshake information to the second communication terminal.

[0066] S702: The first communication terminal determines that it has not received the first handshake message indicating the first synchronization state sent by the second communication terminal.

[0067] It is understandable that in step S702, the determination that the first handshake message indicating the first synchronization state sent by the second communication terminal was not received means that the first communication terminal did not receive it after entering the first state.

[0068] S703: The first communication terminal sends a second handshake message indicating the first synchronization state to the second communication terminal.

[0069] S704: The second communication terminal is in the first state and is ready to send handshake information to the first communication terminal.

[0070] S705: The second communication terminal determines that it has received the indication of the first synchronization state and the second handshake information sent by the first communication terminal.

[0071] S706: The second communication terminal responds to the third handshake information, determines that it has completed the handshake synchronization with the first communication terminal, and sends the seventh handshake information indicating the second synchronization state to the first communication terminal.

[0072] In some embodiments of this specification, after the first communication terminal sends second handshake information indicating a first synchronization state to the second communication terminal, the method further includes: the first communication terminal determining that it has received eighth handshake information indicating a second synchronization state sent by the second communication terminal; the eighth handshake information is sent by the second communication terminal to the first communication terminal in response to the second handshake information after the second communication terminal determines that it has received the second handshake information, the second communication terminal is in a first state, and the second communication terminal has already sent the third handshake information to the first communication terminal; the first communication terminal discards the eighth handshake information.

[0073] It is understood that in the embodiments of this specification, before receiving the eighth handshake information, the first communication terminal has already received the third handshake information indicating the first synchronization state sent by the second communication terminal, and has completed the handshake synchronization with the second communication terminal based on the third handshake information. Therefore, after receiving the eighth handshake information sent by the second communication terminal in response to the second handshake information, the eighth handshake information can be discarded without processing. That is, in the aforementioned... Figure 6 After step S607, the eighth handshake message is received but not processed.

[0074] In some embodiments of this specification, the third handshake information is sent by the second communication terminal to the first communication terminal after the second communication terminal receives and discards the second handshake information while in the second state, and then determines that the second communication terminal is in the first state. The second state is used to indicate that the corresponding communication terminal is not in a state of waiting to communicate with the peer communication terminal.

[0075] That is, in the embodiments of this specification, if the second communication terminal receives the second handshake information while it is in the second state (not ready), it discards the second handshake information; then, when the second communication terminal is in the first state (i.e., ready), it sends a third handshake information indicating the first synchronization state to the first communication terminal. In this embodiment, the first communication terminal needs to send two handshake messages, while the second communication terminal only needs to send one handshake message. (Refer to...) Figure 8 As shown, the communication synchronization method in the embodiments of this specification may include the following steps: S801: The first communication terminal is in the first state and is ready to send handshake information to the second communication terminal.

[0076] S802: The first communication terminal determines that it has not received the first handshake message indicating the first synchronization state sent by the second communication terminal.

[0077] It is understandable that in step S802, the determination that the first handshake message indicating the first synchronization state sent by the second communication terminal was not received means that the first communication terminal did not receive it after entering the first state.

[0078] S803: The first communication terminal sends a second handshake message indicating the first synchronization state to the second communication terminal.

[0079] S804: The second communication terminal is in the second state and discards the second handshake information.

[0080] S805: The second communication terminal is in the first state, and the second communication terminal sends a third handshake message indicating the first synchronization state to the first communication terminal.

[0081] S806: The first communication terminal responds to the third handshake information, determines that it has completed the handshake synchronization with the second communication terminal, and sends handshake information indicating the second synchronization state to the second communication terminal.

[0082] In some embodiments of this specification, before the first communication terminal is in the first state, the method further includes: when the first communication terminal determines that it is in the second state and the first communication terminal determines that it has received the ninth handshake information indicating the first synchronization state sent by the second communication terminal, the ninth handshake information is discarded; the second state is used to characterize that the corresponding communication terminal is not in a state of waiting to communicate with the peer communication terminal.

[0083] It is understood that the second communication terminal is ready before the first communication terminal and sends the ninth handshake information to the first communication terminal. The first communication terminal is not yet ready when it receives the ninth handshake information, and can discard this ninth handshake information at this time. Only after the first communication terminal is ready can it send the aforementioned second handshake information to the second communication terminal. Since the second communication terminal has already sent handshake information indicating the first synchronization state to the first communication terminal, it can perform handshake synchronization upon receiving this second handshake information, marking itself as synchronized, and sending handshake information indicating the second synchronization state to the first communication terminal. The first communication terminal can mark itself as synchronized upon receiving the handshake information indicating the second synchronization state from the second communication terminal and end the handshake synchronization process. In this embodiment, the first communication terminal only needs to send handshake information once, while the second communication terminal needs to send handshake information twice. (Refer to...) Figure 9 As shown, the communication synchronization method in the embodiments of this specification may include the following steps: S901: The first communication terminal receives the ninth handshake information indicating the first synchronization state.

[0084] S902: The first communication terminal is in the second state and discards the ninth handshake information.

[0085] S903: The first communication terminal is in the first state and is ready to send handshake information to the second communication terminal.

[0086] S904: The first communication terminal sends a second handshake message indicating the first synchronization state to the second communication terminal.

[0087] S905: The second communication terminal is in the first state. The second communication terminal determines that it has completed the handshake synchronization with the first communication terminal, and responds to the second handshake information by sending handshake information indicating the second synchronization state to the first communication terminal.

[0088] In some embodiments of this specification, after the first communication terminal determines that it has completed handshake synchronization with the second communication terminal, the method further includes: the first communication terminal ending handshake synchronization with the second communication terminal, and discarding the tenth handshake information upon receiving the tenth handshake information from the second communication terminal.

[0089] It is understood that in the embodiments of this specification, when the first communication terminal completes the handshake synchronization with the second communication terminal and marks the first communication terminal as synchronized, it will discard the handshake information regardless of what kind of handshake information the first communication terminal receives from the second communication terminal, that is, regardless of whether it indicates the first synchronization state or the second synchronization state.

[0090] In some embodiments of this specification, the communication synchronization between the first communication terminal and the second communication terminal is inter-core communication synchronization.

[0091] It can be understood that the first and second communication terminals can be central processing units, integrated into the processor system, and thus... Figure 3 The communication synchronization method described can be applied to the central processing unit and implemented in software. Alternatively, the first and second communication ends can also be other hardware structures on the processor system, which may further include a central processing unit. Figure 3 The communication synchronization method can be implemented through other hardware structures outside the central processing unit, so that the communication synchronization process can be decoupled from the central processing unit, thereby improving the efficiency of the computing core.

[0092] Based on the above communication synchronization method, this specification also provides an asynchronous inter-core communication handshake synchronization method with mutual matching between two ends. This method can be applied to communication synchronization between the producer core (hereinafter referred to as the producer) and the consumer core (hereinafter referred to as the consumer). The producer can be the aforementioned first communication end, and the consumer can be the aforementioned second communication end; or, the producer can be the aforementioned second communication end, and the consumer can be the aforementioned first communication end.

[0093] refer to Figure 10As shown, after inter-core communication begins: Once the Procuder (consumer) is ready, it prepares to send a handshake message to the peer. At this point, it can send an unmatch (not synchronized) or match (synchronized) message to the peer based on whether an unmatch message has been received from the peer (i.e., whether a previous handshake protocol message from the peer was unmatched). If an unmatch message is received from the peer, the local register is marked as matched, and a handshake protocol message carrying the match flag is sent to the peer, ending the local matching process. Ending the local matching process means the local behavior ends, and subsequent handshake protocol messages received from the peer are directly discarded without processing. If no unmatch message is received from the peer, the local register is marked as unmatched, and an unmatch flag message is sent to the peer.

[0094] If the handshake protocol message from the other end is not subsequently received with the flag "unmatch", the local register is marked as "matched", and a handshake protocol message carrying the "match" flag is sent to the other end, ending the local matching process. If a "match" handshake message is received from the other end, the local register is marked as "procuder-consumer matched successfully", ending the local matching process. Here, "if the handshake protocol message from the other end is not subsequently received with the flag "unmatched" can be understood as the current Procuder (consumer) not receiving a "match" message from the other end, but receiving an "unmatch" message first. In this case, the local matching can be completed directly based on the "unmatch" message, and a handshake protocol message carrying the "match" flag is sent to the other end, ending the local matching process.

[0095] Specifically, based on the different readiness times of producers and consumers, real-world scenarios can be divided into six categories, which are discussed below. Figures 11 to 16 These six application scenarios will be introduced.

[0096] Reference Figure 11As shown, in the first application scenario, the consumer first prepares and sends a protocol message carrying an "unmatch" flag to the producer. When this message arrives at the producer, the producer's storage resources are not yet ready (i.e., not online), and therefore cannot accept the handshake request, so the producer discards the handshake request. Once the producer is ready (online), it sends a protocol message carrying an "unmatch" flag to the consumer. When this message arrives at the consumer, the consumer marks the match as successful (matched) and sends a protocol message carrying a "match" flag to the producer, ending the local matching process. When the producer receives the protocol message carrying a "match" flag, it marks the match as successful and ends the local matching process. In this application scenario, the producer only needs to send one handshake protocol message, while the consumer needs to send two handshake protocol messages.

[0097] Reference Figure 12 As shown, in the second application scenario, the consumer is ready first and sends a protocol message carrying an "unmatch" flag to the producer. When this message arrives at the producer, the producer is already ready but has not yet sent a handshake request. At this point, the producer marks the match as successful and sends a protocol message carrying a "match" flag to the consumer, ending the local matching process. When the consumer receives this message, it marks the match as successful ("matched") and ends the local matching process. In this application scenario, both the producer and consumer only need to send one handshake protocol message.

[0098] Reference Figure 13 As shown, in the third application scenario, the consumer is ready first and sends a protocol message carrying an "unmatch" flag to the producer. When this message arrives at the producer, the producer is already ready and has already sent a handshake protocol message carrying an "unmatch" flag. At this point, the producer marks the match as successful and sends a protocol message carrying a "match" flag to the consumer, ending the local matching process. The consumer first receives the protocol message carrying an "unmatch" flag, then marks the match as successful (matched), and sends a handshake protocol message carrying a "match" flag. Subsequent handshake protocol messages carrying a "match" flag from the producer are not processed. In this application scenario, both the producer and consumer need to send two handshake protocol messages.

[0099] Reference Figure 14As shown, in the fourth application scenario, the producer is ready first and sends a protocol message carrying an "unmatch" flag to the consumer. When this message arrives at the producer, the producer's core is not yet ready, so it does not process the message. Only after the consumer is ready does it send a protocol message carrying the "unmatch" flag to the producer. When the producer receives this message, it marks the match as successful (matched) and sends a protocol message carrying the "match" flag to the consumer, ending the local matching process. When the consumer receives the producer's protocol message carrying the "match" flag, it marks the match as successful (matched), ending the matching process. In this application scenario, the producer needs to send two handshake protocol messages, while the consumer only needs to send one protocol message.

[0100] Reference Figure 15 As shown, in the fifth application scenario, the producer is ready first and sends a protocol message carrying an "unmatch" flag to the consumer. When this message arrives at the producer, the producer is already ready but has not yet sent a handshake protocol message. At this point, the consumer marks a successful match and sends a protocol message carrying a "match" flag, ending the matching process. When the producer receives this message, it marks a successful match and ends the matching process. In this application scenario, both the producer and consumer only need to send one handshake protocol message.

[0101] Reference Figure 16 As shown, in the sixth application scenario, the producer first prepares and sends a protocol message carrying an "unmatch" flag to the consumer. When this message arrives at the producer, the producer is already ready and has sent a handshake protocol message carrying the "unmatch" flag. At this point, the consumer marks a successful match and sends a protocol message carrying the "match" flag, ending the matching process. Subsequent protocol messages received from the producer carrying the "match" flag are not processed. When the producer receives the first message carrying the "unmatch" flag from the consumer, it marks a successful match, sends a protocol message carrying the "match" flag, and ends the matching process. Subsequent protocol messages received from the consumer carrying the "match" flag are not processed. In this application scenario, both the producer and consumer only need to send two handshake protocol messages, but the second one is invalid.

[0102] The above method can reduce the number of handshake protocol messages between producers and consumers to 1-2 times. Even if the ready times of producers and consumers are very different, only 1-2 handshake requests are needed. Compared with the traditional method, which requires sending many (even tens of millions) handshake requests, it can reduce the number of communications, reduce channel occupation, and improve communication efficiency.

[0103] Based on the communication synchronization method described above, one or more embodiments of this specification also provide a processor system. The system may include apparatus (including distributed systems), software (applications), modules, plug-ins, servers, clients, etc., using the methods described in the embodiments of this specification, combined with necessary hardware implementation. Based on the same innovative concept, the apparatuses in one or more embodiments provided in this specification are as described in the following embodiments. Since the implementation schemes and methods for solving the problem by the apparatus are similar, the implementation of specific apparatuses in the embodiments of this specification can refer to the implementation of the foregoing methods, and repeated details will not be elaborated further. As used below, the terms "unit" or "controller" can refer to a combination of software and / or hardware that implements a predetermined function. Although the Ctrip Connect described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated. Figure 17 The diagram shown is a schematic representation of a processor system provided in an embodiment of this specification. Figure 17 As shown, the processor system 1700 may include a central processing unit 1710 and a communication controller 1720, wherein the communication controller 1720 includes a communication instruction parsing unit 1721, a status register 1722, and a handshake control unit 1723.

[0104] The central processing unit 1710 is used to generate and send communication instructions to the communication instruction parsing unit, the communication instructions being used to instruct the communication controller 1720 to communicate with the peer processor system.

[0105] The communication instruction parsing unit 1721 is used to parse the received communication instruction and store the parsing result as communication status information in the status register 1722.

[0106] It can be understood that the communication instruction can be information such as the readiness status, the peer processor system, the memory address for sending or receiving data, and the amount of data to be sent or received, sent by the central processing unit 1710 to the communication controller 1720 after determining that the processor system is ready. Furthermore, the communication instruction parsing unit 1721 can parse the communication instruction based on the communication protocol between the central processing unit 1710 and the communication controller 1720, extract the processor system's readiness status and communication status information (e.g., device information of the peer processor system, synchronization status between the processor system and the peer processor system, communication status between the processor system and the peer processor system, etc.), and store the communication status information in a status register.

[0107] The handshake control unit 1723 is configured to: obtain communication status information from the status register, and when it is determined based on the communication status information that the processor system is in a first state and that it has not received first handshake information indicating a first synchronization state from the peer processor system, send second handshake information indicating a first synchronization state to the peer processor system. The first state is used to characterize that the processor system is in a state of waiting to communicate with the peer processor system, and the first synchronization state characterizes that the processor system and the peer processor system have not completed handshake synchronization; when it is determined that a third handshake information indicating a first synchronization state has been received from the peer processor system, determine that handshake synchronization with the peer processor system has been completed, and send fourth handshake information indicating a second synchronization state to the peer processor system. The second synchronization state characterizes that the processor system and the peer processor system have completed handshake synchronization.

[0108] It is understandable that the handshake control unit 1723 in the processor system 1700 can serve as... Figure 3 The first or second communication terminal in the middle, Figure 3 The communication synchronization method can be specifically implemented by the handshake control unit 1723 in the processor system 1700. Furthermore, during the handshake synchronization process, the handshake control unit 1723 can also adjust the synchronization state stored in the status register; for example, it can adjust the synchronization state in the status register from unsynchronized to synchronized based on the handshake synchronization status. In other embodiments, the central processing unit 1710 in the processor system 1700 can serve as... Figure 3 The first or second communication terminal in the middle, Figure 3 The communication synchronization method can also be implemented by the central processing unit 1710 in the processor system 1700, and this specification does not limit it.

[0109] In some embodiments of this specification, the handshake control unit may include a first handshake control subunit and a second handshake control subunit. When the processor system acts as the source of communication data during data communication, the processor system completes handshake synchronization with the peer processor system through the first handshake control subunit; when the processor system acts as the source of communication data during data communication, the processor system completes handshake synchronization with the peer processor system through the second handshake control subunit.

[0110] It is understood that when the processor system acts as the data producer mentioned in the foregoing embodiments, the first handshake control subunit can be used as... Figure 3 The first communication terminal in the process is used to perform actions such as... Figure 3The communication synchronization method in the above embodiment; when the processor system acts as the data producer mentioned in the foregoing embodiment, the second handshake control subunit can be used as... Figure 3 The first communication terminal in the process is used to perform actions such as... Figure 3 Communication synchronization methods in [the context of the text].

[0111] In some embodiments of this specification, the status register is used to store device information of the peer processor system, the synchronization status between the processor system and the peer processor system, and the communication status between the processor system and the peer processor system.

[0112] The description and functions of the handshake control module can be understood by referring to the section on communication synchronization methods, and will not be repeated here.

[0113] refer to Figure 18 As shown in some embodiments of this specification, the communication controller includes a communication instruction parser, a communication instruction status register, a producer handshake controller, a consumer handshake controller, and a communication executor. The communication instruction parser receives communication instructions from the CPU (i.e., the central processing unit 1710), parses key information, and stores it in the communication instruction status register. Subsequent handshake matching and data transfer processes do not require CPU involvement, thus decoupling the CPU. The communication instruction status register stores information such as peer information, successful matching information, and communication completion status. The handshake matching information and communication status of the local producer and consumer are stored in this register. The producer handshake controller and consumer handshake controller can implement the proposed handshake synchronization mechanism using a simple state machine and a small number of registers, introducing fewer hardware resources. The communication executor is used to transfer or receive data after a successful handshake match.

[0114] Specifically, refer to Figure 19 As shown, in the handshake synchronization method based on the communication controller, in the producer's core (e.g., Figure 17 The processor system in the middle) and the consumer's core (e.g. Figure 17 When a processor system (such as a CPU) performs inter-core communication, the CPU can issue a communication instruction to the hardened communication controller. The communication controller then uses a mechanism based on... Figure 4 The handshake protocol message format generated in the CPU is used for inter-core communication synchronization. Specifically, communication synchronization can be completed through 1 to 2 handshake requests. After communication synchronization is completed, the hardened communication controller can reply with a completion signal to the CPU.

[0115] In some embodiments of this specification, the aforementioned processor system is also applicable to wafer-level chips, where a wafer-level chip refers to a chip integrating the aforementioned processor system. It can be understood that a wafer-level chip directly designs, manufactures, and packages the entire wafer (or most of it) as a single, gigantic chip ("big die"). It integrates all functional units, such as computing cores, memory, and communication networks, which would otherwise require multiple independent chips interconnected externally. Multiple heterogeneous computing cores are arranged in an array and interconnected via a network-on-wafer (NoW). This NoW uses a specially designed topology (such as 2D Mesh, Torus, and custom topologies for AI computing), interconnected via an extremely high-bandwidth physical layer (PHY) using ultra-short-distance, parallelized high-speed serial links, and employs low-overhead communication protocols and congestion control mechanisms to support large-scale parallelism for these high-speed serial links. The processor system provided in the embodiments of this specification can participate in the NoW as one type of computing core, and the computing cores can use the synchronization methods described in the embodiments of this specification for handshaking synchronization.

[0116] This specification also provides a chip that integrates at least one of the aforementioned processor systems.

[0117] This specification also provides an embodiment of a board card, including the aforementioned chip.

[0118] This specification also provides an electronic device, including the aforementioned board.

[0119] This specification also provides a computer storage medium that stores computer program instructions, which, when executed, implement the steps of the above-described communication synchronization method.

[0120] This specification also provides a computer program product, which includes a computer program that, when executed, implements the steps of the above-described communication synchronization method.

[0121] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory.

[0122] The various embodiments in this specification are described in a progressive manner. For the same or similar parts between the various embodiments, please refer to each other. The focus of each embodiment is to describe the differences from other embodiments.

[0123] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions.

[0124] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0125] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute certain parts of the methods of various embodiments of this application.

[0126] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.

[0127] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0128] Although this application has been described through embodiments, those skilled in the art will know that this application has many modifications and variations without departing from the spirit of this application, and it is intended that the appended claims cover such modifications and variations without departing from the spirit of this application.

Claims

1. A communication synchronization method, characterized in that, include: When the first communication terminal is in the first state, the first communication terminal determines that it has not received the first handshake information indicating the first synchronization state sent by the second communication terminal, and sends the second handshake information indicating the first synchronization state to the second communication terminal; the first state is used to characterize that the corresponding communication terminal is in a state of waiting to communicate with the peer communication terminal, and the first synchronization state characterizes that the second communication terminal and the first communication terminal have not completed the handshake synchronization. When the first communication terminal determines that it has received the third handshake information indicating the first synchronization state sent by the second communication terminal, the first communication terminal determines that it has completed the handshake synchronization with the second communication terminal, and sends the fourth handshake information indicating the second synchronization state to the second communication terminal; the second synchronization state indicates that the second communication terminal and the first communication terminal have completed the handshake synchronization.

2. The communication synchronization method according to claim 1, characterized in that, After the first communication terminal is in the first state, it also includes: The first communication terminal confirms that it has received the first handshake message; The first communication terminal determines that it has completed a handshake synchronization with the second communication terminal, and the second communication terminal sends a fifth handshake message indicating the second synchronization state.

3. The communication synchronization method according to claim 1, characterized in that, The third handshake information is sent to the first communication terminal after the second communication terminal is in the first state and determines that it has not received the second handshake information sent by the first communication terminal.

4. The communication synchronization method according to claim 1, characterized in that, The third handshake information is sent from the second communication terminal to the first communication terminal when the second communication terminal is in the first state after the second communication terminal receives and discards the second handshake information in the second state. The second state is used to indicate that the corresponding communication end is not in a state of waiting to communicate with the other end.

5. The communication synchronization method according to claim 3, characterized in that, After the first communication terminal sends a second handshake message indicating the first synchronization state to the second communication terminal, the method further includes: The first communication terminal determines that it has received the sixth handshake information indicating the second synchronization state sent by the second communication terminal; the sixth handshake information is sent by the second communication terminal to the first communication terminal in response to the second handshake information when the second communication terminal determines that it has received the second handshake information, the second communication terminal is in the first state and the second communication terminal has not sent the third handshake information to the first communication terminal; The first communication terminal determines that it has completed handshake synchronization with the second communication terminal, and sends a seventh handshake message indicating the second synchronization state to the second communication terminal.

6. The communication synchronization method according to claim 3, characterized in that, After the first communication terminal sends a second handshake message indicating the first synchronization state to the second communication terminal, the method further includes: The first communication terminal determines that it has received the eighth handshake information indicating the second synchronization state sent by the second communication terminal; the eighth handshake information is sent by the second communication terminal to the first communication terminal in response to the second handshake information after the second communication terminal determines that it has received the second handshake information, the second communication terminal is in the first state, and the second communication terminal has sent the third handshake information to the first communication terminal; The first communication terminal discards the eighth handshake information.

7. The communication synchronization method according to claim 1, characterized in that, Before the first communication terminal is in the first state, the following also applies: When the first communication terminal is in the second state, and the first communication terminal determines that it has received the ninth handshake information indicating the first synchronization state sent by the second communication terminal, the ninth handshake information is discarded; the second state is used to characterize that the corresponding communication terminal is not in a state of waiting to communicate with the peer communication terminal.

8. The communication synchronization method according to claim 1, characterized in that, After the first communication terminal determines that it has completed the handshake synchronization with the second communication terminal, the process further includes: The first communication terminal ends the handshake synchronization with the second communication terminal, and discards the tenth handshake information upon receiving the tenth handshake information from the second communication terminal.

9. The communication synchronization method according to claim 1, characterized in that, The communication synchronization between the first communication terminal and the second communication terminal is inter-core communication synchronization.

10. A processor system, characterized in that, It includes a central processing unit and a communication controller, wherein the communication controller includes a communication instruction parsing unit, a status register, and a handshake control unit; The central processing unit is used to generate and send communication instructions to the communication instruction parsing unit, and the communication instructions are used to instruct the communication controller to communicate with the peer processor system. The communication instruction parsing unit is used to parse the received communication instruction and store the parsing result as communication status information in the status register; The handshake control unit is configured to: obtain communication status information from the status register, and when it is determined based on the communication status information that the processor system is in a first state and that it has not received first handshake information indicating a first synchronization state from the peer processor system, send second handshake information indicating a first synchronization state to the peer processor system. The first state indicates that the processor system is in a state of waiting to communicate with the peer processor system, and the first synchronization state indicates that the processor system and the peer processor system have not completed handshake synchronization. When it is determined that a third handshake information indicating a first synchronization state has been received from the peer processor system, determine that handshake synchronization with the peer processor system has been completed, and send fourth handshake information indicating a second synchronization state to the peer processor system. The second synchronization state indicates that the processor system and the peer processor system have completed handshake synchronization.

11. The processor system according to claim 10, characterized in that, The handshake control unit includes a first handshake control subunit and a second handshake control subunit; When the processor system acts as the source of communication data during data communication, the processor system completes handshake synchronization with the peer processor system through the first handshake control subunit; when the processor system acts as the source of communication data during data communication, the processor system completes handshake synchronization with the peer processor system through the second handshake control subunit.

12. The processor system according to claim 10, characterized in that, The status register is used to store the device information of the peer processor system, the synchronization status between the processor system and the peer processor system, and the communication status between the processor system and the peer processor system.

13. A chip, characterized in that, The chip integrates at least one processor system as described in any one of claims 10 to 12.

14. A circuit board, characterized in that, Includes the chip described in claim 13.

15. An electronic device, characterized in that, Includes the board as described in claim 14.