Multi-target scattered echo parallel calculation method, device, equipment and storage medium
By equipping the embedded real-time operating system with multi-CPU core parallel computing, the problem of low serial computing efficiency is solved and efficient calculation of multi-target scattering echoes is achieved.
Patent Information
- Application Number
- CN202111246613.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-26
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2041-10-26
AI Technical Summary
In the prior art, embedded real-time operating system is used to perform serial calculations on multi-target scattered echoes, resulting in long calculation time and low efficiency.
By equipping multiple CPU cores on the hardware platform, computing tasks corresponding to the CPU cores are created, and targets are assigned to each CPU core for parallel computing based on affinity rules.
The calculation efficiency of multi-target scattering echo on the embedded real-time operating system is improved, the calculation time is reduced, and the processing capability is improved.
Smart Images

Figure CN113986541B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of signal processing technology, and in particular to a method, device, equipment and storage medium for parallel calculation of multi-target scattered echoes. Background Art
[0002] In air-space confrontation scenarios, it is often necessary to calculate the scattered echoes of multiple targets. In order to ensure the real-time calculation, an embedded real-time operating system is usually used to calculate the scattered echoes of multiple targets. At present, the embedded real-time operating system adopts a serial calculation method to calculate the scattered echoes of multiple targets one by one. The serial calculation method not only takes a long time to calculate, but also has low efficiency. Summary of the invention
[0003] In view of the problem that the serial calculation method has long calculation time and low efficiency, the embodiments of the present invention provide a multi-target scattered echo parallel calculation method, device, equipment and storage medium, which can improve the calculation efficiency of multi-target scattered echo calculation on an embedded real-time operating system.
[0004] In a first aspect, an embodiment of the present invention provides a multi-target scattered echo parallel computing method, which is applied to a VxWorks system mounted on a hardware platform, wherein the hardware platform includes more than two CPU cores; the method includes:
[0005] Determine the number of CPU cores and the number of targets to be processed in the hardware platform;
[0006] According to the number of CPU cores in the hardware platform, create two or more computing tasks corresponding to the CPU cores;
[0007] Determining a target having affinity with each CPU core according to the number of CPU cores in the hardware platform and the number of targets;
[0008] On each CPU core of a target having affinity, a corresponding computing task is called to perform computing on the target having affinity with the CPU core.
[0009] Preferably, the number of computing tasks created is equal to the number of CPU cores in the hardware platform, and the more than two computing tasks correspond one-to-one to the more than two CPU cores.
[0010] Preferably, determining the targets having affinity with each CPU core according to the number of CPU cores in the hardware platform and the number of targets includes:
[0011] Determining a grouping parameter according to a quotient obtained by dividing the number of the targets by the number of CPU cores in the hardware platform;
[0012] Calculate the targets with affinity to each CPU core according to the preset affinity calculation rule and the grouping parameter.
[0013] Preferably, determining the grouping parameter according to the quotient obtained by dividing the number of the targets by the number of CPU cores in the hardware platform includes: determining the largest integer less than the quotient as the grouping parameter;
[0014] Calculating the targets with affinity to each CPU core according to the preset affinity calculation rule and the grouping parameter includes: substituting the grouping parameter into the following preset affinity calculation rule to obtain the targets with affinity to each CPU core;
[0015] The preset affinity calculation rule includes:
[0016] CPU(j) = {target(j + N*0), target(j + N*1), target(j + N*2), …, target(j + N*group)}
[0017] Where group is the grouping parameter; 0 < j ≤ N, and j is an integer, N is the number of CPU cores in the hardware platform, M is the number of the targets, j + N*group ≤ M, CPU(j) is the jth CPU core, and target(x) is the target numbered x.
[0018] Preferably, the targets are multiple and all located in the same target cluster;
[0019] Before determining the targets with affinity to each CPU core, it further includes: determining the relationships of multiple targets in the target cluster, and configuring numbers for each target according to the relationships of multiple targets in the target cluster.
[0020] Preferably, calling the corresponding calculation task to calculate the targets with affinity to the CPU core includes:
[0021] Creating blocked semaphores respectively for the targets with affinity to the CPU core, and each semaphore includes the target number of the corresponding target;
[0022] Passing one semaphore from the blocked semaphores, and obtaining the target number of the corresponding target from the passed semaphore;
[0023] Obtaining the scattered echo data of the corresponding target according to the target number;
[0024] Calculate the target characteristics of the scattered echo data, and after the calculation is completed, return to the step of passing one signal amount from the blocked signal amount until there is no blocked signal amount.
[0025] Preferably, after the target characteristic calculation is performed on the scattered echo data, the method further comprises: generating a calculation completion mark corresponding to the target number;
[0026] After the calling corresponding computing task calculates the target having affinity with the CPU core, it also includes: determining whether the number of current computing completion flags is equal to the number of the targets, and if so, determining that the parallel computing is ended.
[0027] In a second aspect, an embodiment of the present invention further provides a multi-target scattered echo parallel computing device, which is located in a VxWorks system mounted on a hardware platform, wherein the hardware platform includes more than two CPU cores; the device includes:
[0028] A quantity determination unit, used to determine the number of CPU cores and the number of targets to be processed in the hardware platform;
[0029] A computing task creation unit, used to create two or more computing tasks corresponding to the CPU cores according to the number of CPU cores in the hardware platform;
[0030] an affinity determination unit, configured to determine a target having affinity with each CPU core according to the number of CPU cores in the hardware platform and the number of targets;
[0031] The parallel computing unit is used to call a corresponding computing task on each CPU core of a target having affinity to perform computing on the target having affinity to the CPU core.
[0032] In a third aspect, an embodiment of the present invention further provides a computing device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in any embodiment of this specification is implemented.
[0033] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, enables the computer to execute the method described in any embodiment of this specification.
[0034] The embodiment of the present invention provides a multi-target scattered echo parallel calculation method, device, equipment and storage medium. Since the hardware platform includes more than two CPU cores, by creating more than two computing tasks corresponding to the CPU cores, different CPU cores can call their corresponding computing tasks to complete the computing process in parallel without interfering with each other, which greatly improves the computing efficiency compared to serial computing. In addition, when allocating targets, the targets allocated to the CPU cores are determined according to the affinity, which can greatly increase the stickiness between the CPU cores and the targets, so that when the CPU cores call the computing tasks to calculate the targets with affinity, the computing efficiency can be further improved. Furthermore, as an embedded real-time operating system, the VxWorks system provides users with a good development environment, which is convenient for realizing the parallel computing of multiple CPU cores. It can be seen that this scheme can improve the computing efficiency of multi-target scattered echo calculation on the embedded real-time operating system. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 This is a flow chart of a multi-target scattered echo parallel calculation method provided by an embodiment of the present invention;
[0037] Figure 2 is a flow chart of another multi-target scattered echo parallel calculation method provided by an embodiment of the present invention;
[0038] Figure 3 is a hardware architecture diagram of a computing device provided by an embodiment of the present invention;
[0039] Figure 4 It is a structural diagram of a multi-target scattered echo parallel computing device provided by one embodiment of the present invention.
[0040] Figure 5 It is a structural diagram of another multi-target scattered echo parallel computing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions 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 part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0042] As mentioned above, currently, the embedded real-time operating system can only use serial calculation mode to calculate the scattered echoes of multiple targets one by one. When the number of targets to be calculated is large, the serial calculation mode takes a long time and has low efficiency. If the calculation efficiency needs to be improved, the parallel calculation mode is the preferred mode, but the existing embedded real-time operating system only supports the serial calculation mode. If the parallel calculation mode needs to be applied to the embedded real-time operating system, the embedded real-time operating system needs to be mounted on a hardware platform including multiple CPU cores so that the CPU resources can ensure the implementation of parallel calculation. As an embedded real-time operating system, the VxWorks system provides users with a good development environment. Using this development environment, combined with the target characteristics to be processed, the parallel calculation of multiple CPU cores can be realized. In addition, when allocating multiple targets to the CPU core, not only the problem of load balancing needs to be considered, but also the stickiness between the CPU core and the target needs to be considered to ensure that the CPU core can ensure the best calculation efficiency when calculating the target.
[0043] The specific implementation of the above concept is described below.
[0044] Please refer to Figure 1 The embodiment of the present invention provides a multi-target scattered echo parallel computing method, which is applied to a VxWorks system mounted on a hardware platform, wherein the hardware platform includes more than two CPU cores; the method includes:
[0045] Step 100, determining the number of CPU cores and the number of targets to be processed in the hardware platform.
[0046] Step 102: Create two or more computing tasks corresponding to the CPU cores according to the number of CPU cores in the hardware platform.
[0047] Step 104 : Determine the targets having affinity with each CPU core according to the number of CPU cores in the hardware platform and the number of targets.
[0048] Step 106: On each CPU core of the target having affinity, a corresponding computing task is called to perform computing on the target having affinity with the CPU core.
[0049] In the embodiment of the present invention, since the hardware platform includes more than two CPU cores, by creating more than two computing tasks corresponding to the CPU cores, different CPU cores can call their corresponding computing tasks to complete the computing process in parallel without interfering with each other, which greatly improves the computing efficiency compared to serial computing; in addition, when allocating targets, the targets allocated to the CPU cores are determined according to the affinity, which can greatly increase the stickiness between the CPU cores and the targets, so that when the CPU cores call the computing tasks to calculate the targets with affinity, the computing efficiency can be further improved; further, as an embedded real-time operating system, the VxWorks system provides users with a good development environment, which is convenient for realizing parallel computing of multiple CPU cores. It can be seen that this scheme can improve the computing efficiency of multi-target scattered echo calculation on the embedded real-time operating system.
[0050] Described below Figure 1 How the various steps are performed.
[0051] First, with respect to step 100 , the number of CPU cores and the number of targets to be processed in the hardware platform are determined.
[0052] In the air-space confrontation scenario, the confrontation target may be one or more. When there are multiple confrontation targets, the multiple targets can be determined as a target cluster. In general, there are multiple confrontation targets, so it is necessary to determine multiple confrontation targets as targets to be processed, and process the scattered echo data of the targets to be processed simultaneously. In order to ensure that the scattered echo data of multiple targets to be processed can be processed in real time during the confrontation process, an embedded real-time operating system can be used. In an embodiment of the present invention, the embedded real-time operating system used is a VxWorks system. The development environment provided by the VxWorks system is used to realize parallel processing of multiple CPU cores, and the real-time computing can also be guaranteed.
[0053] The more CPU cores in the hardware platform, the more threads that can be processed in parallel. In the embodiment of the present invention, in order to achieve parallel processing of multiple targets, it is necessary to determine the number of CPU cores in the hardware platform and the number of targets to be processed.
[0054] Then, for step 102, two or more computing tasks corresponding to the CPU cores are created according to the number of CPU cores in the hardware platform.
[0055] When the CPU core calculates the scattered echo of the target, it needs to call and execute computing tasks. Therefore, the more computing tasks are created, the more targets can be processed simultaneously, because the computing tasks are equivalent to the number of targets that the CPU core can process simultaneously. Therefore, computing tasks are a logical concept. Simply put, it is the number of simulated CPU cores. It can be seen that one CPU core corresponds to at least one computing task. In order to make full use of multiple CPU cores, the number of computing tasks can generally be greater than the number of CPU cores.
[0056] In an embodiment of the present invention, the number of computing tasks created is equal to the number of CPU cores in the hardware platform, and the two or more computing tasks created correspond one-to-one to the two or more CPU cores included in the hardware platform. When creating computing tasks, the VxWorks system is used to create an interface to achieve this. In this way, each CPU core in the hardware platform is fully utilized, and the parallel computing efficiency is improved.
[0057] It should be noted that the number of computing tasks created may not be greater than the number of CPU cores in the hardware platform, but it is necessary to ensure that the number of computing tasks is greater than 2, and the computing tasks are created for more than two CPU cores, that is, the number of CPU cores used is greater than 2, so as to ensure the parallel computing of the target.
[0058] Next, for step 104, targets having affinity with each CPU core are determined according to the number of CPU cores in the hardware platform and the number of targets.
[0059] In the embodiment of the present invention, in order to improve the computing efficiency of the CPU core, the target allocated to the CPU core may be determined by calculating affinity.
[0060] In addition, there are multiple targets, and all are located in the same target cluster; before determining the target with affinity to each CPU core, it also includes: determining the relationship between the multiple targets in the target cluster, and configuring a number for each target according to the relationship between the multiple targets in the target cluster.
[0061] Considering that there are certain relationships among multiple targets in the target cluster, such as positional relationships, order relationships, etc., multiple targets can be numbered to determine the affinity between the target and the CPU core using the target number. Specifically, the relationship among multiple targets in the target cluster is determined, and each target is assigned a number according to the relationship among the multiple targets in the target cluster. For example, multiple targets can be numbered according to the distance between the positions corresponding to the multiple targets and a certain measurement point, or they can be numbered according to the order of the multiple targets.
[0062] Accordingly, in an embodiment of the present invention, the target having an affinity with each CPU core can be determined at least through the following steps S1-S2:
[0063] S1: Determine the grouping parameter according to the quotient obtained by dividing the number of the targets by the number of CPU cores in the hardware platform.
[0064] When determining the grouping parameter, the largest integer less than the quotient can be determined as the grouping parameter. For example, if the number of CPU cores is 3 and the number of targets is 12, then the quotient is 4, and the grouping parameter can be determined as 3; if the number of CPU cores is 3 and the number of targets is 10, then the quotient is 10 / 3, and the grouping parameter can be determined as 3.
[0065] S2: Calculate the targets having an affinity with each CPU core according to the preset affinity calculation rule and the grouping parameter.
[0066] In an embodiment of the present invention, the preset affinity calculation rule may include:
[0067] CPU(j) = {target(j + N * 0), target(j + N * 1), target(j + N * 2), …, target(j + N * group)}
[0068] where group is the grouping parameter; 0 < j ≤ N, and j is an integer, N is the number of CPU cores in the hardware platform, M is the number of the targets, j + N * group ≤ M, CPU(j) is the jth CPU core, and target(x) is the target numbered x.
[0069] By substituting the grouping parameter group into the above preset affinity calculation rule, the targets having an affinity with each CPU core can be obtained.
[0070] Continuing to explain the example in S1, if the number of CPU cores N is 3 and the number of targets M is 12, then the quotient is 4, and the grouping parameter group is determined to be 3. Then, according to the above preset affinity calculation rule, we can obtain: CPU(1) = {target(1), target(4), target(7), target(10)}, CPU(2) = {target(2), target(5), target(8), target(11)}, CPU(3) = {target(3), target(6), target(9), target(12)}; if the number of CPU cores N is 3 and the number of targets M is 10, then the quotient is 10 / 3, and the grouping parameter group is determined to be 3. Then, according to the preset affinity calculation rule, we can obtain CPU(1) = {target(1), target(4), target(7), target(10)}, CPU(2) = {target(2), target(5), target(8)}, CPU(3) = {target(3), target(6), target(9)}.
[0071] According to the above preset affinity calculation rules, the numbers of multiple targets assigned to the same CPU core are discontinuous, which better represents the randomness of the targets and can more accurately represent the integrity of the target cluster. When the number of targets is greater than the number of CPU cores, each CPU core in the hardware platform is assigned a target with affinity, which can ensure load balancing of multiple CPU cores.
[0072] In addition, in addition to the above-mentioned preset affinity calculation rules, other affinity calculation rules can also be used. For example, in an embodiment of the present invention, first, according to the quotient obtained by dividing the number of targets by the number of CPU cores in the hardware platform, the largest integer less than the quotient can be determined as a grouping parameter; then, starting from the starting number, a continuous number of targets with the same number as the grouping parameter is selected as a group, and a total number of groups with the same number as the number of CPU cores is selected. If there are no ungrouped targets, then the target with affinity corresponding to each CPU core is the target corresponding to one of the target numbers in one group; if there are still ungrouped targets, the ungrouped target numbers are randomly assigned to one of the groups, and the target with affinity corresponding to each CPU core is the target corresponding to one of the target numbers after random assignment.
[0073] In addition, after determining the targets that have affinity with each CPU core, the configuration interface of the VxWorks system is used to set the affinity relationship between each target and the corresponding computing task of the CPU core, so that each CPU core can call the corresponding computing task to calculate the target with which the affinity relationship has been set.
[0074] Finally, for step 106, on each CPU core of the target having affinity, a corresponding computing task is called to perform computing on the target having affinity with the CPU core.
[0075] In the embodiment of the present invention, please refer to Figure 2 , at least the following steps 200-206 can be used for calculation:
[0076] Step 200, creating blocked semaphores for targets having affinity with the CPU core respectively, each semaphore including a target number of the corresponding target;
[0077] Step 202, passing a semaphore from the blocked semaphores, and obtaining a target number of a corresponding target from the passed semaphore;
[0078] Step 204, acquiring scattered echo data of the corresponding target according to the target number;
[0079] Step 206, calculate the target characteristics of the scattered echo data, and after the calculation is completed, return to the step of passing one signal from the blocked signal until there is no blocked signal.
[0080] In this embodiment, each computing task can perform target scattered echo calculations on multiple targets in sequence. According to the affinity calculation result, in the callback function of the computing task corresponding to each CPU, all blocked semaphores with corresponding target numbers are created, a semaphore is passed from the blocked semaphores, and the target number of the target and the scattered echo data of the corresponding target are obtained from the passed semaphore. The scattered echo data includes the position and posture of the target, and the target characteristic calculation is performed on the scattered echo data to obtain the scattered echo of the target.
[0081] In one embodiment of the present invention, in order to facilitate statistics on whether multiple targets have been calculated in parallel, after the target characteristic calculation is performed on the scattered echo data, a calculation completion flag corresponding to the target number is generated. For example, after the target characteristic calculation of the target is completed, the calculation completion flag FLAG[i] of the target is set to true, where i is the target number. After the target scattered echo calculation of this target is completed, the next semaphore is passed from the blocked semaphores, and the same steps as the previous one are performed until all targets with affinity to the CPU core are calculated.
[0082] In addition, a calculation completion flag may be set for the target number in advance. When the target is not calculated, the calculation completion flag may be FLAG[i]=flase. After the target characteristic calculation is performed on the scattered echo data, the calculation completion flag corresponding to the target number is modified to FLAG[i]=true.
[0083] Finally, after calling the corresponding computing task to calculate the target having affinity with the CPU core, it is determined whether the number of current computing completion flags is equal to the number of the targets. If so, it is determined that the parallel computing is terminated.
[0084] like Figure 3 , Figure 4 As shown, an embodiment of the present invention provides a multi-target scattered echo parallel computing device. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. From the hardware level, Figure 3 FIG. 1 is a hardware architecture diagram of a computing device where a multi-target scattered echo parallel computing device provided by an embodiment of the present invention is located, except Figure 3 In addition to the processor, memory, network interface, and non-volatile memory shown in the figure, the computing device in which the device is located in the embodiment may also generally include other hardware, such as a forwarding chip responsible for processing messages, etc. Taking software implementation as an example, Figure 4 As shown, as a device in a logical sense, the CPU of the computing device in which it is located reads the corresponding computer program in the non-volatile memory into the memory and runs it. This embodiment provides a multi-target scattered echo parallel computing device, which is located in a VxWorks system mounted on a hardware platform, and the hardware platform includes more than two CPU cores; the device includes:
[0085] A quantity determination unit 401 is used to determine the number of CPU cores and the number of targets to be processed in the hardware platform;
[0086] A computing task creation unit 402, configured to create two or more computing tasks corresponding to the CPU cores according to the number of CPU cores in the hardware platform;
[0087] An affinity determination unit 403, configured to determine a target having affinity with each CPU core according to the number of CPU cores in the hardware platform and the number of targets;
[0088] The parallel computing unit 404 is used to call the corresponding computing task on each CPU core of the target having affinity to perform computing on the target having affinity with the CPU core.
[0089] In an embodiment of the present invention, the computing task creation unit 402 is specifically configured to create a number of computing tasks equal to the number of CPU cores in the hardware platform, and the two or more computing tasks correspond one-to-one to the two or more CPU cores.
[0090] In an embodiment of the present invention, the affinity determination unit 403 is specifically configured to determine a grouping parameter according to a quotient obtained by dividing the number of targets by the number of CPU cores in the hardware platform; and calculate a target having an affinity with each CPU core according to a preset affinity calculation rule and the grouping parameter.
[0091] In an embodiment of the present invention, when the affinity determination unit 403 executes to determine the grouping parameter according to the quotient obtained by dividing the number of targets by the number of CPU cores in the hardware platform, it is specifically configured to determine the largest integer less than the quotient as the grouping parameter; when the affinity determination unit 403 executes to calculate the target having an affinity with each CPU core according to the preset affinity calculation rule and the grouping parameter, it is specifically configured to substitute the grouping parameter into the following preset affinity calculation rule to obtain a target having an affinity with each CPU core; the preset affinity calculation rule includes:
[0092] CPU(j) = {target(j + N * 0), target(j + N * 1), target(j + N * 2), …, target(j + N * group)}
[0093] where group is the grouping parameter; 0 < j ≤ N, and j is an integer, N is the number of CPU cores in the hardware platform, M is the number of targets, j + N * group ≤ M, CPU(j) is the jth CPU core, and target(x) is the target numbered x.
[0094] In an embodiment of the present invention, there are multiple targets, and all of them are located in the same target cluster.
[0095] Please refer to Figure 5 , the multi-target scattered echo parallel computing device may further include:
[0096] A number configuration unit 405, configured to determine the relationship between multiple targets in the target cluster, and configure a number for each target according to the relationship between multiple targets in the target cluster.
[0097] In one embodiment of the present invention, when the parallel computing unit 404 executes the call corresponding computing task to calculate the target having affinity with the CPU core, it is specifically used to create blocked semaphores for the targets having affinity with the CPU core, each semaphore including the target number of the corresponding target; pass a semaphore from the blocked semaphores, and obtain the target number of the corresponding target from the passed semaphore; obtain the scattered echo data of the corresponding target according to the target number; calculate the target characteristics of the scattered echo data, and return to the step of passing a semaphore from the blocked semaphores after the calculation is completed until there is no blocked semaphore.
[0098] In one embodiment of the present invention, the parallel computing unit 404 is further used to generate a calculation completion flag corresponding to the target number after executing the target characteristic calculation on the scattered echo data; the parallel computing unit 404 is also used to determine whether the current number of calculation completion flags is equal to the number of targets after the corresponding computing task is called to calculate the targets having affinity with the CPU core, and if so, determine that the parallel computing is terminated.
[0099] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on a multi-target scattered echo parallel computing device. In other embodiments of the present invention, a multi-target scattered echo parallel computing device may include more or fewer components than those shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0100] The information interaction, execution process and other contents between the modules in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention. For the specific contents, please refer to the description in the embodiment of the method of the present invention, and no further description is given here.
[0101] An embodiment of the present invention further provides a computing device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, a multi-target scattered echo parallel computing method in any embodiment of the present invention is implemented.
[0102] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the processor executes a multi-target scattered echo parallel calculation method in any embodiment of the present invention.
[0103] Specifically, a system or device equipped with a storage medium can be provided, on which software program code that implements the functions of any of the above-mentioned embodiments is stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program code stored in the storage medium.
[0104] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
[0105] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.
[0106] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.
[0107] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.
[0108] It should be noted that, in this article, relational terms such as first and second 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 statement "comprise a ..." do not exclude the presence of other identical factors in the process, method, article or device including the elements.
[0109] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.
[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A parallel calculation method for scattered echoes of multiple targets, characterized in that: Applied to the VxWorks system running on a hardware platform, where there are more than two CPU cores in the hardware platform; the method includes: Determine the number of CPU cores in the hardware platform and the number of targets to be processed; Create more than two computing tasks corresponding to the CPU cores according to the number of CPU cores in the hardware platform; Determine the targets with affinity to each CPU core according to the number of CPU cores in the hardware platform and the number of the targets; On each CPU core with an affinity target, call the corresponding computing task to calculate the target with affinity to this CPU core; The calling the corresponding computing task to calculate the target with affinity to this CPU core includes: Create blocked semaphores for the targets with affinity to this CPU core respectively, and each semaphore includes the target number of the corresponding target; Pass one semaphore from the blocked semaphores, and obtain the target number of the corresponding target from the passed semaphore; Obtain the scattered echo data of the corresponding target according to the target number; Perform target characteristic calculation on the scattered echo data, and after the calculation is completed, return to the step of passing one semaphore from the blocked semaphores until there are no blocked semaphores.
2. The method according to claim 1, characterized in that The number of created computing tasks is equal to the number of CPU cores in the hardware platform, and the more than two computing tasks correspond one-to-one with the more than two CPU cores.
3. The method according to claim 1, characterized in that The determining the targets with affinity to each CPU core according to the number of CPU cores in the hardware platform and the number of the targets includes: Determine the grouping parameter according to the quotient obtained by dividing the number of the targets by the number of CPU cores in the hardware platform; Calculate the targets with affinity to each CPU core according to the preset affinity calculation rule and the grouping parameter.
4. The method according to claim 3, wherein The determining the grouping parameter according to the quotient obtained by dividing the number of the targets by the number of CPU cores in the hardware platform includes: determining the largest integer less than the quotient as the grouping parameter; The calculating the targets with affinity to each CPU core according to the preset affinity calculation rule and the grouping parameter includes: substituting the grouping parameter into the following preset affinity calculation rule to obtain the targets with affinity to each CPU core; The preset affinity calculation rule includes: CPU(j) = {target(j + N * 0), target(j + N * 1), target(j + N * 2), …, target(j + N * group)} Where group is the grouping parameter; 0 < j ≤ N, and j is an integer, N is the number of CPU cores in the hardware platform, M is the number of the targets, j + N * group ≤ M, CPU(j) is the jth CPU core, and target(x) is the target with the number x.
5. The method according to claim 1, characterized in that: The targets are multiple and are all in the same target cluster; Before determining the target having affinity with each CPU core, the method further includes: determining the relationship between multiple targets in the target cluster, and configuring a number for each target according to the relationship between the multiple targets in the target cluster.
6. The method according to claim 5, characterized in that After the target characteristic calculation is performed on the scattered echo data, the method further includes: generating a calculation completion mark corresponding to the target number; After the calling corresponding computing task calculates the target having affinity with the CPU core, it also includes: determining whether the number of current computing completion flags is equal to the number of the targets, and if so, determining that the parallel computing is ended.
7. A multi-target scattered echo parallel computing device, characterized in that: A VxWorks system mounted on a hardware platform, wherein the hardware platform includes more than two CPU cores; the device includes: A quantity determination unit, used to determine the number of CPU cores and the number of targets to be processed in the hardware platform; A computing task creation unit, used to create two or more computing tasks corresponding to the CPU cores according to the number of CPU cores in the hardware platform; an affinity determination unit, configured to determine a target having affinity with each CPU core according to the number of CPU cores in the hardware platform and the number of targets; A parallel computing unit is used to call a corresponding computing task on each CPU core of a target having affinity to perform computing on the target having affinity to the CPU core; When executing the call of the corresponding computing task to calculate the target having affinity with the CPU core, the parallel computing unit is specifically used to create blocked semaphores for the targets having affinity with the CPU core, each semaphore including the target number of the corresponding target; pass a semaphore from the blocked semaphores, and obtain the target number of the corresponding target from the passed semaphore; obtain scattered echo data of the corresponding target according to the target number; calculate the target characteristics of the scattered echo data, and return to the step of passing a semaphore from the blocked semaphores after the calculation is completed, until there is no blocked semaphore.
8. A computing device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
A multi-core processing system and a task allocation method thereof
CN108958944A