CN113835863A - Data communication method and software platform thereof - Google Patents
Data communication method and software platform thereof Download PDFInfo
- Publication number
- CN113835863A CN113835863A CN202111145472.2A CN202111145472A CN113835863A CN 113835863 A CN113835863 A CN 113835863A CN 202111145472 A CN202111145472 A CN 202111145472A CN 113835863 A CN113835863 A CN 113835863A
- Authority
- CN
- China
- Prior art keywords
- interrupt
- source
- interrupt source
- thread
- priority
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000004891 communication Methods 0.000 title claims abstract description 40
- 230000007246 mechanism Effects 0.000 abstract description 17
- 238000004519 manufacturing process Methods 0.000 abstract description 5
- 230000000875 corresponding effect Effects 0.000 description 40
- 238000010586 diagram Methods 0.000 description 4
- 230000000903 blocking effect Effects 0.000 description 3
- 238000004088 simulation Methods 0.000 description 3
- 238000001514 detection method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 230000002747 voluntary effect Effects 0.000 description 1
- 238000005406 washing Methods 0.000 description 1
Images
Classifications
-
- 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/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4812—Task transfer initiation or dispatching by interrupt, e.g. masked
-
- 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/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/48—Indexing scheme relating to G06F9/48
- G06F2209/484—Precedence
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
- Bus Control (AREA)
Abstract
The embodiment of the invention discloses a data communication method and a software platform thereof, which are applied to an embedded system, wherein the embedded system comprises a plurality of interrupt sources and thread functions, the interrupt sources comprise first interrupt sources, the thread functions comprise first thread functions, and the first thread functions correspond to the first interrupt sources, and the method comprises the following steps: receiving a first interrupt request sent by the first interrupt source, creating a first file handle according to the first interrupt request, reading the first file handle, running the first thread function, and executing a first interrupt event corresponding to the first interrupt request. By the method, the embedded type and the communication mechanism are combined to simulate the interrupt service, and the file handle is created and read, so that the thread function of the corresponding interrupt source runs, the corresponding interrupt item is executed, the interrupt mechanism is realized, a hardware module is not needed, and the production cost brought by the hardware module is reduced.
Description
Technical Field
The invention relates to the technical field of embedded systems, in particular to a data communication method and a software platform thereof.
Background
The embedded system is widely applied to the fields of industrial internet, intelligent manufacturing, ubiquitous internet of things and the like, and is a Linux system.
With the increasing application of the internet of things technology to embedded devices, traditional electric appliances or electronic devices may not have the capability of accessing the internet, such as air conditioners, washing machines and the like, which cannot access the internet, and need to access the internet through ethernet or WiFi, the most common way is to connect the electric appliances or electronic devices with WiFi through communication buses (such as UART, SPI, I2C and the like) on hardware of the electric appliances or electronic devices, and to implement internet control through respective customized universal UART protocols, and the WiFi end implements a universal serial port protocol to dock various peripheral electric devices.
Currently, embedded systems require the implementation of interrupt mechanisms by means of hardware modules.
Disclosure of Invention
The embodiment of the invention provides a data communication method and a software platform thereof, which simulate an interrupt mechanism of a hardware module in an embedded system to realize interrupt without the help of the hardware module.
In a first aspect, an embodiment of the present invention provides a data communication method applied to an embedded system, where the embedded system includes a plurality of interrupt sources and thread functions, the plurality of interrupt sources includes a first interrupt source, the plurality of thread functions includes a first thread function, and the first thread function corresponds to the first interrupt source, where the method includes:
receiving a first interrupt request sent by the first interrupt source;
creating a first file handle according to the first interrupt request;
reading the first file handle;
the first thread function operates to execute a first interrupt transaction corresponding to the first interrupt request.
In a second aspect, an embodiment of the present invention provides a software platform for data communication, configured to execute the above-mentioned data communication method, and applied to an embedded system, where the embedded system includes a plurality of interrupt sources and thread functions, the plurality of interrupt sources includes a first interrupt source, the plurality of thread functions includes a first thread function, and the first thread function corresponds to the first interrupt source, and the software platform includes:
an interrupt request receiving unit, configured to receive a first interrupt request sent by the first interrupt source;
a file handle creating unit configured to create a first file handle according to the first interrupt request;
a file handle reading unit for reading the first file handle;
and a function execution unit, configured to execute the first thread function and execute a first interrupt transaction corresponding to the first interrupt request.
In the embodiment of the invention, the embedded type and the communication mechanism are combined to simulate the interrupt service, the file handle is created in a blocking mode through the communication mechanism, the corresponding thread function of the interrupt source is operated by reading the file handle, and the interrupt event corresponding to the interrupt request of the interrupt source is executed, so that the purpose of interrupt is achieved, a hardware module is not needed, and the production cost brought by the hardware module is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of an embedded system according to an embodiment of the present application;
fig. 2 is a flowchart of a data communication method according to an embodiment of the present application;
fig. 3 is another flowchart of a data communication method according to an embodiment of the present application;
fig. 4 is a flowchart of a data communication method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data communication software platform according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a data communication method and a software platform thereof, an interrupt service mechanism is simulated by cutting an embedded type and a communication mechanism, a file handle is created in a blocking mode through the communication mechanism, the file handle is read to achieve the purpose of interrupt, a hardware module is not needed, and the production cost of the hardware module is reduced.
The data communication method and the software platform thereof will be described in detail below.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an embedded system according to an embodiment of the present disclosure, where the embedded system is a Linux system, and the embedded system includes a plurality of interrupt sources 10, a file handle set 20, and a thread function 30.
The plurality of interrupt sources 10 at least include a first interrupt source and a second interrupt source, an interrupt is caused by an event of certain hardware or certain software, so that the computer temporarily stops the current task and executes another program, and when the another program is processed, the current task is continuously processed.
The set of file handles 20 is used to identify the interrupt source 10 and to create file handles and read file handles to implement interrupts.
The plurality of thread functions 30 at least includes a first thread function corresponding to the first interrupt source and a second thread function corresponding to the second interrupt source, each of the thread functions corresponding to an interrupt transaction.
The interrupt mechanism includes two kinds of interrupt, the first one is triggered interrupt mode and the second one is platform simulating interrupt mode.
The interrupt triggering mode is implemented based on a hardware module, the hardware module includes various interrupt service functions, for example, GPIO0 interrupt service functions, UART1 interrupt service functions, and other functions, the interrupt vector table may form an entry address of a corresponding interrupt service function according to the interrupt source, or the interrupt vector table stores a first address of each interrupt service function, the interrupt source sends an interrupt request to the interrupt vector table, and the interrupt vector table starts the corresponding interrupt service function.
In the interrupt triggering mode, an interrupt mechanism needs to be implemented by a hardware module.
The platform simulation interrupt mode is realized based on software platform simulation, the interrupt source 10 is simulated through a communication mechanism, the interrupt vector table on the hardware module is simulated through the file handle set 20, and the interrupt service function on the hardware module is simulated through the thread function 30.
In the platform simulation interrupt mode, an interrupt mechanism can be realized without a hardware module.
Referring to fig. 2, fig. 2 is a flowchart of a data communication method applied to the embedded system according to an embodiment of the present application, where the method includes:
101. and receiving a first interrupt request sent by the first interrupt source.
The interrupt source includes a plurality of interrupt sources, and the request task corresponding to each interrupt source may be different, where the interrupt source is a cause of an interrupt or a source that sends an interrupt request signal.
In the embodiment of the application, an interrupt source on a hardware module is simulated through an IPC communication mechanism, wherein the IPC communication mechanism comprises a message, a pipeline and the like.
In an embodiment of the present application, the interrupt request is received by the file handle set, and when the first interrupt source sends a first interrupt request, the first interrupt request is received by the file handle set.
102. And creating a first file handle according to the first interrupt request.
After receiving an interrupt request, creating a file handle corresponding to the interrupt request according to the interrupt request, and realizing subsequent interrupt through the file handle.
And after the file handle set receives the first interrupt request, creating a corresponding first file handle, and realizing subsequent interrupt through the first file handle.
103. And reading the first file handle.
After creating a file handle, the file handle is read by occluding opening the created file handle.
Accordingly, after the first file handle corresponding to the first interrupt request is created, the first interrupt request is responded to by reading the first file handle.
104. The first thread function operates to execute a first interrupt transaction corresponding to the first interrupt request.
The first thread function corresponds to the first interrupt request sent by the first interrupt source, and the first thread function is operated, that is, a first interrupt event corresponding to the first interrupt request is executed, so as to realize interrupt.
The data communication method of the embodiment of the application is applied to the embedded system, the system comprises a plurality of interrupt sources, thread functions and a file handle set, wherein the file handle set is used for creating a file handle, the plurality of interrupt sources at least comprise a first interrupt source and a second interrupt source, the plurality of thread functions at least comprise a first thread function corresponding to the first interrupt source and a second thread function corresponding to the second interrupt source, when an interrupt request sent by one interrupt source is received, the file handle is created according to the interrupt request, the file handle is opened through blocking, the file handle is read, the corresponding thread function is enabled to run, and the corresponding interrupt is executed, so that the purpose of interruption is achieved.
Referring to fig. 3, fig. 3 is another flowchart of a data communication method according to an embodiment of the present application, before the step 101 is executed, the method further includes:
105. and carrying out interrupt source class division on the plurality of interrupt sources according to the interrupt types.
The interrupt source includes a plurality of types, for example, the interrupt source includes: external device request interrupts, fault forced interrupts, real time clock request interrupts, and program voluntary interrupts, among others.
The external device requests an interrupt, and generally, the external device sends an interrupt request requiring service after completing its own operation.
The computer or some other equipment is usually provided with a device for automatically detecting faults, such as operation overflow, power failure or other alarm signals, and when the faults occur, an interrupt request is sent.
The real-time clock interrupt, when timing detection and control are met in control, can control time intervals through a clock circuit, and can send an interrupt request when timing is needed, or can send an interrupt request when detection is needed.
The program is voluntarily interrupted, an interrupt caused by a special instruction, or an interrupt caused by a hardware circuit, when a user debugs the program, the program is voluntarily interrupted to check an intermediate result or to find a checking means adopted by an error, such as a breakpoint interrupt, a single step interrupt, and the like.
106. And carrying out priority classification on the plurality of interrupt sources according to the processing item corresponding to each interrupt source.
The processing items corresponding to the interrupt request of each interrupt source may be the same or different, and for the system, the processing items of the interrupt sources are also classified into mild, severe and urgent, and the priority levels of a plurality of interrupt sources may be classified according to the processing items through system customization, and the priority levels may be classified into emergency processing, general processing and the like.
After the plurality of interrupt sources are classified into categories and prioritized, each interrupt source should include corresponding category information and priority information, which is convenient for the interrupt work of the subsequent system.
Optionally, after the interrupt source classes are classified according to the interrupt types, the number of interrupt requests of each interrupt source class is counted within a preset time period, the interrupt source classes are ranked according to the number of interrupt requests, and the priority classes are classified according to the ranking of the sequence numbers.
After the interrupt source categories are divided, the interrupt request times of each interrupt source category are counted in a certain time period, so that the interrupt request conditions of the interrupt source categories can be known, and a plurality of interrupt source categories are divided into emergency processing, general emergency processing or common processing according to the sequence number arrangement.
Optionally, after counting the number of times of interrupt requests of each interrupt source type within a preset time, determining whether the number of times of interrupt requests of each interrupt source type is greater than a preset number of times of requests, if so, suspending receiving the interrupt requests of the interrupt source type, and if not, continuing to receive the interrupt requests of the interrupt source type.
And setting preset request times in the system, and performing corresponding action on each interrupt source type through data comparison, or performing priority classification on a plurality of interrupt source types through data comparison.
For example, the preset number of requests is set to 10 and 20, when the number of interrupt requests of a certain type of interrupt source in a preset time period is greater than 20, the system suspends the interrupt requests of the interrupt source of the type, and may set to suspend the interrupt requests of the interrupt source of the type for a certain time period, and resume receiving the interrupt requests of the interrupt source of the type after suspending for a certain time period.
For example, the preset number of requests is set to 10 and 20, and when the number of interrupt requests of a certain interrupt source category in a preset time period is between 10 and 20, the system continues to receive interrupt requests of the interrupt source of the category.
The data communication method is applied to the embedded system, the system comprises a plurality of interrupt sources, thread functions and a file handle set, wherein the file handle set is used for creating file handles, the plurality of interrupt sources comprise first interrupt sources, and the plurality of thread functions comprise first thread functions corresponding to the first interrupt sources.
Referring to fig. 4, fig. 4 is a flowchart of a data communication method according to an embodiment of the present application, and after the step 101 is executed, the method further includes:
1011. and judging whether the second thread function is operated currently or not.
The interrupt request in the system is received at irregular time, and an interrupt task may be already running while other interrupt requests are received, so that after the first interrupt request sent by the first interrupt source is received, whether a situation that a second thread function is running exists is judged first.
If the determination result is that there is no currently running second thread function, step 1012 is executed, and if the determination result is that there is no currently running second thread function, step 102 is executed.
1012. Reading the second class information of the second interrupt source corresponding to the second thread function and the first class information of the first interrupt source.
When the second thread function which is currently running is judged to exist, the system is executing the second interrupt event of the second interrupt source, but the priority level of each interrupt source may be different, namely the urgency level of each interrupt request, or the interrupt sequence is different because the category of each interrupt source is different.
Since the interrupt sources are classified into interrupt source categories according to types in advance, and each interrupt source corresponds to a corresponding interrupt source category, after the first interrupt request is received and a second thread function which is running exists, category information corresponding to the two interrupt sources is read.
1013. And judging whether the first interrupt source and the second interrupt source are in the same category or not according to the first category information and the second category information.
Because the interrupt sources are divided into interrupt source categories according to types in advance, each interrupt source corresponds to a corresponding interrupt source category, and whether the interrupt sources are the same category can be judged by reading the category information corresponding to the two interrupt sources.
If the two are judged to be the same category, go to step 1014, otherwise go to step 1015, and go to step 102 after step 1015 is finished.
1014. And continuing to run the second thread function.
When the first interrupt source and the second interrupt source belong to the same category, it indicates that the priority levels of the first interrupt source and the second interrupt source may be the same, so that the second thread function continues to be run, and the second interrupt event of the second interrupt source is completed.
1015. And interrupting the running of the second thread function.
And when the first interrupt source and the second interrupt source do not belong to the same category, interrupting the second thread function corresponding to the second interrupt source, creating a first file handle corresponding to the first interrupt source, completing the execution of the first interrupt event of the first interrupt source, and continuing to execute the second interrupt event of the second interrupt source.
Optionally, after receiving a first interrupt request sent by the first interrupt source, determining whether the second thread function is currently operated, if not, creating the first file handle according to the first interrupt request, if so, reading the second priority information of the second interrupt source corresponding to the second thread function and the first priority information of the first interrupt source, determining whether the priority of the first interrupt source is greater than the priority of the second interrupt source according to the first priority information and the second priority information, if not, continuing to operate the second thread function, if so, interrupting the operation of the second thread function, and creating the first file handle according to the first interrupt request.
Since the interrupt sources are divided into priority levels in advance, each interrupt source 6 corresponds to a corresponding priority level, when the first interrupt request is received and a running second thread function exists, the thread functions of the interrupt sources with high priority levels are run by comparing the priority level information of the two interrupt sources, and after the running is finished, the thread functions which are interrupted before are continuously run.
Optionally, the plurality of interrupt sources at least includes a first interrupt source, a second interrupt source, and a third interrupt source, the plurality of thread functions at least includes a first thread function, a second thread function, and a third thread function, the first thread function corresponds to a first interrupt request issued by the first interrupt source, the second thread function corresponds to a second interrupt request issued by the second interrupt source, and the third thread function corresponds to a third interrupt request issued by the third interrupt source.
For example, when the system is running the second thread function of the second interrupt source, receives the first interrupt request of the first interrupt source, determines that the priority of the first interrupt source is higher than that of the second interrupt source according to the priority information, the system suspends running the second thread function, creates the first file handle and runs the first thread function, receives a third interrupt request sent by a third interrupt source during running the first thread function, determines the priority of the third interrupt source and the first interrupt source, continues running the first thread function if the priority of the third interrupt source is lower than that of the first interrupt source, compares the priority of the third interrupt source and the priority of the second interrupt source after running the first thread function, if the priority of the third interrupt source is higher than that of the second interrupt source, the third file handle is created first, the third thread function is operated, and the second thread function interrupted before is operated after the third thread function is operated.
Optionally, after reading the second priority information of the second interrupt source corresponding to the second thread function and the first priority information of the first interrupt source, judging whether the priority of the first interrupt source is greater than the priority of the second interrupt source or not according to the first priority information and the second priority information, if so, continuing to operate the second thread function, and if so, continuing to operate the second thread function, and creating the first file handle according to the first interrupt request, interrupting the running of the second thread function if the priority of the first interrupt source is greater than that of the second interrupt source, and creating the first file handle according to the first interrupt request.
In the embodiment of the present application, interrupt sources with the same priority may be set to be processed in parallel, and interrupt sources with different priorities may be processed in sequence according to the priority level.
Optionally, after the first thread function is operated, when the operation of the first thread function is finished, whether a second thread function for interrupting the operation exists is determined, if yes, the second thread function is continuously operated, and if not, the embedded system finishes the interruption operation.
The data communication method is applied to the embedded system, the system comprises a plurality of interrupt sources, thread functions and a file handle set, wherein the file handle set is used for creating file handles, the plurality of interrupt sources comprise first interrupt sources, and the plurality of thread functions comprise first thread functions corresponding to the first interrupt sources.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a data communication software platform according to an embodiment of the present disclosure, where the software platform is used to execute the data communication method and is applied to an embedded system, the embedded system includes a plurality of interrupt sources and thread functions, the plurality of interrupt sources includes a first interrupt source, the plurality of thread functions includes a first thread function, and the first thread function corresponds to the first interrupt source, and the software platform includes:
an interrupt request receiving unit, configured to receive a first interrupt request sent by the first interrupt source, where the interrupt request receiving unit is further configured to receive interrupt requests sent by other interrupt sources.
And the file handle creating unit is used for creating a first file handle according to the first interrupt request, and the file handle unit is also used for creating corresponding file handles according to other interrupt requests.
And the file handle reading unit is used for reading the first file handle and is also used for reading other file handles.
And the function running unit is used for running the first thread function and executing a first interrupt event corresponding to the first interrupt request, and is also used for running thread functions of other interrupt sources.
And the class dividing unit is used for classifying the interrupt sources of the interrupt source movement according to the interrupt types.
And the priority level dividing unit is used for performing priority level division on the plurality of interrupt sources according to the processing items corresponding to each interrupt source.
Optionally, the data communication software platform according to the embodiment of the present application further includes units with other functions, which are not described herein again.
The data communication software platform of the embodiment of the application is combined with the embedded type and communication mechanism to simulate the interrupt service, and the file handle is created and read, so that the thread function of the corresponding interrupt source runs, the corresponding interrupt item is executed, the interrupt mechanism is realized, the hardware module is not needed, and the production cost brought by the hardware module is reduced.
The data communication method and the device thereof provided by the embodiment of the present application are introduced in detail, and a specific example is applied in the description to explain the principle and the implementation of the present application, and the description of the embodiment is only used to help understanding the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (10)
1. A data communication method is applied to an embedded system, the embedded system comprises a plurality of interrupt sources and thread functions, the interrupt sources comprise first interrupt sources, the thread functions comprise first thread functions, and the first thread functions correspond to the first interrupt sources, the method comprises the following steps:
receiving a first interrupt request sent by the first interrupt source;
creating a first file handle according to the first interrupt request;
reading the first file handle;
the first thread function operates to execute a first interrupt transaction corresponding to the first interrupt request.
2. The data communication method according to claim 1, wherein the plurality of interrupt sources further includes a second interrupt source, the plurality of thread functions further includes a second thread function, the second thread function corresponds to the second interrupt source, and before the receiving of the first interrupt request sent by the first interrupt source, the method further includes:
carrying out interrupt source class division on a plurality of interrupt sources according to interrupt types;
carrying out priority classification on a plurality of interrupt sources according to the processing items corresponding to each interrupt source;
each interrupt source comprises category information and priority level information, the first interrupt source comprises first category information and first priority level information, and the second interrupt source comprises second category information and second priority level information.
3. The data communication method according to claim 2, wherein after said classifying the interrupt sources according to the interrupt types, the method further comprises:
counting the interruption request times of each interruption source type in a preset time period;
sequence number arrangement is carried out on a plurality of interrupt source types according to the interrupt request times;
and carrying out priority classification on the classes of the plurality of interrupt sources according to the sequence number arrangement.
4. The data communication method according to claim 3, wherein after counting the number of interrupt requests of each interrupt source category within the preset time, the method further comprises:
judging whether the interruption request times of each interruption source type are larger than preset request times or not;
if yes, suspending receiving the interrupt request of the interrupt source type;
if not, continuing to receive the interrupt request of the interrupt source type.
5. The data communication method according to claim 2, wherein after said receiving the first interrupt request sent by the first interrupt source, the method further comprises:
judging whether the second thread function is operated currently or not;
if not, creating the first file handle according to the first interrupt request;
if yes, reading the second type information of the second interrupt source corresponding to the second thread function and the first type information of the first interrupt source;
judging whether the first interrupt source and the second interrupt source are in the same category or not according to the first category information and the second category information;
if yes, continuing to operate the second thread function;
if not, interrupting the running of the second thread function;
and creating the first file handle according to the first interrupt request.
6. The data communication method according to claim 2, wherein after said receiving the first interrupt request sent by the first interrupt source, the method further comprises:
judging whether the second thread function is operated currently or not;
if not, creating the first file handle according to the first interrupt request;
if yes, reading the second priority level information of the second interrupt source corresponding to the second thread function and the first priority level information of the first interrupt source;
judging whether the priority of the first interrupt source is greater than the priority of the second interrupt source according to the first priority information and the second priority information;
if not; continuing to run the second thread function;
if so, interrupting the operation of the second thread function;
and creating the first file handle according to the first interrupt request.
7. The data communication method according to claim 6, wherein after the reading of the second priority information of the second interrupt source corresponding to the second thread function and the first priority information of the first interrupt source, the method further comprises:
judging whether the priority of the first interrupt source is greater than the priority of the second interrupt source according to the first priority information and the second priority information;
if the priority of the first interrupt source is smaller than that of the second interrupt source, continuing to run the second thread function;
if the priority of the first interrupt source is the same as that of the second interrupt source, continuing to run the second thread function, and creating the first file handle according to the first interrupt request;
and if the priority of the first interrupt source is greater than that of the second interrupt source, interrupting the running of the second thread function, and creating the first file handle according to the first interrupt request.
8. The data communication method of claim 2, wherein after said executing the first thread function, the method further comprises:
when the first thread function finishes running, judging whether a second thread function which interrupts running exists or not;
if yes, continuing to operate the second thread function;
if not, the embedded system finishes the interrupt work.
9. A data communication software platform for performing the data communication method according to any one of claims 1 to 8, applied to an embedded system, wherein the embedded system includes a plurality of interrupt sources and thread functions, the plurality of interrupt sources includes a first interrupt source, the plurality of thread functions includes a first thread function, and the first thread function corresponds to the first interrupt source, the software platform comprising:
an interrupt request receiving unit, configured to receive a first interrupt request sent by the first interrupt source;
a file handle creating unit configured to create a first file handle according to the first interrupt request;
a file handle reading unit for reading the first file handle;
and a function execution unit, configured to execute the first thread function and execute a first interrupt transaction corresponding to the first interrupt request.
10. The data communication software platform according to claim 9, wherein said plurality of interrupt sources further includes a second interrupt source, said plurality of threading functions further includes a second threading function, said second threading function corresponding to said second interrupt source, said software platform further comprising:
the class dividing unit is used for carrying out interrupt source class division on the plurality of interrupt sources according to the interrupt types;
and the priority classification unit is used for performing priority classification on the plurality of interrupt sources according to the processing items corresponding to each interrupt source.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111145472.2A CN113835863B (en) | 2021-09-28 | 2021-09-28 | Data communication method and software platform thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111145472.2A CN113835863B (en) | 2021-09-28 | 2021-09-28 | Data communication method and software platform thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113835863A true CN113835863A (en) | 2021-12-24 |
CN113835863B CN113835863B (en) | 2024-07-09 |
Family
ID=78967168
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111145472.2A Active CN113835863B (en) | 2021-09-28 | 2021-09-28 | Data communication method and software platform thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113835863B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114253694A (en) * | 2022-02-25 | 2022-03-29 | 杭州雄迈集成电路技术股份有限公司 | Asynchronous processing method and device based on neural network accelerator |
CN114490004A (en) * | 2022-04-14 | 2022-05-13 | 广州万协通信息技术有限公司 | Interrupt processing method and device based on CSKY architecture |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH04211839A (en) * | 1990-02-20 | 1992-08-03 | Nec Corp | Interruption controller |
US5193187A (en) * | 1989-12-29 | 1993-03-09 | Supercomputer Systems Limited Partnership | Fast interrupt mechanism for interrupting processors in parallel in a multiprocessor system wherein processors are assigned process ID numbers |
CN1667573A (en) * | 2004-10-26 | 2005-09-14 | 中国科学技术大学 | Operating system based on server / execution stream model |
CN1963767A (en) * | 2006-11-27 | 2007-05-16 | 浙江大学 | Method to realize interruption of component embedded operation system |
CN103294544A (en) * | 2012-02-27 | 2013-09-11 | 展讯通信(上海)有限公司 | Embedded system as well as interrupt processing method and device thereof |
US20180349304A1 (en) * | 2017-06-04 | 2018-12-06 | International Business Machines Corporation | Techniques for handling interrupts in a processing unit using interrupt request queues |
-
2021
- 2021-09-28 CN CN202111145472.2A patent/CN113835863B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5193187A (en) * | 1989-12-29 | 1993-03-09 | Supercomputer Systems Limited Partnership | Fast interrupt mechanism for interrupting processors in parallel in a multiprocessor system wherein processors are assigned process ID numbers |
JPH04211839A (en) * | 1990-02-20 | 1992-08-03 | Nec Corp | Interruption controller |
CN1667573A (en) * | 2004-10-26 | 2005-09-14 | 中国科学技术大学 | Operating system based on server / execution stream model |
CN1963767A (en) * | 2006-11-27 | 2007-05-16 | 浙江大学 | Method to realize interruption of component embedded operation system |
CN103294544A (en) * | 2012-02-27 | 2013-09-11 | 展讯通信(上海)有限公司 | Embedded system as well as interrupt processing method and device thereof |
US20180349304A1 (en) * | 2017-06-04 | 2018-12-06 | International Business Machines Corporation | Techniques for handling interrupts in a processing unit using interrupt request queues |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114253694A (en) * | 2022-02-25 | 2022-03-29 | 杭州雄迈集成电路技术股份有限公司 | Asynchronous processing method and device based on neural network accelerator |
CN114490004A (en) * | 2022-04-14 | 2022-05-13 | 广州万协通信息技术有限公司 | Interrupt processing method and device based on CSKY architecture |
Also Published As
Publication number | Publication date |
---|---|
CN113835863B (en) | 2024-07-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113835863A (en) | Data communication method and software platform thereof | |
WO2020134634A1 (en) | Program debugging method, program debugging apparatus, terminal device, and storage medium | |
CN108287769B (en) | Information processing method and device | |
CN109144873B (en) | Linux kernel processing method and device | |
CN108804109B (en) | Industrial deployment and control method based on multi-path functional equivalent module redundancy arbitration | |
EP0902367A2 (en) | Data processing unit with debug capabilities | |
US6754851B2 (en) | Debugging kernel system | |
CN113821257B (en) | Method and device for inquiring information of processor kernel call stack | |
CN109933549B (en) | Interrupt controller suitable for RISC-V treater | |
KR930009633B1 (en) | Interrupt handling method for a data processor | |
US6463492B1 (en) | Technique to automatically notify an operating system level application of a system management event | |
Hills | Structured interrupts | |
CN1997966A (en) | Method and system for concurrent excution of mutiple kernels | |
CN114425787A (en) | Control method and device for robot automatic test, server and storage medium | |
CN114415559A (en) | Equipment linkage method and device | |
CN110837399A (en) | Method and device for managing streaming computing application program and computing equipment | |
CN111786856A (en) | Browser environment checking method and device | |
CN112559136A (en) | Method and device for interrupting delivery of computer | |
JPH07311686A (en) | Computer system and method for generation and processing of system management interrupt in it | |
JPH0922369A (en) | Illicit operation detection method in kernel of multi-tasking system | |
CN110955507B (en) | Method for multitask access to same IIC bus based on vxWorks system | |
CN112673354A (en) | System state detection method, system state device and terminal equipment | |
US6745375B1 (en) | System and method for reducing computational overhead in a sequenced functional verification system | |
CN115599563B (en) | Parallel I/O control method, device and equipment for serial I/O access | |
CN118151518A (en) | Instruction processing method of motion control system and motion control system |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |