CN113190496A - Kernel communication method, device, chip, electronic equipment and storage medium - Google Patents

Kernel communication method, device, chip, electronic equipment and storage medium Download PDF

Info

Publication number
CN113190496A
CN113190496A CN202110444208.2A CN202110444208A CN113190496A CN 113190496 A CN113190496 A CN 113190496A CN 202110444208 A CN202110444208 A CN 202110444208A CN 113190496 A CN113190496 A CN 113190496A
Authority
CN
China
Prior art keywords
interface
resource
kernel
state
access
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
Application number
CN202110444208.2A
Other languages
Chinese (zh)
Other versions
CN113190496B (en
Inventor
汪超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Goodix Technology Co Ltd
Original Assignee
Shenzhen Goodix Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Goodix Technology Co Ltd filed Critical Shenzhen Goodix Technology Co Ltd
Priority to CN202110444208.2A priority Critical patent/CN113190496B/en
Publication of CN113190496A publication Critical patent/CN113190496A/en
Application granted granted Critical
Publication of CN113190496B publication Critical patent/CN113190496B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/17Interprocessor communication using an input/output type connection, e.g. channel, I/O port

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention relates to the technical field of communication, and discloses a kernel communication method, a kernel communication device, a kernel communication chip, electronic equipment and a storage medium. The method is applied to a kernel communication device comprising at least one group of interfaces, wherein different interfaces in each group of interfaces are used for being connected with different kernels sharing the same resource, and each interface is connected with at most one kernel, and the method comprises the following steps: receiving a resource access request sent by a kernel connected with a first interface through the first interface; the first interface is one interface in at least one group of interfaces; when the resource states of the second interface are determined to be resource idle, sending a notice representing permission of access to a kernel connected with the first interface through the first interface; the second interface refers to each interface except the first interface in the group to which the first interface belongs; and updating the resource state of the first interface into the resource access. The embodiment of the application can enable the multi-core communication to react more timely and faster, is beneficial to improving the overall performance of the multi-core system and has expandability.

Description

Kernel communication method, device, chip, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of communication, in particular to a kernel communication method, a kernel communication device, a chip, electronic equipment and a storage medium.
Background
The multi-core technology can enable a computer to process tasks in parallel and improve the processing performance of the computer, and is widely applied to various electronic devices at present. When each kernel in the multi-core system accesses resources, the problem of resource competition exists; i.e., shared resources of multiple cores, can only be accessed by one core at a time.
At present, the resource lock technology is generally adopted to solve the problem of resource competition. Specifically, the kernel sends an access request carrying a target resource identifier and an identity identifier of the kernel to a module responsible for coordinating resource allocation; the module responsible for coordinating resource allocation firstly identifies a target resource identifier and the identity identifier of the kernel from the access request, and then queries whether a resource lock corresponding to the target resource is locked or not according to the target resource identifier; if the resource lock corresponding to the target resource is not locked, the module responsible for coordinating resource allocation gives the resource lock to the kernel according to the identity of the kernel to represent that the kernel has the access right of the target resource, and records that the resource lock corresponding to the target resource is locked; and the module responsible for coordinating resource allocation can not record that the resource lock corresponding to the target resource is not locked again until the kernel returns the resource lock to the module responsible for coordinating resource allocation, so that a plurality of kernels are prevented from having the access right of the target resource at the same time.
Disclosure of Invention
Embodiments of the present invention provide a kernel communication method, apparatus, chip, electronic device, and storage medium, so that a plurality of kernel communications are more timely and faster in response, which is beneficial to improving the overall performance of a multi-core system, and has expandability.
In order to solve the foregoing technical problem, in a first aspect, an embodiment of the present invention provides a kernel communication method, which is applied to a kernel communication device including at least one group of interfaces, where each group of interfaces includes at least two interfaces, different interfaces in each group of interfaces are used for being connected to different kernels sharing a same resource, and each interface is connected to at most one kernel; the method comprises the following steps: receiving a resource access request sent by a kernel connected with a first interface through the first interface; wherein the first interface is one interface of the at least one group of interfaces; when the resource states of the second interface are determined to be resource idle, sending a notice representing permission of access to a kernel connected with the first interface through the first interface; the second interface refers to each interface except the first interface in a group to which the first interface belongs; and updating the resource state of the first interface into resource access.
In a second aspect, an embodiment of the present invention provides a kernel communication device, including: the system comprises a control module and at least one group of interfaces; each group of interfaces comprises at least two interfaces, and one end of each interface is connected with the control module; the other end of each interface in each group of interfaces is used for being connected with a kernel sharing the same resource, and each interface is connected with at most one kernel; the control module is used for receiving a resource access request sent by a kernel connected with a first interface through the first interface, sending a notice representing permission to access to the kernel connected with the first interface through the first interface when the resource state of a second interface is determined to be resource idle, and updating the resource state of the first interface into resource access; wherein the first interface is one interface of the at least one group of interfaces; the second interface refers to each interface except the first interface in the group to which the first interface belongs.
In a third aspect, an embodiment of the present invention provides a chip, including: the kernel communication device is included.
In a fourth aspect, an embodiment of the present invention provides an electronic device, including: the kernel communication device or the chip.
In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the kernel communication method.
In the embodiment of the invention, different interfaces in each group of interfaces are used for being connected with different kernels sharing the same resource, namely, the kernels sharing the same resource are associated by connecting the same group of interfaces, so that the interfaces based on communication can distinguish whether the kernels sharing the same resource are the kernels sharing the same resource or not, and whether the resources are allowed to be accessed or not is respectively determined based on the resource state of the interfaces recorded inside. Compared with the prior art that interaction between each kernel and a kernel communication device needs to realize resource sharing based on information such as resource identification, kernel identification and the like, in the technical scheme of the application, on one hand, each kernel does not need to carry information such as resource identification, kernel identification and the like in a resource access request sent to the kernel communication device, so that the information quantity carried by the resource access request is less, and the sending process is quicker; on the other hand, the kernel communication device does not need to identify information such as the resource identifier, the kernel identifier and the like from the resource access request and then perform subsequent access authorization, so that the amount of information to be processed is small, and the processing speed is high. Therefore, the technical scheme of the application has the advantages of more timely response and higher speed in the resource sharing communication of two or more than two kernels, and is beneficial to improving the overall performance of the multi-core system comprising the two or more than two kernels. Moreover, because the number of interfaces in each group can be expanded, if the number of kernels sharing the same resource is increased, the interfaces can be flexibly added; because the group number of the interfaces can be expanded, if new resources needing to be shared appear, the interfaces can be flexibly expanded; and thus has scalability.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
FIG. 1 is a flow diagram of a kernel communication method in one embodiment of the present application;
FIG. 2 is a schematic diagram of a kernel communication device according to an embodiment of the present application;
FIG. 3 is a flow diagram of a kernel communication method in one embodiment of the present application;
FIG. 4 is a flow diagram of a kernel communication method in one embodiment of the present application;
FIG. 5 is a flow diagram of a kernel communication method in one embodiment of the present application;
FIG. 6 is a flow diagram of a kernel communication method in one embodiment of the present application;
FIG. 7 is a flow diagram of a kernel communication method in one embodiment of the present application;
FIG. 8 is a flow diagram of a kernel communication method in one embodiment of the present application;
FIG. 9 is a flow diagram of a kernel communication method in one embodiment of the present application;
FIG. 10 is a flow diagram of a kernel communication method in one embodiment of the present application;
FIG. 11A is a diagram illustrating the connection of a kernel to kernel communication device according to one embodiment of the present application;
FIG. 11B is a flowchart illustrating interaction between a kernel and a kernel communicator in an embodiment of the present application;
FIG. 12 is a flow diagram of a kernel communication method in one embodiment of the present application;
FIG. 13 is a flow diagram of a kernel communication method in one embodiment of the present application;
FIG. 14 is a flow diagram of a kernel communication method in one embodiment of the present application;
FIG. 15 is a diagram of a kernel communication device according to an embodiment of the present application.
DETAILED DESCRIPTION OF EMBODIMENT (S) OF INVENTION
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in detail with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that in various embodiments of the invention, numerous technical details are set forth in order to provide a better understanding of the present application. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present invention, and the embodiments may be mutually incorporated and referred to without contradiction.
The embodiment of the invention provides a kernel communication method, which is applied to a kernel communication device comprising at least one group of interfaces, wherein each group of interfaces comprises at least two interfaces, different interfaces in each group of interfaces are used for being connected with different kernels sharing the same resource, and each interface is connected with at most one kernel. In one example, as shown in FIG. 1, the method includes the following steps.
Step 101, receiving a resource access request sent by a kernel connected with a first interface through the first interface. The first interface is one of at least one group of interfaces.
Step 102, determining whether the resource states of the second interface are all in resource idle; the second interface refers to each interface except the first interface in the group to which the first interface belongs. If the determination result in the step 102 is yes, go to step 103; and if the judgment result in the step 102 is negative, ending the process.
And 103, sending a notice which represents that the access is allowed to the kernel connected with the first interface through the first interface.
And 104, updating the resource state of the first interface into the resource access.
In this embodiment, the kernel communication device includes at least one set of interfaces, and each set of interfaces includes at least two interfaces; different interfaces in each group of interfaces are used for being connected with different cores sharing the same resource (such as a memory resource), and each group of interfaces corresponds to one shared resource; each interface is connected with at most one kernel, which means that each kernel connected to the kernel communication device has an interface uniquely corresponding to the kernel, and communication between different kernels and the kernel communication device is realized through different interfaces. The first interface is an interface which receives a resource access request in the kernel communication device; the second interface refers to each interface except the first interface in the group to which the first interface belongs.
In this embodiment, after receiving, by the kernel communication device through the first interface, the resource access request sent by the kernel connected to the first interface, when it is determined that the resource states of the second interface are all resource idle, that is, when the determination result in step 102 is yes, a notification representing that access is allowed is sent to the kernel connected to the first interface through the first interface. The second interface refers to each interface except the first interface in the group to which the first interface belongs, so that the resource states of the second interfaces are all resource idle, that is, the resource states of each interface except the first interface in the group to which the first interface belongs are all resource idle, which indicates that a kernel connected to an interface in the group to which the first interface belongs does not have the access right of the resource at present, that is, the group to which the first interface belongs corresponds to the resource in the idle state. Thus, a kernel connected to the first interface may be allowed to access the resource. Meanwhile, after the kernel connected with the first interface is allowed to access the resource, the resource state of the first interface is updated to be in the resource access, so that the problem of resource use conflict is avoided. When it is determined that the resource states of the second interfaces are not all resource idle, that is, under the condition that the determination result in step 102 is no, it indicates that the group where the first interface is located corresponds to the resource that is already occupied by one of the interfaces, except the first interface, in the group where the first interface belongs to, and at this time, one resource state exists in the second interfaces, that is, the second interface in resource access; in this case, the control module 1 may not respond to the resource access request, and directly end the process.
In this embodiment, the interfaces in each group of interfaces are used for connecting with the cores sharing the same resource, that is, the cores sharing the same resource are associated by connecting with the same group of interfaces, so that the interfaces based on communication can distinguish whether the cores share the same resource, and distinguish whether to allow access to the resource based on the resource state of the interfaces recorded inside. Compared with the prior art that interaction between each kernel and a kernel communication device needs to realize resource sharing based on information such as resource identification, kernel identification and the like, in the technical scheme of the application, on one hand, each kernel does not need to carry information such as resource identification, kernel identification and the like in a resource access request sent to the kernel communication device, so that the information quantity carried by the resource access request is less, and the sending process is quicker; on the other hand, the kernel communication device does not need to identify information such as the resource identifier, the kernel identifier and the like from the resource access request and then perform subsequent access authorization, so that the amount of information to be processed is small, and the processing speed is high. Therefore, the technical scheme of the application has the advantages of more timely response and higher speed in the resource sharing communication of two or more than two kernels, and is beneficial to improving the overall performance of the multi-core system comprising the two or more than two kernels.
The application also provides a kernel communication device. The kernel communication device can be applied to electronic equipment comprising a multi-core system; wherein, the multi-core system refers to a system comprising two or more than two cores; the electronic device may be a mobile phone, a personal computer, a server, etc. In one embodiment, as shown in fig. 2, the kernel communication device includes a control module 1 and at least one set of interfaces, each set of interfaces includes at least two interfaces; the control module 1 is configured to execute the kernel communication method. Two sets of interfaces are illustrated in the figure, the first set of interfaces comprising two interfaces, respectively: interface 2-1, interface 2-2; the second group of interfaces comprises three interfaces, which are respectively: interface 3-1, interface 3-2, interface 3-3. The number of groups of interfaces and the number of interfaces in each group can be set according to actual needs, and the figure is only an exemplary illustration.
The interfaces in each group of interfaces are used for connecting with the cores sharing the same resource, that is, each group of interfaces corresponds to one resource to be shared. For example, two cores, coreA and coreB, share one resource z1, and the connection modes of coreA and coreB can be the following two. Firstly, connecting the core A and the core B with interfaces in a first group of interfaces, namely connecting the core A with an interface 2-1 and connecting the core B with an interface 2-2; the first set of interfaces now corresponds to resource z 1. Secondly, connecting the core A and the core B with interfaces in a second group of interfaces, namely correspondingly connecting the core A and the core B with any two of the interfaces 3-1, 3-2 and 3-3, for example, connecting the core A with the interface 3-1, connecting the core B with the interface 3-2, and connecting the interface 3-3 in the second group of interfaces with no kernel; the second set of interfaces now corresponds to resource z 1. Subsequently if there are additional cores coreC that also need the shared resource z1, then a connection may be made to interface 3-3 in the second set of interfaces; but interface 3-3 in the second set of interfaces may not be connected to a kernel that shares resources other than resource z 1.
If, within the electronic device, there is a core E, core F shared resource z2 in addition to the core A, core B shared resource z1, then the core A, core B may be connected into one set of interfaces and the core E, core F may be connected into another set of interfaces. For example, coreA and coreB are respectively and correspondingly connected with an interface 2-1 and an interface 2-2 in the first group of interfaces; the core E and the core F are correspondingly connected with the interface 3-1 and the interface 3-2 in the second group of interfaces respectively.
If, within the electronic device, there is a coreA, coreE shared resource z3 in addition to the coreA, coreB shared resource z1, then coreA, coreB may be connected into one set of interfaces and coreA, coreE may be connected into another set of interfaces; for example, coreA and coreB are respectively and correspondingly connected with an interface 2-1 and an interface 2-2 in the first group of interfaces; the core A and the core E are correspondingly connected with the interface 3-1 and the interface 3-2 in the second group of interfaces respectively.
If the core a and core b share the resource z2 in addition to the resource z1, another core communication device is needed to realize the sharing of the resource z2 by core a and core b. That is, a plurality of kernel communication devices may be included in the electronic apparatus.
As can be seen from the above, the multiple communication methods and kernel communication apparatus of the present application have higher flexibility, extensibility, and portability, and are mainly embodied in:
(1) the number of interfaces included in a group of interfaces can be flexibly set according to the number of cores sharing the same resource; even if more interfaces are contained in the preset group of interfaces and the number of cores sharing the same resource is small, normal work is not influenced completely; and if the number of the cores sharing the same resource is increased, the cores can be flexibly added;
(2) the number of the interface groups can be flexibly set according to actual requirements; even if the number of the preset interface groups is more than the current actual requirement, the normal work is not influenced at all; and if new resources needing to be shared appear, the flexible expansion can be realized;
(3) the number of kernel communication devices in the electronic equipment can be set according to the number of resources shared by the same multiple kernels; each kernel communication device works independently and does not influence each other, so the expansibility is better; in addition, the kernel communication device does not need to be operated based on a special platform of the electronic equipment, so that the portability is better.
After the control module 1 is connected with each kernel, the interfaces connected with the kernels can be identified, and the resource states of the interfaces are recorded; the resource state of an interface refers to the state that a resource presents to a kernel connected with the interface. When the kernel communication device is in a reset state, the kernels do not start to work, and at the moment, the resource states of the interfaces connected with the kernels are set to be in resource idle, wherein the resource idle means that the resource is not occupied by any kernel. After a certain kernel obtains the access right of the resource, the control module 1 will update the resource state of the interface connected with the kernel into the resource access. The resource state of each interface recorded by the control module 1 can be queried by the kernel connected with each interface. When receiving a status query request sent by a kernel through an interface, the control module 1 may send a resource status corresponding to the interface to the kernel through the interface, that is, send a status presented by a resource to the kernel. The control module 1 may also send the resource state of the interface to the kernel connected to the interface through the interface at regular time, or send the resource state of the interface to the kernel connected to the interface when detecting that the resource state of the interface changes.
In one embodiment, the kernel issues a resource access request when it queries that a resource can be accessed. As shown in fig. 3, before step 101, step 100 is further included: receiving a state query request sent by a kernel connected with a first interface through the first interface, and sending a resource state of the first interface to the kernel connected with the first interface through the first interface; and the resource state of the first interface is in resource idle.
In this embodiment, before sending the resource access request, the kernel connected to the first interface sends a status query request to query whether the resource is accessible; and after receiving that the resource state of the first interface is in the resource idle state, sending a resource access request to the control module 1. Therefore, the resource access request sent this time can be ensured to be acknowledged as much as possible, namely, the resource can be allowed to be accessed with high probability; it is possible to avoid an additional processing burden caused by blindly transmitting a resource access request (access right of a resource cannot be obtained even if the resource access request is transmitted).
In one embodiment, each interface includes a first pin, a second pin, and a third pin. The status query request and the resource status of the first interface in step 100 are transmitted through the first pin; the resource access request in step 101 is transmitted through the second pin; the notification in step 103 is transmitted via the third pin.
In the embodiment, different information is sent through different pins, so that the set number of numerical values or character strings for distinguishing different information can be reduced, the processing process of different information is simpler and quicker, and the reaction speed is improved.
By way of example, the information that may be transmitted includes a status query request, a resource status of the first interface, a resource access request, and a notification characterizing the allowed access. It is possible for the control module 1 to receive two types of information from the kernel: a status query request and a resource access request; there are also two types of information that may be sent to the kernel: resource status of the first interface, notification.
If the information which is possibly transmitted is transmitted through the same pin, at least two values are set for the information received by the control module 1, for example, the status query request is represented by the number 01, and the resource access request is represented by the number 02; in this way, when the control module 1 recognizes the received information, it is necessary to distinguish two kinds of values to determine which information is. If the status query request and the resource access request are transmitted at different pins, the control module 1 does not need to identify the received information, and can know which information is received according to the pin receiving the information as long as receiving one information. Therefore, different information is distinguished by different pins, and for different information received by the control module 1, the identification process can be simplified, the operation is simpler and quicker, and the response speed is improved.
If the information which is possibly transmitted is transmitted through the same pin, then, for the information sent by the control module 1, because the resource states of the interfaces are different, that is, the resource states are at least two, the type of the notification is at least one (that is, the above-mentioned notification which represents the permission of access), at least three values are set; if the resource state is represented by the number 03 in the resource idle state, the resource state is represented by the number 04 in the resource busy state; the notification characterizing the allowed access is denoted with the number 05. Wherein, the resource is busy means that the resource is being accessed by other kernels. In this way, when the control module 1 is to transmit the resource status of the interface to the kernel, it is necessary to select one of the three values to indicate which information is to be transmitted. If the resource status of the interface, the notification, is transmitted at different pins, the control module 1 only needs to select one of the two values to indicate which information. When the control module 1 is to send a notification to the kernel, as in this example, in the case of only one type of notification, it may not be necessary to select one from a plurality of values, as long as one information (e.g., high level) is sent out. Therefore, different information is distinguished by different pins, and for the control module 1 to send different information, the sending process can be simpler and faster, and the response speed is improved.
In one embodiment, as shown in fig. 4, further comprising step 105: and updating the resource state of the second interface to be the resource busy. The execution sequence of step 105 is in sequence with that of step 104.
In a plurality of cores sharing the same resource, one core is granted the access right of the resource, and the state of the resource presented to the core is in resource access (namely, the resource state of the first interface is in resource access), and the state of the resource presented to the other cores is in resource busy (namely, the resource state of the second interface is in resource busy). Therefore, while the kernel has the access right of the resource, the resource states inquired by other kernels are all resource busy, and for other kernels, the resource can be clearly known to be occupied by other kernels, so that a resource access request cannot be initiated. Then, the operation mode of the kernel may also be set as required, and the resource access request may still be initiated when knowing that the resource is already occupied by other cores, for example, when some preset emergency occurs, the resource access request may be initiated regardless of whether the resource is already occupied by other cores.
In this embodiment, when the kernel connected to the first interface is granted access right, not only the resource state of the first interface is updated, but also the resource states of the interfaces other than the first interface in the group in which the first interface is located are updated at the same time; therefore, each kernel can timely acquire the state of the resource corresponding to the kernel by inquiring the state of the interface connected with the kernel.
In one embodiment, as shown in FIG. 5, the method comprises steps 106, in addition to steps 101-105: and after receiving a notice which is used for representing resource release and sent by a kernel connected with the first interface through the first interface, updating the resource state of the first interface and the resource state of the second interface into resource idle.
In this embodiment, the kernel actively notifies the control module 1 after releasing the resource, so that the control module 1 can update the state of the resource to each kernel, that is, update the resource state of the interface, in time, so that each kernel can query the resource state of the latest interface, and thus know whether the resource is idle in time.
In one embodiment, as shown in FIG. 6, the method comprises steps 107 in addition to steps 101-106: and sending a notice representing the resource release to a kernel connected with the second interface through the second interface.
In this embodiment, compared to the example in fig. 5, after receiving the notification indicating the resource release sent by the kernel connected to the first interface through the first interface, the control module 1 also sends the notification indicating the resource release to another kernel sharing the same resource with the kernel. And sending a notification representing resource release to a kernel connected with the second interface through the second interface, wherein the execution sequence of the two actions is not limited.
For example, coreA and coreB share the same memory resource, coreA currently has the access right of the memory resource, and coreB also wants to access the memory resource, but does not respond after sending a resource access request; in this example, the interface connected to coreB corresponds to the first interface, and the interface connected to coreA corresponds to the second interface. The coreB will periodically query the resource status of the interface to which the coreB is connected, e.g., once in 10 ms. Assuming that the resource state of the interface queried by the core B at this time is resource busy (indicating that the core A does not release the memory resource); when the current query of the coreB is just finished, the coreA releases the memory resource and informs the control module 1; although the control module 1 updates the resource states of the interfaces connected with the core a and the core b in time to be resource idle, the core b needs to wait until the next query to know that the resources are idle and send out the resource access request again. In this embodiment, the control module 1 notifies the core b immediately after receiving the notification indicating the resource release sent by the core a; then coreB can immediately know that the memory resource is released, at this time, coreB can immediately send out a resource access request; or, the state query request is sent first, and then the resource access request is sent after the resource state of the interface is confirmed to be in the resource idle state.
Therefore, in this embodiment, when a resource is occupied by a certain kernel, for other kernels that also want to access the resource, the information that the resource is released can be known more timely, and the access right of the resource can be obtained more timely.
In one embodiment, as shown in FIG. 7, the following steps are included.
Step 701, receiving n resource access requests sent by n kernels respectively connected with n first interfaces through the n first interfaces; wherein n first interfaces belong to the same group and n is an integer greater than or equal to 2;
step 702, determining whether the resource states of the second interface are all in resource idle; the second interface refers to each interface except the first interface in the group to which the first interface belongs. If the determination result in the step 702 is negative, go to step 703; if the determination result in step 702 is yes, the process is terminated.
Step 703, according to the preset interface priority order, selecting the first interface with the highest priority from the n first interfaces.
Step 704, sending a notification characterizing the allowed access to the kernel connected to the first interface with the highest priority through the first interface with the highest priority.
Step 705, the resource status of the first interface is updated to be in the resource access.
In this embodiment, the control module 1 presets priorities for each interface of the same group; when a plurality of cores sharing the same resource are connected to a plurality of interfaces in the same group, the priority order of the plurality of cores can be kept consistent with the priority order of the plurality of interfaces in the same group; that is, a core of a first priority (i.e., highest priority) is connected to an interface of a first priority, a core of a second priority (i.e., highest priority) is connected to an interface of a second priority, and a core of a third priority (i.e., highest priority) is connected to an interface of a third priority, … … so that the interface priority order can represent the core priority order. When the control module 1 receives resource access requests sent by a plurality of cores sharing the same resource at the same time, the access right of the resource can be given to the core connected with the interface with the highest priority according to the preset interface priority order. For resource access requests received from interfaces with non-highest priority, the control module 1 may not respond; when it is determined in step 502 that the second interface exists, the process is directly ended. In addition, in other embodiments, when the control module 1 receives resource access requests sent by multiple cores sharing the same resource at the same time, the control module 1 may also select one interface optionally, and give the access right of the resource to the core connected to the selected interface.
In the embodiment, the priority of the access rights of different kernels is judged by presetting the priority of the interface; it is simple and quick.
In the above embodiment, when the control module 1 determines that the second interface exists in the second interface and the resource status is in the resource access, it indicates that the access right of the resource corresponding to the group in which the first interface is located has been given to the kernel connected to the second interface, and at this time, the control module 1 may directly end the process without responding to the resource access request. However, in the embodiment shown in fig. 8, when the control module 1 determines that the second interface exists in the second interface and the resource status is the second interface in the resource access, the control module 1 may notify the kernel connected to the first interface.
Specifically, in the embodiment of fig. 8, in addition to steps 101 to 104, the method further includes step 108: and sending a notice representing resource competition to a kernel connected with the second interface with the resource state being the resource access through the second interface with the resource state being the resource access.
In this embodiment, among multiple cores sharing the same resource, for example, cores core a and core b share the same resource, when core a has a resource access right, if control module 1 receives a resource access request sent by core b, it notifies core a that another core also wants to access the resource, that is, there is a resource contention currently. That is, the interface connected to coreB corresponds to the first interface, and the interface connected to coreA corresponds to the second interface whose resource status is in resource access; after receiving the resource access request sent by the core b through the first interface, the control module 1 sends a notification representing resource contention to the core a through the second interface whose resource state is in resource access. This makes it possible for coreA to know about the situation and, depending on the actual situation, to mention the release of the resource. For example, coreA is not urgently needed for the resource, and can improve the release of the resource; then access to the resource can be obtained as early as possible for coreB. The technical scheme of the embodiment is beneficial to reasonable allocation among a plurality of kernels of resources.
In one embodiment, as shown in fig. 9, in addition to steps 101 to 104 and 108, the following steps are also included.
Step 109, adding a mark of waiting to acquire the resource in the resource state of the first interface.
Step 110, adding a waiting to release resource mark in the resource state of the second interface in which the resource state is the resource access.
Wherein, the execution sequence of step 108, step 109 and step 110 is not limited; and in this embodiment, step 109 and step 110 may be performed alternatively or separately.
In this embodiment, when there is a contention for resources by other cores, the state of the resources presented to each core is also adjusted accordingly. Specifically, for the kernel having the resource access right, a waiting-to-release resource flag is added in the resource state, that is, the kernel still has the access right of the resource but has other kernels competing for the resource, and the resource state can be regarded as a waiting-to-release resource; thus, the kernel can know that other kernels want to access the resource by inquiring the resource state of the interface. For a kernel that does not have the access right of the resource but wants to access the resource, a wait-to-acquire resource flag is added in the resource state, that is, the kernel cannot currently have the access right of the resource but is competing for the resource, and the resource state can be regarded as a wait-to-acquire resource.
In the embodiment, the types of the resource states of the interface are set more abundantly, so that the states of the resources presented to the kernels can be recorded in more detail, and the kernels can know different states of the resources in time.
In one embodiment, as shown in FIG. 10, in addition to comprising steps 101-104, 109-110; the method also comprises the following steps.
Step 111, when receiving a notice representing resource release sent by a kernel connected with a second interface with the resource state being in the resource access through the second interface with the resource state being in the resource access, sending a notice representing permission to access to the kernel connected with the first interface through the first interface;
step 112, updating the resource state of the second interface with the resource state being in the resource access to be in the resource busy state, and updating the resource state of the first interface with the resource access.
In this embodiment, when control module 1 receives a notification indicating the release of a resource, it immediately gives access to the resource to the cores that are competing for the resource, and updates the state that the resource presents to the cores. Specifically, the control module 1 may query the resource state of each interface, and if the resource state of a certain interface is queried and a wait-to-acquire resource flag is added, it is considered that the kernel connected to the interface wants to access the resource; inquiring the first interface; a notification characterizing the permission to access is then sent through the first interface to a kernel connected to the first interface. Or, a list waiting for acquiring the resource is pre-stored in the control module 1, and after receiving the resource access request of the first interface, although it is determined that the resource state of the second interface is in the resource access, the first interface may be added to the list; thus, when receiving the notice representing the resource release, the first interface waiting for acquiring the resource is inquired.
According to the technical scheme of the embodiment, when the resource is released, the access right of the resource can be directly given to the kernel needing to access the resource, and the processing speed is higher during resource allocation.
For example, please refer to fig. 11A and fig. 11B simultaneously, memory resource memory is shared by core a and core B, and core a and core B are connected to interface 2-1 and interface 2-2 in the first set of interfaces, respectively. The resource states of the interfaces can be divided into five types: free while resource is idle, occ while resource is busy, rfg while waiting to acquire resource, rff while waiting to release resource, grant while resource access. In the figure, state, request and event indicate transmission paths of three different pins in one interface. The specific process of the kernel communication method is as follows.
The Reset state of the coreA and coreB sides in the figure includes the following procedures. When the kernel communication state is in the reset state, the resource state of the interface 2-1 and the resource state of the interface 2-2 are both free.
After the coreA sends the state query request through the interface 2-1, the control module 1 sends the resource state of the interface 2-1 to be free through the interface 2-1. Wherein, the state inquiry request and the resource state of the interface are transmitted through the transmission channel state.
The Request read/write data on the coreA side in the figure refers to: when the resource state received by the coreA from the interface 2-1 is free, the resource access request is sent through the interface 2-1. Wherein the resource access request is transmitted through the transmission path request. In this example, interface 2-1 connected to coreA corresponds to a first interface, and interface 2-2 connected to coreB corresponds to a second interface.
The get grant at the coreA side in the graph refers to: after receiving the resource access request through the interface 2-1, the control module 1 queries the resource state of the interface 2-2 belonging to the same group as the interface 2-1, and finds that the resource state of the interface 2-2 is free, that is, it means that the core b does not occupy the memory resource. Thus, control module 1 sends a notification to coreA over interface 2-1 that the token allows access. Wherein the notification characterizing the allowed access is transmitted via the transmission path event.
The control module 1 updates the resource status of the interface 2-1 from free to grant and the resource status of the interface 2-2 from free to occ.
The Read/write data on the coreA side in the figure refers to: after coreA receives the notification that the token allows access, it can read/write the memory.
The Request read/write data on the coreB side in the figure refers to: control module 1 receives the resource access request through interface 2-2, i.e. coreB sends the resource access request through interface 2-2. The control module 1 inquires that the resource status of the interface 2-1 is grant, so that no response is made to the interface 2-2 receiving the resource access request.
The control module 1 updates the resource status of the interface 2-1 from grant to rff and the resource status of the interface 2-2 from occ to rgf.
Release of the resource on the coreA side in the figure means: the control module 1 receives a notification sent by coreA, which characterizes the release of resources.
The get grant at the coreB side in the graph refers to: when the control module 1 inquires that the resource state of the interface 2-2 is rgf, indicating that the coreB is waiting for acquiring the resource; thus, control module 1 sends a notification to coreB over interface 2-2 that characterizes the permission to access.
The control module 1 updates the resource status of the interface 2-1 from rff to occ and updates the resource status of the interface 2-2 from rgf to grant.
The Read/write data on the coreB side in the figure refers to: after coreB receives the notification that the token allows access, it can read/write the memory.
Release of the resource on the coreB side in the figure means: the control module 1 receives a notification sent by coreB, which characterizes the release of resources.
Notify event in the figure means: after Request read/write data at the coreB side in the graph occurs, the control module 1 can send a notification representing resource competition to the coreA through the interface 2-1 to inform the coreA that other kernels need to use the memory; after Release of the resource on the coreA side occurs, the control module 1 may send a notification indicating resource Release to coreB through the interface 2-2 to notify that the coreB may request to access the resource.
The above embodiments may be combined arbitrarily, as follows is another plural combinable manner.
In one embodiment, as shown in FIG. 12, the following steps are included.
Step 100: and receiving a state query request sent by a kernel connected with the first interface through the first interface, and sending the resource state of the first interface to the kernel connected with the first interface through the first interface.
Step 101, receiving a resource access request sent by a kernel connected with a first interface through the first interface. The first interface is one of at least one group of interfaces.
Step 102, determining whether the resource states of the second interface are all in resource idle. The second interface refers to each interface except the first interface in the group to which the first interface belongs. If the determination result in the step 102 is yes, go to step 103; if the determination result in step 102 is negative, go to step 108.
And 103, sending a notice which represents that the access is allowed to the kernel connected with the first interface through the first interface.
And 104, updating the resource state of the first interface into the resource access.
Step 108: and sending a notice representing resource competition to a kernel connected with the second interface with the resource state being the resource access through the second interface with the resource state being the resource access.
In one embodiment, as shown in FIG. 13, the method includes the following steps.
Step 100: and receiving a state query request sent by a kernel connected with the first interface through the first interface, and sending the resource state of the first interface to the kernel connected with the first interface through the first interface.
Step 101, receiving a resource access request sent by a kernel connected with a first interface through the first interface. The first interface is one of at least one group of interfaces.
Step 102, determining whether the resource states of the second interface are all in resource idle. The second interface refers to each interface except the first interface in the group to which the first interface belongs. If the determination result in the step 102 is yes, go to step 103; if the determination result in step 102 is negative, go to step 108.
And 103, sending a notice which represents that the access is allowed to the kernel connected with the first interface through the first interface.
And 104, updating the resource state of the first interface into the resource access.
Step 108: and sending a notice representing resource competition to a kernel connected with the second interface with the resource state being the resource access through the second interface with the resource state being the resource access.
Step 109, adding a mark of waiting to acquire the resource in the resource state of the first interface.
Step 110, adding a waiting to release resource mark in the resource state of the second interface in which the resource state is in the resource access.
In one embodiment, as shown in FIG. 14, the method includes the following steps.
Step 100: and receiving a state query request sent by a kernel connected with the first interface through the first interface, and sending the resource state of the first interface to the kernel connected with the first interface through the first interface.
Step 101, receiving a resource access request sent by a kernel connected with a first interface through the first interface. The first interface is one of at least one group of interfaces.
Step 102, determining whether the resource state of the second interface is in resource idle. The second interface refers to each interface except the first interface in the group to which the first interface belongs. If the determination result in the step 102 is yes, go to step 103; if the determination result in step 102 is negative, go to step 108.
And 103, sending a notice which represents that the access is allowed to the kernel connected with the first interface through the first interface.
And 104, updating the resource state of the first interface into the resource access.
Step 108: and sending a notice representing resource competition to a kernel connected with the second interface with the resource state being the resource access through the second interface with the resource state being the resource access.
Step 109, adding a mark of waiting to acquire the resource in the resource state of the first interface.
Step 110, adding a waiting to release resource mark in the resource state of the second interface in which the resource state is in the resource access.
Step 111, when receiving a notice representing resource release sent by a kernel connected with a second interface with a resource state being in resource access through the second interface with the resource state being in resource access, sending a notice representing permission to access to the kernel connected with the first interface through the first interface;
step 112, updating the resource state of the second interface with the resource state being in the resource access to be in the resource busy state, and updating the resource state of the first interface with the resource access.
The steps in the above embodiments are divided for clarity, and the implementation may be combined into one step or split into some steps, and the steps are divided into multiple steps, so long as the steps include the same logical relationship, which is within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
An embodiment of the present application further provides a kernel communication device, as shown in fig. 15, which is similar to the kernel communication device shown in fig. 2, except that the control module 1 includes: a connected state processing unit 11 and a logic control unit 12.
The logic control unit 12 is configured to receive, through the first interface, a resource access request sent by a kernel connected to the first interface, and send, through the first interface, a notification indicating that access is allowed to the kernel connected to the first interface when it is determined that the resource states of the second interface are all resource idle.
The logic control unit 12 is further configured to send, after sending the notification indicating that the access is allowed to the core connected to the first interface through the first interface, first indication information indicating that the access to the resource by the core connected to the first interface is allowed to the state processing unit.
The state processing unit 11 is configured to update the resource state of the first interface to be in resource access and update the resource state of the second interface to be in resource busy after receiving the first indication information.
Fig. 15 only schematically illustrates the location of the interface, but the specific functions of the interface and the connection manner between the interface and the kernel are the same as those in fig. 2, and are not described again here. In fig. 15, core a and core b may be cores already connected to the core communication device, and core x and core y may be cores that can be extended as needed, and the extended cores may be connected to the spare interfaces of the core communication device in a one-to-one correspondence. FIG. 15 is a diagram showing in detail the connection relationship between core A and core B via interfaces and the state processing unit 11 and the logic control unit 12, and schematically showing the connection relationship between core X and core Y via interfaces and the state processing unit 11 and the logic control unit 12; it is emphasized that each core interfaces with the state processing unit 11 and the logic control unit 12 in the same way.
Wherein, the meanings of state, request and event are the same as those in fig. 11A, that is, the transmission paths of three different pins in one interface are represented; and the state inquiry request and the resource state of the interface are transmitted through a transmission channel state, the resource access request is transmitted through a transmission channel request, and the notice representing the permission of access is transmitted through a transmission channel event. The state, request and event paths are independent, that is, different pins in an interface independently form a path.
As shown in the figure, the transmission path request can not only transmit the resource access request to the logic control unit 12, but also transmit the resource access request to the status processing unit 11 synchronously. In this case, after receiving the first indication information indicating that the kernel connected to the first interface is allowed to access the resource, the state processing unit 11 may further determine whether the resource access request transmitted by the first interface is received, and after determining that the resource access request transmitted by the first interface is received, update the resource state of the first interface to be in resource access, and update the resource state of the second interface to be in resource busy. That is, the condition for the state processing unit 11 to update the resource state of the interface is more strict, and it is possible to avoid the erroneous control due to the occurrence of a problem in the logic control unit 12 as much as possible.
In one embodiment, the logic control unit 12 is further configured to, after receiving, through the first interface, a resource release notification sent by a core connected to the first interface, send, through the second interface, a notification representing the resource release to the core connected to the second interface.
In an embodiment, the logic control unit 12 is further configured to send, after receiving, through the first interface, a resource release notification sent by a core connected to the first interface, third indication information indicating that the core connected to the first interface has released resources to the state processing unit. The state processing unit is further configured to update both the resource state of the first interface and the resource state of the second interface to be in resource idle after receiving the third indication information.
In an embodiment, the logic control unit 12 is further configured to, when it is determined that the second interface in the resource access exists in the second interface, send a notification representing resource contention to a core connected to the second interface in the resource access through the second interface in the resource access in the resource state.
In one embodiment, the logic control unit 12 is further configured to send, to the state processing unit, second indication information representing that the first interface requests to access the resource when it is determined that the resource state is the second interface in the resource access in the second interface; the state processing unit is further used for executing at least one of the following steps after receiving the second indication information: adding a mark of waiting to acquire a resource in the resource state of the first interface; and adding a waiting resource release mark in the resource state of the second interface in which the resource state is the resource access.
In an embodiment, the logic control unit 12 is further configured to, when receiving, through the second interface whose resource status is in the resource access, a notification indicating that the resource is released, where the notification is sent by the core connected to the second interface whose resource status is in the resource access, send, through the first interface, a notification indicating that access is allowed to the core connected to the first interface, and send the first indication information to the status processing unit; the state processing unit is further configured to update the resource state of the second interface, which is in the resource access, to be a resource busy state and update the resource state of the first interface to be the resource access after receiving the first indication information.
In an embodiment, when the logic control unit 12 receives n resource access requests received through n first interfaces and sent by n cores respectively connected to the n first interfaces, and when it is determined that the resource states of the second interfaces are all resource idle, according to a preset interface priority order, a first interface with the highest priority is selected from the n first interfaces, and a notification representing permission of access is sent to the core connected to the first interface with the highest priority through the first interface with the highest priority; wherein n is an integer greater than or equal to 2.
The state processing unit 11 and the logic control unit 12 may be software program modules or hardware circuit modules. Those skilled in the art can design hardware circuits according to the functions implemented by the state processing unit 11 and the logic control unit 12, respectively. The kernel communication device in the present application is an execution main body of the kernel communication method, and therefore, technical means related in the embodiment of the kernel communication device and technical means related in the embodiment of the kernel communication method correspond to each other; and will not be described in detail herein.
The embodiment of the application also provides a chip, which comprises the kernel communication device; please refer to fig. 2; i.e. it is understood that the core communication device is encapsulated within a chip.
Wherein, the chip comprises an input/output pin; the interface in the kernel communication device can be understood as being formed by input and output pins of a chip, each interface comprises at least one input and output pin, and each input and output pin belongs to at most one interface. As mentioned in the above embodiments, each interface may include a first pin, a second pin and a third pin, and in this case, it can be understood that the first pin, the second pin and the third pin are three input/output pins of the chip.
For example, assuming that the chip includes 20 i/o pins and is numbered sequentially, each interface in the core communication device may include a first pin, a second pin, and a third pin; at this time, the interface 2-1 in fig. 2 may be formed by the input/output pins 1 to 3, the interface 2-2 may be formed by the input/output pins 4 to 6, the interface 3-1 may be formed by the input/output pins 7 to 9, the interface 3-2 may be formed by the input/output pins 10 to 12, and the interface 3-3 may be formed by the input/output pins 13 to 15.
The embodiment of the application also provides electronic equipment which comprises the kernel communication device or the chip. The electronic device is an electronic device including a multi-core system, and the electronic device may be, for example, a mobile phone, a personal computer, a server, or the like.
The electronic equipment comprises the kernel communication device, and the kernel communication device is directly arranged on a circuit board in the electronic equipment in a hardware circuit module mode. The electronic device comprises the chip, and it is understood that the core communication device is packaged in the chip and is arranged on the circuit board in the form of the chip.
An embodiment of the present invention further provides a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific embodiments for practicing the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (25)

1. A kernel communication method is applied to a kernel communication device comprising at least one group of interfaces, each group of interfaces comprises at least two interfaces, different interfaces in each group of interfaces are used for being connected with different kernels sharing the same resource, and each interface is connected with at most one kernel; the method comprises the following steps:
receiving a resource access request sent by a kernel connected with a first interface through the first interface; wherein the first interface is one interface of the at least one group of interfaces;
when the resource states of all the interfaces except the first interface in the group to which the first interface belongs are determined to be resource idle, sending a notice representing permission of access to a kernel connected with the first interface through the first interface;
and updating the resource state of the first interface into resource access.
2. The kernel communication method according to claim 1, wherein after sending the notification indicating that the access is allowed to the kernel connected to the first interface through the first interface, the method further comprises:
and updating the resource state of the second interface to be resource busy.
3. The kernel communication method according to claim 2, further comprising:
and after receiving a notice which is used for representing resource release and is sent by a kernel connected with the first interface through the first interface, updating the resource state of the first interface and the resource state of the second interface into resource idle.
4. The kernel communication method according to claim 3, further comprising, after receiving, via the first interface, a notification indicating resource release sent by a kernel connected to the first interface, the following:
and sending the notice for representing the resource release to a kernel connected with the second interface through the second interface.
5. The kernel communication method according to claim 1, wherein before receiving, via the first interface, the resource access request sent by the kernel connected to the first interface, the method further comprises:
receiving a state query request sent by a kernel connected with the first interface through the first interface, and sending a resource state of the first interface to the kernel connected with the first interface through the first interface; wherein the resource state of the first interface is in resource idle.
6. The core communication method according to claim 5, wherein the first interface comprises a first pin, a second pin, and a third pin;
the state query request and the resource state of the first interface are transmitted through the first pin; the resource access request is transmitted through the second pin; the notification is transmitted through the third pin.
7. The kernel communication method according to claim 1, wherein after receiving, via the first interface, the resource access request sent by the kernel connected to the first interface, the method further comprises:
and when determining that the interfaces with the resource states being in resource access exist in the interfaces except the first interface in the group to which the first interface belongs, sending a notification representing resource competition to a kernel connected with a second interface with the resource states being in resource access through the interfaces with the resource states being in resource access.
8. The kernel communication method according to any one of claims 1 to 7, further comprising, after receiving, via the first interface, a resource access request sent by a kernel connected to the first interface:
when it is determined that a second interface in which the resource status is in the resource access exists in the second interface, at least one of the following steps is performed:
adding a mark of waiting to acquire the resource in the resource state of the first interface;
and adding a mark for waiting to release the resource in the resource state of the second interface in the resource access.
9. The kernel communication method of claim 8, further comprising:
when a notice of the release of the representation resource sent by a kernel connected with a second interface with the resource state being in the resource access is received through the second interface with the resource state being in the resource access, sending a notice of the representation permission access to the kernel connected with the first interface through the first interface;
and updating the resource state of the second interface with the resource state being in resource access to be in resource busy, and updating the resource state of the first interface with the resource access.
10. The kernel communication method of claim 1,
the receiving, by the first interface, the resource access request sent by the kernel connected to the first interface specifically includes: receiving n resource access requests sent by n kernels respectively connected with the n first interfaces through the n first interfaces; wherein n first interfaces belong to the same group and n is an integer greater than or equal to 2;
the sending, to a kernel connected to the first interface, a notification indicating that access is allowed through the first interface includes:
according to a preset interface priority order, selecting a first interface with the highest priority from the n first interfaces;
and sending a notice representing that the access is allowed to the kernel connected with the first interface with the highest priority through the first interface with the highest priority.
11. A kernel communication device, comprising: the system comprises a control module and at least one group of interfaces;
each group of interfaces comprises at least two interfaces, and one end of each interface is connected with the control module; the other end of each interface in each group of interfaces is used for being connected with a kernel sharing the same resource, and each interface is connected with at most one kernel;
the control module is used for receiving a resource access request sent by a kernel connected with a first interface through the first interface, sending a notice representing permission of access to the kernel connected with the first interface through the first interface when the resource state of a second interface is determined to be resource idle, and updating the resource state of the first interface into resource access;
wherein the first interface is one interface of the at least one group of interfaces; the second interface refers to each interface except the first interface in the group to which the first interface belongs.
12. The kernel communication device of claim 11, wherein the control module is further configured to update the resource status of the second interface to be resource busy when a notification indicating that access is allowed is sent to the kernel connected to the first interface through the first interface.
13. The kernel communication device of claim 12, wherein the control module comprises: the state processing unit and the logic control unit are connected; each interface is connected with the logic control unit;
the logic control unit is used for receiving a resource access request sent by a kernel connected with the first interface through the first interface, and sending a notice representing permission of access to the kernel connected with the first interface through the first interface when the resource state of the second interface is determined to be resource idle;
the logic control unit is further configured to send, to the state processing unit, first indication information representing that the kernel connected to the first interface is allowed to access the resource after sending, through the first interface, a notification representing that access is allowed to the kernel connected to the first interface;
and the state processing unit is used for updating the resource state of the first interface into resource access and updating the resource state of the second interface into resource busy after receiving the first indication information.
14. The apparatus according to claim 13, wherein the logic control unit is further configured to send, via the second interface, a notification indicating the resource release to the core connected to the second interface after receiving, via the first interface, a resource release notification sent by the core connected to the first interface.
15. The kernel communication device according to claim 13 or 14, wherein the logic control unit is further configured to send, to the state processing unit, third indication information indicating that the kernel connected to the first interface has released the resource, after receiving, through the first interface, a resource release notification sent by the kernel connected to the first interface;
the state processing unit is further configured to update both the resource state of the first interface and the resource state of the second interface to be in resource idle after receiving the third indication information.
16. A kernel communication device as claimed in claim 13, wherein each said interface is further connected to said state processing unit;
the state processing unit is used for sending the resource state of the interface to a kernel connected with the interface through the interface.
17. The kernel communication device of claim 16, wherein each of the interfaces comprises a first pin, a second pin, and a third pin; the first pin is used for transmitting the resource state of the interface, the second pin is used for transmitting the resource access request, and the third pin is used for transmitting the notification.
18. The apparatus according to claim 13, wherein the logic control unit is further configured to send, when it is determined that the second interface in the resource access has the resource status, a notification indicating resource contention to a core connected to the second interface in the resource access through the second interface in the resource access having the resource status.
19. The kernel communication device according to claim 13 or 18, wherein the logic control unit is further configured to send, to the state processing unit, second indication information indicating that the first interface requests to access the resource, when it is determined that the resource state is a second interface in resource access in the second interface;
the state processing unit is further configured to, after receiving the second indication information, perform at least one of the following steps:
adding a mark of waiting to acquire the resource in the resource state of the first interface;
and adding a mark for waiting to release the resource in the resource state of the second interface in the resource access.
20. The apparatus according to claim 19, wherein the logic control unit is further configured to, when receiving, through the second interface in which the resource status is in resource access, a notification indicating that a resource is released, where the notification is sent by a core connected to the second interface in which the resource status is in resource access, send, through the first interface, the notification indicating that access is allowed to the core connected to the first interface, and send the first indication information to the status processing unit;
the state processing unit is further configured to update the resource state of the second interface, which is in the resource access state, to be a resource busy state and update the resource state of the first interface to be the resource access state after receiving the first indication information.
21. The kernel communication device of claim 11,
when the control module receives n resource access requests sent by n kernels respectively connected with n first interfaces through the n first interfaces, and when the resource states of the second interfaces are determined to be all resource idle, a first interface with the highest priority is selected from the n first interfaces according to a preset interface priority order, and a notification representing permission of access is sent to the kernel connected with the first interface with the highest priority through the first interface with the highest priority; wherein n first interfaces belong to the same group and n is an integer greater than or equal to 2.
22. A chip, comprising: the kernel communication device of any one of claims 11 to 21.
23. An electronic device, comprising: the core communication device of claims 11 to 21, or the chip of claim 22.
24. The electronic device of claim 23, further comprising: and the plurality of kernels are electrically connected with the kernel communication device through the interfaces respectively.
25. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the kernel communication method according to any one of claims 1 to 10.
CN202110444208.2A 2021-04-23 2021-04-23 Kernel communication method, device, chip, electronic equipment and storage medium Active CN113190496B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110444208.2A CN113190496B (en) 2021-04-23 2021-04-23 Kernel communication method, device, chip, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110444208.2A CN113190496B (en) 2021-04-23 2021-04-23 Kernel communication method, device, chip, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113190496A true CN113190496A (en) 2021-07-30
CN113190496B CN113190496B (en) 2023-12-26

Family

ID=76978301

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110444208.2A Active CN113190496B (en) 2021-04-23 2021-04-23 Kernel communication method, device, chip, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113190496B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1811740A (en) * 2006-02-28 2006-08-02 重庆重邮信科股份有限公司 Method for achieving multiprocessor share peripheral circuit and its circuit
US20070266196A1 (en) * 2004-09-16 2007-11-15 Nec Corporation Information Processing Apparatus Having Multiple Processing Units Sharing Multiple Resources
US20080010643A1 (en) * 2006-07-07 2008-01-10 Nec Electronics Corporation Multiprocessor system and access right setting method in the multiprocessor system
CN104346317A (en) * 2013-07-23 2015-02-11 中兴通讯股份有限公司 Shared resource access method and device
WO2019212182A1 (en) * 2018-05-04 2019-11-07 Samsung Electronics Co., Ltd. Apparatus and method for managing a shareable resource in a multi-core processor
CN111597130A (en) * 2019-02-21 2020-08-28 意法半导体(格勒诺布尔2)公司 Method for arbitrating access to a shared memory and corresponding electronic device
WO2020220225A1 (en) * 2019-04-29 2020-11-05 华为技术有限公司 Resource acquisition method, related apparatus, and computer storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070266196A1 (en) * 2004-09-16 2007-11-15 Nec Corporation Information Processing Apparatus Having Multiple Processing Units Sharing Multiple Resources
CN1811740A (en) * 2006-02-28 2006-08-02 重庆重邮信科股份有限公司 Method for achieving multiprocessor share peripheral circuit and its circuit
US20080010643A1 (en) * 2006-07-07 2008-01-10 Nec Electronics Corporation Multiprocessor system and access right setting method in the multiprocessor system
CN104346317A (en) * 2013-07-23 2015-02-11 中兴通讯股份有限公司 Shared resource access method and device
WO2019212182A1 (en) * 2018-05-04 2019-11-07 Samsung Electronics Co., Ltd. Apparatus and method for managing a shareable resource in a multi-core processor
CN111597130A (en) * 2019-02-21 2020-08-28 意法半导体(格勒诺布尔2)公司 Method for arbitrating access to a shared memory and corresponding electronic device
WO2020220225A1 (en) * 2019-04-29 2020-11-05 华为技术有限公司 Resource acquisition method, related apparatus, and computer storage medium

Also Published As

Publication number Publication date
CN113190496B (en) 2023-12-26

Similar Documents

Publication Publication Date Title
CN108141471B (en) Method, device and equipment for compressing data
CN110971591B (en) Method and system for multi-process access to trusted application
JPH06301627A (en) System and method for access adjustment direct to access storage device
CN113709707B (en) Method and device for sidecar deployment in service grid, electronic equipment and storage medium
CN112882742A (en) Software updating method and related equipment
US11231964B2 (en) Computing device shared resource lock allocation
JP2003199136A (en) Load distribution system for base station controller
CN113190496A (en) Kernel communication method, device, chip, electronic equipment and storage medium
KR20170117326A (en) Direct memory access control device for at least one processing unit having a random access memory
CN111124964A (en) Communication control method and device for CPU and IIC bus
CN108234352B (en) Electronic control unit and data transmission method
CN112235204B (en) Data reporting method, system, electronic equipment and storage medium
CN108874560B (en) Method and communication device for communication
JP2022552150A (en) Data structures, memory means and devices
CN107844262B (en) Data caching and sending method and device
CN108959144B (en) Communication between field programmable gate arrays
CN116244099B (en) Method and device for communication of processes in embedded system, electronic equipment and storage medium
US20240177532A1 (en) Information processing device, information processing method, and storage medium storing information processing program
CN116684074B (en) Method and device for driving multi-core scheduling algorithm of hardware password module and electronic equipment
CN114546927B (en) Data transmission method, core, computer readable medium, and electronic device
CN112769640B (en) Process communication method, system, server and storage medium
CN113162990B (en) Message sending method, device, equipment and storage medium
CN111124987B (en) PCIE-based data transmission control system and method
US20240069888A1 (en) Vehicular software update system and method therefor
US20220334758A1 (en) Control circuit, information processing system, and control method

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