Multiprocessor system, switch and data processing method thereof

By introducing switches of management units and data switching units in a multiprocessor system, using management tables and priority adjustment mechanisms, the problem of multiprocessor shared memory access conflicts is solved, and system performance and data access efficiency are improved.

CN119046225AActive Publication Date: 2024-11-29SHANGHAI XINLIJI SEMICON CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411554936.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-04
Publication Date
2024-11-29
Estimated Expiration
2044-11-04

AI Technical Summary

Technical Problem

Multi-processor systems are prone to access conflicts when accessing shared memory, which affects data accuracy and system performance. The existing management unit cannot effectively manage access to shared memory by multiple processors.

Method used

A switch with a management unit is designed to manage the memory access operation of the processor through management tables and data exchange units, adjust the task pointer according to the priority of the memory access task, coordinate resource allocation, avoid conflicts, and change in memory state. Update the management table when it is updated.

Benefits of technology

It effectively solves the access conflict problem when multiple processors access shared memory at the same time, ensures the correctness and consistency of data, and improves system performance and data memory access efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119046225A_ABST
    Figure CN119046225A_ABST
Patent Text Reader

Abstract

The invention discloses a multiprocessor system, a switch and a data processing method thereof, a management unit of the system receives memory access task data sent by a processor connected with the management unit through a processor interface of the switch, and the management unit comprises a source processor and a target memory; inquiring whether the current state of the target memory is an idle state or a busy state; if the target memory is in the busy state, storing the memory access task data into a management table; adjusting a task pointer according to the priority information of each memory access task data in the management table; and in response to the condition that a target memory in the memory access task data pointed by the task pointer is converted into an idle state, executing a data memory access operation of a source processor in the memory access task data pointed by the task pointer on the target memory, and deleting the memory access task data from the management table. According to the method, access of multiple processors to the shared memory is managed, and the problem of access conflicts possibly occurring when the multiple processors access the shared memory at the same time is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of multi-processors, and in particular to a multi-processor system, a switch and a data processing method thereof. Background Art

[0002] In modern computer systems, multi-processor systems and shared memory are two important technical fields: a multi-processor system refers to a system containing multiple processors that can execute different tasks in parallel to improve system performance; shared memory refers to memory that multiple processors can share access to, which can reduce memory usage and improve data access efficiency.

[0003] Typically, a multiprocessor system uses a bus to exchange data between multiple processors. When multiple processors need to access shared memory, they can share data through a bus or a crossbar switch. At the same time, in order to ensure data consistency, a management unit is usually required to manage data access rights and order.

[0004] However, there are still some problems in practical applications: first, when multiple processors access shared memory at the same time, access conflicts may occur, which will affect the correctness and consistency of the data; second, the existing management units can usually only manage one processor's access to shared memory, but cannot manage multiple processors' access to shared memory at the same time, which will affect the performance of the system.

[0005] The disclosure of the above background technology content is only used to assist in understanding the concept and technical solution of the present application. It does not necessarily belong to the prior art of the present application, nor does it necessarily provide technical guidance. In the absence of clear evidence that the above content has been disclosed before the filing date of the present application, the above background technology should not be used to evaluate the novelty and creativity of the present application. Summary of the invention

[0006] The purpose of the present invention is to provide an improved switch, which serves as an intermediary between multiple processors and multiple shared memories, manages the access of multiple processors to the shared memories, and solves the access conflict problem that occurs when multiple processors access the same shared memory at the same time.

[0007] To achieve the above object, the technical solution adopted by the present invention is as follows: A multi-processor system with shared memory and switch comprises a switch, a plurality of processors and a plurality of memories, wherein the switch is configured with a management unit, a plurality of processor interfaces and a plurality of memory interfaces; The management unit includes a management table, and the management unit manages the memory access operations of each processor to the memory in the following manner: Receive memory access task data sent by the processor connected to the processor interface, wherein the memory access task data includes a source processor and a target memory; Inquiring whether the current state of the target memory is an idle state or a busy state; If the target memory is in a busy state, storing the memory access task data in the management table; Adjust the task pointer according to the priority information of each access task data in the management table; In response to the target memory in the memory access task data pointed to by the task pointer being converted to an idle state, the source processor in the memory access task data pointed to by the task pointer executes a data access operation on the target memory, and deletes this memory access task data from the management table.

[0008] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the priority information of each memory access task data is obtained by any one of the following methods: The memory access task data also includes a task type, the priority information is determined according to the task type, and the memory access task data and the priority information are stored in the management table; Alternatively, the management table is further configured with a priority item, the memory access task data further includes a task type, the management unit determines the priority information corresponding to the task type, and after storing the memory access task data in the management table, records the determined priority information into the priority item corresponding to the memory access task data; Alternatively, the memory access task data further includes priority information.

[0009] Further, based on any one of the technical solutions or a combination of multiple technical solutions described above, the switch is further configured with a data exchange unit, and the data memory access includes an operation of accessing data to the target memory and an operation of writing data to the target memory; The data access operation of the source processor on the target memory in the memory access task data pointed to by the task pointer includes: The data that the task requests to access from the target memory is sent to the source processor through the data exchange unit; and / or the data that the task requests to write is sent to the target memory through the data exchange unit.

[0010] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the management table is further configured with a data content size information item, and the memory access task data also includes the capacity value of the data requested by the task to be accessed from the target memory or the capacity value of the data requested to be written by the task; Before deleting the access task data from the management table, the method further includes: The source processor verifies whether the capacity value of the access data through the data exchange unit matches the capacity value in the memory access task data, or verifies whether the capacity value of the data written to the target memory through the data exchange unit matches the capacity value in the memory access task data; If there is no match, error information is fed back to the source processor.

[0011] Further, based on any one of the technical solutions or a combination of multiple technical solutions mentioned above, the data exchange unit is also configured to exchange data between different processors.

[0012] Furthermore, based on any one of the technical solutions or a combination of multiple technical solutions mentioned above, if it is found that the current state of the target memory in the memory access task data is an idle state, the memory access task data will not be stored in the management table, and the source processor in the memory access task data will execute the data access operation on the target memory.

[0013] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the current state of the target memory is queried in any one of the following ways: The management unit sends a query request to the target memory through a corresponding memory interface, and the target memory returns its own status information in response to the query request; Alternatively, the management unit further includes a memory state record table for recording the current state of each memory actively reported to the management unit when the state changes, and the management unit determines the current state of the target memory by querying the memory state record table; Alternatively, the memory interface is further configured to store the current state of the memory connected thereto, and the management unit determines the current state of the target memory by reading the memory interface connected to the target memory.

[0014] Furthermore, based on any one of the technical solutions or a combination of multiple technical solutions described above, after deleting this memory access task data from the management table, it is determined whether there are still tasks in the management table. If so, the task pointer is adjusted according to the priority information of the remaining memory access task data in the management table.

[0015] Furthermore, based on any one of the technical solutions or a combination of multiple technical solutions described above, after the source processor in the memory access task data pointed to by the task pointer executes the data access operation on the target memory, the accessed data is invalidated, and the message of the invalidation of the data is notified to other processors that also contain the data.

[0016] Further, based on any one of the technical solutions or a combination of multiple technical solutions mentioned above, the data exchange unit is a Crossbar structure with a switch matrix.

[0017] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the management unit adjusts the task pointer according to the priority of each memory access task data in the management table, including: In the management table, memory access task data corresponding to the same target memory are classified into the same category, and memory access task data corresponding to different target memories are classified into different categories; Assign task pointers to different types of memory access task data; Among the memory access task data of the same category, according to the priority information thereof, the task pointer is pointed to the memory access task data with the highest priority in the category.

[0018] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the data memory access operation of the source processor on the target memory in the memory access task data is performed in the following manner: When a memory is converted from a busy state to an idle state, the idle state information is actively reported to the management unit; The management unit queries the management table for a category corresponding to the memory, and if no category is found, the memory remains idle; If the category is found, the task pointer corresponding to the category and the memory access task data it points to are determined; The source processor in the memory access task data executes a data memory access operation on the target memory, and the target memory actively reports busy status information to the management unit.

[0019] According to another aspect of the present invention, the present invention provides a switch, comprising a management unit, a plurality of processor interfaces and a plurality of memory interfaces, wherein the processor interface is configured to connect to a processor outside the switch, and the memory interface is configured to connect to a memory outside the switch; The management unit includes a management table, and the management unit manages the memory access operations of each processor to the memory in the following manner: Receive memory access task data sent by the processor connected to the processor interface, wherein the memory access task data includes a source processor and a target memory; Inquiring whether the current state of the target memory is an idle state or a busy state; If the target memory is in a busy state, storing the memory access task data in the management table; Adjust the task pointer according to the priority information of each access task data in the management table; In response to the target memory in the memory access task data pointed to by the task pointer being converted to an idle state, the source processor in the memory access task data pointed to by the task pointer executes a data access operation on the target memory, and deletes this memory access task data from the management table.

[0020] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the priority information of each memory access task data is obtained by any one of the following methods: The memory access task data also includes a task type, the priority information is determined according to the task type, and the memory access task data and the priority information are stored in the management table; Alternatively, the management table is further configured with a priority item, the memory access task data further includes a task type, the management unit determines the priority information corresponding to the task type, and after storing the memory access task data in the management table, records the determined priority information into the priority item corresponding to the memory access task data; Alternatively, the memory access task data further includes priority information.

[0021] Further, based on any one of the technical solutions or a combination of multiple technical solutions described above, the switch is further configured with a data exchange unit, and the data memory access includes an operation of accessing data to the target memory and an operation of writing data to the target memory; The data access operation of the source processor on the target memory in the memory access task data pointed to by the task pointer includes: The data that the task requests to access from the target memory is sent to the source processor through the data exchange unit; and / or the data that the task requests to write is sent to the target memory through the data exchange unit.

[0022] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the management table is further configured with a data content size information item, and the memory access task data also includes the capacity value of the data requested by the task to be accessed from the target memory or the capacity value of the data requested to be written by the task; Before deleting the access task data from the management table, the method further includes: The source processor verifies whether the capacity value of the access data through the data exchange unit matches the capacity value in the memory access task data, or verifies whether the capacity value of the data written to the target memory through the data exchange unit matches the capacity value in the memory access task data; If there is no match, error information is fed back to the source processor.

[0023] Further, based on any one of the technical solutions or a combination of multiple technical solutions mentioned above, the data exchange unit is also configured to exchange data between different processors.

[0024] Furthermore, based on any one of the technical solutions or a combination of multiple technical solutions mentioned above, if it is found that the current state of the target memory in the memory access task data is an idle state, the memory access task data will not be stored in the management table, and the source processor in the memory access task data will execute the data access operation on the target memory.

[0025] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the current state of the target memory is queried in any one of the following ways: The management unit sends a query request to the target memory through a corresponding memory interface, and the target memory returns its own status information in response to the query request; Alternatively, the management unit further includes a memory state record table for recording the current state of each memory actively reported to the management unit when the state changes, and the management unit determines the current state of the target memory by querying the memory state record table; Alternatively, the memory interface is further configured to store the current state of the memory connected thereto, and the management unit determines the current state of the target memory by reading the memory interface connected to the target memory.

[0026] Furthermore, based on any one of the technical solutions or a combination of multiple technical solutions described above, after deleting this memory access task data from the management table, it is determined whether there are still tasks in the management table. If so, the task pointer is adjusted according to the priority information of the remaining memory access task data in the management table.

[0027] Furthermore, based on any one of the technical solutions or a combination of multiple technical solutions described above, after the source processor in the memory access task data pointed to by the task pointer executes the data access operation on the target memory, the accessed data is invalidated, and the message of the invalidation of the data is notified to other processors that also contain the data.

[0028] Further, based on any one of the technical solutions or a combination of multiple technical solutions mentioned above, the data exchange unit is a Crossbar structure with a switch matrix.

[0029] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the management unit adjusts the task pointer according to the priority of each memory access task data in the management table, including: In the management table, memory access task data corresponding to the same target memory are classified into the same category, and memory access task data corresponding to different target memories are classified into different categories; Assign task pointers to different types of memory access task data; Among the memory access task data of the same category, according to the priority information thereof, the task pointer is pointed to the memory access task data with the highest priority in the category.

[0030] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the data memory access operation of the source processor on the target memory in the memory access task data is performed in the following manner: When a memory is converted from a busy state to an idle state, the idle state information is actively reported to the management unit; The management unit queries the management table for a category corresponding to the memory, and if no category is found, the memory remains idle; If the category is found, the task pointer corresponding to the category and the memory access task data it points to are determined; The source processor in the memory access task data executes a data memory access operation on the target memory, and the target memory actively reports busy status information to the management unit.

[0031] According to another aspect of the present invention, the present invention provides a data processing method of a multi-processor system with a shared memory and a switch, comprising the following steps: The management unit of the system receives memory access task data sent by the processor connected to it through the processor interface of the switch, wherein the memory access task data includes a source processor and a target memory; Inquiring whether the current state of the target memory is an idle state or a busy state; If the target memory is in a busy state, storing the memory access task data in a management table; Adjust the task pointer according to the priority information of each access task data in the management table; In response to the target memory in the memory access task data pointed to by the task pointer being converted to an idle state, the source processor in the memory access task data pointed to by the task pointer executes a data access operation on the target memory, and deletes this memory access task data from the management table.

[0032] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the data processing method of the multi-processor system with shared memory and switch provided by the present invention also includes: A data exchange unit with a Crossbar structure having a switch matrix is ​​pre-built in the switch, and each port of the data exchange unit is connected to each processor and memory respectively; Executing the data access operation of the source processor on the target memory in the memory access task data pointed to by the task pointer comprises the following steps: The management unit controls the closing of a switch on a path between the source processor and the target memory in the Crossbar structure.

[0033] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, adjusting the task pointer includes: In the management table, memory access task data corresponding to the same target memory are classified into the same category, and memory access task data corresponding to different target memories are classified into different categories; Assign task pointers to different types of memory access task data; Among the memory access task data of the same category, according to the priority information thereof, the task pointer is pointed to the memory access task data with the highest priority in the category.

[0034] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the priority information of each memory access task data is obtained by any one of the following methods: The memory access task data also includes a task type, the priority information is determined according to the task type, and the memory access task data and the priority information are stored in the management table; Alternatively, the management table is further configured with a priority item, the memory access task data further includes a task type, the management unit determines the priority information corresponding to the task type, and after storing the memory access task data in the management table, records the determined priority information into the priority item corresponding to the memory access task data; Alternatively, the memory access task data further includes priority information.

[0035] Further, based on any one of the technical solutions or a combination of multiple technical solutions described above, the switch is further configured with a data exchange unit, and the data memory access includes an operation of accessing data to the target memory and an operation of writing data to the target memory; The data access operation of the source processor on the target memory in the memory access task data pointed to by the task pointer includes: The data that the task requests to access from the target memory is sent to the source processor through the data exchange unit; and / or the data that the task requests to write is sent to the target memory through the data exchange unit.

[0036] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the management table is further configured with a data content size information item, and the memory access task data also includes the capacity value of the data requested by the task to be accessed from the target memory or the capacity value of the data requested to be written by the task; Before deleting the access task data from the management table, the method further includes: The source processor verifies whether the capacity value of the access data through the data exchange unit matches the capacity value in the memory access task data, or verifies whether the capacity value of the data written to the target memory through the data exchange unit matches the capacity value in the memory access task data; If there is no match, error information is fed back to the source processor.

[0037] Further, based on any one of the technical solutions or a combination of multiple technical solutions mentioned above, the data exchange unit is also configured to exchange data between different processors.

[0038] Furthermore, based on any one of the technical solutions or a combination of multiple technical solutions mentioned above, if it is found that the current state of the target memory in the memory access task data is an idle state, the memory access task data will not be stored in the management table, and the source processor in the memory access task data will execute the data access operation on the target memory.

[0039] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the current state of the target memory is queried in any one of the following ways: The management unit sends a query request to the target memory through a corresponding memory interface, and the target memory returns its own status information in response to the query request; Alternatively, the management unit further includes a memory state record table for recording the current state of each memory actively reported to the management unit when the state changes, and the management unit determines the current state of the target memory by querying the memory state record table; Alternatively, the memory interface is further configured to store the current state of the memory connected thereto, and the management unit determines the current state of the target memory by reading the memory interface connected to the target memory.

[0040] Furthermore, based on any one of the technical solutions or a combination of multiple technical solutions described above, after deleting this memory access task data from the management table, it is determined whether there are still tasks in the management table. If so, the task pointer is adjusted according to the priority information of the remaining memory access task data in the management table.

[0041] Furthermore, based on any one of the technical solutions or a combination of multiple technical solutions described above, after the source processor in the memory access task data pointed to by the task pointer executes the data access operation on the target memory, the accessed data is invalidated, and the message of the invalidation of the data is notified to other processors that also contain the data.

[0042] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the data memory access operation of the source processor on the target memory in the memory access task data is performed in the following manner: When a memory is converted from a busy state to an idle state, the idle state information is actively reported to the management unit; The management unit queries the management table for a category corresponding to the memory, and if no category is found, the memory remains idle; If the category is found, the task pointer corresponding to the category and the memory access task data it points to are determined; The source processor in the memory access task data executes a data memory access operation on the target memory, and the target memory actively reports busy status information to the management unit.

[0043] The beneficial effects brought by the technical solution provided by the present invention are as follows: a. Solve the access conflict problem that may occur when multiple processors access shared memory at the same time to ensure the correctness and consistency of data; b. Manage the access of multiple processors to shared memory and coordinate resource allocation to avoid affecting system performance; c. The management unit stores conflicting tasks that share the same memory request into the management table and sorts the waiting order of the tasks in the table according to the task priority to improve the efficiency of the system; d. Shared memory includes multiple memories. The processor can store and access data in the shared memory according to computing requirements, thereby improving data access efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0045] Figure 1 A schematic diagram of a data processing method of a multi-processor system with a shared memory and a switch provided for an exemplary embodiment of the present invention; Figure 2 A block diagram of a multiprocessor system with shared memory and a switch provided for an exemplary embodiment of the present invention; Figure 3 A schematic diagram of the structure of a switch in a multi-processor system provided for an exemplary embodiment of the present invention; Figure 4A schematic diagram of the connection between a data exchange unit and an interface in a switch provided by an exemplary embodiment of the present invention; Figure 5 A schematic diagram of table entries of a management table provided for an exemplary embodiment of the present invention; Figure 6 A memory 1 provided for an exemplary embodiment of the present invention is a first sub-representation diagram of a target memory classification; Figure 7 Memory 3 provided for an exemplary embodiment of the present invention is a second sub-table diagram of the target memory classification. DETAILED DESCRIPTION

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

[0047] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0048] In the prior art, a switch is a device used to connect multiple network devices, which can realize high-speed transmission and exchange of data.

[0049] The present invention aims to solve the access conflict problem that may occur when multiple processors share memory by improving the switch structure.

[0050] In one embodiment of the present invention, a multi-processor system with shared memory and a switch is provided, such as Figure 2 As shown, the system includes a switch, multiple processors and multiple memories; multiple interfaces on one side of the switch are connected to multiple processors, and multiple interfaces on the other side are connected to multiple memories, so as to realize efficient interaction between multiple processors and multiple memories of the shared memory module and improve the performance of the multi-processor system.

[0051] See also Figure 3 The switch is configured with a management unit, a switching unit, a plurality of processor interfaces and a plurality of memory interfaces; wherein the management unit includes a management table, such as Figure 1 As shown, the management unit manages the memory access operations of each processor to the memory in the following manner: Receive memory access task data sent by the processor connected to the processor interface, wherein the memory access task data includes a source processor and a target memory; Inquiring whether the current state of the target memory is an idle state or a busy state; If the target memory is in a busy state, storing the memory access task data in the management table; Adjust the task pointer according to the priority information of each access task data in the management table; In response to the target memory in the memory access task data pointed to by the task pointer being converted to an idle state, the source processor in the memory access task data pointed to by the task pointer executes a data access operation on the target memory, and deletes this memory access task data from the management table.

[0052] See also Figure 1 If it is inquired that the current state of the target memory in the memory access task data is an idle state, the memory access task data is not stored in the management table, and the source processor in the memory access task data executes the data memory access operation on the target memory.

[0053] In this embodiment, the rule of executing the task with the highest priority first is adopted. Therefore, the priority information of each memory access task data needs to be obtained first. At least the following three methods can be used: Method 1: In addition to the information of the source processor and the target memory, the memory access task data also includes the task type. The priority information is determined according to the task type. For example, Hard Real-time Tasks represent tasks that must meet the deadline, otherwise it will cause unacceptable damage or fatal errors to the system. This type of task type, which usually does not allow any task instance to time out, sets its priority to level I; for example, periodic tasks are tasks that arrive at regular intervals, such as sensor data collection, and their priority can be set to level III; then the memory access task data and the priority information are stored in the management table; Method 2: The management table is further configured with a priority item, the memory access task data also includes a task type, the management unit determines the priority information corresponding to the task type, and after storing the memory access task data in the management table, records the determined priority information into the priority item corresponding to the memory access task data, wherein the method of determining the priority according to the task type is also to determine the priority according to the strength of the real-time urgency of the task, and the more urgent the real-time urgency, the higher the priority; Method 3: The memory access task data also directly includes priority information.

[0054] In this embodiment, the switch is also configured with a data exchange unit, such as Figure 3 As shown; the data access includes an operation of accessing data to the target memory and an operation of writing data to the target memory; If the task is to access data, the data access operation of the source processor on the target memory in the memory access task data is executed, that is, the data accessed from the target memory by the task request is sent to the source processor through the data exchange unit; If the task is to write data, the source processor executing the data access operation on the target memory in the memory access task data sends the data requested to be written by the task to the target memory through the data exchange unit.

[0055] See also Figure 5 , the management table is also configured with an information item of data content size, and the memory access task data also includes the capacity value of the data that the task requests to access from the target memory or the capacity value of the data that the task requests to write; Before deleting the access task data from the management table, the method further includes: The source processor verifies whether the capacity value of the access data through the data exchange unit matches the capacity value in the memory access task data, or verifies whether the capacity value of the data written to the target memory through the data exchange unit matches the capacity value in the memory access task data; If there is no match, error information is fed back to the source processor.

[0056] If the source processor receives a feedback message that an error occurs in the memory access data, it can choose to send the same memory access task data to the switch again and cancel the previous read operation or write operation that caused the error.

[0057] In a specific embodiment, the data exchange unit is a Crossbar structure having a switch matrix, such as Figure 4 As shown, when it is determined that a task is to be executed, the management unit controls the switch on the path between the source processor and the target memory in the memory access task data in the Crossbar structure to be closed; In addition to executing the processor shared memory task corresponding to the memory access task data, the data exchange unit is also configured to exchange data between different processors. At this time, the management unit controls the switch on the path between the two target processors in the Crossbar structure to be closed.

[0058] As can be seen above, after receiving a task, the priority is secondary. The first thing to do is to determine whether the current state of the target memory specified in the task is idle or busy. There are at least three ways to query the state: Mode 1: The management unit sends a query request to the target memory through the corresponding memory interface, and the target memory returns its own status information in response to the query request; Mode 2: The management unit further includes a memory status record table (not shown) for recording the current status of each memory actively reported to the management unit when the status changes, and the management unit determines the current status of the target memory by querying the memory status record table; Mode 3: The memory interface is further configured to store the current state of the memory connected thereto, and the management unit determines the current state of the target memory by reading the memory interface connected to the target memory.

[0059] like Figure 1 As shown, after deleting this memory access task data from the management table, it is determined whether there are still tasks in the management table. If so, the task pointer is adjusted according to the priority information of the remaining memory access task data in the management table, and then the target memory in the entry pointed to by the task pointer is changed from a busy state to an idle state, and the source processor can repeat the sharing operation of the target memory in the new task. This method allows a memory to be limited to not being able to perform data access tasks by other processors during the process of being accessed by the current processor, and at the same time, it cannot be used by the current processor to perform other data access tasks, thereby solving the access conflict problem.

[0060] In a specific embodiment, after executing the data access operation of the source processor in the memory access task data pointed to by the task pointer on the target memory, the accessed data is invalidated, and the message of the invalidation of the data is notified to other processors that also contain the data to ensure memory consistency and data consistency.

[0061] Optionally, the number of management tables is one, and the number of task pointers allocated in the table is also one; In other embodiments, multiple task pointers may be allocated according to different target memories, see Figure 6 and Figure 7 : In the management table, memory access task data corresponding to the same target memory are classified into the same category, and memory access task data corresponding to different target memories are classified into different categories; in a specific embodiment, the management table can be divided into multiple areas, and the management table can include multiple sub-tables, such as Figure 6 The first sub-table for memory 1 and Figure 7 The second sub-table for memory 3 is shown; Assign task pointers to different types of memory access task data. Figure 6 The target memory is allocated as task pointer 1 in the first subtable of memory 1. Figure 7 The target memory is the task pointer 3 allocated in the second subtable of memory 3; Among the memory access task data of the same category, according to the priority information thereof, the task pointer is pointed to the memory access task data with the highest priority in the category.

[0062] When the task pointed to by the task pointer is completed, the memory access task data is deleted from the management table, and the task pointer is pointed to the remaining memory access task data to select the one with the highest priority. Figure 7 For example, after deleting the memory access task data whose source processor is processor 4, task pointer 2 points to the memory access task data issued by processor 1.

[0063] If there are two data in the remaining memory access task data that have the highest priority among the remaining data, then the FIFO rule can be followed. Figure 6For example, after deleting the memory access task data whose source processor is processor 4, the memory access task data whose task type is Aperiodic Tasks (non-periodic tasks) that enters the table first will be processed first, and the Soft Real-time Tasks (soft real-time tasks) that enter the table later will need to continue waiting. If during the waiting process, that is, during the execution of Aperiodic Tasks (non-periodic tasks), a new Hard Real-time Tasks of processor 3 to memory 1 comes in, then after executing the Aperiodic Tasks (non-periodic tasks) and deleting the memory access task data in the table, this Soft Real-time Tasks (soft real-time tasks) will still need to wait, because the task pointer will be adjusted to point to the newly entered Hard Real-time Tasks with a higher priority than it. Aperiodic Tasks here represent tasks that have no fixed period and arrive randomly, such as user interaction operations; Soft Real-time Tasks usually also have a deadline associated with them, and hope to meet the requirements of this deadline, but this is not mandatory: that is, even if the deadline is exceeded, it is still meaningful to schedule and complete this task, such as video on demand systems, information collection and retrieval systems, etc.

[0064] If a new task data about accessing memory 2 is entered, and memory 2 is busy at this time, a third sub-table (not shown) is created accordingly, and a new task pointer 3 is allocated to point to the memory access task data written into the third sub-table.

[0065] Whenever a memory is converted from a busy state to an idle state, the idle state information is actively reported to the management unit; The management unit queries the management table for the category corresponding to the memory, for example, the memory that is turned into an idle state is memory 5, and only Figure 6 The first sub-table for memory 1 and Figure 7 The second sub-table for memory 3 is shown, but there is no sub-table for memory 5, that is, no category is found, and the memory remains idle; If the category is found, for example, the memory that is in the idle state is memory 1, then the category is determined to correspond to Figure 6 The first sub-table shown, in which the memory access task data pointed to by the task pointer is determined in the first sub-table; The source processor in the memory access task data executes the data memory access operation on the target memory, and the target memory actively reports the busy status information to the management unit, so that the switch can store the memory access task data in the management table when the target memory is in a busy state when the new shared task for memory 1 is received by the switch.

[0066] In one embodiment of the present invention, a switch is provided, such as Figure 3 As shown, it includes a management unit, multiple processor interfaces and multiple memory interfaces, the processor interface is configured to connect to a processor outside the switch, and the memory interface is configured to connect to a memory outside the switch; The management unit includes a management table, and the management unit manages the memory access operations of each processor to the memory in the following manner: Receive memory access task data sent by the processor connected to the processor interface, wherein the memory access task data includes a source processor and a target memory; Inquiring whether the current state of the target memory is an idle state or a busy state; If the target memory is in a busy state, storing the memory access task data in the management table; Adjust the task pointer according to the priority information of each access task data in the management table; In response to the target memory in the memory access task data pointed to by the task pointer being converted to an idle state, the source processor in the memory access task data pointed to by the task pointer executes a data access operation on the target memory, and deletes this memory access task data from the management table.

[0067] It should be noted that the switch provided in this embodiment and the multi-processor system with shared memory and switch provided in the above embodiment belong to the same inventive concept. The switch in this embodiment can realize the multi-processor system in the above embodiment by connecting peripheral processors and memories. The entire contents of the multi-processor system embodiment with shared memory and switch are incorporated into this switch embodiment by full reference to avoid redundancy.

[0068] In one embodiment of the present invention, a data processing method of a multi-processor system with a shared memory and a switch is provided. Figure 1 As shown, the data processing method includes the following steps: The management unit of the system receives memory access task data sent by the processor connected to it through the processor interface of the switch, wherein the memory access task data includes a source processor and a target memory; Inquiring whether the current state of the target memory is an idle state or a busy state; If the target memory is in a busy state, storing the memory access task data in a management table; Adjust the task pointer according to the priority information of each access task data in the management table; In response to the target memory in the memory access task data pointed to by the task pointer being converted to an idle state, the source processor in the memory access task data pointed to by the task pointer executes a data access operation on the target memory, and deletes this memory access task data from the management table.

[0069] The data processing method of the multi-processor system with shared memory and switch provided in this embodiment also includes: A data exchange unit with a Crossbar structure having a switch matrix is ​​pre-built in the switch, and each port of the data exchange unit is connected to each processor and memory respectively; Executing the data access operation of the source processor on the target memory in the memory access task data pointed to by the task pointer comprises the following steps: The management unit controls the closing of a switch on a path between the source processor and the target memory in the Crossbar structure.

[0070] Furthermore, the step of adjusting the task pointer includes: In the management table, memory access task data corresponding to the same target memory are classified into the same category, and memory access task data corresponding to different target memories are classified into different categories; Assign task pointers to different types of memory access task data; Among the memory access task data of the same category, according to the priority information thereof, the task pointer is pointed to the memory access task data with the highest priority in the category.

[0071] The data processing method provided in this embodiment and the multi-processor system with shared memory and switch provided in the above embodiment belong to the same inventive concept. The multi-processor system in the above embodiment can be used as the hardware basis for executing the data processing method in this embodiment. The entire content of the multi-processor system with shared memory and switch embodiment is incorporated into this data processing method embodiment by full reference to avoid redundancy.

[0072] The present invention can be widely used in application fields such as multi-processor systems, shared memory systems and switch devices: first, the switch of the present invention can effectively solve the access conflict problem when multiple processors access the shared memory at the same time, and ensure the correctness and consistency of the data, which is of great significance for the performance improvement of the multi-processor system; secondly, the management unit of the present invention can manage the access of multiple processors to the shared memory, which is of great value for certain application scenarios that require a large amount of data exchange.

[0073] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0074] The above is only a specific implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A multiprocessor system with shared memory and switches, It is characterized in that The invention comprises a switch, a plurality of processors and a plurality of memories, wherein the switch is configured with a management unit, a plurality of processor interfaces and a plurality of memory interfaces; The management unit includes a management table, and the management unit manages the memory access operations of each processor to the memory in the following manner: Receive memory access task data sent by the processor connected to the processor interface, wherein the memory access task data includes a source processor and a target memory; Inquiring whether the current state of the target memory is an idle state or a busy state; If the target memory is in a busy state, storing the memory access task data in the management table; Adjust the task pointer according to the priority information of each access task data in the management table; In response to the target memory in the memory access task data pointed to by the task pointer being converted to an idle state, the source processor in the memory access task data pointed to by the task pointer executes a data access operation on the target memory, and deletes this memory access task data from the management table.

2. The multiprocessor system with shared memory and switch according to claim 1, It is characterized in that Use any of the following methods to obtain the priority information of each fetch task data: The memory access task data also includes a task type, the priority information is determined according to the task type, and the memory access task data and the priority information are stored in the management table; Alternatively, the management table is further configured with a priority item, the memory access task data further includes a task type, the management unit determines the priority information corresponding to the task type, and after storing the memory access task data in the management table, records the determined priority information into the priority item corresponding to the memory access task data; Alternatively, the memory access task data further includes priority information.

3. The multiprocessor system with shared memory and switch according to claim 1, It is characterized in that The switch is also configured with a data exchange unit, and the data access includes an operation of accessing data to the target memory and an operation of writing data to the target memory; The data access operation of the source processor on the target memory in the memory access task data pointed to by the task pointer includes: The data accessed by the task request from the target memory is sent to the source processor via the data exchange unit; And / or, the data requested to be written by the task is sent to the target memory through the data exchange unit.

4. The multiprocessor system with shared memory and switch according to claim 3, It is characterized in that The management table is also configured with a data content size information item, and the memory access task data also includes the capacity value of the data that the task requests to access from the target memory or the capacity value of the data that the task requests to write; Before deleting the access task data from the management table, the method further includes: The source processor verifies whether the capacity value of the access data through the data exchange unit matches the capacity value in the memory access task data, or verifies whether the capacity value of the data written to the target memory through the data exchange unit matches the capacity value in the memory access task data; If there is no match, error information is fed back to the source processor.

5. The multiprocessor system with shared memory and switch according to claim 3, It is characterized in that The data exchange unit is further configured to exchange data between different processors.

6. The multiprocessor system with shared memory and switch according to claim 1, It is characterized in that If it is inquired that the current state of the target memory in the memory access task data is an idle state, the memory access task data is not stored in the management table, and the source processor in the memory access task data executes the data memory access operation on the target memory.

7. The multiprocessor system with shared memory and switch according to claim 1, It is characterized in that Inquire whether the current state of the target memory is idle or busy by any of the following methods: The management unit sends a query request to the target memory through a corresponding memory interface, and the target memory returns its own status information in response to the query request; Alternatively, the management unit further includes a memory state record table for recording the current state of each memory actively reported to the management unit when the state changes, and the management unit determines the current state of the target memory by querying the memory state record table; Alternatively, the memory interface is further configured to store the current state of the memory connected thereto, and the management unit determines the current state of the target memory by reading the memory interface connected to the target memory.

8. The multiprocessor system with shared memory and switch according to claim 1, It is characterized in that After deleting the memory access task data from the management table, it is determined whether there are still tasks in the management table, and if so, the task pointer is adjusted according to the priority information of the remaining memory access task data in the management table.

9. The multiprocessor system with shared memory and switch according to claim 1, It is characterized in that After executing the data access operation of the source processor in the memory access task data pointed to by the task pointer on the target memory, the accessed data is invalidated, and a message of the invalidation of the data is notified to other processors that also contain the data.

10. The multiprocessor system with shared memory and switch according to any one of claims 3 to 5, It is characterized in that The data exchange unit is a Crossbar structure with a switch matrix.

11. A multiprocessor system with a shared memory and a switch according to any one of claims 1 to 9, It is characterized in that The management unit adjusts the task pointer according to the priority of each access task data in the management table, including: In the management table, memory access task data corresponding to the same target memory are classified into the same category, and memory access task data corresponding to different target memories are classified into different categories; Assign task pointers to different types of memory access task data; Among the memory access task data of the same category, according to the priority information thereof, the task pointer is pointed to the memory access task data with the highest priority in the category.

12. The multiprocessor system with shared memory and switch according to claim 11, It is characterized in that The data access operation of the source processor to the target memory in the memory access task data is performed in the following manner: When a memory is converted from a busy state to an idle state, the idle state information is actively reported to the management unit; The management unit queries the management table for a category corresponding to the memory, and if no category is found, the memory remains idle; If the category is found, the task pointer corresponding to the category and the memory access task data it points to are determined; The source processor in the memory access task data executes a data memory access operation on the target memory, and the target memory actively reports busy status information to the management unit.

13. A switch, It is characterized in that It includes a management unit, a plurality of processor interfaces and a plurality of memory interfaces, wherein the processor interface is configured to connect to a processor outside the switch, and the memory interface is configured to connect to a memory outside the switch; The management unit includes a management table, and the management unit manages the memory access operations of each processor to the memory in the following manner: Receive memory access task data sent by the processor connected to the processor interface, wherein the memory access task data includes a source processor and a target memory; Inquiring whether the current state of the target memory is an idle state or a busy state; If the target memory is in a busy state, storing the memory access task data in the management table; Adjust the task pointer according to the priority information of each access task data in the management table; In response to the target memory in the memory access task data pointed to by the task pointer being converted to an idle state, the source processor in the memory access task data pointed to by the task pointer executes a data access operation on the target memory, and deletes this memory access task data from the management table.

14. A data processing method for a multiprocessor system having a shared memory and a switch, It is characterized in that The following steps are involved: The management unit of the system receives memory access task data sent by the processor connected to it through the processor interface of the switch, and the memory access task data includes a source processor and a target memory; Inquiring whether the current state of the target memory is an idle state or a busy state; If the target memory is in a busy state, storing the memory access task data in a management table; Adjust the task pointer according to the priority information of each access task data in the management table; In response to the target memory in the memory access task data pointed to by the task pointer being converted to an idle state, the source processor in the memory access task data pointed to by the task pointer executes a data access operation on the target memory, and deletes this memory access task data from the management table.

15. The data processing method of the multi-processor system with shared memory and switch according to claim 14, It is characterized in that Also includes: A data exchange unit with a Crossbar structure having a switch matrix is ​​pre-built in the switch, and each port of the data exchange unit is connected to each processor and memory respectively; Executing the data access operation of the source processor on the target memory in the memory access task data pointed to by the task pointer comprises the following steps: The management unit controls the closing of a switch on a path between the source processor and the target memory in the Crossbar structure.

16. The data processing method of a multi-processor system with a shared memory and a switch according to claim 14, It is characterized in that Adjusting the task pointers includes: In the management table, memory access task data corresponding to the same target memory are classified into the same category, and memory access task data corresponding to different target memories are classified into different categories; Assign task pointers to different types of memory access task data; Among the memory access task data of the same category, according to the priority information thereof, the task pointer is pointed to the memory access task data with the highest priority in the category.

Citation Information

Patent Citations

  • Method, equipment, computer equipment and system for realizing memory sharing control

    CN115080262A

  • Switch, memory sharing method and system, computing equipment and storage medium

    CN117118930A

  • Dynamic memory protection method and device, computer equipment and storage medium

    CN117234729A

  • Data transmission device, data processing equipment, system, method and medium

    CN117312229A

  • Memory system shared by multiple hosts, memory access method, equipment and storage medium

    CN117806851A