Single-thread program parallel processing device

By compiling a single-threaded program into executable code and marking it as multiple code segments, and using module combinations for parallel processing, the problem of long operation time of single-threaded program is solved, parallel processing of single-threaded programs is realized, and processor resources are improved Utilization.

CN118916007APending Publication Date: 2024-11-08TAIZHOU ASKPOWER ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410952716.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-08-15
Filing Date
2024-07-16
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

Due to program path dependence, single-threaded programs have a long operation time and cannot fully utilize processor resources for parallel processing.

Method used

By compiling the source code of a single-threaded program into executable code and marking the executable code, multiple code segments are generated, and the parallel execution of the code segment is achieved using the combination of storage modules, identification modules, control modules and computing modules. , the control module judges and controls parallel processing of the computing module based on the identification and status.

Benefits of technology

It realizes parallel processing of single-threaded programs, improves computing speed, reduces program computing time, and optimizes processor resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916007A_ABST
    Figure CN118916007A_ABST
Patent Text Reader

Abstract

The invention relates to a single-thread program parallel processing device which comprises a storage module, an identification module, a control module and an operation module. The storage module is used for storing code segments; the identification module is used for identifying a plurality of code segments based on markers marking the code segments, and the code segments can be executed in parallel; the number of the operation modules is N, and the control module is used for controlling all the operation modules to execute the code segments in a parallel processing mode. Source codes of a single-thread program are compiled into executable codes in advance, the executable codes are marked to obtain a plurality of code segments capable of being executed in parallel, the code segments are stored in a storage module, an operation module executes the code segments in a parallel processing mode, and parallel processing of the single-thread program is achieved. The method is beneficial for improving the single-thread program operation speed and reducing the program operation time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of processors, and in particular to a single-threaded program parallel processing device. Background Art

[0002] Single-threaded programs have the characteristics of system stability and strong scalability.

[0003] However, during the execution of a single-threaded program, the program paths taken are arranged in a continuous order, and the previous ones must be processed before the latter ones can be executed.

[0004] This results in a longer operation time for single-threaded programs. Summary of the invention

[0005] In order to reduce program operation time, the present application provides a single-threaded program parallel processing device.

[0006] The present application provides a single-thread program parallel processing device, which adopts the following technical solution: A single-thread program parallel processing device comprises a storage module, an identification module, a control module and a calculation module; The storage module is used to store code segments; The identification module is used to identify multiple code segments based on the markers marking the code segments, and the multiple code segments are used to be executed in parallel; There are N computing modules. The control module is used to control all the operation modules to execute multiple code segments in a parallel processing manner.

[0007] By adopting the above technical solution, the source code of the single-threaded program is compiled into executable code in advance, and the executable code is marked to obtain multiple code segments that can be executed in parallel. The multiple code segments are stored in the storage module, and the operation module executes the multiple code segments in a parallel processing manner, thereby realizing parallel processing of single-threaded programs, which is beneficial to improving the operation speed of single-threaded programs and reducing program operation time.

[0008] Preferably, the control module is used to control all the operation modules to execute multiple code segments in a parallel processing manner, including: The operation module is used to output a flag when the execution of the code segment is completed; The control module is used to control all the operation modules to execute the next group of N code segments in a parallel processing manner when N identifiers are detected.

[0009] By adopting the above technical solution, it is determined by marking whether the current code segment has completed the operation, and then the operation of the subsequent code segment is controlled; after completing the parallel processing of N code segments, the parallel processing of the next group of N code segments is executed.

[0010] Preferably, the control module is used to control all the operation modules to execute multiple code segments in a parallel processing manner, including: The control module is used to determine the status of all operation modules; The control module is used to control the idle computing module to execute a specific code segment, where the specific code segment is any executable code segment among all the code segments to be executed.

[0011] By adopting the above technical solution, the time required for each operation module to execute different code segments may vary. If any operation module is idle, the idle operation module immediately executes the subsequent code segment, thereby reducing the program operation time.

[0012] Preferably, the control module is used to determine whether the code segment is executable based on the code segment execution condition.

[0013] By adopting the above technical solution, it is possible to control the idle state computing module to execute a specific code segment.

[0014] In summary, the present application includes at least one of the following beneficial technical effects: 1. Pre-compile the source code of the single-threaded program into executable code, and mark the executable code to obtain multiple code segments that can be executed in parallel. The multiple code segments are stored in the storage module, and the operation module executes the multiple code segments in a parallel processing manner, thereby realizing the parallel processing of the single-threaded program, which is conducive to improving the operation speed of the single-threaded program and reducing the program operation time; 2. Use the flag to determine whether the current code segment has completed the operation, and then control the operation of the subsequent code segment; 3. During the parallel execution of multiple code segments, after completing the parallel processing of N code segments, the next group of N code segments are executed in parallel; 4. The time required for each computing module to execute different code segments may vary. If any computing module is idle, the idle computing module will immediately execute the subsequent code segments to reduce the program computing time. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a structural block diagram of a single-threaded program parallel processing device.

[0016] Explanation of the accompanying drawings: 1. Storage module; 2. Identification module; 3. Control module; 4. Operation module. DETAILED DESCRIPTION

[0017] The following is combined with Figure 1 This application is described in further detail.

[0018] Example 1 The present application embodiment discloses a single-thread program parallel processing method, comprising the following steps: A single-thread program parallel processing device comprises a storage module 1, an identification module 2, a control module 3 and a calculation module 4.

[0019] The storage module 1 is used to store the code segments obtained by the above method.

[0020] The identification module 2 is used to identify multiple code segments based on the markers marking the code segments.

[0021] There are N computing modules 4 .

[0022] The control module 3 is used to control all the operation modules 4 to execute multiple code segments in a parallel processing manner.

[0023] Specifically, The control module 3 is used to control all the operation modules 4 to execute N code segments in a parallel processing manner; The operation module 4 is used to output a flag when the execution of the code segment is completed; The control module 3 is used to control all the operation modules 4 to execute the next group of N code segments in a parallel processing manner when N identifiers are detected.

[0024] Example 2 The difference between this embodiment and embodiment 1 is that the control module 3 is used to control all the operation modules 4 to execute multiple code segments in a parallel processing manner, including: The control module 3 is used to control all the operation modules 4 to execute N code segments in a parallel processing manner; The control module 3 is used to determine the status of all the operation modules 4; The control module 3 is used to control the idle computing module 4 to execute a specific code segment, where the specific code segment is any executable code segment among all the code segments to be executed.

[0025] Specifically, the operation module 4 is used to output an identification when the execution of the code segment is completed; The control module 3 determines the state of the operation module 4 based on the identification; The control module 3 is used to determine whether the code segment is executable based on the code segment execution condition; the code segment execution condition includes the dependency relationship, causal relationship, data relationship, etc. with the executing code segment.

[0026] Example 3 The difference between this embodiment and embodiment 1 is that the control module 3 is used to control all the operation modules 4 to execute multiple code segments in a parallel processing manner, including: The control module 3 is used to control all the operation modules 4 to execute N code segments in a parallel processing manner; The operation module 4 is used to output a flag when the execution of the code segment is completed; The control module 3 is used to determine the status of all the operation modules 4; The control module 3 is used to control the idle computing module 4 to execute a specific code segment when M identifiers are detected; wherein 1≤M<N, and the specific code segment is any executable code segment among all the code segments to be executed; The control module 3 is used to control all the operation modules 4 to execute the next group of N specific code segments in a parallel processing manner when N identifiers are detected.

[0027] The control module 3 is used to determine whether the code segment is executable based on the code segment execution condition; the code segment execution condition includes the dependency relationship, causal relationship, data relationship, etc. with the executing code segment.

[0028] The implementation principle of a single-threaded program parallel processing device in an embodiment of the present application is as follows: the source code of the single-threaded program is pre-compiled into executable code, and the executable code is marked to obtain multiple code segments that can be executed in parallel. The multiple code segments are stored in a storage module 1, and the operation module 4 executes the multiple code segments in a parallel processing manner, thereby realizing the parallel processing of the single-threaded program, which is beneficial to improving the operation speed of the single-threaded program and reducing the program operation time.

[0029] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.

Claims

1. A single-threaded program parallel processing device, characterized in that: It comprises a storage module (1), an identification module (2), a control module (3) and a calculation module (4); The storage module (1) is used to store code segments; The identification module (2) is used to identify multiple code segments based on the markers of the marked code segments, and the multiple code segments are used to be executed in parallel; The number of operation modules (4) is N. The control module (3) is used to control all the operation modules (4) to execute multiple code segments in a parallel processing manner.

2. The single-thread program parallel processing device according to claim 1, characterized in that: The control module (3) is used to control all the operation modules (4) to execute multiple code segments in a parallel processing manner, including: The operation module (4) is used to output an identification when the execution of the code segment is completed; The control module (3) is used to control all the operation modules (4) to execute the next group of N code segments in a parallel processing manner when N identifiers are detected.

3. The single-thread program parallel processing device according to claim 1, characterized in that: The control module (3) is used to control all the operation modules (4) to execute multiple code segments in a parallel processing manner, including: The control module (3) is used to determine the status of all the operation modules (4); The control module (3) is used to control the idle state computing module (4) to execute a specific code segment, where the specific code segment is any executable code segment among all the code segments to be executed.

4. The single-thread program parallel processing device according to claim 3, characterized in that: The control module (3) is used to determine whether the code segment is executable based on the code segment execution condition.