Communication method, electronic device, chip, storage medium, and program product
Patent Information
- Application Number
- CN202510451403.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2026-10-20
AI Technical Summary
[0004]这种核间通信方式,存在通信效率低的问题
[0065]本申请中,第二设备发送的业务数据包可包括用于指示目的处理器核的第一目的标识,这样接收到业务数据包的第一处理器核可在第一目的标识指示其他处理器核的情况下,直接将业务数据包以预设传输方式发送至其他处理器核。第一目的标识的存在,以及,第一处理器核的对于业务数据包的转发能力,避免了现有技术中业务数据包需要先传输至主核进行业务数据包的处理,进而进行业务数据包的分发的复杂流程,减少了资源的浪费和通道的浪费,提高了核间通信的效率,在第一设备与第二设备的通信场景下,提高了设备之间的通信效率。
Smart Images

Figure HDA0005355014400000011 
Figure HDA0005355014400000012 
Figure HDA0005355014400000013
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a communication method, electronic device, chip, storage medium, and program product. Background Technology
[0002] With the continuous development of semiconductor technology, the number of transistors that can be integrated on a single chip has increased dramatically. Different processor cores can be integrated on a single chip or on a separate chip. Multiple processor cores can handle different types of business tasks, improving business processing efficiency.
[0003] The sending and receiving of data between multiple processor cores is called inter-core communication. In existing inter-core communication scenarios, the default architecture is a central processing unit (CPU) core as the master core, with other processor cores (e.g., Bluetooth cores / sensor cores) as slave cores. The master core acts as a relay medium for service data packets, requiring data parsing and repackaging of these packets so that it can send the repackaged packets to the designated device or slave core.
[0004] This inter-core communication method suffers from low communication efficiency. Summary of the Invention
[0005] This application provides a communication method, electronic device, chip, storage medium, and program product. When the first processor core of the first device determines the destination identifier of a received service data packet and instructs the destination processor core, the first processor core can directly pass the service data packet to the destination processor core for service processing. This avoids the complex process in the prior art where service data packets need to be transmitted to the main core for processing and then distributed, reducing resource and channel waste, improving the efficiency of inter-core communication, and also improving the communication efficiency between the first device and other devices.
[0006] To achieve the above objectives, the embodiments of this application adopt the following technical solutions.
[0007] In a first aspect, a communication method is provided, applied to a first device, the first device including multiple processor cores, the multiple processor cores including a first processor core and a second processor core.
[0008] The communication method includes: a first processor core of a first device receiving at least one service data packet. The service data packet includes a first destination identifier, which indicates a destination processor core for processing the service data packet. If the destination processor core indicated by the first destination identifier of the service data packet is a second processor core, the first processor core sends the service data packet to the second processor core.
[0009] The second processor core performs business processing based on business data packets.
[0010] In this application, the first processor core acts as the receiving core for service data packets. When the first destination identifier of the service data packet indicates that the destination processor core is not the first processor core, the first processor core can send the service data packet to the corresponding destination processor core according to the first destination identifier. This eliminates the need for processing and forwarding service data packets through the default master core, avoiding resource and channel waste and improving the efficiency of inter-core communication. In communication scenarios between the first device and other devices, it also improves the communication efficiency between devices.
[0011] In one possible implementation of the first aspect, the first processor core sends service data packets to the second processor core, including:
[0012] The first processor core sends the service data packets to the second processor core using a preset transmission method.
[0013] The preset transmission method includes any method that transmits data according to the original data format and content of the business data packet.
[0014] In this application, the preset transmission method is any method that transmits data according to the original data format and content of the business data packet. For example, the preset transmission method can be transparent transmission.
[0015] In this application, the first processor core sends service data packets using a preset transmission method. This means that the first processor core does not perform service data packet processing such as data parsing and repackaging. The first processor core can directly forward service data packets to the second processor core, greatly improving inter-core communication efficiency. Furthermore, the first processor core is not used for processing service data packets not belonging to its own core, allowing it to focus its capabilities on processing its own service data packets, resulting in higher performance.
[0016] In another possible implementation of the first aspect, the multiple processor cores also include a third processor core. The method further includes:
[0017] If the first destination identifier of the service data packet points to the third processor core, the first processor core will send the service data packet to the third processor core.
[0018] The third processor core performs business processing based on business data packets.
[0019] In this application, even if the first destination identifier of the service data packet points to a non-first processor core, such as a third processor core, the first processor core can still send the service data packet to the third processor core. That is, regardless of the number of processor cores, as long as the first destination identifier of the service data packet points to a non-first processor core, the first processor core can directly send the service data packet to the corresponding destination processor core. This inter-core communication method, which does not require processing and forwarding of the service data packet by the main core, avoids resource and channel waste, resulting in high inter-core communication efficiency.
[0020] In another possible implementation of the first aspect, the first destination identifier is the address identifier of the processor core, and the first device stores a routing table that includes the correspondence between each processor core of the first device and the address identifier.
[0021] The method also includes:
[0022] The first processor core queries the routing table for the destination processor core corresponding to the address identifier used as the first destination identifier in the service data packet.
[0023] In this application, the first processor core can determine the destination processor core of the service data packet by querying the routing table, thereby enabling the forwarding of the service data packet. This eliminates the need for the main core to process and forward the service data packet, improving inter-core communication efficiency.
[0024] In another possible implementation of the first aspect, the routing table is pre-stored in a designated storage space of the first device, which is a shared storage space of multiple processor cores. Alternatively, the routing table is pre-stored in the storage space of each individual processor core of the first device.
[0025] In this application, each processor core of the first device has access to the shared storage space. Any processor core can act as the first processor core to access the routing table, thereby determining the destination processor core of the service data packet by querying the routing table, and realizing the forwarding of the service data packet. This eliminates the need for the main core to process and forward service data packets, improving the efficiency of inter-core communication.
[0026] In another possible implementation of the first aspect, the first destination identifier of the service data packet is a service identifier, and the first device stores a service configuration table, which includes the correspondence between each processor core of the first device and the service identifiers that each processor core is responsible for.
[0027] The method also includes:
[0028] The first processor core queries the service configuration table for the destination processor core corresponding to the service identifier used as the first destination identifier in the service data packet.
[0029] In this application, any processor core can act as the first processor core to access the service configuration table, determine the destination processor core of the service data packet, and thus realize the forwarding of the service data packet. This eliminates the need for the main core to process and forward service data packets, improving inter-core communication efficiency.
[0030] In another possible implementation of the first aspect, there is a correspondence between each processor core and an address identifier in the first device, and each pair of processor cores' address identifiers corresponds to a transmission channel for transmitting service data packets.
[0031] The first processor core sends service data packets to the second processor core, including:
[0032] The first processor core, using its own address identifier and the target transmission channel corresponding to the target address identifier, sends the service data packet carrying the target address identifier to the second processor core. The target address identifier is the address identifier corresponding to the destination processor core.
[0033] In this application, each pair of processor cores has an address identifier corresponding to a transmission channel for transmitting service data packets. The first processor core can determine the corresponding target transmission channel based on the target address identifier, and then send the service data packet carrying the target address identifier to the second processor core through the target transmission channel. Any processor core can act as the first processor core to transmit service data packets, eliminating the need for the main core to process and forward service data packets, thus improving the efficiency of inter-core communication.
[0034] In another possible implementation of the first aspect, the service configuration table is stored in a designated storage space of the first device, which is a shared storage space of multiple processor cores. The multiple processor cores have access permissions to the service configuration table, and the service identifiers responsible for each processor core in the service configuration table are written by each processor core.
[0035] In this application, each processor core of the first device has access to the shared storage space. Any processor core can act as the first processor core to access the service configuration table, determine the destination processor core of the service data packet through the service configuration table, and thus realize the forwarding of the service data packet. This eliminates the need for the main core to process and forward service data packets, improving the efficiency of inter-core communication.
[0036] In another possible implementation of the first aspect, the method further includes:
[0037] For each processor core, when the first device performs an operating system cold boot, the processor core writes the service identifier corresponding to the service information and the address identifier of the processor core into the service configuration table based on the service information it is responsible for processing.
[0038] In this application, when the first device performs an operating system cold boot, each processor core can obtain the service identifier of the service information processed by its own core, and write the service identifier of the service information processed by its own core into a service configuration table according to an agreed format, thereby obtaining a service configuration table containing the correspondence between each processor core in the first device and the service identifiers that each processor core is responsible for processing. The service configuration table can clearly identify the service identifier corresponding to each processor core, and the service identifiers corresponding to each processor core in the service configuration table are real-time data, making the distribution of service data packets more accurate.
[0039] In another possible implementation of the first aspect, the method further includes:
[0040] For each processor core, if the service handled by the processor core is updated during the operation of the first device, the processor core updates the service identifier corresponding to the processor core in the service configuration table.
[0041] Among them, updating business information includes at least one of adding business information, deleting business information, and modifying business information.
[0042] In this application, the service configuration table is a dynamically updatable table for each processor core. If the service handled by a processor core is updated, the processor core can update the service identifier in the service configuration table at any time, realizing the dynamic updating of the corresponding services for each processor core in the service configuration table. Compared to a routing table that specifies the address identifiers of each processor core, the service configuration table can more accurately express the service scope handled by each processor core. Furthermore, for updates to the services handled by a processor core, the processor core can automatically update the service configuration table, eliminating the need for repeated manual modifications and significantly reducing development costs. Moreover, the service identifiers corresponding to each processor core in the service configuration table are real-time data, resulting in more accurate distribution of service data packets.
[0043] In another possible implementation of the first aspect, the method further includes:
[0044] If the first device adds a fourth processor core, the fourth processor core will write the service identifier of the service information it is responsible for processing and the address identifier of the fourth processor core into the service configuration table based on the service information it is responsible for processing.
[0045] In this application, the service configuration table is dynamically updatable for each processor core. If a new processor core is added, the services handled by each processor core will be adjusted accordingly. In this case, the newly added fourth processor core and other processor cores can update the service identifiers they are responsible for processing in the service configuration table in real time, realizing dynamic updates of the services corresponding to each processor core in the service configuration table. This eliminates the need for repeated manual modifications, significantly reducing development costs. Furthermore, the service identifiers corresponding to each processor core in the service configuration table are real-time data, making the distribution of service data packets more accurate.
[0046] In another possible implementation of the first aspect, the first processor core of the first device receives at least one service data packet, including:
[0047] The first processor core of the first device receives at least one service data packet sent by the second device.
[0048] or,
[0049] The first processor core of the first device receives at least one service data packet sent by the application of the first device.
[0050] In this application, the service data packets received by the first processor core can be service data packets from the second device or service data packets from the application of the first device. Regardless of the type of inter-core communication scenario involved, the effect of improving inter-core communication efficiency can be achieved, thereby improving the overall communication efficiency.
[0051] In another possible implementation of the first aspect, the method further includes:
[0052] The first processor core receives a service response packet obtained by the other processor cores from processing the service data packets. The service response packet includes a second destination identifier indicating the device processing the service response packet.
[0053] If the second destination identifier of the service response packet indicates the second device, the first processor core sends the service response packet to the second device.
[0054] If the second destination identifier of the service response packet indicates the target application of the first device, the first processor verifies the service response packet and sends it to the target application.
[0055] If the second destination identifier of the service response packet indicates the first processor core, the first processor core performs data processing on the service response packet.
[0056] The communication method provided in this application is applicable to different communication scenarios. In different communication scenarios, the first processor core can transmit the service reply packet to the corresponding destination according to the second destination identifier of the service reply packet. In the entire communication process, the first processor core acts as both the receiving core and the sending core, realizing the direct transmission of service data packets and service reply packets, thereby improving communication efficiency.
[0057] In another possible implementation of the first aspect, in a communication scenario between the first device and the second device, the first processor core of the first device is determined by the type of communication connection between the first device and the second device.
[0058] Specifically, in another possible implementation of the first aspect, the multiple processor cores of the first device include a central processing unit core, a Bluetooth core, and a sensor control center core.
[0059] If the communication connection between the first device and the second device is a serial communication connection, the first processor core is a central processing unit core;
[0060] If the communication connection between the first device and the second device is a Bluetooth communication connection, then the first processor core is a Bluetooth core.
[0061] In this application, the different types of communication connections determine the first processor core. The first processor core is a processor core adapted to the communication connection, and can also be used as a distribution core for business data packets, thereby improving communication efficiency and increasing the adaptability of communication methods.
[0062] Secondly, a communication method is provided for use in a second device, the method comprising:
[0063] The second device executes the first service and generates a service data packet corresponding to the first service. The service data packet includes a first destination identifier, which indicates the destination processor core for processing the service data packet.
[0064] The second device sends a service data packet to the first processor core of the first device, so that the first processor core sends the service data packet to the destination processor core indicated by the first destination identifier for service processing. The first processor core and the destination processor core are respectively one of the multiple processor cores of the first device.
[0065] In this application, the service data packet sent by the second device may include a first destination identifier for indicating the destination processor core. Thus, the first processor core receiving the service data packet can directly send the service data packet to other processor cores using a preset transmission method, provided the first destination identifier indicates that other processor cores are also receiving the data packet. The presence of the first destination identifier, and the forwarding capability of the first processor core for service data packets, avoids the complex process in the prior art where service data packets need to be transmitted to the main core for processing and then distributed. This reduces resource and channel waste, improves the efficiency of inter-core communication, and enhances communication efficiency between the first and second devices.
[0066] Thirdly, an electronic device is provided, comprising a communication interface, a memory, a plurality of processors, and a computer program stored in the memory, wherein the plurality of processors execute the computer program to implement the steps of the method described in any one of the first aspects, or the steps of the method described in the second aspect.
[0067] Fourthly, a computer-readable storage medium is provided that stores instructions which, when executed by a computer program by a processor, implement the steps of the method described in any one of the first aspects, or the steps of the method described in the second aspect.
[0068] Fifthly, a computer program product comprising instructions is provided, including a computer program that, when executed by a processor, implements the steps of the method described in any one of the first aspects, or the steps of the method described in the second aspect.
[0069] In a sixth aspect, embodiments of this application provide a chip including a plurality of processors, the plurality of processors being configured to invoke a computer program in memory to perform steps of the method as described in any one of the first aspects, or steps of the method described in the second aspect.
[0070] Understandably, the beneficial effects that the electronic device described in the third aspect, the computer-readable storage medium described in the fourth aspect, the computer program product described in the fifth aspect, and the chip described in the sixth aspect can be achieved by referring to the beneficial effects of the first aspect and any possible design thereof, or the second aspect and any possible design thereof, which will not be repeated here. Attached Figure Description
[0071] Figure 1 This is a scene illustration of a smartwatch communicating with a mobile phone.
[0072] Figure 2 This is a schematic diagram showing the correspondence between a business identifier and a business allocation table;
[0073] Figure 3 This is a schematic diagram illustrating another scenario of communication between a smartwatch and a mobile phone.
[0074] Figure 4 This is a schematic diagram illustrating another scenario of communication between a smartwatch and a mobile phone.
[0075] Figure 5 This is a schematic diagram of a communication scenario between a personal computer and a smartwatch;
[0076] Figure 6 A flowchart illustrating a communication method provided in an embodiment of this application;
[0077] Figure 7 This is a schematic diagram illustrating a scenario of communication between a smartwatch and a mobile phone, provided as an embodiment of this application.
[0078] Figure 8 This is a schematic diagram illustrating another scenario of communication between a smartwatch and a mobile phone, provided as an embodiment of this application.
[0079] Figure 9 A schematic diagram of an inter-core communication process provided in an embodiment of this application;
[0080] Figure 10 A schematic diagram illustrating a scenario of communication between a smartwatch and a PC, provided as an embodiment of this application;
[0081] Figure 11 A schematic diagram illustrating another type of inter-core communication provided in an embodiment of this application;
[0082] Figure 12 An example diagram of a service configuration table provided in an embodiment of this application;
[0083] Figure 13 A schematic diagram illustrating another scenario of communication between a smartwatch and a PC, provided as an embodiment of this application;
[0084] Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0085] Figure 15 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application;
[0086] Figure 16 This is a schematic diagram of a chip system provided in an embodiment of this application. Detailed Implementation
[0087] In the description of the embodiments of this application, the terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to be a limitation of this application. As used in the specification and appended claims of this application, the singular expressions "a," "the," "the," "the," and "this" are intended to also include expressions such as "one or more," unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, "at least one" and "one or more" refer to one or more (including two). The term "and / or" is used to describe the relationship between related objects, indicating that three relationships can exist; for example, A and / or B can indicate: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0088] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized. The term "connection" includes direct connections and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.
[0089] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0090] With the continuous development of semiconductor technology, the number of transistors that can be integrated on a single chip has increased dramatically. Different cores can be integrated on a single chip or on a separate chip, and different processor cores can be responsible for processing different types of business data. For example, multiple processor cores may include a central processing unit (CPU) core, a Bluetooth core (BT core), a sensor hub core, and so on.
[0091] The sending and receiving of data between multiple processor cores is called inter-core communication. In typical inter-core communication scenarios, the central processing unit (CPU) core is the master core, and the other processor cores are slave cores.
[0092] In one scenario, when an electronic device with multiple cores acts as a receiver, it can receive service data packets sent by other devices. These service data packets are then transmitted to the master core. The master core performs data parsing and repackaging on these service data packets, and then distributes the repackaged service data packets to the corresponding target slave cores, which are the processor cores that process the service data packets.
[0093] In another scenario, when an electronic device with multiple cores acts as the transmitter, different slave cores generate service data packets according to their respective service types. Each slave core then transmits these service data packets to the master core. The master core parses and repackages these service data packets, and then sends the repackaged service data packets to the corresponding other devices.
[0094] In inter-core communication where the master core acts as a relay medium, all service data packets must be sent and received through the master core. The master core needs to parse and repackage the service data packets, resulting in relatively low efficiency of inter-core communication.
[0095] Furthermore, when an electronic device with multiple cores acts as the receiving end, the receiving core for service data packets depends on the device's communication method. For example, in an electronic device including a CPU core and a BT core, when communicating with other devices via Bluetooth, service data packets sent by other devices to the electronic device will first be received by the BT core. As the receiving core for service data packets in the Bluetooth communication scenario, the BT core, after receiving the service data packet, will send it to the CPU core. The CPU core will then parse and repackage the data before distributing it. In other words, when the receiving core for service data packets is not the CPU core (main core), inter-core communication adds an extra step of sending service data packets from the core to the main core, further reducing the efficiency of inter-core communication.
[0096] The following section uses a specific communication scenario to illustrate the current inter-core communication process. We will first use an electronic device consisting of a master core and a slave core to simply explain inter-core communication. Figure 1 A scenario diagram illustrating communication between a smartwatch and a mobile phone is provided. Both the smartwatch and the mobile phone include a CPU core and a BitTorrent core. The CPU core is the master core, responsible for data processing of sensor data; the BitTorrent core is the slave core, responsible for data processing of audio data.
[0097] The data transmission process between a smartwatch and a mobile phone includes: the sending end (such as a smartwatch or mobile phone) notifies the receiving end to prepare for communication by raising a handshake pin, and waits for the receiving end's response. Raising the handshake pin can be done by pulling it high or low, depending on the specific communication protocol. After detecting the change in the handshake pin's state, the receiving end (such as a mobile phone or smartwatch) performs some initialization operations (such as clearing the buffer) and notifies the sending end that communication is ready. After the handshake is successful between the receiving and sending ends, the master core controls the opening or closing of the Serial Peripheral Interface (SPI) transceiver channel. After the sending end's master core opens the SPI channel, the sending end begins sending data; after the receiving end's master core opens the SPI channel, the receiving end receives data.
[0098] Specifically, for example, in a scenario where a mobile phone and a smartwatch establish a Bluetooth communication connection, the BT core acts as the receiving core. When the mobile phone acts as the sending end, and its application needs to send business data to the smartwatch, the application packages the business data into a business data packet and sends it to the smartwatch's BT core. The smartwatch's BT core distinguishes between business data packets that it processes and those that it does not, based on a preset business distribution table. Business data packets that it processes are stored locally for further processing, while those that it does not process are forwarded to the CPU core for processing.
[0099] The BT core can distinguish between service data packets processed by itself and those not processed by it based on the service identifier of the service data packet and a preset service classification table. In one example, Figure 2 A schematic diagram showing the correspondence between service identifiers and service distribution tables is provided. The information fields of the service data packet may also include a service identifier (serviceID, SID). This service identifier is used to point to the target core for data processing. For example, ... Figure 2As shown, if the SID in the information field of a service data packet is 0x09, the BT core queries the preset service distribution table and finds that the service data packet with SID 0x09 should be processed by the BT core. That is, the service data packet with SID 0x09 is the service data packet that this core is responsible for processing, and the BT core retains this service data packet locally for processing. In other scenarios, if the SID in the information field of a service data packet received by the smartwatch's BT core is 0x03, the BT core queries the preset service distribution table and finds that the service data packet with SID 0x03 should be processed by the CPU core. Then, the BT core can forward this service data packet to the CPU core for processing. In this way, inter-core communication between the BT core and the CPU core is completed. In some other embodiments, the information field of the service data packet may also include a client identifier (Client ID, CID), a context identifier, a connection identifier, etc.
[0100] In the example of the above electronic device including a communication scenario with one master core and one slave core, the problem of low efficiency in inter-core communication is not very significant. However, with the development of technology that integrates multiple processor cores into electronic device chips, the problem of low efficiency in inter-core communication becomes very significant in scenarios with one master core and at least two slave cores.
[0101] Figure 3 A diagram illustrating another scenario of communication between a smartwatch and a mobile phone is provided. Figure 3 The smartwatches and phones shown integrate one main core and at least two slave cores. In one example, the main core can be a CPU core, responsible for audio data processing; the at least two slave cores can include a BT core and a SensorHub core, where the BT core handles GPS data processing and the SensorHub core handles sensor data processing. In this communication scenario, a mapping relationship between address identifiers and processors (similar to the processor cores integrated on the processor) is defined. Table 1 below shows the core mapping table representing this mapping relationship between address identifiers and processors.
[0102] Table 1
[0103] Address Identifier processor describe 0x01 Application processor chip Application processor chip with integrated SensorHub core 0x02 Central control unit chip Central control unit chip with integrated CPU core 0x03 BT chip BT chip with integrated BT core
[0104] exist Figure 3 In the given communication scenario, the process of the smartwatch and the mobile phone shaking hands is... Figure 1 The handshake mechanism in the communication scenario is similar, so it will not be elaborated here.
[0105] After the smartwatch and the phone successfully establish a handshake, the CPU core enables the SPI channel. The CPU core and the BT core communicate with each other via the remote control protocol (RMT ON chan1) on channel 1; the CPU core and the SensorHub core communicate with each other via the remote control protocol (RMT ON chan2) on channel 2.
[0106] Let's take the inter-core communication between the CPU core, BT core, and SensorHub core in one device (a smartwatch) as an example. In a scenario where the phone and smartwatch communicate via Bluetooth, the smartwatch's BT core acts as the receiving core. That is, the identifier for one or more service data packets sent from the phone to the smartwatch points to the BT core. After receiving the service data packet, the BT core needs to distinguish between service data packets that it needs to process and those that are not, based on the service data contained within the data packet.
[0107] Combining the kernel mapping table given in Table 1, Figure 3 The given communication scenario diagram and Figure 4 A schematic diagram of another smartwatch and mobile phone communication scenario is given to illustrate how the smartwatch's BT core, CPU core, and SensorHub core process the received service data packets.
[0108] like Figure 4 As shown, the BT core of the smartwatch receives three service data packets sent by the mobile phone: service data packet 1, service data packet 2, and service data packet 3. Since the smartwatch and mobile phone are connected via Bluetooth, the BT core of the smartwatch acts as the receiving core, and the identifiers in the header information of service data packets 1, 2, and 3 all point to the BT core. Referring to Table 1, the identifier (ID) of service data packets 1, 2, and 3 is 0x03. However, in reality, service data packet 1 is processed by the BT core, service data packet 2 is processed by the CPU core, and service data packet 3 is processed by the SensorHub core.
[0109] The BT core distinguishes between service data packets, classifying them as Service Data Packet 1 (to be processed by the core itself) and Service Data Packets 2 and 3 (not to be processed by the core). The BT core forwards Service Data Packet 2 and Service Data Packet 3 to the CPU core for processing via Channel 1.
[0110] After receiving service data packets 2 and 3, the CPU core processes them respectively. This processing includes data parsing and repackaging. After parsing, the CPU core determines that service data packet 2 is processed by this core, while service data packet 3 is not. Service data packet 3 is processed by the SensorHub core. In this case, based on the identifier (0x01) of the SensorHub core in the core mapping table, the CPU core repackages service data packet 3, generating a new service data packet 3.1 (ID = 0x01), and sends service data packet 3.1 to the SensorHub core for processing via channel 2.
[0111] After the BT core, CPU core, and SensorHub core in the smartphone generate the corresponding service response packets for the service data packets, the service response packets need to be returned to the phone via the sending core (BT core) under the Bluetooth communication connection.
[0112] Specifically, the SensorHub core generates a service response packet 3.1 corresponding to service data packet 3.1. The SensorHub core can send service response packet 3.1 to the CPU core. The CPU core processes the service data packet based on service response packet 3.1 and generates a new service response packet 3.2. The CPU core returns service response packet 3.2 and service response packet 2 corresponding to the locally processed service data packet 2 to the BT core. The BT core returns service response packet 1 corresponding to the locally processed service data packet 1, the received service response packet 2, and service response packet 3.2 to the mobile phone via Bluetooth connection.
[0113] Depend on Figure 4 The given example of inter-core communication shows that when the receiving core is the BT core, if the BT core wants to send service data packet 3, which is processed by the SensorHub core, to the SensorHub core, it needs to go through the main CPU core for service data packet processing. Similarly, if the SensorHub core wants to return service reply packet 3.1 to the BT core, it also needs to go through the main CPU core for service data packet processing. The CPU core, as the main core and acting as a relay medium for service data packets in inter-core communication, needs to perform data operations such as parsing service data packets and repackaging service data packets not processed by its own core, making the overall efficiency of inter-core communication very low.
[0114] Furthermore, the main CPU needs to receive service data packets that are not processed by the BT core and are forwarded by the BT core through channel 1; after processing the service data packets, the service data packets processed by the SensorHub core are forwarded out through channel 2. The overall process results in redundant data flow, leading to a waste of channel resources.
[0115] above Figure 4 An example of inter-core communication using a BT core as a transceiver core under a Bluetooth communication connection is given. Figure 5 A schematic diagram illustrating the inter-core communication of a smartwatch is presented as another communication scenario. Figure 5 A schematic diagram of a communication scenario between a personal computer and a smartwatch is provided. Figure 5 The communication scenario shown is a communication scenario between a personal computer (PC) and a smartwatch. The communication method between the PC and the smartwatch is serial communication. In serial communication, the CPU core is a receiving core and a sending core.
[0116] In another example, the header information of the service data packet in this communication scenario includes a source address identifier and a destination address identifier. The header information can be represented as (destination address identifier | source address identifier). For example, if the header information of the service data packet is (2|6), then referring to the core mapping table shown in Table 1 above, we can see that the destination address identifier of this service data packet points to the CPU core, and the source address identifier points to the PC. That is, this service data packet is sent from the PC to the smartwatch, and this service data packet is processed by the CPU core. In another example, the header information of the service data packet can also be directly abbreviated to 26.
[0117] In scenarios where the communication between the PC and the smartwatch is via serial communication, the CPU core serves as both a receiving core and a transmitting core. The PC sends one or more PC commands to the smartwatch, each command corresponding to a service data packet, and each service data packet representing a different service type of data. For example, a PC command might include reading the identification of a specific sensor device on the smartwatch, or controlling the smartwatch to start playing music. Different services are distributed across different processor cores on the smartwatch.
[0118] However, in communication scenarios where the CPU core is the primary core, the address identifier of the service data packet corresponding to one or more PC commands sent by the PC needs to point to the primary core (such as the CPU core). The CPU core processes the received service data packet, distinguishing between service data packets processed by this core and those not processed by this core based on the service data contained within. The CPU core repackages the service data packets not processed by this core, regenerates new service data packets, and sends them to the corresponding core. Correspondingly, after the processor core generates the service response packet corresponding to the service data packet, it needs to return to the CPU core first. After the CPU core identifies that it is response data corresponding to the PC command, it regenerates the service response packet and sends it to the PC.
[0119] like Figure 5As shown, the smartwatch's CPU core receives three service data packets sent by the mobile phone: service data packet 4 ("26AAAAAAAAAA"), service data packet 5 ("26BBBBBBBBBB"), and service data packet 6 ("26CCCCCCCCCC"). The source address identifiers in the headers of service data packets 4, 5, and 6 all point to the PC, while the destination address identifiers in the headers of these packets all point to the CPU core. In reality, service data packet 4 is processed by the CPU core, service data packet 5 by the SensorHub core, and service data packet 6 by the BT core. After parsing service data packets 4, 5, and 6, the CPU core distinguishes between service data packets processed by itself (service data packet 4) and those not processed by itself (service data packets 5 and 6). The CPU core then repackages service data packets 5 and 6 to obtain new service data packets 5.1 ("12BBBBBBBBBB") and 6.1 ("32CCCCCCCCCC"). The destination address identifier in the header of service data packet 5.1 points to the SensorHub core, and the source address identifier points to the CPU core. The CPU core sends service data packet 5.1 to the SensorHub core for processing. The destination address identifier in the header of service data packet 6.1 points to the BT core, and the source address identifier points to the CPU core. The CPU core sends service data packet 6.1 to the BT core for processing.
[0120] Accordingly, the SensorHub core, based on the service response packet 5.1 corresponding to service data packet 5.1, needs to send service response packet 5.1 to the CPU core for processing. Therefore, the destination address identifier in the header of service response packet 5.1 points to the CPU core, and the source address identifier points to the SensorHub core. The BT core, based on the service response packet 6.1 corresponding to service data packet 6.1, also needs to send service response packet 6.1 to the CPU core for processing. Therefore, the destination address identifier in the header of service response packet 6.1 points to the CPU core, and the source address identifier points to the BT core. The CPU core processes the received service response packets 5.1 and 6.1 respectively. After recognizing that service response packets 5.1 and 6.1 are response data in response to PC commands, it generates new service response packets 5.2 and 5.3 respectively. The CPU core sends service response packets 5.2, 5.3, and the processed service response packet 4 to the PC via serial communication. The target address identifier in the header information of business response packets 4, 5.2 and 5.3 points to the PC, and the source address identifier points to the CPU core.
[0121] Figure 4 and Figure 5 The given electronic device includes an inter-core communication scenario with one master core and multiple slave cores. For example, in an inter-core communication scenario with the CPU core as the master core and the BT core and SensorHub core as slave cores, regardless of which core is the receiving or sending core, if a service data packet is involved that cannot be processed by the current core, the CPU core (master core) needs to process the service data packet, generate a new service data packet, and then send the new service data packet to the target slave core. The entire process involves the master core's service data packet processing and forwarding operations, which is very time-consuming and results in low inter-core efficiency. In addition, the master core and different slave cores correspond to different transmission channels, and all data packets passing through the master core need to be transmitted through the corresponding transmission channel, resulting in a waste of channel resources.
[0122] To address the low efficiency of inter-core communication in existing scenarios, this application provides a communication method applied to a first device, which includes multiple processor cores. The multiple processor cores include a first processor core and a second processor core. The first processor core of the first device receives at least one service data packet. The service data packet includes a first destination identifier. The first destination identifier points to the destination processor core for processing the service data packet. When the first destination identifier of the service data packet points to a second processor core, the first processor core can directly send the service data packet to the second processor core for service processing. In this solution, the first processor core, as the receiving core of the service data packet, can directly forward the service data packet based on the first destination identifier, eliminating the need for processing and forwarding of service data packets through the default primary core. This avoids resource and channel waste and improves the efficiency of inter-core communication. It also improves the communication efficiency between the first device and other devices.
[0123] In the communication method provided in this application, when the first processor core of the first device acts as the receiving core, the received service data packet can be a service data packet sent by another device (such as the second device); the service data packet received by the first processor core can also be a service data packet sent by another processor core or an upper-layer application of the first device. It is understood that regardless of whether the service data packet comes from the second device, the upper-layer application of the first device, or another processor core of the first device, the processing procedure of the first processor core for the service data packet is similar.
[0124] The following embodiments use the example of a service data packet originating from a second device to illustrate the communication method provided in this application. Figure 6 A flowchart illustrating a communication method provided in this embodiment is given, including:
[0125] S101, the first processor core of the first device receives at least one service data packet sent by the second device.
[0126] The first device may be an electronic device integrating multiple processor cores. These multiple processor cores may include two or more processor cores such as CPU cores, BT cores, and SensorHub cores. It is understood that the multiple processor cores may also include processor cores that the chip may integrate in the future to handle other extended business tasks. The second device may be an electronic device with one or more processor cores; this embodiment does not limit the scope of the second device.
[0127] In this embodiment, in the communication scenario between the first device and the second device, the first processor core used to receive service data packets can also be referred to as the transceiver core. The transceiver core refers to the processor core that communicates with the second device, responsible for receiving service data packets sent by the second device, and for sending service response packets generated by other processor cores to the second device. According to the agreed communication protocol of the communication connection, the type of communication connection between the first device and the second device determines the transceiver core of the first device. That is, under a certain communication connection, the receiving core used by the first device to receive service data packets and the sending core used to send service data packets are the same processor core, hence they can be simply referred to as the transceiver core. Correspondingly, if the communication connection type changes, the transceiver core of the first device will also switch to the processor core corresponding to the communication connection type.
[0128] The first device can establish any type of communication connection with the second device.
[0129] In one example, the first device can establish a near-field wired communication connection with the second device, such as a serial communication connection. When the communication connection between the first and second devices is a serial communication connection, the transceiver core among the multiple processor cores of the first device is the CPU core. The CPU core of the first device is responsible for receiving service data packets sent by the second device, and for sending service response packets generated by other processor cores (e.g., BT core, SensorHub core) to the second device.
[0130] In another example, the first device can establish a near-field wireless communication connection with the second device, such as a Bluetooth communication connection. When the communication connection between the first and second devices is a Bluetooth connection, the transceiver core among the multiple processor cores of the first device is the BT core. The BT core of the first device is responsible for receiving service data packets sent by the second device, and for sending service response packets generated by other processor cores (e.g., CPU core, SensorHub core) to the second device.
[0131] In another example, the first device can also establish a far-field wireless communication connection with the second device, and so on.
[0132] It is understood that this embodiment provides communication methods under serial communication connection and Bluetooth communication connection. The first device and the second device can also establish other communication connections such as signal connection. Each communication connection corresponds to a transceiver core of the first device. The specific transceiver core settings are related to the communication protocol and are not limited here.
[0133] In a communication scenario between the first and second devices, the transmitted service data packets correspond to the service instructions executed by the second device. For example, if the second device is a PC, the service data packets correspond to the PC's service instructions. If the second device is a mobile phone, the service data packets correspond to the mobile phone's service instructions. Different service instructions may correspond to different service types; therefore, different service data packets may correspond to different service types of data.
[0134] In this embodiment, information fields for service data packets transmitted in a communication scenario between the first device and the second device can be defined. For example, the information fields of the service data packets include a destination identifier. The destination identifier points to the destination processor core or target device (such as the second device in this embodiment) that processes the service data packets. For ease of distinction, the destination identifier of the service data packets sent by the second device to the first device is the first destination identifier; the destination identifier of the service data packets (service response packets in this embodiment) sent by the first device to the second device is the second destination identifier. In one possible implementation, the destination identifier can be defined in the header information of the service data packets. In some optional embodiments, the header information of the service data packets may also include a source identifier. The source identifier can be a device / address representing the source of the service data packets.
[0135] In a specific example, the first destination identifier could be an address identifier (TRANID) representing the destination processor core used to process the service data packet. Both the first and second devices can maintain a routing table, which can include the relationship between each processor core (the address corresponds to the processor that integrates that core) and its address identifier. The routing table is shown in Table 1 above. As shown in Table 1, the correspondence between different processor cores and their address identifiers is defined.
[0136] For example, if the first device is a smartwatch and the second device is a PC, the first device includes a CPU core and a BitTorrent core. The PC generates a service data packet. If this service data packet is processed by the CPU, its address identifier is 0x02, pointing to the CPU core (i.e., the CPU chip integrating the CPU core). After the PC and smartwatch successfully handshake, the smartwatch receives the service data packet with address identifier 0x02 sent by the PC, which needs to be processed by the CPU core. Furthermore, the source identifier for this service data packet can be 0x06, meaning the service data packet originates from the PC. The information field of this service data packet can then be represented as "26".
[0137] For example, if a PC generates a service data packet, and this service data packet is to be processed by the BT core, then the address identifier of this service data packet is 0x03, which points to the BT core (that is, to the BT chip that integrates the BT core). After the PC and the smartwatch successfully handshake, the smartwatch receives the service data packet with address identifier 0x03 sent by the PC, which needs to be processed by the BT core.
[0138] For example, when the first device is a PC and the second device is a mobile phone, the first device includes a CPU core and a BitTorrent core. The mobile phone generates a service data packet. If this service data packet is one that the CPU is responsible for processing, then its address identifier is 0x02, pointing to the CPU core (i.e., the CPU chip with the integrated CPU core). After the mobile phone and PC successfully handshake, the PC receives the service data packet with address identifier 0x02 sent by the mobile phone, which needs to be processed by the CPU core.
[0139] It is understandable that the correspondence between processor cores (addresses corresponding to the processors integrating those cores) and address identifiers, as shown in Table 1 above, can be applied to all devices containing those processor cores. For example, the first device is a mobile phone, which contains at least a CPU core. When the mobile phone receives a service data packet with address identifier 0x02, its first processor core can determine, based on the address identifier, that the service data packet is a data packet that the CPU is responsible for processing. Similarly, the first device is a smartwatch, which contains at least a BT core. When the smartwatch receives a service data packet with address identifier 0x03, its first processor core can determine, based on this address identifier, that the service data packet is a data packet that the BT core is responsible for processing. In this way, electronic devices containing multiple processor cores can distribute and process service data packets.
[0140] S102, the first processor core of the first device performs destination identification on the service data packet and determines the destination processor core corresponding to the service data packet.
[0141] In this embodiment, the first processor core of the first device can directly determine the destination processor core corresponding to the service data packet based on the first destination identifier of the service data packet. For example, when the first destination identifier is an address identifier, the first processor core of the first device can query the routing table for the destination processor core corresponding to the address identifier of the service data packet. For example, if the second device is a PC, and the first processor core of the first device is a CPU core, and the header information of the service data packet received by the CPU core is "36", where the address identifier is "3", then the CPU core can determine that the destination processor core corresponding to the service data packet is the BT core. For example, if the second device is a mobile phone, and the first processor core of the first device is a BT core, and the header information of the service data packet received by the BT core is "15", where the address identifier is "1", then the BT core can determine that the destination processor core corresponding to the service data packet is the SensorHub core.
[0142] S103, the first processor core of the first device sends the service data packet to the corresponding destination processor core.
[0143] When the first processor core determines that the destination processor core corresponding to the service data packet is another processor core, the first processor core can directly send the service data packet to the corresponding destination processor core.
[0144] In one specific implementation, the first processor core can send the service data packet to the corresponding destination processor core using a preset transmission method. The preset transmission method refers to a transmission method in which the data is transmitted without any modification or processing, strictly adhering to the original data format and content. For example, the preset transmission method can be transparent transmission. The communication method provided in this embodiment can be applied to transparent transmission, full-duplex communication scenarios.
[0145] The first processor core of the first device is a CPU core, and the header information of the service data packet received by the CPU core is "36". If the CPU core determines that the destination processor core corresponding to the service data packet is the BT core (second processor core), the CPU core directly sends the service data packet to the BT core in a transparent manner. For example, if the first processor core of the first device is the BT core, and the header information of the service data packet received by the BT core is "15", and the BT core determines that the destination processor core corresponding to the service data packet is the SensorHub core (third processor core), the BT core directly sends the service data packet to the SensorHub core in a transparent manner.
[0146] S104, after the processor core of the first device generates the service response packet corresponding to the service data packet, each processor core sends the service response packet to the first processor core.
[0147] After the first processor core of the first device sends the service data packet to the corresponding destination processor core, each destination processor core can perform corresponding response operations based on the service data packet to generate response data. Each destination processor core can then package and process the response data to obtain a service response packet corresponding to the service data packet of the second device.
[0148] The service response packets generated by each destination processor core are similar to the service data packets received by the first processor core. The service response packets may include a source identifier and a second destination identifier. The second destination identifier may also be an address identifier.
[0149] When the second destination identifier is an address identifier, the address identifier can be used to point to either a device or a processor core. For example, when the address identifier is 0x05, it points to a mobile phone; when the address identifier is 0x06, it points to a PC. Alternatively, the correspondence between address identifiers and processor cores can be found in Table 1 above.
[0150] The address identifier of the service response packet is determined based on the source identifier of the service data packet corresponding to the service response packet. If the source identifier of the service data packet points to a device, then the address identifier of the service response packet points to that device; if the source identifier of the service data packet points to a processor (same as the processor core), then the address identifier of the service response packet points to the processor.
[0151] For example, in this embodiment, the source identifier of the service response packet points to each destination processor core; the second destination identifier of the service response packet generated corresponding to the service data packet whose source identifier points to the second device points to the second device.
[0152] Specifically, the second device is a PC, and the first device is a smartwatch. When the CPU core, BT core, and SensorHub core in the smartwatch generate service response packets based on service data packets with source identifiers pointing to the PC, the second destination identifier of the generated service response packets is "6", used to point to the PC. Alternatively, the second device can be a mobile phone, and the first device can be a smartwatch. When the CPU core, BT core, and SensorHub core in the smartwatch generate service response packets based on service data packets with source identifiers pointing to the mobile phone, the second destination identifier of the generated service response packets is "5", used to point to the mobile phone.
[0153] S105, the first processor core of the first device performs destination identification on the service response packet. When it is determined that the second destination identifier of the service response packet points to the second device, the first processor core sends the service response packet to the second device.
[0154] Similar to S102 above, in this embodiment, the first processor core of the first device can send the service reply packet to the second device based on the correspondence between the address identifier and the device, when the address identifier of the service reply packet points to the second device.
[0155] For example, the second device is a PC, and the first device's transceiver core is a CPU core. The CPU core receives a service response packet with a second destination identifier of "6," pointing to the PC, and then sends the service response packet to the PC. As another example, the second device is a mobile phone, and the first device's transceiver core is a BT core. The BT core receives a service response packet with a second destination identifier of "5," pointing to the mobile phone, and then sends the service response packet to the mobile phone.
[0156] In this embodiment, each processor core of the first device may process multiple tasks synchronously or asynchronously, and can receive multiple service data packets from different second devices, and also generate multiple service response packets that need to be sent to different second devices. The first processor core of the first device transmits service data packets based on the first destination identifier of the service data packets, and transmits service response packets based on the second destination identifier of the service response packets, which makes the data transmission of service data packets and service response packets more accurate and reliable.
[0157] In some other communication scenarios, if the service data packet comes from the upper layer application of the first device, then the first processor core of the first device can point to the upper layer application based on the second destination identifier of the received service reply packet, and the first processor core can send the service reply packet to the upper layer application.
[0158] In this embodiment, in the communication scenario between the first device and the second device, there is no concept of master and slave cores among the multiple processor cores in the first device. The service data packets / service response packets transmitted in the communication scenario between the first device and the second device include a destination identifier. The first processor core of the first device corresponding to the communication type can directly forward the service data packet to the corresponding destination processor core for service processing based on the first destination identifier of the service data packet. The second destination identifier of the service response packet generated by each processor core can point to the second device, and the first processor core of the first device can directly return the service response packet to the second device based on the second destination identifier of the service response packet. In the inter-core communication process of the multiple processor cores of the first device involved in the communication between the first device and the second device, there is no processor core that needs to perform relay medium for service data packet processing. The processor cores can directly transmit service data packets / service response packets, avoiding the waste of channel resources in inter-core communication, greatly improving the efficiency of inter-core communication, and further improving the communication efficiency between the first device and the second device.
[0159] Taking an electronic device comprising two processor cores as an example, the communication method provided in the embodiments of this application will be explained. Figure 7 As shown, Figure 7 A schematic diagram illustrating a scenario of communication between a smartwatch and a mobile phone is provided. In this embodiment, the smartwatch is the first device, comprising a CPU core and a BT core; the mobile phone is the second device. The smartwatch and the mobile phone establish a Bluetooth communication connection, with the BT core of the smartwatch serving as the first processor core. Furthermore, both the smartwatch and the mobile phone store routing tables. Both the CPU core and the BT core in the smartwatch can access the routing tables stored in the smartwatch. These routing tables can be stored in a designated storage space, which is a shared storage space for multiple processor cores.
[0160] In this embodiment, after the BT core of the smartwatch receives the service data packet corresponding to the mobile service command sent by the mobile phone, it compares the first destination identifier (such as the address identifier) of the service data packet with the routing table to distinguish between service data packets processed by this core and those not processed by this core. If the service data packet is not processed by this core, and the first destination identifier of the service data packet points to the CPU core, the BT core can send the service data packet to the CPU core for processing through channel 1 in a transparent manner. After receiving the service reply packet transmitted by the CPU core through channel 1, the BT core determines that the service reply packet is a service reply packet corresponding to the mobile phone service command based on the second destination identifier of the service reply packet, and the BT core returns the service reply packet to the mobile phone. Inter-core communication between different processor cores corresponds to different transmission channels, which are determined by the inter-core communication protocol. The corresponding transmission channel can be determined based on the processor core (or the corresponding address identifier) of the communication between each pair of cores. For example, the transmission channel between the BT core and the CPU core is channel 1.
[0161] Taking an electronic device comprising three processor cores as an example, the communication method provided in the embodiments of this application will be explained. Figure 8 As shown, Figure 8A schematic diagram illustrating another scenario of communication between a smartwatch and a mobile phone is provided. In this embodiment, the smartwatch is the first device, comprising a CPU core, a BT core, and a SensorHub core; the mobile phone is the second device. The smartwatch and mobile phone establish a Bluetooth communication connection, with the BT core of the smartwatch acting as the first processor core. Furthermore, both the smartwatch and the mobile phone store routing tables. The CPU core, BT core, and SensorHub core in the smartwatch can all access the routing tables stored in the smartwatch. The routing tables can be stored in a designated storage space, which is a shared storage space for multiple processor cores. In one example, the CPU core is responsible for audio data processing; the BT core is responsible for GPS data processing; and the SensorHub core is responsible for sensor data processing. The BT core, as the first processor core, can communicate with the CPU core via channel 1 and with the SensorHub core via channel 2.
[0162] In this embodiment, when the BT core is used as the first processor core, there is no need for inter-core communication between the CPU core and the SensorHub core. That is, the service data packets will be transmitted directly from the BT core to the SensorHub core without passing through the CPU core. Therefore, the transmission channel between the CPU core and the SensorHub core can be saved, avoiding the waste of the channel.
[0163] Combination Figure 9 The flowchart of inter-core communication is given below for illustration. In this flowchart, the first destination identifier of the service data packet is the address identifier.
[0164] The mobile phone sends three different mobile service commands to the smartwatch, namely service data packet 11, service data packet 22 and service data packet 33.
[0165] Among them, service data packet 11 is the service data packet corresponding to obtaining the smartwatch's location command. Obtaining the smartwatch's location command belongs to the data processing of the Global Positioning System (GPS) service, and service data packet 11 should be processed by the BT core. Therefore, the header information of service data packet 11 is "35", the source identifier points to the mobile phone (0x05), and the address identifier points to the BT core of the first device (0x03). The information fields of service data packet 11 are as follows: Figure 9 The "35xxxxx" shown.
[0166] Service data packet 22 is the service data packet corresponding to the command to start playing music. Since the command to start playing music belongs to audio service data processing, service data packet 22 should be processed by the CPU core. Therefore, the header information of service data packet 22 is "25", the source identifier points to the mobile phone (0x05), and the address identifier points to the CPU core of the first device (0x02). The information fields of service data packet 22 are as follows: Figure 9 The "25xxxxx" shown.
[0167] Service data packet 33 corresponds to the instruction to read the sensor device identifier of the smartwatch. This instruction falls under sensor service data processing, and service data packet 33 should be processed by the SensorHub core. Therefore, the header information of service data packet 33 is "15", the source identifier points to the mobile phone (0x05), and the address identifier points to the SensorHub core of the first device (0x01). The information fields of service data packet 33 are as follows: Figure 9 The "15xxxxx" shown.
[0168] The smartwatch communicates with the mobile phone via Bluetooth. The smartwatch's BT core acts as the transceiver core (first processor core), receiving service data packets 11, 22, and 33 sent by the mobile phone. It then performs destination identification on each service data packet to determine the corresponding destination processor core.
[0169] For service data packet 11: Based on the header information "35" of service data packet 11, the BT core queries the routing table to determine that the destination processor core corresponding to the address identifier "3" of service data packet 11 is the BT core, and service data packet 11 is a service data packet processed by this core. The BT core retains service data packet 11 for service processing and generates a corresponding service response packet 11. Service response packet 11 is the response data generated in response to service data packet 11; therefore, the header information of service response packet 11 is "53", the source identifier points to the BT core of the first device (0x03), and the second destination identifier points to the mobile phone (0x05). After generating service response packet 11, the BT core can return service response packet 11 to the mobile phone.
[0170] For service data packet 22: Based on the header information "25" of service data packet 22, the BT core queries the routing table to determine that the destination processor core corresponding to the address identifier "2" of service data packet 22 is the CPU core. Since service data packet 22 is not processed by this core, the BT core sends service data packet 22 to the CPU core for service processing via transparent transmission. Upon receiving service data packet 22, the CPU core queries the routing table to determine that the destination processor core corresponding to service data packet 22 is its own core (CPU core). The CPU core processes service data packet 22 and generates a corresponding service response packet 22. Service response packet 22 is response data generated in response to a mobile phone service command; therefore, the header information of service response packet 22 is "52", the source identifier points to the CPU core of the first device (0x02), and the second destination identifier points to the mobile phone (0x05). After receiving service response packet 22, the BT core, based on the second destination identifier of service response packet 22, queries the routing table to determine that the second destination identifier of service response packet 22 points to the mobile phone, and then sends service response packet 22 to the mobile phone.
[0171] For business data packet 33: The processing flow of business data packet 33 is similar to that of business data packet 22, and will not be described in detail here.
[0172] In this embodiment, the BT core of the smartwatch serves as the transceiver core for establishing a Bluetooth communication connection between the smartwatch and the mobile phone. As the first processor core, the BT core can receive multiple service data packets sent by the mobile phone and, based on the first destination identifier of the service data packets, distribute them to the corresponding destination processor cores for service processing via transparent transmission. After each processor core generates a corresponding service reply packet, it can also send the service reply packet to the first processor core via transparent transmission. The first processor core then sends the service reply packet to the corresponding electronic device (mobile phone) based on the second destination identifier of the service reply packet. During inter-core communication among the multiple processor cores of the smartwatch, data can be transmitted directly between the multiple processor cores without the need for a "main core" as an intermediary. There is also no processor core that needs to perform service data packet processing (such as parsing data packets and then regenerating them for forwarding), thus avoiding waste of channel resources in inter-core communication and greatly improving the efficiency of inter-core communication. Furthermore, this improves the communication efficiency between the first device and the second device.
[0173] Taking another example, where the first device is an electronic device comprising three processor cores, we will illustrate another communication method provided in the embodiments of this application. Figure 10 As shown, Figure 10A schematic diagram illustrating a scenario of communication between a smartwatch and a PC is provided. In this embodiment, the smartwatch is the first device, comprising a CPU core, a BT core, and a SensorHub core; the PC is the second device. The smartwatch and PC establish a serial communication connection, with the smartwatch's CPU core acting as the transceiver core (first processor core). Furthermore, both the smartwatch and the PC store routing tables. The CPU core, BT core, and SensorHub core in the smartwatch can all access the routing tables stored in the service. These routing tables can be stored in a designated storage space, which is a shared storage space for multiple processor cores. In one example, the CPU core handles audio service data processing; the BT core handles GPS service data processing; and the SensorHub core handles sensor service data processing. As the first processor core, the CPU core can communicate with the BT core via channel 1 and with the SensorHub core via channel 3.
[0174] In this embodiment, when the CPU core is used as the first processor core, the service data packets are directly transmitted from the CPU core to the BT core and the SensorHub core respectively, without the need to establish a transmission channel between the BT core and the SensorHub core, thus avoiding the waste of channels.
[0175] Combination Figure 11 A flowchart illustrating another type of inter-core communication is provided. The first destination identifier of the service data packet is the address identifier.
[0176] The PC sends three different mobile service commands to the smartwatch, namely service data packet 44, service data packet 55 and service data packet 66.
[0177] Among them, service data packet 44 is the service data packet corresponding to the command to start playing music. The command to start playing music belongs to the data processing of audio services, and service data packet 44 should be processed by the CPU core. Therefore, the header information of service data packet 44 is "26", the source identifier points to the PC (0x06), and the address identifier points to the CPU core of the first device (0x02). The information fields of service data packet 44 are as follows: Figure 11 The figure shown is “26yyyyy”.
[0178] Service data packet 55 corresponds to the instruction to read the sensor device identifier of the smartwatch. This instruction falls under sensor service data processing, and service data packet 55 should be processed by the SensorHub core. Therefore, the header information of service data packet 55 is "16", the source identifier points to the PC (0x06), and the address identifier points to the SensorHub core of the first device (0x01). The information fields of service data packet 55 are as follows: Figure 11The figure shown is “16yyyyy”.
[0179] Service data packet 66 is the service data packet corresponding to obtaining the smartwatch's location command. Obtaining the smartwatch's location command belongs to the data processing of the Global Positioning System (GPS) service, and service data packet 66 should be processed by the BT core. Therefore, the header information of service data packet 66 is "36", the source identifier points to the PC (0x06), and the address identifier points to the BT core of the first device (0x03). The information fields of service data packet 66 are as follows: Figure 11 The figure shown is “36yyyyy”.
[0180] The smartwatch communicates with the PC via serial communication. The smartwatch's CPU core acts as a transceiver core, receiving service data packets 44, 55, and 66 sent by the mobile phone, identifying the destination of each data packet, and determining the corresponding destination processor core.
[0181] For service data packet 44: Based on the header information "26" of service data packet 44, the CPU core queries the routing table to determine that the destination processor core of service data packet 44 is the CPU core, and service data packet 44 is a service data packet processed by this core. The CPU core retains service data packet 44 for service processing and generates a service response packet 44 corresponding to service data packet 44. Service response packet 44 is response data generated in response to PC service instructions; therefore, the header information of service response packet 44 is "62", the source identifier points to the CPU core of the first device (0x02), and the second destination identifier points to the PC (0x06). After generating service response packet 44, the CPU core can return service response packet 44 to the PC.
[0182] For service data packet 55: Based on the header information "16" of service data packet 55, the CPU core queries the routing table to determine that the destination processor core of service data packet 55 is the SensorHub core. Since service data packet 55 is not processed by this core, the CPU core sends service data packet 55 to the SensorHub core for processing via transparent transmission. Upon receiving service data packet 55, the SensorHub core, after querying the routing table to determine that service data packet 55 is for its own processing, performs service processing on service data packet 55, generating a corresponding service response packet 55. The service response packet 55 is response data generated in response to PC commands; therefore, the header information of service response packet 55 is "61," with the source identifier pointing to the SensorHub core of the first device (0x01) and the second destination identifier pointing to the PC (0x06). After receiving service response packet 55, the CPU core, based on the second destination identifier of service response packet 55, queries the routing table to determine that the second destination identifier of service response packet 55 points to the PC, and sends service response packet 44 to the mobile phone.
[0183] For business data packet 66: The processing flow for business data packet 66 is similar to that for business data packet 55, and will not be elaborated here.
[0184] In this embodiment, the CPU core of the smartwatch acts as the transceiver core for establishing a serial communication connection between the smartwatch and the PC. The smartwatch's CPU core can receive multiple service data packets sent by the mobile phone and, based on the first destination identifier of the service data packets, distribute them to the corresponding processor cores for data processing via transparent transmission. After each processor core generates a corresponding service response packet, it can also receive service response packets from each processor core via transparent transmission and, based on the second destination identifier of the service response packet, send the service response packet to the corresponding electronic device (PC). During inter-core communication among the multiple processor cores of the smartwatch, data can be directly transmitted between the multiple processor cores without the need for a "main core" as an intermediary. There are no processor cores that need to perform service data packet processing as a relay medium. Especially in inter-core communication scenarios with a large number of processor cores, this avoids repeated copying, storage, and forwarding of data between cores, preventing waste of channel resources and greatly improving the efficiency of inter-core communication. Furthermore, it improves the communication efficiency between the first device and the second device.
[0185] In the above embodiments, the routing tables of the first device / second device are manually defined tables in each device. The routing tables specify the correspondence between the identifiers and addresses of each processor core of the first device and the other second devices. In actual communication scenarios between the first and second devices, the services handled by multiple processor cores of the first device may be updated, such as adding / deleting / modifying the services handled by a processor core. These updates will involve changes in the scope of services handled by each processor core in the first device, and the destination processor core corresponding to the service data packets received by the first device may need to be updated. The manually defined routing tables require manual updates, and the routing tables must be downloaded to the first and second devices via over-the-air (OTA) technology. Alternatively, when the number of processor cores in the first device changes, such as adding or deleting a processor core, the routing tables also need to be manually updated, and the updated routing tables must be downloaded to the first and second devices via OTA. The involvement of service updates and processor core updates increases the development cost of inter-core communication methods based on routing tables; if updates are repeated, repeated manual modifications are also required, further increasing development costs.
[0186] In light of the current problem, this application provides another communication method, which defines a dynamic service configuration table, including service information of each processor core of the first device.
[0187] In one specific implementation, each processor core of the first device can write the service identifier corresponding to the service information it is responsible for processing into a service configuration table. Specifically, each processor core can obtain the service identifier of the service information processed by its own core, and write the service identifier of the service information processed by its own core into the service configuration table according to a predetermined format, thereby obtaining a service configuration table containing the correspondence between each processor core in the first device and the service identifiers that each processor core is responsible for processing. The service configuration table can clearly define the service identifier corresponding to each processor core. In another feasible approach, the service configuration table can also include the correspondence between each processor core and an address identifier. Thus, the service configuration table includes the correspondence between each processor core, the address identifier, and the service identifier. The service configuration table can be stored in a designated storage space of the first device. This designated storage space is a shared storage space for multiple processor cores. Each processor core of the first device has access rights to this storage space, and each processor core can perform read / write operations on the service configuration table.
[0188] In one specific implementation, during a cold boot of the first device's operating system, each processor core can obtain service information for the services running on its respective processor core based on the macro on / off states and initialized threads of each service. That is, each processor core obtains the service identifier corresponding to the service it is responsible for and writes it into the service configuration table. Each time the first device performs a cold boot of the operating system, it triggers a re-initialization of the service configuration table. During the operation of the first device, if the service handled by a processor core is updated, the processor core can update the service identifier in the service configuration table at any time, achieving dynamic updates of the services corresponding to each processor core in the service configuration table. Compared to a routing table that specifies the address identifiers of each processor core, the service configuration table can more accurately express the service scope handled by each processor core. Furthermore, for service updates by processor cores, the processor core can automatically update the service configuration table, eliminating the need for repeated manual modifications and significantly reducing development costs. Moreover, the service identifiers corresponding to each processor core in the service configuration table are real-time data, making service data packet distribution more accurate.
[0189] Furthermore, if the number of processor cores in the first device is updated—for example, by adding a new processor core—the newly added core can write the service identifier of the service it is responsible for processing into the service configuration table during initialization. Simultaneously, the services processed by other processor cores will also be adjusted, and these other processor cores can also update the service identifiers they are responsible for processing in their service configuration tables in real time. Conversely, if a processor core is deleted, it means that the services processed by the other processor cores will also be adjusted accordingly, and these other processor cores can also update the service identifiers they are responsible for processing in their service configuration tables in real time. This achieves dynamic updating of the service configuration table regardless of whether a processor core is added or deleted.
[0190] In one example, Figure 12 A sample diagram of a service configuration table is provided. The first destination identifier of the service data packet is the service identifier.
[0191] like Figure 12 The service configuration table shown includes service information written by the CPU core and processed by the CPU core, service identifiers written by the SensorHub core and processed by the SensorHub core, and service identifiers written by the BT core and processed by the BT core.
[0192] Specifically, the CPU core is responsible for processing information from various services, including the display screen, touch panel, and audio. The service identifier SID for the display screen is 0x01, for the touch panel it is 0x02, and for the audio it is 0x03 to 0x06.
[0193] Specifically, the SensorHub core is responsible for processing information from various services, including near-field communication and motion. The service identifier (SID) for near-field communication is 0x07, and the service identifier (SID) for motion is 0x08.
[0194] Specifically, the BT core is responsible for processing information from various services, including GPS, Bluetooth, and applications. The service identifier (SID) for GPS is 0x07, for Bluetooth it is 0x08, and for applications it is 0x09.
[0195] The service identifier SID for near-field communication is 0x07, which overlaps with the service identifier SID for global positioning system (GPS) which is also 0x07. This can be understood as meaning that when processing communication-related services, GPS-related services also need to be processed.
[0196] Both the first and second devices can maintain a service configuration table, with the first destination identifier of the service data packet being the service identifier (SID). This service identifier can be any field in the information fields of the service data packet. After receiving the service data packet, the first processor core of the first device can look up the destination processor core corresponding to the SID of the service data packet in the service configuration table. For example, if the SID of the service data packet is 0x01, then the service data packet can be considered to be related service data of the display screen processed by the CPU core. It can be determined that the destination processor core corresponding to the service data packet is the CPU core, and the address identifier (TRANID) of the CPU core is 0x02.
[0197] Figure 13 Another scenario diagram illustrating communication between a smartwatch and a PC is provided. In this diagram, the smartwatch is the first device, and the PC is the second device. For a more detailed explanation of smartwatch-PC communication, please refer to the above. Figure 11 Example provided.
[0198] In this embodiment, the PC sends three different mobile service commands corresponding to the smartwatch, namely service data packet 7, service data packet 8 and service data packet 9.
[0199] Among them, business data packet 7 is the business data packet corresponding to the command to start playing music, and the first destination identifier of business data packet 7 is SID (0x04). In one example, the information field of business data packet 7 is as follows: Figure 13 The text appears to be a string of characters and symbols, possibly a corrupted file or a corrupted file. A direct translation wouldn't be meaningful.
[0200] Service data packet 8 is the service data packet corresponding to the near-field communication enable command. The first destination identifier of service data packet 8 is SID (0x07). In one example, the information field of service data packet 8 is as follows: Figure 13 The text appears to be a string of characters and symbols, possibly a corrupted file or a corrupted file. A direct translation wouldn't be meaningful.
[0201] Service data packet 9 is the service data packet corresponding to the application instruction. The first destination identifier of service data packet 9 is SID (0x07). The information fields of service data packet 9 are as follows: Figure 13 The text appears to be a string of characters and symbols, possibly a corrupted file or a corrupted file. A direct translation wouldn't be
[0202] The smartwatch communicates with the PC via serial communication. The smartwatch's CPU core acts as the first processor core, receiving service data packets 7, 8, and 9 sent by the mobile phone. It identifies the destination based on the first destination identifier (SID in this embodiment) of the service data packets to determine the corresponding destination processor core.
[0203] For service data packet 7: Based on the SID "4", i.e., "0x04", the CPU core determines the destination processor core of service data packet 7 as the CPU core by querying the service configuration table. Service data packet 7 is a service data packet processed by this core. The CPU core retains service data packet 7 for data processing and generates a corresponding service response packet 7. Service response packet 7 is the response data generated in response to the PC's service command; therefore, the second destination identifier of service response packet 7 points to the PC (0x06). The CPU core sends service response packet 7 to the PC based on the second destination identifier of service response packet 7.
[0204] For service data packet 8: Based on the SID "7" (i.e., "0x07") of service data packet 8, the CPU core, after consulting the service configuration table, determines that the destination processor cores for service data packet 8 are the SensorHub core and the BT core. The address identifier (TRANID) of the BT core is 0x03, and the address identifier (TRANID) of the SensorHub core is 0x01. The CPU core can determine the target transmission channel between the BT core and the CPU core based on the address identifier of the BT core. It then sends service data packet 8 carrying the address identifier (TRANID = 0x03) to the BT core through the target transmission channel for service processing. Similarly, the CPU core can determine the target transmission channel between the SensorHub core and the CPU core based on the address identifier of the SensorHub core. It then sends service data packet 8 carrying the address identifier (TRANID = 0x01) to the SensorHub core through the target transmission channel for service processing.
[0205] The SensorHub core receives and processes service data packet 8, generating a service response packet 8.1 corresponding to service data packet 8. The second destination identifier of service response packet 8.1 points to PC (0x06). The BT core receives and processes service data packet 8, generating a service response packet 8.2 corresponding to service data packet 8. The second destination identifier of service response packet 8.2 points to PC (0x06). After the CPU core receives service response packet 8.1 sent by the SensorHub core and service response packet 8.2 sent by the BT core, it sends service response packets 8.1 and 8.2 to PC according to the second destination identifiers of service response packets 8.1 and 8.2.
[0206] For service data packet 9: Based on the SID "9" (0x09) of service data packet 9, the CPU core determines the destination processor core as the BT core by querying the service configuration table. The BT core's address identifier (TRANID) is 0x03. The CPU core can determine the target transmission channel between the BT core and the CPU core based on the BT core's address identifier. Service data packet 9, carrying the address identifier (TRANID = 0x03), is then sent to the BT core through the target transmission channel for service processing.
[0207] The BT core receives and processes service response packet 9, generating a service response packet 9 corresponding to service data packet 9. The second destination identifier of service response packet 9 points to PC (0x06). After the CPU core receives service response packet 9 sent by the BT core, it sends service response packet 9 to PC according to the second destination identifier of service response packet 9.
[0208] In this embodiment, when each processor core generates an update responsible for sending services, each processor core can promptly update the service identifier in the service configuration table. This allows the service configuration table to be dynamically updated without repeated manual modifications, reducing the development workload of the service configuration table and improving its adaptability in inter-core communication scenarios. The first processor core of the first device can distribute service data packets according to the service identifiers corresponding to each processor core in the service configuration table, further improving the accuracy of service data packet distribution and increasing inter-core communication efficiency.
[0209] Both the first device and the second device in the above embodiments of this application can be electronic devices. Exemplarily, electronic devices can be portable computers (such as mobile phones), tablet computers, laptop computers, personal computers (PCs), wearable electronic devices (such as smartwatches), augmented reality (AR) / virtual reality (VR) devices, in-vehicle computers, and other devices with multiple processor cores. The following embodiments do not impose any special limitations on the specific form of the electronic device.
[0210] Figure 14 A schematic diagram of the structure of the electronic device 100 is shown.
[0211] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0212] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0213] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0214] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0215] In this embodiment, the processor 110 may include multiple processor cores, which may include CPU cores, BT cores, SensorHub cores, and other processor cores responsible for tasks of different business types.
[0216] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0217] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, a serial communication interface, etc.
[0218] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In this embodiment, the first device and the second device can handshake via the GPIO interface.
[0219] In this embodiment, the first device and the second device can establish a serial communication connection through a serial communication interface. Exemplary examples include the recommended standard RS-232 interface, RS-485 interface, transistor-transistor logic serial interface (TTL), etc. Additionally, USB interfaces and Bluetooth interfaces can also be used as serial communication interfaces to establish serial communication connections between devices. This embodiment is not limited to these examples.
[0220] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0221] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0222] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.
[0223] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0224] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0225] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0226] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.
[0227] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR). The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0228] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0229] In this embodiment, the first device and the second device can achieve Bluetooth communication connection, WiFi communication connection, etc. through the wireless communication module 160.
[0230] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0231] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0232] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0233] Figure 15 A possible structural schematic diagram of the electronic device involved in the above embodiments is shown. Figure 15 The illustrated electronic device 1500 includes a communication module 1501, a storage module 1502, and multiple processing modules 1503. Taking three processing modules as an example, the multiple processing modules may include a central processing module, a Bluetooth processing module, and a sensor processing module. Different processing modules are used for tasks of different business types. It is understood that this embodiment does not limit the number of processing modules deployed in an electronic device.
[0234] As an example, the central processing module can be as follows: Figure 14 The CPU core among the multiple processor cores shown can be a Bluetooth processing module as follows: Figure 14 The BT core among the multiple processor cores shown can be used as follows: Figure 14 The SensorHub core is one of the multiple processor cores shown. Alternatively, processing module 1503 can also be a processing module for tasks of other business types. Communication module 1501 can be, for example, Figure 14 The wireless communication module 160 or mobile communication module 150 shown is an example. The storage module 1502 can be, for example... Figure 14 The internal memory 121 shown. The electronic device provided in this application embodiment can be Figure 14 The electronic device 100 shown.
[0235] This application also provides a chip system (e.g., a system-on-a-chip (SoC)). Figure 16 As shown, the chip system includes multiple processors 1601 and at least one interface circuit 1602. Exemplarily, the multiple processors may include three processors, such as a CPU, a Bluetooth processor, and a sensor processor. Different processors are used for tasks of different business types. It is understood that, with the development of chip integration technology, this embodiment does not limit the number of processor cores integrated on a single chip system.
[0236] Processor 1601 and interface circuit 1602 can be interconnected via lines. For example, interface circuit 1602 can be used to receive signals from other devices (e.g., the memory of an electronic device). As another example, interface circuit 1602 can be used to send signals to other devices (e.g., one or more processors or other electronic devices). Exemplarily, interface circuit 1602 can read instructions stored in memory and send those instructions to one or more processors. When the instructions are executed by one or more processors, the electronic device can perform the steps in the above embodiments. Of course, the chip system may also include other discrete components, and this application embodiment does not specifically limit this.
[0237] This application also provides a computer-readable storage medium including computer instructions that, when executed on the electronic device, cause the electronic device to perform various functions or steps performed by the electronic device 100 in the above method embodiment.
[0238] This application also provides a computer program product that, when run on a computer, causes the computer to perform the various functions or steps performed by the electronic device 100 in the above method embodiments. For example, the computer may be the aforementioned electronic device 100.
[0239] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0240] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0241] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0242] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0243] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0244] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A communication method, characterized in that, Applied to a first device, the first device including a plurality of processor cores, the plurality of processor cores including a first processor core and a second processor core; the method includes: The first processor core of the first device receives at least one service data packet; the service data packet includes a first destination identifier, which is used to indicate the destination processor core that processes the service data packet. If the destination processor core indicated by the first destination identifier of the service data packet is the second processor core, the first processor core will send the service data packet to the second processor core; The second processor core performs service processing based on the service data packets.
2. The method according to claim 1, characterized in that, The first processor core sends the service data packet to the second processor core, including: The first processor core sends the service data packet to the second processor core using a preset transmission method; The preset transmission method includes any method of transmitting according to the original data format and content of the service data packet.
3. The method according to claim 1 or 2, characterized in that, The plurality of processor cores further includes a third processor core; the method further includes: If the destination processor core pointed to by the first destination identifier of the service data packet is the third processor core, the first processor core will send the service data packet to the third processor core; The third processor core performs business processing based on the business data packets.
4. The method according to any one of claims 1-3, characterized in that, The first destination identifier is the address identifier of the processor core, and the first device stores a routing table, which includes the correspondence between each processor core of the first device and the address identifier; The method further includes: The first processor core queries the routing table for the destination processor core corresponding to the address identifier used as the first destination identifier in the service data packet.
5. The method according to claim 4, characterized in that, The routing table is pre-stored in a designated storage space of the first device, which is a shared storage space of the plurality of processor cores; or, the routing table is pre-stored in the storage space of each of the processor cores of the first device.
6. The method according to any one of claims 1-3, characterized in that, The first destination identifier in the service data packet is a service identifier. The first device stores a service configuration table, which includes the correspondence between each processor core of the first device and the service identifiers that each processor core is responsible for. The method further includes: The first processor core queries the service configuration table for the destination processor core corresponding to the service identifier that serves as the first destination identifier in the service data packet.
7. The method according to any one of claims 1-6, characterized in that, There is a correspondence between each processor core and address identifier in the first device, and each pair of processor core address identifiers corresponds to a transmission channel for transmitting service data packets; The first processor core sends the service data packet to the second processor core, including: The first processor core sends the service data packet carrying the target address identifier to the second processor core via the target transmission channel corresponding to its own address identifier and the target address identifier, wherein the target address identifier is the address identifier corresponding to the destination processor core.
8. The method according to claim 6, characterized in that, The service configuration table is stored in a designated storage space of the first device. The designated storage space is a shared storage space of the plurality of processor cores. The plurality of processor cores have access permissions to the service configuration table. The service identifiers that each processor core is responsible for in the service configuration table are written by each processor core.
9. The method according to any one of claims 6-8, characterized in that, The method further includes: For each processor core, when the first device performs an operating system cold boot, the processor core writes the service identifier corresponding to the service information and the address identifier of the processor core into the service configuration table based on the service information it is responsible for processing.
10. The method according to any one of claims 6-9, characterized in that, The method further includes: For each processor core, during the operation of the first device, if the service handled by the processor core is updated, the processor core updates the service identifier corresponding to the processor core in the service configuration table; The updating of business information includes at least one of adding business information, deleting business information, and modifying business information.
11. The method according to any one of claims 6-10, characterized in that, The method further includes: If the first device adds a fourth processor core, the fourth processor core, based on the service information it is responsible for processing, writes the service identifier of the service information it is responsible for processing and the address identifier of the fourth processor core into the service configuration table.
12. The method according to any one of claims 1-11, characterized in that, The first processor core of the first device receives at least one service data packet, including: The first processor core of the first device receives at least one service data packet sent by the second device; or, The first processor core of the first device receives at least one service data packet sent by the application of the first device.
13. The method according to any one of claims 1-12, characterized in that, The method further includes: The first processor core receives a service response packet obtained by other processor cores processing the service data packet; the service response packet includes a second destination identifier for indicating the device processing the service response packet. If the second destination identifier of the service response packet indicates the second device, the first processor core sends the service response packet to the second device; If the second destination identifier of the service response packet indicates the target application of the first device, the first processor verifies the service response packet and sends it to the target application; If the second destination identifier of the service response packet indicates the first processor core, the first processor core performs data processing on the service response packet.
14. The method according to any one of claims 1-13, characterized in that, In the communication scenario between the first device and the second device, the first processor core of the first device is determined by the type of communication connection between the first device and the second device.
15. The method according to claim 14, characterized in that, The first device has multiple processor cores, including a central processing unit core, a Bluetooth core, and a sensor control center core; If the communication connection between the first device and the second device is a serial communication connection, then the first processor core is the central processing unit core. If the communication connection between the first device and the second device is a Bluetooth communication connection, then the first processor core is the Bluetooth core.
16. A communication method, characterized in that, Applied to a second device, the method includes: The second device executes the first service and generates a service data packet corresponding to the first service; the service data packet includes a first destination identifier, which is used to indicate the destination processor core for processing the service data packet; The second device sends the service data packet to the first processor core of the first device, so that the first processor core sends the service data packet to the destination processor core indicated by the first destination identifier for service processing. The first processor core and the destination processor core are respectively one of the multiple processor cores of the first device.
17. An electronic device comprising a communication interface, a memory, multiple processors, and a computer program stored in the memory, characterized in that, Each of the processors executes the computer program to implement the steps of the method of any one of claims 1-15, or to implement the steps of the method of claim 16.
18. A chip, characterized in that, The chip includes multiple processor cores; different processor cores handle different services. The plurality of processor cores perform the steps of the method as described in any one of claims 1-15, or implement the steps of the method as described in claim 16.
19. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1-15, or implements the steps of the method according to claim 16.
20. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1-15, or implements the steps of the method according to claim 16.