Inter-core communication method, device, equipment, medium and product

By using the communication matrix to generate interface code and information to be transmitted in inter-core communication development, the problems of low efficiency of inter-core communication development and unfriendly service interface description in the prior art are solved, and more efficient inter-core communication and more Low R&D costs.

CN119493760APending Publication Date: 2025-02-21SHENZHEN DESAY SV AUTOMOTIVE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411544462.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

In the development of inter-core communication, there is a transfer layer media selection that depends on the hardware architecture, the communication protocol definition is inconsistent, resulting in duplicate development of functions, testing and maintenance efficiency, and the business interface description is not well readable and maintainable. Sex and friendly increase the communication cost of R&D needs.

Method used

By obtaining the target service information sent by the request sender, forming a communication matrix based on the information, and generating interface codes through the communication matrix, calling the inter-core communication component to generate information to be transmitted, and finally sending it to the target object through the corresponding transmission medium.

Benefits of technology

It improves the readability, maintainability and friendliness of business interface requirements descriptions, reduces the communication costs of R&D requirements, quickly generates business interfaces, and improves the efficiency of business coordination among components.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119493760A_ABST
    Figure CN119493760A_ABST
Patent Text Reader

Abstract

The invention discloses an inter-core communication method and device, equipment, a medium and a product, and the method comprises the steps: obtaining target service information sent by a request sender, forming a communication matrix based on the target service information, and generating an interface code through the communication matrix; calling an inter-core communication component based on the interface code, and generating to-be-transmitted information corresponding to the target service information through an object entity in the inter-core communication component; and sending the to-be-transmitted information to a target object through a corresponding transmission medium. According to the technical scheme, the readability, maintainability and friendliness of service interface requirement description are improved through the design of the communication matrix related to the service; the communication cost of research and development requirements is reduced, the service interface is quickly generated, and the service joint debugging efficiency between the components is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to an inter-core communication method, device, equipment, medium and product. Background Art

[0002] In the hardware architecture design of automotive electronics products, there is usually a coexistence of system-on-chip (SOC) and microcontroller unit (MCU), such as a chip architecture designed in a multi-core heterogeneous manner. Different software and hardware functions are deployed on the MCU and SOC respectively to work together to complete the functions of the entire product.

[0003] On this basis, the inter-core communication (ICPC) function between MCU and SOC naturally becomes a very important development requirement in the overall software architecture. Summary of the invention

[0004] The present invention provides an inter-core communication method, device, equipment, medium and product to realize inter-core communication between SOC and MCU, and improve the readability, maintainability and friendliness of the business interface requirement description during the inter-core communication process, thereby improving the efficiency of business joint debugging between components.

[0005] In a first aspect, an embodiment of the present disclosure provides an inter-core communication method, including:

[0006] Acquire target service information sent by the request sender, form a communication matrix based on the target service information, and generate an interface code through the communication matrix;

[0007] Calling the inter-core communication component based on the interface code, generating information to be transmitted corresponding to the target business information through the object entity in the inter-core communication component;

[0008] The information to be transmitted is sent to the target object via a corresponding transmission medium.

[0009] In a second aspect, an embodiment of the present disclosure provides an inter-core communication device, including:

[0010] A code generation module, used for acquiring target service information sent by a request sender, forming a communication matrix based on the target service information, and generating an interface code through the communication matrix;

[0011] An information generation module, used to call the inter-core communication component based on the interface code, and generate information to be transmitted corresponding to the target business information through an object entity in the inter-core communication component;

[0012] The information transmission module is used to send the information to be transmitted to the target object via the corresponding transmission medium.

[0013] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:

[0014] at least one processor; and

[0015] a memory communicatively connected to at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute an inter-core communication method provided by the above-mentioned first aspect embodiment.

[0017] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a processor to implement an inter-core communication method provided by the embodiment of the first aspect above when executing.

[0018] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the computer program implements an inter-core communication method provided in the embodiment of the first aspect above.

[0019] An inter-core communication method, device, equipment, medium and product of an embodiment of the present invention obtains the target business information sent by the request sender, forms a communication matrix based on the target business information, and generates an interface code through the communication matrix; calls the inter-core communication component based on the interface code, generates information to be transmitted corresponding to the target business information through the object entity in the inter-core communication component; and sends the information to be transmitted to the target object through the corresponding transmission medium. The above technical solution improves the readability, maintainability and friendliness of the business interface requirement description through the business-related communication matrix design; reduces the communication cost of R&D requirements, quickly generates business interfaces, and improves the efficiency of business joint debugging between components.

[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1a This is an example diagram of an overall architecture of inter-core communication provided by Embodiment 1 of the present invention;

[0023] Figure 1b This is an example diagram of a multi-core heterogeneous platform provided in the first embodiment of the present invention;

[0024] Figure 1c This is an example diagram of an inter-core communication protocol provided by Embodiment 2 of the present invention;

[0025] Figure 2 is a flow chart of an inter-core communication method provided by Embodiment 1 of the present invention;

[0026] Figure 3 is a flow chart of an inter-core communication method provided by Embodiment 2 of the present invention;

[0027] Figure 4 It is a schematic diagram of the structure of an inter-core communication device provided in Embodiment 3 of the present invention;

[0028] Figure 5 It is a structural schematic diagram of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first", "second" and "target" in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof 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 necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] Traditional inter-core communication development mainly includes the selection and implementation of inter-core transport layer media, communication protocol definition, and the provision of data transmission and communication functions.

[0032] Among them, the choice of transport layer media depends more on the chip platform and hardware architecture design used by the product, that is, it is implemented based on a specific hardware solution, such as the gateway platform based on the S32G series chip adopts hardware interrupts and inter-core shared memory; the content of the communication protocol and the definition of interaction vary from person to person, and it is difficult for the implementation plan to have a unified standard and functional applicability. When the project or platform development is flat, there are potential problems such as repeated functional development, low testing and maintenance efficiency, etc. On the other hand, the content of the protocol often represents the corresponding business function requirements. In traditional software solutions, the inter-core communication data transmission function is also provided in the form of an application programming interface (API), such as a data sending function interface and a data receiving function interface. Users need to implement the serialization and deserialization of the data stream by themselves.

[0033] The inter-core communication realized by this method, from the perspective of data, involves too much protocol data content and interaction logic in the integrated use process of the provided API, which increases the development and maintenance costs; there are differences in the definition of each communication protocol, and it cannot guarantee the applicability of good communication functions, that is, it cannot meet the potential inter-core communication interaction scenario requirements of many products; it lacks good business scalability, maintainability, and engineering; when the requirements change, more man-hours are required to code, implement, test, and verify the interface, and the risk of errors may be introduced; most traditional solutions are described by protocol documents of protocol data streams, and business developers and testers need to care about and deal with protocol data accurately and time-consumingly, and cannot focus on the logic of the business itself. It is not very friendly to upper-level business personnel, which brings a large communication cost. Therefore, this application provides an inter-core communication method to solve the above technical problems.

[0034] Embodiment 1

[0035] This embodiment is executed through the overall architecture of inter-core communication, which is used for inter-core communication between SOC and MCU. Both SOC core and MCU core can be considered as a core or m core. The terms a core and m core are usually used to describe the core types of computer processors. SOC (a core) can be a client or a server, and the same applies to MCU (m core). It can be understood that whether it is SOC or MCU, the overall architecture of inter-core communication in the embodiment of the present invention can be integrated to achieve efficient inter-core communication.

[0036] The overall architecture of inter-core communication is integrated on SOC and / or MCU. Figure 1a is an example diagram of an overall architecture of inter-core communication provided by the first embodiment of the present invention, such as Figure 1a As shown, the overall architecture of inter-core communication, i.e., the integrated components of the inter-core communication framework, is a framework integrated with inter-core communication services, including inter-core communication interface facilities (inter-core interface components), inter-core communication infrastructure (inter-core communication components), and inter-core transmission medium facilities (inter-core transmission medium). Among them, the inter-core communication interface facilities are the inter-core business interface layer, the inter-core communication infrastructure is the inter-core business session layer, which can also be considered as the application layer, and the inter-core transmission medium facilities are the inter-core transmission medium layer.

[0037] The inter-core communication interface facilities include the intra-core (Inter-Process Communication, IPC) interface, interface mapping logic and inter-core user service interface. The interface mapping logic includes server-side service interface mapping and service-side interface mapping. The inter-core service interface includes client-type interface and server-type interface. The inter-core user service interface, interface mapping logic and intra-core ipc interface interact accordingly based on the device type.

[0038] The inter-core communication infrastructure at least includes a client entity, a server entity, an inter-core transmission logic processing subcomponent, a serialization and deserialization subcomponent, and a transmission medium abstract interface. Among them, the client entity and the server entity are used to create and execute requests, and the serialization and deserialization subcomponents are used to perform data serialization and deserialization processing. The inter-core transmission logic processing subcomponent is used to realize the transmission of information between the inter-core communication overall framework, and the transmission medium abstract interface is used to realize the transmission of information between two cores. The inter-core communication infrastructure can also include a business entity management subcomponent, a data cache management subcomponent, a transmission medium management subcomponent, a server operation entity, and a logging and data playback subcomponent.

[0039] The inter-core transmission medium facilities include at least IPCF transmission media based on the Inter-Platform Communication Framework (IPCF), SPI transmission media based on the Serial Peripheral Interface (SPI), and UART transmission media based on the Universal Asynchronous Receiver / Transmitter (UART). Other types of transmission media may also be included. The specific type of transmission media is determined based on actual needs and platforms, and this embodiment does not limit this.

[0040] Exemplarily, the executing subject SOC is the client, which is connected to the object entity (client entity) in the inter-core communication infrastructure based on the inter-core communication interface facility to realize the interaction between the interface layer and the application layer. The object entity transmits data to the serialization and deserialization subcomponents, performs corresponding data stream processing, and transmits the processed information to the inter-core transmission medium facility through the inter-core transmission logic processing to realize the interaction between the application layer and the transmission layer. Based on the various types of transmission media in the inter-core transmission medium facility, the transmission medium abstract interface in the inter-core communication infrastructure is called to transmit the information to the MCU server to realize the inter-core communication between the SOC (a core / client) and the MCU (m core / server).

[0041] Figure 1b This is an example diagram of a multi-core heterogeneous platform provided in the first embodiment of the present invention. The inter-core communication method adopted in the embodiment of the present invention is supported by the platform. Figure 1b As shown, the multi-core heterogeneous platform includes SOC and MCU, and SOC and MCU interact through specific communication protocols, such as ICPC protocol. In this embodiment, take SOC as the client, MCU as the server, and the current execution subject as the client as an example. Among them, SOC integrates ICPC interface generation tools, ICPC infrastructure and at least two inter-core business applications, and can also integrate ICPC data playback tools and ICPC analysis management tools; the same is true for MCU, and the specific integration content is determined based on actual needs. Among them, the ICPC interface generation tool is called by the ICPC communication matrix. The interface generation tool forms the corresponding business interface code based on the communication matrix, and calls the ICPC infrastructure through the business interface code, that is, Figure 1a The inter-core communication infrastructure shown in the figure implements inter-core business applications through the ICPC infrastructure and the corresponding IPC interface. The ICPC infrastructure can also call the ICPC data playback tool and ICPC analysis management tool through the corresponding IPC interface.

[0042] Among them, in the overall implementation process of inter-core communication, the generation and transmission of information are implemented by ICPC protocol, such as Figure 1b As shown, information exchange is carried out through the ICPC protocol in the multi-core heterogeneous platform. Figure 1c is an example diagram of an inter-core communication protocol provided by Embodiment 2 of the present invention, such as Figure 1a and Figure 1c As shown, Figure 1a The inter-core transmission medium facility in Figure 1c The transport layer is used to realize the transmission of information. Figure 2 Inter-core communication infrastructure correspondence Figure 1c The application layer is used to realize the generation of information.

[0043] The inter-core communication protocol adopts the big-endian transmission mode, such as Figure 1c As shown, the communication protocol used by the transport layer includes the magic number 0XCEBC, the whole packet crc16, the transmission header length, the data length, the protocol version number, the transmission control word, the timestamp, the Sync number, the ack number and the options field. Among them, the magic number is 2 bytes, which is used to mark the IPCF communication transmission, and the value is 0xCE, 0XBC, which identifies the inter-core communication service flow; the whole packet crc16 is 2 bytes, and the crc16 calculates {transmission header length...application data [data length-1]} to check the accuracy of the transmission packet data; the transmission header length is 1 byte, which represents the size and length of the transmission header data and supports the function extension of the transport layer; the data length is 2 bytes, which is used to describe the communication application service layer data length, the application layer data length, and support bandwidth rate related test evaluation items; the protocol version number is 1 byte, which identifies different transport layer protocols. Different protocols may have extended data, and the value of 0x01 is the default protocol version number; the transmission control word is 1 byte, which is used for control identification and describes the transmission quality control, such as whether the transmission requires an ack response, the subpacket identification, ack message identifier. The ack process does not affect other transmissions, providing transmission response confirmation and processing priority of important messages, etc. Bit0: When the sync message identifier is 1, it represents a transport layer handshake frame. Bit1: When the ack message identifier is 1, it represents a transport layer ack response frame. Other bits are reserved for use. The timestamp is 8 bytes, describing the transmission time point and supporting time-related test evaluation items for transmission. The sync number is 2 bytes, which is the transmission sequence number. It increases by +1 during the transmission process, and is a transmission confirmation field. The ack number is 2 bytes, and the ack number is the last received data message sync+1, which is a transmission confirmation field. The optons field is an m-byte extended protocol field [m=0..N]. The length and content are defined according to the protocol version number. The default protocol version does not have this field, m=0.

[0044] The communication protocol used by the application layer includes business data crc16, data length, message flag, interface ID (i.e. business ID), service ID, sequence number and business load. Among them, the business data crc16 is 2 bytes, crc16 calculates {data length...business data [data length-1]}, and performs business data accuracy verification; the business data length is 2 bytes, the business data length {message flag...load}, supports parsing, the business data stream is variable length, and the data of different functional business protocols is different; the message flag is 1 byte, the codec version number is reserved, the message type is 2 bits, bit0 / bit1, the message type R&&R (0x01), Reply (0x02), 0neway (0x03) 2 bits, bit2 / bit3, the codec version number is 4 bits, bit4 / bit5 / bit6 / bit7 is reserved for use, and the implementation Current communication business scenarios: RR (request and expect reply type), request without reply type, request response; interface ID is 2 bytes, used to describe and distinguish different business interfaces, and each business function interface is mapped to a unique ID; service ID is 2 bytes, used to describe and distinguish different service modules to which different functional interfaces belong, and each business module is mapped to a unique ID; sequence number is 2 bytes, used to describe and distinguish different calls of the same interface ID at different times, the call identifier of the {interface + service ID} message; business payload is the serialized byte stream of parameters carried by the functional interface, which is optional and defined according to the inter-core communication function business matrix. Each functional interface may carry parameters, such as the input parameters carried by the request type interface, and the byte stream is serialized according to the agreed serialization rules.

[0045] Figure 2 This is a flow chart of an inter-core communication method provided in the first embodiment of the present invention. This embodiment is applicable to the situation where inter-core communication is performed between a server and a client. The method can be performed by an inter-core communication device, which can be implemented in the form of hardware and / or software. In the inter-core communication process, the execution subject of the embodiment of the present invention is the sending end when the inter-core communication process performs information exchange for the first time.

[0046] like Figure 2 As shown, the method includes:

[0047] S101. Acquire target business information sent by a request sender, form a communication matrix based on the target business information, and generate an interface code through the communication matrix.

[0048] In this embodiment, the request sender can be understood as the user end. The target service information can be understood as information related to a specific service sent by the user end, which is identified and sent by the service requester, and at least includes the sender information, the receiver information, the input parameter, the output parameter, the service identifier, the service identifier, the serialization information and the deserialization information. The communication matrix can be understood as a table corresponding to the target service information, and the content contained therein is consistent with the target service information, and the format is an Excel table. Among them, the sender information represents the relevant information of the execution subject of the embodiment of the present invention, and at least includes the sender identifier and the interactive interface information (the transmission interface identifier required for the sender to send information), and the receiver information represents the relevant information of the electronic device that interacts with the execution subject of the embodiment of the present invention, and at least includes the receiver identifier and the interactive interface information (the transmission interface identifier required when the receiver receives the information of the sender). The input parameters and the output parameters are user-defined parameters, which are interface description information, used for interface description of the sender side, such as the service interface description and service interface description of the sender side, and the input parameters and the output parameters are integer structures. The service identifier can be understood as the unique identification information (Identity, ID) of the service requested by the user end, and the service identifier can be understood as the unique identification information of the upper-layer service to which the service belongs. A service can contain multiple services. The serialization information can be understood as the serialization processing rules corresponding to the requested service, and the deserialization information can be understood as the deserialization processing rules corresponding to the requested service. The interface code can be understood as the code used to link to the application layer. The link of the interface code corresponds to the specific service, so as to realize the formation and sending of specific service request information through the application layer.

[0049] In this embodiment, target business information sent by the request sender, including at least sending end information, receiving end information, input parameters, output parameters, service identifier, business identifier, serialization information and deserialization information, is obtained, a communication matrix in Excel format is formed based on the target business information, and a business interface code corresponding to the communication matrix is ​​generated through a specific code generation tool.

[0050] S102: calling the inter-core communication component based on the interface code, and generating information to be transmitted corresponding to the target business information through the object entity in the inter-core communication component.

[0051] In this embodiment, the overall architecture of inter-core communication includes an inter-core interface component, an inter-core communication component, and an inter-core transmission medium, wherein the inter-core interface component is an interface layer, that is, Figure 1a The inter-core communication service infrastructure shown in FIG. 1 is an application layer (session layer) for inter-core communication. Figure 1a The inter-core communication infrastructure shown in Figure 1 is the transport layer. Figure 1aThe inter-core transmission medium facility shown. The object entity can be understood as the basic component of the inter-core communication infrastructure, at least the client entity, the server entity, and the serialization and deserialization subcomponents, and can also include the business entity management subcomponent, the data cache management subcomponent, the transmission medium management subcomponent, the server operation entity, the logging and data playback subcomponent, the inter-core transmission logic processing subcomponent, etc. It can be understood that if the electronic device serving as the execution subject of this embodiment is the client, the client entity is mainly used in the object entity, and if the electronic device is the server, the server entity is mainly used in the object entity. The information to be transmitted can be understood as the business request information containing the core content of the target business information, which is serialized data stream information.

[0052] Specifically, the interaction between the interface layer and the application layer is implemented based on the interface code, the inter-core communication component corresponding to the application layer is accessed, the object entity in the inter-core communication component is called, the request is created and processed through the client entity (or server entity), the business request information corresponding to the target business information is determined, and the business request information is processed accordingly through the serialization and deserialization sub-components in the inter-core communication component to form information to be transmitted.

[0053] S103: Send the information to be transmitted to the target object via a corresponding transmission medium.

[0054] In this embodiment, the electronic device that is the execution subject of this embodiment is the sending end, and correspondingly, the target object can be understood as the receiving end, and the two interact to realize inter-core communication. When the execution subject is SOC, the target object is MCU, and similarly, when the execution subject is MCU, the target object is SOC.

[0055] Specifically, based on the available transmission medium in the inter-core transmission medium corresponding to the transmission layer, the information to be transmitted is sent to the target object based on the receiving end information in the target business information through the transmission medium abstract interface in the inter-core communication component, thereby realizing the inter-core communication between the SOC and MCU cores.

[0056] An inter-core communication method provided by an embodiment of the present invention includes obtaining target business information sent by a request sender, forming a communication matrix based on the target business information, and generating an interface code through the communication matrix; calling an inter-core communication component based on the interface code, generating information to be transmitted corresponding to the target business information through an object entity in the inter-core communication component; and sending the information to be transmitted to the target object through a corresponding transmission medium. The above technical solution improves the readability, maintainability, and friendliness of the business interface requirement description through the design of a business-related communication matrix; reduces the communication cost of R&D requirements, quickly generates business interfaces, and improves the efficiency of business joint debugging between components; through the design of the inter-core communication basic framework, it can quickly adapt and develop the transmission medium layer based on specific transmission medium requirements without affecting the existing implementation, and is transparent to the business interface, and the business interface API can be quickly migrated and reused between different hardware platforms and different transmission media; through the design of a generalized inter-core communication protocol, it provides good reusability, versatility, and business scalability, and meets the conventional communication interaction requirements between different components.

[0057] Embodiment 2

[0058] Figure 3 It is a flowchart of an inter-core communication method provided in the second embodiment of the present invention. This embodiment is a further optimization of any of the above embodiments and can be applied to the situation where inter-core communication is performed between the server and the client. The method can be executed by an inter-core communication device, and the inter-core communication device can be implemented in the form of hardware and / or software.

[0059] like Figure 3 As shown, the method includes:

[0060] S201. Obtain target business information, and form a communication matrix based on the target business information. The communication matrix is ​​in a table form.

[0061] In this embodiment, the target service information provided by the request sender is obtained, and a corresponding communication matrix in the form of an Excel table is formed based on each item in the target service information. The communication matrix contains all the contents of the target service information.

[0062] S202: Generate an interface code corresponding to the communication matrix based on a preset interface code template using a code generation tool.

[0063] In this embodiment, the code generation tool is a component for generating code. The code generation tool includes several code templates. Different code templates have different functions. For example, the interface code template is a code for providing a transmission interface to realize the interaction between the interface layer and the application layer.

[0064] In the process of business integration, expansion and maintenance, the traditional inter-core communication development model requires manual coding for business changes, which requires high coding man-hour costs and has the risk of coding errors. Therefore, this embodiment implements coding through a code generation tool to improve coding efficiency and accuracy.

[0065] Specifically, the communication matrix is ​​input into the code generation tool, and the code generation tool fills the communication matrix into the corresponding position in the go2-based interface code template, generates an interface code corresponding to the communication matrix, so as to connect to the application layer and realize the formation and transmission of business requests.

[0066] S203, calling the inter-core communication component based on the interface code, calling the request creation interface through the client entity or the server entity in the inter-core communication component, and determining the business request information.

[0067] In this embodiment, the request creation interface can be understood as the interface used to form the service request information in the object entity. The service request information can be understood as the request information required by the request sender to perform the service, corresponding to the target service information, and at least includes the data structure of the input parameters in the target service information, the service identifier and the service identifier.

[0068] Specifically, when the sending end is a client, the inter-core communication component is called based on the interface code and connected to the client entity in the inter-core communication component. When the sending end is a server, the inter-core communication component is called based on the interface code and connected to the server entity in the inter-core communication component. The client entity / server entity contains multiple interfaces. Based on the information contained in the communication matrix, it is determined that the request to create the interface needs to be called. Based on the request to create the interface, the client entity / server entity determines the data structure of the input parameters in the communication matrix, the service identifier and the business identifier, and determines this information as the business request information. Preferably, the data structure of the input parameters is an integer structure.

[0069] S204. Based on the serialization information, the service request information is serialized by the serialization and deserialization processing subcomponents in the inter-core communication component to obtain information to be transmitted.

[0070] In this embodiment, the serialization information can be understood as the serialization processing rules corresponding to the specific business. The serialization and deserialization processing subcomponent is used to perform serialization processing and deserialization processing. The information to be transmitted can be understood as the business request information with universality after serialization, which can be quickly accepted and recognized by the receiving end.

[0071] Specifically, only serialization processing needs to be performed in the request formation and sending stages. Therefore, the serialization and deserialization processing subcomponents in the inter-core communication component serialize the business request information based on the serialization information in the communication matrix to obtain the serialized business request information, that is, the information to be transmitted.

[0072] S205: If the protocol type of the communication protocol included in the communication matrix is ​​the first protocol type, the information to be transmitted is sent to the target object via the corresponding transmission medium, and the request creation interface of the object entity is destroyed.

[0073] In this embodiment, the first protocol type can be understood as a protocol type of a one-way communication mode, which does not require a response, for example, a oneway request.

[0074] Specifically, the communication matrix also includes a specific transmission protocol. If the protocol type of the communication protocol included in the communication matrix is ​​the first protocol type, it indicates that this inter-core communication is a one-way data transmission. At this time, the information to be transmitted is sent to the target object through any one or more available transmission media of the IPCF transmission medium, the SPI transmission medium, and the UART transmission medium. At the same time, since the protocol type of the communication protocol included in the communication matrix is ​​the first protocol type, it indicates that this inter-core communication does not require a response from the target object. Therefore, for a single thread, there is no need to perform subsequent steps, and the request creation interface for the thread in the object entity can be destroyed.

[0075] S206: If the protocol type of the communication protocol included in the communication matrix is ​​the second protocol type, the information to be transmitted is sent to the target object through the corresponding transmission medium, and the execution process of the object entity is blocked.

[0076] In this embodiment, the second protocol type can be understood as a protocol type of a two-way communication mode, which requires responses from both ends, such as Request and Response requests.

[0077] Specifically, the communication matrix also includes a specific transmission protocol. If the protocol type of the communication protocol included in the communication matrix is ​​the second protocol type, it indicates that the inter-core communication is bidirectional data transmission. At this time, the information to be transmitted is sent to the target object through any one or more available transmission media of IPCF transmission medium, SPI transmission medium and UART transmission medium. At the same time, before receiving the information fed back by the target object, the execution process of the object entity is blocked to save the running computing power, and the blockage is released when the information fed back by the target object is received.

[0078] Optionally, if the protocol type of the communication protocol included in the communication matrix is ​​the second protocol type, the method further includes:

[0079] S207: Acquire feedback information sent by the target object through a transmission medium associated with the target object.

[0080] In this embodiment, the feedback information may be understood as response information to the information formed by the target object after receiving the information to be transmitted, corresponding to the information to be transmitted as request information.

[0081] Specifically, the target object as the receiving end generates corresponding response information, namely feedback information, after receiving the information to be transmitted, and transmits the feedback information back to the electronic device as the execution subject of this embodiment through the same transmission medium. The feedback information transmitted back by the receiving target device through each transmission medium.

[0082] S208: Deserialize the feedback information based on the deserialization information.

[0083] In this embodiment, the deserialization information can be understood as a deserialization processing rule corresponding to a specific service.

[0084] Specifically, in the feedback information transmission phase, the feedback information needs to be deserialized to unify the data format of the request sender. Therefore, the data stream processing subcomponent in the inter-core communication component deserializes the feedback information based on the deserialized information in the communication matrix to obtain the deserialized feedback information.

[0085] S209: Run the execution process of the object entity, and return the feedback information after deserialization processing to the request sender through the object entity.

[0086] In this embodiment, the object entity receives the feedback information sent by the data processing subcomponent, contacts the blocking state of the corresponding thread, runs the execution process, and returns the deserialized feedback information to the request sender through the same interface.

[0087] An inter-core communication method provided by an embodiment of the present invention includes obtaining target business information and forming a communication matrix based on the target business information, wherein the communication matrix is ​​in a tabular form; using a code generation tool, generating an interface code corresponding to the communication matrix based on a preset interface code template; calling an inter-core communication component based on the interface code, and calling a request creation interface through a client entity or a server entity in the inter-core communication component to determine business request information; based on serialization information, serializing the business request information through a serialization and deserialization processing subcomponent in the inter-core communication component to obtain information to be transmitted; if the protocol type of the communication protocol contained in the communication matrix is ​​a first protocol type, sending the information to be transmitted to the target object through a corresponding transmission medium, and destroying the request creation interface of the object entity; if the protocol type of the communication protocol contained in the communication matrix is ​​a second protocol type, sending the information to be transmitted to the target object through the corresponding transmission medium, and blocking the execution process of the object entity. The above technical solution, based on the defined and designed inter-core communication basic framework, can quickly adapt and develop the transmission medium layer based on specific transmission medium requirements without affecting the existing implementation, and is transparent to the business interface; through the layered design of the inter-core communication framework, the business interface API can be quickly migrated and reused between different hardware platforms and different transmission media; by describing the business matrix in tabular form, the readability, maintainability and friendliness of the business interface requirement description are improved; the communication cost of R&D requirements is reduced; the general standardized and extensible inter-core communication protocol provides good reusability, versatility and business extensibility, and meets the conventional communication interaction requirements between different components; through the design of data injection and capture devices, it provides good business data closed-loop capability and testability; based on the business API logic template design and the supporting interface code self-generation tool, the business interface is quickly generated, which reduces the coding manpower investment, improves the efficiency of business joint debugging between components, and helps promote the verification link of the product software architecture.

[0088] The technical solution adopted in the embodiment of the present invention designs and defines an inter-core communication transmission frame protocol suitable for common communication scenario services (Request, OneWay, Response); adopts a templated standardized logic construction of the user communication service API and an extended design of the transmission medium layer; based on the stub / proxy style user service interface template construction design and implementation, the design defines a communication framework for a closed-loop communication data layered by interfaces, facilities, and transmission media.

[0089] The above technical content is completely different from the common communication software based on communication function interface API in the industry. Communication framework users do not need to care about the definition of the underlying business protocol and the communication function interface call logic, but only care about the interface requirement design and definition at the business level, and support the definition and internal implementation of the communication business function interface prototype based on engineering templates. It meets the current design concept of service-oriented architecture (SOA) design, business standardization, and low-code implementation and deployment based on model development of automotive software.

[0090] Embodiment 3

[0091] Figure 4 Schematic diagram of the structure of an inter-core communication device provided by Embodiment 3 of the present invention. Figure 4 As shown, the device comprises:

[0092] The code generation module 31 is used to obtain the target service information sent by the request sender, form a communication matrix based on the target service information, and generate an interface code through the communication matrix;

[0093] An information generation module 32, configured to call the inter-core communication component based on the interface code, and generate information to be transmitted corresponding to the target business information through an object entity in the inter-core communication component;

[0094] The information transmission module 33 is used to send the information to be transmitted to the target object via a corresponding transmission medium.

[0095] The inter-core communication device adopted in this technical solution improves the readability, maintainability and friendliness of the business interface requirement description through the business-related communication matrix design; reduces the communication cost of R&D requirements, quickly generates business interfaces, and improves the efficiency of business coordination between components.

[0096] Optionally, the communication matrix includes at least sending end information, receiving end information, input parameters, output parameters, service identifier, business identifier, serialization information and deserialization information.

[0097] Optionally, the code generation module 31 is specifically used for:

[0098] Acquire target business information, and form a communication matrix based on the target business information, wherein the communication matrix is ​​in a table form;

[0099] An interface code corresponding to the communication matrix is ​​generated based on a preset interface code template by a code generation tool.

[0100] Optionally, the information generating module 32 is specifically used for:

[0101] Based on the interface code, the inter-core communication component is called, and the client entity or the server entity in the inter-core communication component calls the request creation interface to determine the business request information;

[0102] Based on the serialization information, the service request information is serialized by the serialization and deserialization processing subcomponents in the inter-core communication component to obtain the information to be transmitted.

[0103] Optionally, the information transmission module 33 is specifically used for:

[0104] If the protocol type of the communication protocol included in the communication matrix is ​​the first protocol type, the information to be transmitted is sent to the target object through the corresponding transmission medium, and the request creation interface of the object entity is destroyed;

[0105] If the protocol type of the communication protocol included in the communication matrix is ​​the second protocol type, the information to be transmitted is sent to the target object through the corresponding transmission medium, and the execution process of the object entity is blocked.

[0106] Optionally, the device further includes an information feedback module, which is specifically used to:

[0107] If the protocol type of the communication protocol included in the communication matrix is ​​the second protocol type, obtaining feedback information sent by the target object through a transmission medium associated with the target object;

[0108] Based on the deserialization information, deserialize the feedback information;

[0109] The execution process of the object entity is run, and feedback information after deserialization processing is returned to the request sender through the object entity.

[0110] The inter-core communication device provided in the embodiment of the present invention can execute the inter-core communication method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0111] Embodiment 4

[0112] Figure 5: is a structural schematic diagram of an electronic device provided in Embodiment 4 of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0113] like Figure 5 As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0114] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0115] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 performs the various methods and processes described above, such as the inter-core communication method.

[0116] In some embodiments, the inter-core communication method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the inter-core communication method described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to perform the inter-core communication method in any other appropriate manner (e.g., by means of firmware).

[0117] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0118] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0119] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0120] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0121] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0122] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0123] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0124] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for inter-core communication, characterized in that: include: Acquire target service information sent by the request sender, form a communication matrix based on the target service information, and generate an interface code through the communication matrix; Calling the inter-core communication component based on the interface code, generating information to be transmitted corresponding to the target business information through the object entity in the inter-core communication component; The information to be transmitted is sent to the target object via a corresponding transmission medium.

2. The method according to claim 1, characterized in that The communication matrix at least includes sending end information, receiving end information, input parameters, output parameters, service identifiers, business identifiers, serialization information and deserialization information.

3. The method according to claim 1, characterized in that Acquiring target service information sent by the request sender, forming a communication matrix based on the target service information, and generating an interface code through the communication matrix, including: Acquire target business information, and form a communication matrix based on the target business information, wherein the communication matrix is ​​in a table form; An interface code corresponding to the communication matrix is ​​generated based on a preset interface code template by a code generation tool.

4. The method according to claim 2, characterized in that: Calling the inter-core communication component based on the interface code and generating information to be transmitted corresponding to the target business information through the object entity in the inter-core communication component includes: Based on the interface code, the inter-core communication component is called, and the client entity or the server entity in the inter-core communication component calls the request creation interface to determine the business request information; Based on the serialization information, the service request information is serialized by the serialization and deserialization processing subcomponents in the inter-core communication component to obtain the information to be transmitted.

5. The method according to claim 1, characterized in that: The information to be transmitted is sent to the target object via a corresponding transmission medium, including: If the protocol type of the communication protocol included in the communication matrix is ​​the first protocol type, the information to be transmitted is sent to the target object through the corresponding transmission medium, and the request creation interface of the object entity is destroyed; If the protocol type of the communication protocol included in the communication matrix is ​​the second protocol type, the information to be transmitted is sent to the target object through the corresponding transmission medium, and the execution process of the object entity is blocked.

6. The method according to claim 2, characterized in that Also includes: If the protocol type of the communication protocol included in the communication matrix is ​​the second protocol type, obtaining feedback information sent by the target object through a transmission medium associated with the target object; Based on the deserialization information, deserialize the feedback information; The execution process of the object entity is run, and feedback information after deserialization processing is returned to the request sender through the object entity.

7. An inter-core communication device, characterized in that: include: A code generation module, used for acquiring target service information sent by a request sender, forming a communication matrix based on the target service information, and generating an interface code through the communication matrix; An information generation module, used to call the inter-core communication component based on the interface code, and generate information to be transmitted corresponding to the target business information through an object entity in the inter-core communication component; The information transmission module is used to send the information to be transmitted to the target object via the corresponding transmission medium.

8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute an inter-core communication method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement an inter-core communication method according to any one of claims 1 to 6 when executed.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements an inter-core communication method according to any one of claims 1 to 6.