CN114780505A - Data and file interaction method - Google Patents
Data and file interaction method Download PDFInfo
- Publication number
- CN114780505A CN114780505A CN202210314993.4A CN202210314993A CN114780505A CN 114780505 A CN114780505 A CN 114780505A CN 202210314993 A CN202210314993 A CN 202210314993A CN 114780505 A CN114780505 A CN 114780505A
- Authority
- CN
- China
- Prior art keywords
- processor
- data
- file
- request
- file operation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/178—Techniques for file synchronisation in file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/545—Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space
Abstract
The application discloses a data and file interaction method, which comprises the following steps: responding to an interrupt request from a slave processor in the multi-core processor; receiving a file operation request and/or a data transmission request sent by the slave processor through a data and file interaction double channel; and executing the file operation request and/or the data transmission request sent by the slave processor. On the basis of not increasing system cost, the data and file interaction application mode of the dual system is realized by using the characteristics of the operating system and the OpenAMP software architecture, reliable file operation and data transmission can be provided, and different application requirements and diversity are met.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data and file interaction method.
Background
With the development of semiconductor technology and industry, industrial control systems become more complex, multiple processors are usually required to cooperate with each other, and dual-core communication is also increasingly applied to control systems. Dual core communication is generally communication between multiple CPU (Central Processing Unit) cores on a single chip, or communication between multiple MCU (micro controller Unit) chips. However, in consideration of Chip cost and other factors, the integration of multiple CPU cores into one SOC (System on Chip) is also increasingly applied to industrial control.
Most of the current communication among cores of a multi-CPU core processor is realized based on a shared memory, an inter-core or external interrupt mode. As shown in fig. 1, the shared memory stores data, inter-core interrupt notification messages, and the CPU1 and the CPU2 application layer parse and process inter-core data according to a protocol. The inter-core data processing mode has a single form, cannot meet the requirements of a multi-core file operation interface and cannot meet the requirements of data interaction and file operation at the same time, and has great limitation on occasions with complex application.
Disclosure of Invention
The application provides a data and file interaction method, which aims to solve the problem that the existing inter-core data processing mode is single in form.
The method is applied to a main processor in a multi-core processor, and a first operating system is deployed on the main processor; the method comprises the following steps:
responding to an interrupt request from a slave processor in the multi-core processor;
receiving a file operation request and/or a data transmission request sent by the slave processor through a data and file interaction double channel;
and executing the file operation request and/or the data transmission request sent by the slave processor.
The application provides a data and file interaction method on the other hand, the method is applied to a main processor in a multi-core processor, and a first operating system is deployed on the main processor; the method comprises the following steps:
sending an interrupt request to a slave processor in a multi-core processor;
and sending a file operation request and/or a data transmission request to the slave processor through a data and file interaction double channel.
The method is applied to a slave processor in a multi-core processor, and a second operating system is deployed on the slave processor; the method comprises the following steps:
responding to an interrupt request of a main processor in the multi-core processor;
receiving a file operation request and/or a data transmission request sent by the main processor through a data and file interaction double channel;
and executing the file operation request and/or the data transmission request sent by the main processor.
The method is applied to a slave processor in a multi-core processor, and a second operating system is deployed on the slave processor; the method comprises the following steps:
sending an interrupt request to a main processor in a multi-core processor;
and sending a file operation request and/or a data transmission request to the main processor through the data and file interaction double channels.
The method is applied to a multi-core processor, the multi-core processor comprises a main processor and at least one slave processor, a first operating system is deployed on the main processor, and a second operating system is deployed on the slave processor;
the method comprises the following steps:
the slave processor sends an interrupt request to the master processor; the master processor responds to the interrupt request of the slave processor; the main processor receives a file operation request and/or a data transmission request sent by the auxiliary processor through a data and file interaction double channel; the master processor executes a file operation request and/or a data transmission request sent by the slave processor; alternatively, the first and second liquid crystal display panels may be,
the master processor sends an interrupt request to the slave processor; the slave processor responds to the interrupt request of the master processor; the slave processor receives a file operation request and/or a data transmission request sent by the master processor through a data and file interaction double channel; and the slave processor executes the file operation request and/or the data transmission request sent by the master processor.
According to the data and file interaction method, on the basis of not increasing system cost, the data and file interaction application mode of the dual system is achieved by using the operating system characteristics and the OpenAMP software architecture, reliable file operation and data transmission can be provided, and different application requirements and diversity are met.
Drawings
FIG. 1 is a block diagram of inter-core communication for a conventional multi-core processor;
FIG. 2 is a schematic diagram illustrating a data and file interaction method applied to a host processor according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram illustrating another data and file interaction method applied to a host processor according to an embodiment of the present disclosure;
FIG. 4 is a diagram illustrating a data and file interaction method applied to a slave processor according to an embodiment of the present application;
FIG. 5 is a diagram illustrating another data and file interaction method applied to a slave processor according to an embodiment of the present application;
fig. 6 is a data and file interaction block diagram of a dual-core dual system according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of a file interaction process of a dual-core dual system according to an embodiment of the present application;
fig. 8 is a schematic diagram of a data interaction process of a dual-core dual system according to an embodiment of the present application.
The implementation, functional features and advantages of the object of the present application will be further explained with reference to the embodiments, and with reference to the accompanying drawings.
Detailed Description
In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application clearer and clearer, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In the description of the present application, it is to be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", and the like, indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, are only for convenience in describing the present application and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and thus, should not be construed as limiting the present application. Furthermore, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Example 1
As shown in fig. 2, a first embodiment of the present application provides a data and file interaction method, which is applied to a main processor in a multi-core processor, where the main processor is deployed with a first operating system;
the method comprises the following steps:
step S11, responding to the interrupt request of the slave processor in the multi-core processor;
step S12, receiving the file operation request and/or the data transmission request sent by the slave processor through a data and file interaction double channel;
and step S13, executing the file operation request and/or the data transmission request sent by the processor.
In one example, the data and file interaction dual channel comprises two independent channels, and each channel has respective identification information. The identification information includes, but is not limited to, a name, an identification number.
In an example, the executing the file operation request and/or the data transmission request sent from the processor further includes:
and analyzing and distributing the received request.
In an example, the executing the file operation request and/or the data transfer request sent from the processor further includes:
and feeding back the execution result of the file operation request to the slave processor.
Example 2
As shown in fig. 3, a second embodiment of the present application provides a data and file interaction method, which is applied to a main processor in a multi-core processor, where the main processor is deployed with a first operating system;
the method comprises the following steps:
step S21, sending an interrupt request to a slave processor in the multi-core processor;
and step S22, sending a file operation request and/or a data transmission request to the slave processor through the data and file interaction dual channels.
In one example, the data and file interaction dual channel comprises two independent channels, and each channel has respective identification information. The identification information includes, but is not limited to, a name, an identification number.
In one example, the sending the file operation request and/or the data transfer request to the slave processor through the data and file interaction dual channels comprises:
the thread that will send the file operation request enters blocking mode.
In one example, the thread that will send the file operation request enters a blocking mode, and then further comprises:
and returning the thread entering the blocking mode after receiving the execution result of the file operation request fed back by the slave processor.
Further, an embodiment of the present application further provides a main processor, configured to load and execute at least one program code stored in a memory, so as to implement the data and file interaction method described in the first embodiment or the second embodiment.
Example 3
As shown in fig. 4, a third embodiment of the present application provides a data and file interaction method, which is applied to a slave processor in a multi-core processor, where a second operating system is deployed on the slave processor;
the method comprises the following steps:
step S31, responding to the interrupt request of the main processor in the multi-core processor;
step S32, receiving a file operation request and/or a data transmission request sent by the main processor through a data and file interaction double channel;
and step S33, executing the file operation request and/or the data transmission request sent by the main processor.
In one example, the data and file interaction dual channel comprises two independent channels, and each channel has respective identification information. The identification information includes, but is not limited to, a name, an identification number.
In an example, the executing the file operation request and/or the data transmission request sent by the main processor further includes:
and analyzing and distributing the received request.
In an example, the executing the file operation request and/or the data transmission request sent by the main processor further includes:
and feeding back the execution result of the file operation request to the main processor.
Example 4
As shown in fig. 5, a fourth embodiment of the present application provides a data and file interaction method, which is applied to a slave processor in a multi-core processor, where a second operating system is deployed on the slave processor;
the method comprises the following steps:
step S41, sending an interrupt request to a main processor in the multi-core processor;
and step S42, sending a file operation request and/or a data transmission request to the main processor through the data and file interaction dual channels.
In one example, the data and file interaction dual channel comprises two independent channels, and each channel has respective identification information. The identification information includes, but is not limited to, a name, an identification number.
In an example, the sending a file operation request and/or a data transmission request to the host processor over the data and file interaction dual channels includes:
the thread that sends the file operation request enters blocking mode.
In one example, the thread that will send the file operation request enters a blocking mode, and then further comprises:
and returning the thread entering the blocking mode after receiving the execution result of the file operation request fed back by the main processor.
Further, an embodiment of the present application further provides a slave processor, configured to load and execute at least one program code stored in a memory, so as to implement the data and file interaction method described in the third embodiment or the fourth embodiment.
Example 5
The fifth embodiment of the present application provides a data and file interaction method, which is applied to a multi-core processor, where the multi-core processor includes a master processor and at least one slave processor, a first operating system is deployed on the master processor, and a second operating system is deployed on the slave processor;
the method comprises the following steps:
the slave processor sends an interrupt request to the master processor; the master processor responds to the interrupt request of the slave processor; the master processor receives a file operation request and/or a data transmission request sent by the slave processor through a data and file interaction double channel; the master processor executes a file operation request and/or a data transmission request sent by the slave processor; alternatively, the first and second electrodes may be,
the master processor sends an interrupt request to the slave processor; the slave processor responds to the interrupt request of the master processor; the slave processor receives a file operation request and/or a data transmission request sent by the master processor through a data and file interaction double channel; and the slave processor executes the file operation request and/or the data transmission request sent by the master processor.
Further, an embodiment of the present application further provides a computer-readable storage medium, where at least one extent code is stored in the computer-readable storage medium, and when the at least one extent code is loaded and executed, the method for data and file interaction according to any of the first to fifth embodiments may be implemented.
The following is described in conjunction with fig. 6-8:
as shown in the data and file interaction block diagram of the dual-core dual System shown in fig. 6, the CPU1 adopts a LINUX System, the CPU2 adopts a Real-time Operating System (RTOS), and the CPU1 and the CPU2 are two symmetric CORTEX-a9 cores. Based on an OpenAMP (Open asynchronous Multi-Processing) communication architecture, an operating system scheduling and communication mechanism is fully utilized to realize data and file interaction of a dual-core dual system.
Specifically, first, the CPU1 and the CPU2 create a dual channel (channel 1 and channel 2) for data and file interaction using OpenAMP; then respectively creating a corresponding interrupt processing module and a daemon thread; the shared memory stores data, the interrupt processing module responds to the inter-core interrupt, the daemon thread processes the Rpmsg message and distributes the Rpmsg message to different task processing modules for processing according to the type of the Rpmsg message. For example, a certain thread of the CPU1 sends an RpMsg message through OpenAMP, the CPU2 interrupt processing module responds to an interrupt request, transmits the interrupt message to a daemon thread, and the daemon thread analyzes the RpMsg message by using an identification number (Id) and a Name (Name) of the message and distributes the RpMsg message to different tasks for processing according to the type of the RpMsg message; conversely, the Rpmsg message sent by the CPU2 and received by the CPU1 are processed similarly.
The Rpmsg message processing mode comprises two modes: for messages of file operation types (such as file opening, file writing, file reading, file closing and the like), threads of a sender need to be blocked, and a receiver needs to return a file operation result to the sender; and in the second mode, for the data transmission type message, the thread of the sender does not need to be blocked, and the receiver does not need to respond.
Fig. 7 is a schematic diagram of a file interaction process of a dual-core dual system.
First, the CPU1 and the CPU2 create data and file interactive dual channels in dual systems using OpenAMP, namely RpMsg1 (including channel 1 and channel 2), RpMsg2 (including channel 1 and channel 2). Channel 1 is logically independent of channel 2, with their own Id and Name.
Respectively creating corresponding interrupt processing modules (shown as an interrupt processing module 1 and an interrupt processing module 2 in the figure) and creating daemon threads (shown as a message analysis and distribution module in the figure) in respective systems.
The thread of the CPU2 (shown as the file operation request module in the figure) sends a file operation request (shown as label 1 in the figure), triggers an inter-core interrupt signal of the CPU1 (alternatively, an external interrupt trigger mode may be used), and the thread sending the request enters a blocking mode, waiting for the execution result to return.
The CPU1 interrupt processing module 1 responds to the interrupt request, transmits an interrupt message to the message parsing and distributing module, and the message parsing and distributing module identifies an RpMsg message of the file operation type according to the Id and Name of the message, and distributes the file operation request to the file operation executing module for execution.
The file operation execution module of the CPU1 executes a file operation and returns the execution result (indicated by the label 2 in the figure).
The file operation confirmation module of the CPU2 confirms the file operation execution result and blocks the thread return.
Fig. 8 is a schematic diagram of a data interaction process of a dual-core dual system.
First, the CPU1 and the CPU2 create data and file interactive dual channels in dual systems using OpenAMP, namely RpMsg1 (including channel 1 and channel 2), RpMsg2 (including channel 1 and channel 2). Channel 1 is logically independent of channel 2, with their own Id and Name.
Respectively creating corresponding interrupt processing modules (shown as an interrupt processing module 1 and an interrupt processing module 2 in the figure) and creating daemon threads (shown as a message analysis and distribution module in the figure) in respective systems.
The threads of CPU1 (shown as data transfer issue module in the figure) issue an Rpmsg message of data transfer type and trigger an inter-core interrupt signal for CPU 2.
The interrupt processing module of the CPU2 responds to the interrupt request, transmits the interrupt message to the message parsing and distributing module, and the message parsing and distributing module identifies the Rpmsg message of the data transmission type according to the Id and the Name of the message and distributes the communication data to the data transmission processing module for execution.
Conversely, the CPU2 sends an RpMsg message of the data transfer type, and the process is similar.
The preferred embodiments of the present application have been described above with reference to the accompanying drawings, and the scope of the claims of the present application is not limited thereby. Any modifications, equivalents, and improvements made by those skilled in the art without departing from the scope and spirit of the present application should be within the scope of the claims of the present application.
Claims (10)
1. A data and file interaction method is applied to a main processor in a multi-core processor, wherein a first operating system is deployed on the main processor; characterized in that the method comprises:
responding to an interrupt request from a slave processor in a multicore processor;
receiving a file operation request and/or a data transmission request sent by the slave processor through a data and file interaction double channel;
and executing the file operation request and/or the data transmission request sent by the slave processor.
2. The method of claim 1, wherein the dual data and file interaction channels comprise two independent channels, each having respective identification information.
3. The method of claim 1, wherein said executing the file operation request and/or the data transfer request sent from the processor further comprises:
and analyzing and distributing the received request.
4. The method of claim 1, wherein the executing the file operation request and/or the data transfer request sent from the processor further comprises:
and feeding back an execution result of the file operation request to the slave processor.
5. A data and file interaction method is applied to a main processor in a multi-core processor, wherein a first operating system is deployed on the main processor; characterized in that the method comprises:
sending an interrupt request to a slave processor in a multi-core processor;
and sending a file operation request and/or a data transmission request to the slave processor through a data and file interaction double channel.
6. The method of claim 5, wherein sending a file operation request and/or a data transfer request to the slave processor over a dual data and file interaction channel comprises:
the thread that will send the file operation request enters blocking mode.
7. The method of claim 6, wherein the thread that will send the file operation request enters a blocking mode, and thereafter further comprising:
and returning the thread entering the blocking mode after receiving the execution result of the file operation request fed back by the slave processor.
8. A data and file interaction method is applied to a slave processor in a multi-core processor, and a second operating system is deployed on the slave processor; characterized in that the method comprises:
responding to an interrupt request of a main processor in the multi-core processor;
receiving a file operation request and/or a data transmission request sent by the main processor through a data and file interaction double channel;
and executing the file operation request and/or the data transmission request sent by the main processor.
9. A data and file interaction method is applied to a slave processor in a multi-core processor, and a second operating system is deployed on the slave processor; characterized in that the method comprises:
sending an interrupt request to a main processor in a multi-core processor;
and sending a file operation request and/or a data transmission request to the main processor through the data and file interaction double channels.
10. A data and file interaction method is applied to a multi-core processor, wherein the multi-core processor comprises a main processor and at least one slave processor, a first operating system is deployed on the main processor, and a second operating system is deployed on the slave processor; it is characterized in that the preparation method is characterized in that,
the method comprises the following steps:
the slave processor sends an interrupt request to the master processor; the master processor responds to the interrupt request of the slave processor; the main processor receives a file operation request and/or a data transmission request sent by the auxiliary processor through a data and file interaction double channel; the master processor executes a file operation request and/or a data transmission request sent by the slave processor; alternatively, the first and second electrodes may be,
the master processor sends an interrupt request to the slave processor; the slave processor responds to the interrupt request of the master processor; the slave processor receives a file operation request and/or a data transmission request sent by the master processor through a data and file interaction double channel; and the slave processor executes the file operation request and/or the data transmission request sent by the master processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210314993.4A CN114780505A (en) | 2022-03-29 | 2022-03-29 | Data and file interaction method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210314993.4A CN114780505A (en) | 2022-03-29 | 2022-03-29 | Data and file interaction method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114780505A true CN114780505A (en) | 2022-07-22 |
Family
ID=82426201
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210314993.4A Pending CN114780505A (en) | 2022-03-29 | 2022-03-29 | Data and file interaction method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114780505A (en) |
-
2022
- 2022-03-29 CN CN202210314993.4A patent/CN114780505A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP0362106B1 (en) | Method for scheduling execution of distributed application programs at preset times in an SNA LU 6.2 network environment | |
US5291597A (en) | Method to provide concurrent execution of distributed application programs by a host computer and an intelligent work station on an SNA network | |
US20090271796A1 (en) | Information processing system and task execution control method | |
US7890670B2 (en) | Direct memory access transfer completion notification | |
US20080273543A1 (en) | Signaling Completion of a Message Transfer from an Origin Compute Node to a Target Compute Node | |
US6415332B1 (en) | Method for handling of asynchronous message packet in a multi-node threaded computing environment | |
EP0536073A2 (en) | Method and process for interprocess communication using named pipes | |
CN103942178A (en) | Communication method between real-time operating system and non-real-time operating system on multi-core processor | |
US5528761A (en) | Message passing apparatus for determining if counted acknowledgements from a set of processors are within a defined range | |
US4736319A (en) | Interrupt mechanism for multiprocessing system having a plurality of interrupt lines in both a global bus and cell buses | |
CN115203142A (en) | Multi-core real-time communication system and method | |
US5410650A (en) | Message control system for data communication system | |
CN101424941B (en) | Control implementing method and system | |
CN109144698B (en) | Data acquisition method, event distributor, device, medium, and unmanned vehicle | |
CN115794313B (en) | Virtual machine debugging method, system, electronic device and storage medium | |
US6385659B1 (en) | Handling of asynchronous message packet in a multi-node threaded computing environment | |
US6412018B1 (en) | System for handling asynchronous message packet in a multi-node threaded computing environment | |
EP0504414B1 (en) | Message control system in a data communication system | |
US7889657B2 (en) | Signaling completion of a message transfer from an origin compute node to a target compute node | |
CN109062857A (en) | A kind of new type of messages controller and its communication means that can be communicated between realization of High Speed multiprocessor | |
CN114780505A (en) | Data and file interaction method | |
EP0502215B1 (en) | Message control system in a data communication system | |
US6934953B2 (en) | Deferred procedure call in interface description language | |
CN117389625B (en) | Process synchronization method, system, equipment and medium based on active interrupt instruction | |
US7320044B1 (en) | System, method, and computer program product for interrupt scheduling in processing communication |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |