Inter-nuclear communication method and device, electronic equipment, medium and vehicle
By reading the target kernel information and determining the target communication status, the processing module processes the SOA signal in the target communication status in a preset manner, solving the problem of instability between core communication in the prior art, and achieving efficient and stable inter-core communication, which is suitable for SOA architecture.
Patent Information
- Application Number
- CN202311458679.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-03
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art is difficult to adapt to the service-based software architecture (SOA) in the Cortex-A core, resulting in instability and inefficiency between core communications.
By reading the information sent by the target core, determining the target communication status with the target core based on the information, and processing the SOA signal in a preset manner in the target communication state, achieving stable and efficient inter-core communication.
This method improves the stability and reliability of inter-core communication, is suitable for SOA architecture, and improves signal processing efficiency and real-time performance.
Smart Images

Figure CN119938585A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of multi-core processors, and in particular to an inter-core communication method, device, electronic device, medium and vehicle. Background Art
[0002] The main control chip of the central domain controller is equipped with Cortex-A core and Cortex-M core. The Cortex-M core is used to process controller area network (CAN) or local area network (LAN) signals, and run applications with high real-time requirements such as vehicle control; the Cortex-A core runs high-performance application software and deploys services such as big data collection and analysis, vehicle over-the-air technology (OTA), and remote diagnosis.
[0003] Currently, the Cortex-A core and the Cortex-M core on the market communicate with each other through the Inter-Platform Communication Framework (IPCF) system inside the chip using shared memory to jointly develop software functions. However, IPC is not suitable for the service-oriented architecture (SOA) deployed by Cortex-A. Therefore, there is an urgent need for an inter-core communication protocol that can adapt to the SOA architecture and has fast and stable communication connections. Summary of the invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present disclosure provide an inter-core communication method, device, electronic device, medium and vehicle, which can adapt to the SOA architecture and realize stable and efficient inter-core communication.
[0005] In order to achieve the above objectives, the technical solutions provided by the embodiments of the present disclosure are as follows:
[0006] In a first aspect, an embodiment of the present disclosure provides an inter-core communication method, including:
[0007] Read the information sent by the target kernel;
[0008] Determine a target communication state with a target core according to the information, the target communication state being a preset communication state corresponding to the information;
[0009] In the target communication state, the service-based software architecture SOA signal is processed in a preset manner, and the preset manner corresponds to the target communication state.
[0010] As an optional implementation of the embodiment of the present disclosure, the information is a first count value of the target kernel; determining the target communication state with the target kernel based on the information includes: obtaining a second count value, comparing the first count value and the second count value; when the first count value is equal to the second count value, determining that the target communication state is a ready state; or, when the first count value is not equal to the second count value, determining that the target communication state is a waiting state.
[0011] As an optional implementation of the embodiment of the present disclosure, the corresponding processing of the service-based software architecture SOA signal in the target communication state includes: in the ready state, transmitting the changed SOA signal to the target core, the changed SOA signal is different from the SOA signal transmitted at the historical moment; or, in the waiting state, waiting for the target core to transmit new information.
[0012] As an optional implementation of the embodiment of the present disclosure, when the first count value is not equal to the second count value, after determining that the target communication state is a waiting state, it also includes: in the waiting state, recording the holding time of the waiting state; when the holding time is greater than the preset time, switching from the waiting state to the retry state to update the target communication state to the retry state; in the retry state, sending a reminder signal to the target kernel to remind the target kernel to resend the first count value.
[0013] As an optional implementation of the embodiment of the present disclosure, the information is a start command, and the target communication state is a start state; in the target communication state, the corresponding processing of the service-based software architecture SOA signal includes: in the start state, transmitting all SOA signals to the target kernel.
[0014] As an optional implementation of the embodiment of the present disclosure, the information is a stop instruction, and the target communication state is a stop state; in the target communication state, the corresponding processing of the service-based software architecture SOA signal includes: in the stop state, stopping the transmission of the SOA signal to the target core.
[0015] As an optional implementation of the embodiment of the present disclosure, determining a target communication state with a target core according to information includes: determining a target communication state that satisfies a preset condition according to the information, the information being read in an initial communication state;
[0016] The preset conditions include any of the following:
[0017] The initial communication state is a start state, and the target communication state is one of a start state, a wait state, a ready state, and a stop state;
[0018] The initial communication state is a ready state, and the target communication state is one of a start state, a wait state, a ready state, and a stop state;
[0019] The initial communication state is a waiting state, and the target communication state is one of a starting state, a waiting state, a ready state, a retry state, and a stop state;
[0020] The initial communication state is a retry state, and the target communication state is one of a start state, a wait state, a ready state, and a stop state;
[0021] The initial communication state is the stop state, and the target communication state is one of the start state and the stop state.
[0022] In a second aspect, an embodiment of the present disclosure provides an inter-core communication device, including:
[0023] The reading module is used to read the information sent by the target kernel;
[0024] A determination module, used to determine a target communication state with a target core according to the information, wherein the target communication state is a preset communication state corresponding to the information;
[0025] The processing module is used to process the service-based software architecture SOA signal in a preset manner under the target communication state, and the preset manner corresponds to the target communication state.
[0026] As an optional implementation of an embodiment of the present disclosure, the information is a first count value of the target kernel; the determination module is specifically used to: obtain a second count value, compare the first count value and the second count value; when the first count value is equal to the second count value, determine that the target communication state is a ready state; or, when the first count value is not equal to the second count value, determine that the target communication state is a waiting state.
[0027] As an optional implementation of the embodiment of the present disclosure, the processing module is specifically used to: in a ready state, transmit a changed SOA signal to a target core; or in a waiting state, wait for the target core to transmit new information.
[0028] As an optional implementation of the embodiment of the present disclosure, the determination module is also used to: in a waiting state, record the duration of the waiting state; when the duration is greater than a preset duration, switch from the waiting state to the retry state to update the target communication state to the retry state; in the retry state, send a reminder signal to the target core to remind the target core to resend the first count value.
[0029] As an optional implementation of the embodiment of the present disclosure, the information is a start command, and the target communication state is a start state; the processing module is specifically used to: transmit all SOA signals to the target core in the start state.
[0030] As an optional implementation of the embodiment of the present disclosure, the information is a stop instruction, and the target communication state is a stop state; the processing module is specifically used to: in the stop state, stop transmitting the SOA signal to the target core.
[0031] As an optional implementation of the embodiment of the present disclosure, the determination module is specifically used to: determine a target communication state that meets a preset condition according to information, the information being read in an initial communication state;
[0032] The preset conditions include any of the following:
[0033] The initial communication state is a start state, and the target communication state is one of a start state, a wait state, a ready state, and a stop state;
[0034] The initial communication state is a ready state, and the target communication state is one of a start state, a wait state, a ready state, and a stop state;
[0035] The initial communication state is a waiting state, and the target communication state is one of a starting state, a waiting state, a ready state, a retry state, and a stop state;
[0036] The initial communication state is a retry state, and the target communication state is one of a start state, a wait state, a ready state, and a stop state;
[0037] The initial communication state is the stop state, and the target communication state is one of the start state and the stop state.
[0038] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the inter-core communication method as described in the first aspect or any optional embodiment thereof is implemented.
[0039] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, comprising: a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the inter-core communication method as described in the first aspect or any one of its optional embodiments is implemented.
[0040] In a fifth aspect, an embodiment of the present disclosure provides a vehicle, comprising: the inter-core communication device as described in the second aspect, or the electronic device as described in the third aspect.
[0041] In a sixth aspect, an embodiment of the present disclosure provides a computer program product, comprising: when the computer program product is run on a computer, the computer implements the inter-core communication method as described in the first aspect or any one of its optional embodiments.
[0042] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0043] The present disclosure provides an inter-core communication method, device, electronic device, medium and vehicle. The method reads information sent by a target core, pre-sets a corresponding relationship between information and communication status, and can determine a target communication status with a target core according to the information. There is a corresponding preset mode for the target communication status, so that SOA signals are processed in the target communication status according to the corresponding preset mode. The present disclosure defines the corresponding relationship between information, communication status and preset mode, so that when information sent by a target core is read, the communication status can be set and converted, and then the SOA signal is processed in the preset mode corresponding to the target communication status, so that one core performs corresponding operations according to the instructions of another core, and SOA signal processing is more accurate and efficient, suitable for SOA architecture, and improves the stability and reliability of inter-core communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] Figure 1 A flowchart of an inter-core communication method provided in an embodiment of the present disclosure;
[0047] Figure 2 A schematic diagram of the structure of an inter-core communication device is provided for an embodiment of the present disclosure;
[0048] Figure 3 An embodiment of the present disclosure provides a structural schematic diagram of an electronic device. DETAILED DESCRIPTION
[0049] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0050] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0051] The terms "first", "second", "third", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood in specific circumstances. In addition, in the description of this application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0052] In order to solve all or part of the technical problems mentioned in the above background technology, the embodiments of the present disclosure provide an inter-core communication method, device, electronic device, storage medium and vehicle, wherein the method predefines the correspondence between information, communication status and signal processing method, determines the corresponding target communication state by reading the information sent by the target core, and then processes the SOA signal according to the corresponding processing method under the target communication state, so that the core implementing the method can set the communication state or convert the communication state according to the instruction of the target core, and accurately and efficiently process the SOA signal under each communication state, which is suitable for the SOA architecture, improves the signal processing efficiency, and has strong real-time performance; predefines the correspondence between information, communication status and signal processing method, can effectively reduce the occurrence of errors and failures, and has strong scalability.
[0053] It should be noted that the protection scope of the inter-core communication method described in the embodiment of the present disclosure is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present disclosure are included in the protection scope of the present disclosure.
[0054] An inter-core communication method provided in an embodiment of the present disclosure can be implemented by electronic devices, including but not limited to vehicle terminals, servers, personal computers, laptops, tablet computers, smart phones, etc. Electronic devices include user devices and network devices. Among them, user devices include but are not limited to computers, smart phones, tablet computers, etc.; network devices include but are not limited to a single network server, a server group composed of multiple network servers, or a cloud composed of a large number of computers or network servers in cloud computing, wherein cloud computing is a kind of distributed computing, a super virtual computer composed of a group of loosely coupled computer sets. Among them, the computer device can be operated alone to implement the present disclosure, and can also be connected to the network and implement the present disclosure through interactive operations with other computer devices in the network. Among them, the network where the electronic device is located includes but is not limited to the Internet, wide area network, metropolitan area network, local area network, virtual private network (Virtual Private Network, VPN) network, etc.
[0055] like Figure 1 As shown, Figure 1 A flow chart of an inter-core communication method provided in an embodiment of the present disclosure. The method includes the following steps S101 to S103:
[0056] S101, reading information sent by the target kernel.
[0057] In some embodiments, the target core is a Cortex-A core. The information includes a start command, an end command, and a first count value of the target core. The start command is used to instruct to send all SOA signals to the Cortex-A core; the end command is used to instruct to stop sending SOA signals to the Cortex-A core; and the first count value is used to indicate whether the working state of the target core is abnormal.
[0058] The disclosed embodiment is applied to the Cortex-M core, and the Cortex-M core periodically reads the information sent by the Cortex-A core after power-on. It can be understood as the heartbeat mechanism of the Cortex-M core and the Cortex-A core. It should be noted that the Cortex-M core starts earlier than the Cortex-A core and starts running earlier. The disclosed embodiment uses the Cortex-A core as the main core and the Cortex-M core as the slave core, and is applied to the Cortex-M core. Step S101 specifically reads the information sent by the Cortex-A core.
[0059] In some embodiments, the method can be applied after the Cortex-M core is powered on and initialized to achieve the first setting of the communication state; it can also be applied to the process in which the Cortex-M core is communicating with the target core, and the communication state in which the Cortex-M core is communicating with the target core is defined as the initial communication state. The Cortex-M core realizes the conversion of the communication state by reading information, wherein the initial communication state is any one of the start state (start), wait state (wait), ready state (ready), retry state (retry), and stop state (stop).
[0060] S102: Determine a target communication state with a target kernel according to the information.
[0061] The target communication state is a preset communication state that corresponds to the information; the preset communication state includes a start state, a wait state, a ready state, a retry state, and a stop state.
[0062] In some embodiments, the correspondence between information and preset communication states is defined in advance, and different information corresponds to different communication states. Optionally, if the information is a start command, the target communication state is the start state; if the information is a stop command, the target communication state is the stop state. If the information is the first count value of the target kernel, the target communication state is determined in the following two optional implementations:
[0063] (1) Implementation Method 1
[0064] If the information is the first count value of the target kernel, step S102 determines the target communication state of the target kernel according to the information, including: obtaining a second count value, comparing the first count value with the second count value; and determining that the target communication state is a ready state when the first count value is equal to the second count value.
[0065] Specifically, if the information sent by the target core is its first count value, the Cortex-M core first obtains the second count value of the core, and the second count value is used to indicate whether the working state of the Cortex-M core is abnormal; then the first count value and the second count value are compared to determine whether the first count value is equal to the second count value. When the first count value is equal to the second count value, it indicates that the working states of the target core and the Cortex-M core are normal and data transmission can be performed, and the target communication state is determined to be a ready state.
[0066] (2) Implementation Method 2
[0067] If the information is the first count value of the target core, step S102 determines the target communication state of the target core according to the information, including: obtaining the second count value, comparing the first count value with the second count value; and determining that the target communication state is a waiting state when the first count value is not equal to the second count value.
[0068] Specifically, if the information sent by the target core is its first count value, the Cortex-M core first obtains the second count value of the core, and then compares the first count value with the second count value to determine whether the first count value is equal to the second count value. When the first count value is not equal to the second count value, it indicates that the working status of the target core and the Cortex-M core is abnormal, and data transmission cannot be performed, and the target communication state is determined to be a waiting state.
[0069] In some embodiments, when the target communication state is a waiting state, the holding time of the waiting state is recorded; when the holding time is longer than a preset time, the waiting state is switched to a retry state to update the target communication state to a retry state. The preset time may be 100ms, which is not specifically limited in the present disclosure.
[0070] Specifically, the duration that the Cortex-M core is in the waiting state is recorded, and when the recorded duration is greater than a preset duration, it is determined that the target communication state is updated to the retry state.
[0071] In some embodiments, the target communication state is determined in combination with the initial communication state of the Cortex-M core to achieve the conversion of the communication state. Optionally, step S102 determines the target communication state of the target core according to the information, including: determining the target communication state that meets the preset conditions according to the information, the information is read in the initial communication state;
[0072] The preset conditions include any of the following:
[0073] The initial communication state is a start state, and the target communication state is one of a start state, a wait state, a ready state, and a stop state;
[0074] The initial communication state is a ready state, and the target communication state is one of a start state, a wait state, a ready state, and a stop state;
[0075] The initial communication state is a waiting state, and the target communication state is one of a starting state, a waiting state, a ready state, a retry state, and a stop state;
[0076] The initial communication state is a retry state, and the target communication state is one of a start state, a wait state, a ready state, and a stop state;
[0077] The initial communication state is the stop state, and the target communication state is one of the start state and the stop state.
[0078] In the above embodiment, when the initial communication state of the Cortex-M core is the start state, it can be converted to one of the start state, the wait state, the ready state, and the stop state. The specific conversion is determined according to the information sent by the target core. For example, when the initial communication state is the start state, the information read is a stop command, and the communication state of the Cortex-M core is switched from the start state to the stop state. For another example, when the initial communication state is the start state, the information read is a start command, and the communication state of the Cortex-M core remains in the start state.
[0079] Exemplarily, when the initial communication state is the start state, if the information read is the first count value of the target core, and the first count value is equal to the second count value, the communication state of the Cortex-M core is switched from the start state to the ready state; if the information read is the first count value of the target core, but the first count value is not equal to the second count value, the communication state of the Cortex-M core is switched from the start state to the waiting state.
[0080] In the above embodiment, when the initial communication state of the Cortex-M core is the ready state, it can be converted to one of the start state, the wait state, the ready state, and the stop state. The specific conversion is determined according to the information sent by the target core. For example, when the initial communication state is the ready state, the information read is a stop command, and the communication state of the Cortex-M core is switched from the ready state to the stop state. For another example, when the initial communication state is the ready state, the information read is a start command, and the communication state of the Cortex-M core is switched from the ready state to the start state.
[0081] Exemplarily, when the initial communication state is the ready state, if the information read is the first count value of the target core, and the first count value is equal to the second count value, the communication state of the Cortex-M core remains in the ready state; if the information read is the first count value of the target core, but the first count value is not equal to the second count value, the communication state of the Cortex-M core is switched from the ready state to the waiting state.
[0082] In the above embodiment, when the initial communication state of the Cortex-M core is the waiting state, it can be converted to one of the starting state, waiting state, ready state, retry state, and stop state. The specific conversion is determined according to the information sent by the target core. For example, when the initial communication state is the waiting state, the information read is a stop command, and the communication state of the Cortex-M core is switched from the waiting state to the stop state. For another example, when the initial communication state is the waiting state, the information read is a start command, and the communication state of the Cortex-M core is switched from the waiting state to the starting state.
[0083] Exemplarily, when the initial communication state is a waiting state, if the information read is the first count value of the target core, and the first count value is equal to the second count value, the communication state of the Cortex-M core is switched from the waiting state to the ready state; if the information read is the first count value of the target core, but the first count value is not equal to the second count value, the communication state of the Cortex-M core remains in the waiting state.
[0084] It should be emphasized that when the initial communication state of the Cortex-M core is the waiting state, the length of time the waiting state is maintained will be recorded so as to further convert to the retry state when the length of time exceeds the preset length of time.
[0085] In the above embodiment, when the initial communication state of the Cortex-M core is the retry state, it can be converted to one of the start state, the wait state, the ready state, and the stop state. The specific conversion is determined according to the information sent by the target core. For example, when the initial communication state is the retry state, the information read is a stop command, and the communication state of the Cortex-M core is switched from the retry state to the stop state. For another example, when the initial communication state is the retry state, the information read is a start command, and the communication state of the Cortex-M core is switched from the retry state to the start state.
[0086] Exemplarily, when the initial communication state is the retry state, if the information read is the first count value of the target core, and the first count value is equal to the second count value, the communication state of the Cortex-M core is switched from the retry state to the ready state; if the information read is the first count value of the target core, but the first count value is not equal to the second count value, the communication state of the Cortex-M core is switched from the retry state to the waiting state.
[0087] In the above embodiment, when the initial communication state of the Cortex-M core is the stop state, it can be converted to one of the start state and the stop state. The specific conversion is determined according to the information sent by the target core. For example, when the initial communication state is the stop state, the information read is the start command, and the communication state of the Cortex-M core is switched from the stop state to the start state. For another example, when the initial communication state is the stop state, the information read is the stop command, and the communication state of the Cortex-M core remains in the stop state.
[0088] Exemplarily, as shown in Table 1, Table 1 is a communication state transition table provided in an embodiment of the present disclosure.
[0089] Table 1
[0090]
[0091] The above-mentioned embodiment determines the corresponding target communication state according to the specific content of the information sent by the target kernel, clearly defines various communication states and the transition conditions between communication states, realizes precise control of the behavior of the multi-core processor system, ensures that the system can run correctly in different communication states, reduces the occurrence of errors and failures, and has strong reliability.
[0092] S103: In the target communication state, process the SOA signal according to a preset method.
[0093] The preset mode corresponds to the target communication state. The preset mode includes: (1) sending all SOA signals; (2) sending a changed SOA signal, where the changed SOA signal is different from the SOA signal transmitted at the historical moment; (3) not sending any SOA signal and waiting for the target core to send new information; (4) sending a reminder signal to the target core, where the reminder signal is used to remind the target core to resend the first count value; (5) stopping sending the SOA signal.
[0094] In some embodiments, a correspondence between the communication state and the preset mode is set in advance. Optionally, if the communication mode is a start state, the preset mode is to send all SOA signals; if the communication state is a preparation state, the preset mode is to send a changed SOA signal; if the communication state is a waiting state, no SOA signal is sent, and the target core is waited for to send new information; if the communication state is a retry state, a reminder message is sent to the target core; if the communication state is a stop state, the sending of SOA signals is stopped.
[0095] In some embodiments, when the target communication state is the start state, step S103 of processing the SOA signal in a preset manner in the target communication state includes: in the start state, transmitting all SOA signals to the target core.
[0096] In some embodiments, when the target communication state is a stop state, step S103 of processing the SOA signal in a preset manner in the target communication state includes: in the stop state, stopping transmitting the SOA signal to the target core.
[0097] In some embodiments, when the target communication state is the preparation state, step S103, in the target communication state, processing the SOA signal in a preset manner includes: in the preparation state, transmitting the changed SOA signal to the target core. It should be emphasized that in the preparation state, the Cortex-M core no longer sends all SOA signals to the target core, but filters the unchanged and useless SOA signals, and then transmits the changed SOA signals to the target core, thereby reducing unnecessary repeated signal transmission and improving the efficiency of inter-core communication.
[0098] In some embodiments, when the target communication state is a waiting state, step S103, in the target communication state, processing the SOA signal in a preset manner includes: in the waiting state, waiting for the target core to transmit new information. In this process, the Cortex-M core no longer transmits any SOA signal to the target core, waiting for the target core to transmit new information to switch to a new communication state. If no new information is received within the preset time, the waiting state is switched to the retry state to update to the retry state.
[0099] In some embodiments, when the target communication state is a retry state, step S103, in the target communication state, processing the SOA signal in a preset manner includes: in the retry state, sending a reminder signal to the target core to remind the target core to resend the first count value. The present disclosure provides a retransmission mechanism to remind the target core to resend the first count value in the retry state, thereby ensuring that the target core is working normally, thereby updating to other communication states, realizing inter-core data transmission, and ensuring the stability and reliability of inter-core communication.
[0100] On the basis of the above embodiments, the present disclosure uses the Cortex-A core as the master core and the Cortex-M core as the slave core under the technical background that the startup time of the Cortex-A core and the Cortex-M core are inconsistent. The inter-core communication method is applied to the Cortex-M core. First, the information sent by the Cortex-A core is read to obtain the commands and instructions of the Cortex-A core. According to the information, the target communication state of the Cortex-M core and the Cortex-A core for communication is determined. The target communication state can be one of the start state, the wait state, the preparation state, the retry state, and the stop state. Each communication state corresponds to a different signal processing method. Further, the Cortex-M core processes the SOA signal in a preset manner under the target communication state, which is suitable for the SOA structure, so that the Cortex-M core and the Cortex-A core can quickly establish a connection after startup, and perform stable and secure inter-core information transmission.
[0101] like Figure 2 As shown, Figure 2 A schematic diagram of the structure of an inter-core communication device is provided for an embodiment of the present disclosure, and the device includes:
[0102] The reading module 201 is used to read the information sent by the target kernel;
[0103] A determination module 202, configured to determine a target communication state with a target core according to the information, wherein the target communication state is a preset communication state corresponding to the information;
[0104] The processing module 203 is used to process the service-based software architecture SOA signal in a preset manner under the target communication state, and the preset manner corresponds to the target communication state.
[0105] As an optional implementation of the embodiment of the present disclosure, the information is the first count value of the target kernel; the determination module 202 is specifically used to: obtain the second count value, compare the first count value and the second count value; when the first count value is equal to the second count value, determine that the target communication state is a ready state; or, when the first count value is not equal to the second count value, determine that the target communication state is a waiting state.
[0106] As an optional implementation of the embodiment of the present disclosure, the processing module 203 is specifically used to: in a ready state, transmit a changed SOA signal to the target core, where the changed SOA signal is different from the SOA signal transmitted at a historical moment; or, in a waiting state, wait for the target core to transmit new information.
[0107] As an optional implementation of the embodiment of the present disclosure, the determination module 202 is also used to: in a waiting state, record the duration of the waiting state; when the duration is greater than a preset duration, switch from the waiting state to the retry state to update the target communication state to the retry state; in the retry state, send a reminder signal to the target kernel to remind the target kernel to resend the first count value.
[0108] As an optional implementation of the embodiment of the present disclosure, the information is a start command, and the target communication state is a start state; the processing module 203 is specifically used to: transmit all SOA signals to the target core in the start state.
[0109] As an optional implementation of the embodiment of the present disclosure, the information is a stop instruction, and the target communication state is a stop state; the processing module 203 is specifically used to: in the stop state, stop transmitting the SOA signal to the target core.
[0110] As an optional implementation of the embodiment of the present disclosure, the determination module 202 is specifically used to: determine a target communication state that meets a preset condition according to information, the information being read in an initial communication state;
[0111] The preset conditions include any of the following:
[0112] The initial communication state is a start state, and the target communication state is one of a start state, a wait state, a ready state, and a stop state;
[0113] The initial communication state is a ready state, and the target communication state is one of a start state, a wait state, a ready state, and a stop state;
[0114] The initial communication state is a waiting state, and the target communication state is one of a starting state, a waiting state, a ready state, a retry state, and a stop state;
[0115] The initial communication state is a retry state, and the target communication state is one of a start state, a wait state, a ready state, and a stop state;
[0116] The initial communication state is the stop state, and the target communication state is one of the start state and the stop state.
[0117] An inter-core communication device of an embodiment of the present disclosure reads information sent by a target core through a reading module, pre-sets a corresponding relationship between information and communication status, and then a determination module determines a target communication status with a target core according to the information, and there is a corresponding preset mode for the target communication status, so that a processing module processes an SOA signal in a corresponding preset mode under the target communication state. The present disclosure defines a corresponding relationship between information, communication status, and preset mode, so that when information sent by a target core is read, the communication status can be set and converted, and then the SOA signal is processed in a preset mode corresponding to the target communication status, so that one core performs corresponding operations according to the instructions of another core, and SOA signal processing is more accurate and efficient, suitable for SOA architecture, and improves the stability and reliability of inter-core communication.
[0118] like Figure 3 As shown, Figure 3 The embodiment of the present disclosure provides a schematic diagram of the structure of an electronic device, which includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, each process of the inter-core communication method in the above method embodiment is implemented. And the same technical effect can be achieved, so it will not be repeated here to avoid repetition.
[0119] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the inter-core communication method in the above method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0120] The computer readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0121] An embodiment of the present disclosure provides a vehicle, which includes: an inter-core communication device as described above, or an electronic device as described above, and can achieve the same technical effect. To avoid repetition, it will not be described here.
[0122] An embodiment of the present invention provides a computer program product, which stores a computer program. When the computer program is executed by a processor, it implements the various processes of the inter-core communication method in the above method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0123] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0124] In the present disclosure, the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0125] In the present disclosure, memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0126] In the present disclosure, computer-readable media include permanent and non-permanent, removable and non-removable storage media. Storage media can be implemented by any method or technology to store information, and the information can be computer-readable instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0127] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0128] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for inter-core communication, characterized in that: include: Read the information sent by the target kernel; Determine a target communication state with the target kernel according to the information, wherein the target communication state is a preset communication state corresponding to the information; In the target communication state, a service-based software architecture SOA signal is processed in a preset manner, and the preset manner corresponds to the target communication state.
2. The method according to claim 1, characterized in that The information is a first count value of the target kernel; Determining the target communication state with the target kernel according to the information includes: Obtaining a second count value, and comparing the first count value with the second count value; When the first count value is equal to the second count value, determining that the target communication state is a ready state; or, In a case where the first count value is not equal to the second count value, it is determined that the target communication state is a waiting state.
3. The method according to claim 2, characterized in that The corresponding processing of the service-based software architecture SOA signal in the target communication state includes: In the preparation state, transmitting a changed SOA signal to the target core, wherein the changed SOA signal is different from the SOA signal transmitted at a historical moment; or, In the waiting state, the target core is waited for to transmit new information.
4. The method according to claim 2, characterized in that: After determining that the target communication state is a waiting state when the first count value is not equal to the second count value, the method further includes: In the waiting state, recording the duration of the waiting state; When the holding time is longer than a preset time, switching from the waiting state to the retry state to update the target communication state to the retry state; In the retry state, a reminder signal is sent to the target core to remind the target core to resend the first count value.
5. The method according to claim 1, characterized in that The information is a start command, and the target communication state is a start state; The corresponding processing of the service-based software architecture SOA signal in the target communication state includes: In the start state, all SOA signals are transmitted to the target core.
6. The method according to claim 1, characterized in that The information is a stop instruction, and the target communication state is a stop state; The corresponding processing of the service-based software architecture SOA signal in the target communication state includes: In the stop state, the transmission of the SOA signal to the target core is stopped.
7. The method according to claim 1, characterized in that Determining the target communication state with the target kernel according to the information includes: Determine a target communication state that meets a preset condition according to the information, wherein the information is read in an initial communication state; The preset condition includes any one of the following: The initial communication state is a start state, and the target communication state is one of a start state, a wait state, a ready state, and a stop state; The initial communication state is a preparation state, and the target communication state is one of a start state, a waiting state, a preparation state, and a stop state; The initial communication state is a waiting state, and the target communication state is one of a starting state, a waiting state, a ready state, a retry state, and a stop state; The initial communication state is a retry state, and the target communication state is one of a start state, a wait state, a ready state, and a stop state; The initial communication state is a stop state, and the target communication state is one of a start state and a stop state.
8. An inter-core communication device, characterized in that: include: The reading module is used to read the information sent by the target kernel; a determination module, configured to determine a target communication state with the target kernel according to the information, wherein the target communication state is a preset communication state corresponding to the information; The processing module is used to process the service-based software architecture SOA signal in a preset manner under the target communication state, and the preset manner corresponds to the target communication state.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the inter-core communication method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: include: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the inter-core communication method according to any one of claims 1 to 7 is implemented.
11. A vehicle, characterized in that: include: The inter-core communication device as claimed in claim 8, or the electronic device as claimed in claim 9.