Parallel task computing method and apparatus for multiple hardware devices, and service device

By acquiring multiple idle computing units in the service equipment of the data center and matching them with multiple hardware devices, the parallel operation of multiple hardware devices is achieved, which solves the problem of insufficient computing capabilities in the data center and improves data processing efficiency.

WO2025118397A1PCT designated stage expired Publication Date: 2025-06-12GUANGDONG INST OF ARTIFICIAL INTELLIGENCE & ADVANCED COMPUTING
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/072922
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-06
Filing Date
2024-01-18
Publication Date
2025-06-12

AI Technical Summary

Technical Problem

When existing data centers face explosive growth, their computing power is insufficient, resulting in low data processing efficiency.

Method used

By acquiring multiple idle computing units in the service device and matching them with multiple hardware devices, multiple hardware devices can be realized to operate in parallel, thereby improving data transmission efficiency and accuracy of calculation results.

Benefits of technology

It effectively improves the computing power and data processing efficiency of the data center. Through efficient data transmission and parallel computing, the target calculation results of multiple acquisition tasks are accurately determined.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024072922_12062025_PF_FP_ABST
    Figure CN2024072922_12062025_PF_FP_ABST
Patent Text Reader

Abstract

The present invention provides a parallel task computing method and apparatus for multiple hardware devices, and a service device. The service device is connected to the multiple hardware devices, and the method comprises: acquiring multiple first computing units in an idle state in the service device and a collection task associated with each first computing unit; on the basis of the multiple first computing units and the multiple hardware devices, determining second computing units respectively corresponding to the multiple first computing units; sending multiple collection tasks to the corresponding second computing units respectively, wherein each collection task is used for the corresponding second computing unit to determine a computing result; and on the basis of the computing results respectively returned by the multiple second computing units, determining target computing results corresponding to the multiple collection tasks. In the method, the multiple hardware devices can operate in parallel such that the service device can perform efficient data transmission with the multiple hardware devices to determine the target computing results corresponding to the multiple collection tasks, and the computing capability of a data center can thus be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device and service equipment for parallel task calculation of multiple hardware devices Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device and service equipment for parallel task calculation of multiple hardware devices. Background Art

[0002] With the rapid development of the internet, the digital upgrade of traditional industries, and the rise of artificial intelligence, the computing power of data centers is insufficient to cope with the explosive growth of data. These data centers can accommodate multiple service devices and hardware equipment.

[0003] Therefore, it is increasingly urgent to improve the computing power of data centers. Summary of the Invention

[0004] The present invention provides a method, apparatus and service device for parallel task calculation of multiple hardware devices. When the service device is connected to multiple hardware devices, since these multiple hardware devices can run in parallel, the service device can efficiently transmit data with these multiple hardware devices to accurately determine the target calculation results corresponding to multiple acquisition tasks. This can effectively improve the computing power of the data center and further improve the data processing efficiency of the data center.

[0005] The present invention provides a method for parallel task calculation of multiple hardware devices, which is applied to a service device connected to multiple hardware devices. The method includes:

[0006] Acquire multiple first computing units in the service device that are in an idle state, and a collection task associated with each of the first computing units;

[0007] Determining, according to the plurality of first computing units and the plurality of hardware devices, a second computing unit corresponding to each of the plurality of first computing units, where the second computing unit is located in the plurality of hardware devices;

[0008] Sending the plurality of collection tasks to the corresponding second computing units respectively, and for each of the collection tasks, using the corresponding second computing unit to determine a computing result;

[0009] The target calculation results corresponding to the multiple acquisition tasks are determined according to the calculation results returned by each of the multiple second calculation units.

[0010] According to a method for parallel task calculation of multiple hardware devices provided by the present invention, the second computing unit corresponding to each of the multiple first computing units is determined based on the multiple first computing units and the multiple hardware devices, including: sorting all the third computing units in the service device to obtain a computing unit pool, to which the first computing unit belongs; for each first computing unit in the computing unit pool, determining the serial number corresponding to the first computing unit from the computing unit pool, and obtaining the number of the hardware devices; based on the serial number and the number, determining the target hardware device corresponding to the first computing unit, and the second computing unit corresponding to the first computing unit in the target hardware device, the target hardware device being a hardware device among the multiple hardware devices.

[0011] According to a method for parallel task calculation of multiple hardware devices provided by the present invention, the target hardware device corresponding to the first computing unit and the second computing unit corresponding to the first computing unit in the target hardware device are determined based on the serial number and the quantity, including: sorting the multiple hardware devices to obtain a terminal sequence; for each hardware device, sorting all the second computing units in the hardware device to obtain a computing unit sequence; and determining the target hardware device corresponding to the first computing unit from the terminal sequence based on the serial number and the quantity, and determining the second computing unit corresponding to the first computing unit from the computing unit sequence corresponding to the target hardware device.

[0012] According to a method for parallel task calculation of multiple hardware devices provided by the present invention, the target hardware device corresponding to the first computing unit is determined from the terminal sequence based on the serial number and the quantity, and the second computing unit corresponding to the first computing unit is determined from the computing unit sequence corresponding to the target hardware device, including: determining the remainder and the integer division result respectively based on the serial number and the quantity; determining the hardware device corresponding to the serial number identical to the remainder in the terminal sequence as the target hardware device corresponding to the first computing unit; and determining the second computing unit corresponding to the serial number identical to the integer division result in the computing unit sequence corresponding to the target hardware device as the second computing unit corresponding to the first computing unit.

[0013] According to a method for parallel task calculation of multiple hardware devices provided by the present invention, for each first computing unit, after obtaining the acquisition task associated with the first computing unit, the method further includes: switching the first computing unit from the idle state to the busy state, and switching the first computing unit from the busy state to the idle state when receiving the calculation result returned by the second computing unit corresponding to the first computing unit.

[0014] According to a multi-hardware device parallel task calculation method provided by the present invention, the target calculation results corresponding to the multiple acquisition tasks are determined based on the calculation results returned by each of the multiple second calculation units, including: processing the calculation results returned by each of the multiple second calculation units to obtain the target calculation results corresponding to the multiple acquisition tasks; wherein the processing includes at least one of the following: verification, merging and deduplication.

[0015] The present invention also provides a multi-hardware device parallel task computing device, which is applied to a service device connected to multiple hardware devices. The device includes:

[0016] an acquisition module, configured to acquire a plurality of first computing units in an idle state in the service device, and a collection task associated with each of the first computing units;

[0017] a processing module, configured to determine, based on the plurality of first computing units and the plurality of hardware devices, a second computing unit corresponding to each of the plurality of first computing units, where the second computing unit is located in the plurality of hardware devices;

[0018] a transceiver module, configured to send a plurality of collection tasks to corresponding second calculation units respectively, wherein the collection task is used by the corresponding second calculation unit to determine a calculation result for each collection task;

[0019] The processing module is further configured to determine target calculation results corresponding to the multiple acquisition tasks based on the calculation results returned by each of the multiple second calculation units.

[0020] The present invention also provides a service device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for parallel task calculation of multiple hardware devices as described above is implemented.

[0021] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-mentioned methods for parallel task calculation of multiple hardware devices.

[0022] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-mentioned methods for parallel task calculation of multiple hardware devices.

[0023] The present invention provides a method, device, and service device for parallel task calculation of multiple hardware devices. The method is applied to a service device, which is connected to multiple hardware devices. The method obtains multiple first computing units in an idle state in the service device and the collection tasks associated with each of the first computing units; determines the second computing units corresponding to each of the multiple first computing units based on the multiple first computing units and the multiple hardware devices, and the second computing units are located in the multiple hardware devices; sends multiple collection tasks to the corresponding second computing units respectively, and for each of the collection tasks, the collection task is used to determine the calculation result of the corresponding second computing unit; and determines the target calculation results corresponding to the multiple collection tasks based on the calculation results returned by each of the multiple second computing units. In this method, when the service device is connected to multiple hardware devices, since these multiple hardware devices can run in parallel, the service device can perform efficient data transmission with these multiple hardware devices to accurately determine the target calculation results corresponding to multiple collection tasks, which can effectively improve the computing power of the data center and thereby improve the data processing efficiency of the data center. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. 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 any creative work.

[0025] FIG1a is a schematic diagram of one scenario of a task calculation method provided by the prior art;

[0026] FIG1b is a second schematic diagram of a scenario of a task calculation method provided by the prior art;

[0027] FIG2 is a schematic diagram of a scenario of a method for parallel task calculation using multiple hardware devices provided by the present invention;

[0028] FIG3 is a flow chart of a method for parallel task calculation on multiple hardware devices provided by the present invention;

[0029] FIG4 is a corresponding schematic diagram of the first calculation unit and the second calculation unit provided by the present invention;

[0030] FIG5a is a schematic diagram of a management process of a computing unit pool provided by the present invention;

[0031] FIG5b is a second schematic diagram of the management process of the computing unit pool provided by the present invention;

[0032] FIG5c is a third schematic diagram of the management process of the computing unit pool provided by the present invention;

[0033] FIG5 d is a fourth schematic diagram of the management process of the computing unit pool provided by the present invention;

[0034] FIG5e is a fifth schematic diagram of the management process of the computing unit pool provided by the present invention;

[0035] FIG6 is a second flow chart of the method for parallel task calculation on multiple hardware devices provided by the present invention;

[0036] 7 is a schematic diagram of the structure of a multi-hardware device parallel task computing device provided by the present invention;

[0037] FIG8 is a schematic structural diagram of the service device provided by the present invention. DETAILED DESCRIPTION

[0038] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0039] Figures 1a and 1b illustrate an example scenario of a task computation method in the prior art. In Figures 1a and 1b, the service device (Host) is connected to only one hardware device, Device0, which contains eight control units (CUs): CU0, CU1, CU2, CU3, CU4, CU5, CU6, CU7, and CU8.

[0040] As shown in Figures 1a and 1b, the service device Host and hardware device Device0 communicate via the Peripheral Component Interconnect express 0 (PCIe0) bus. The service device Host reads data, which is then transferred to hardware device Device0 via PCIe0. Hardware device Device0 then performs calculations using its own computing unit and transmits the results to hardware device Device0.

[0041] As can be seen from Figure 1a, the shortcoming of this task calculation method is that the data processing throughput of hardware device Device0, that is, the maximum bandwidth between hardware device Device0 and bus PCIe0, is all busy, making the computing power of hardware device Device0 a performance bottleneck.

[0042] As can be seen from Figure 1b, the shortcomings of this task calculation method are: the bandwidth between hardware device Device0 and bus PCIe0, that is, the maximum throughput of data processing by hardware device Device0, and some computing units in hardware device Device0 are idle, causing bus PCIe0 to become a performance bottleneck.

[0043] In summary, the shortcomings of the task calculation methods in the prior art are that, when faced with complex and large-scale task calculations, the computing performance of a single hardware device cannot meet the computing requirements. Even if a single hardware device has sufficiently high computing efficiency, the channel bandwidth between the hardware device and the PCIe bus has an upper limit, which also makes the computing performance of the single hardware device insufficient to meet the computing requirements. In other words, when a single hardware device processes multiple collection tasks sent by a service device, the limitations of the data center can easily lead to low data processing efficiency in the data center. In this case, the data center only includes one service device and one hardware device.

[0044] It should be noted that Figure 2 is a schematic diagram of a scenario illustrating the method for parallel task computation using multiple hardware devices provided by the present invention. In Figure 2, a service device can connect to four hardware devices: a first hardware device, Device 0; a second hardware device, Device 1; a third hardware device, Device 2; and a fourth hardware device, Device 3.

[0045] Among them, the service device can also be called a server host (Host), which refers to a computer system that manages and transmits data information.

[0046] The service device stores data (such as collection tasks) in its hard disk or memory.

[0047] Hardware devices can also be called heterogeneous computing hardware.

[0048] Optionally, the hardware device may include at least one of the following: a graphics processing unit (GPU), a field-programmable gate array (FPGA), and an application-specific integrated circuit (ASIC).

[0049] Optionally, the service device and each hardware device may transmit data via a PCIe channel, wherein the service device and the first hardware device Device0 may transmit data via the PCIe0 channel, ..., and the service device and the fourth hardware device Device3 may transmit data via the PCIe3 channel.

[0050] As shown in Figure 2, the service device can exchange information with multiple parallel hardware devices. This process not only increases the computing power of the data center, but also effectively improves the overall utilization of the PCIe bus, thereby increasing the data processing efficiency of multiple acquisition tasks. In this case, the data center includes a service device and multiple parallel hardware devices, which can effectively improve the query performance of the data center's database.

[0051] It should be noted that the execution subject involved in the embodiment of the present invention can be a task computing device with multiple hardware devices running in parallel, or it can be a service device that can be connected to multiple hardware devices.

[0052] The embodiment of the present invention will be further described below by taking a service device as an example.

[0053] FIG3 is a flow chart of a method for parallel task calculation on multiple hardware devices provided by the present invention, which may include:

[0054] 301. Acquire multiple first computing units in an idle state in a service device, and a collection task associated with each first computing unit.

[0055] The first computing unit refers to a computing unit in the service device that is used to read data (such as acquisition tasks) and process data (such as calculation results).

[0056] The idle state refers to a current state of the first computing unit that is neither reading data nor processing data.

[0057] The collection task refers to the data processing task that the service device reads from the database.

[0058] Optionally, the collection task may include: text data, image data, audio data, video data, etc.

[0059] The service device has multiple third computing units. These units may be idle or busy, without specific limitations. In this case, the service device may identify the idle third computing unit as the first computing unit from the multiple third computing units, so that the service device can subsequently read the collection task associated with the first computing unit. There may be multiple first computing units.

[0060] In addition, the service device can first generate multiple collection tasks, and then associate each collection task with the corresponding third computing unit. In this way, after obtaining multiple first computing units, the service device can obtain the collection tasks corresponding to each first computing unit, that is, the number of collection tasks is also multiple.

[0061] The busy state refers to the current state of the first computing unit being in a state of reading data or processing data.

[0062] Optionally, the collection tasks associated with different first computing units may be the same or different, which is not specifically limited here.

[0063] 302. Determine, based on the plurality of first computing units and the plurality of hardware devices, a second computing unit corresponding to each of the plurality of first computing units.

[0064] The second computing unit is located in a plurality of hardware devices, and is used to calculate the acquisition task corresponding to the second computing unit.

[0065] It should be noted that the number of second computing units in each hardware device is not limited and can be the same or different, and is not specifically limited here.

[0066] For example, in conjunction with FIG2 , the first hardware device has 7 second computing units, the second hardware device has 8 second computing units, the third hardware device has 8 second computing units, and the fourth hardware device has 8 second computing units.

[0067] In some embodiments, the service device determines the second computing unit corresponding to each of the multiple first computing units based on the multiple first computing units and the multiple hardware devices, which may include: the service device sorts all the third computing units in the service device to obtain a computing unit pool, and the first computing unit belongs to the third computing unit; the service device determines the serial number corresponding to the first computing unit from the computing unit pool for each first computing unit in the computing unit pool, and obtains the number of hardware devices; determines the target hardware device corresponding to the first computing unit and the second computing unit corresponding to the first computing unit in the target hardware device based on the serial number and the number, and the target hardware device is a hardware device among the multiple hardware devices.

[0068] The number of hardware devices is an integer greater than 1.

[0069] After obtaining all third computing units, the service device may arrange all third computing units according to consecutive serial numbers to obtain a corresponding computing unit pool. If all third computing units are in an idle state, all first computing units in the computing unit pool are arranged according to the consecutive serial numbers.

[0070] The following steps are performed for any first computing unit in the computing unit pool: the service device first determines the serial number corresponding to the first computing unit from the computing unit pool, and obtains the number of hardware devices connected to the service device; then, the service device calculates the serial number and the number, and can determine the target hardware device corresponding to the first computing unit from multiple hardware devices, and determine the second computing unit corresponding to the first computing unit in the target hardware device.

[0071] Based on this, the service device can obtain the target hardware device and the corresponding second computing unit corresponding to each first computing unit in the computing unit pool.

[0072] Since the first computing unit and the second computing unit are in one-to-one correspondence, the service device will obtain as many second computing units as there are first computing units, that is, the number of the second computing units is the same as the number of the first computing units.

[0073] It should be noted that the service device has no limitation on the timing of obtaining the serial numbers corresponding to the first computing units and the number of hardware devices.

[0074] In some embodiments, the service device determines the target hardware device corresponding to the first computing unit and the second computing unit corresponding to the first computing unit in the target hardware device based on the serial number and quantity, which may include: the service device sorts multiple hardware devices to obtain a terminal sequence; the service device sorts all the second computing units in the hardware device for each hardware device to obtain a computing unit sequence; the service device determines the target hardware device corresponding to the first computing unit from the terminal sequence based on the serial number and quantity, and determines the second computing unit corresponding to the first computing unit from the computing unit sequence corresponding to the target hardware device.

[0075] The service device can first arrange the multiple connected hardware devices according to consecutive serial numbers to obtain the corresponding terminal sequence, and then perform the following steps for any of the multiple hardware devices: the service device obtains all the second computing units in the hardware device, and arranges all the second computing units according to consecutive serial numbers to obtain the corresponding computing unit sequence. Based on this, the service device will determine the number of computing unit sequences as many as there are hardware devices.

[0076] Then, for each first computing unit, the service device first obtains the serial number of the first computing unit in the computing unit pool, and then, combined with the number of hardware devices obtained previously, determines the target hardware device corresponding to the first computing unit from the terminal sequence; then, the service device first determines the computing unit sequence corresponding to the target hardware device from multiple computing unit sequences, and then determines the second computing unit corresponding to the first computing unit.

[0077] It should be noted that the service device is not limited to the timing of determining the terminal sequence and determining the sequences of the multiple computing units.

[0078] In some embodiments, the service device determines the target hardware device corresponding to the first computing unit from the terminal sequence based on the serial number and quantity, and determines the second computing unit corresponding to the first computing unit from the computing unit sequence corresponding to the target hardware device, which may include: the service device determines the remainder and the integer division result respectively based on the serial number and quantity; the service device determines the hardware device corresponding to the serial number identical to the remainder in the terminal sequence as the target hardware device corresponding to the first computing unit; and determines the second computing unit corresponding to the serial number identical to the integer division result in the computing unit sequence corresponding to the target hardware device as the second computing unit corresponding to the first computing unit.

[0079] In the process of determining the target hardware device corresponding to the first computing unit, the service device may first divide the serial number of the first computing unit by the number of hardware devices to obtain a remainder; then, the service device compares the remainder with the serial numbers in the terminal sequence one by one until the hardware device corresponding to the serial number identical to the remainder is determined as the target hardware device.

[0080] In the process of determining the second computing unit corresponding to the first computing unit, the service device may first divide the serial number of the first computing unit by the number of hardware devices to obtain an integer division result; then, the service device compares the integer division result with the serial numbers in the computing unit sequence corresponding to the target hardware device one by one until the second computing unit corresponding to the serial number identical to the integer division result is determined as the second computing unit corresponding to the first computing unit.

[0081] Optionally, the service device divides the serial number of the first computing unit by the number of hardware devices to obtain a remainder, which may include: the service device determines the remainder according to a first formula.

[0082] Among them, the first formula is: N=K%Q;

[0083] N represents the remainder; K represents the serial number; Q represents the quantity; (·%·) represents the remainder after division.

[0084] Optionally, the service device divides the serial number of the first computing unit by the number of hardware devices to obtain an integer divisibility result, which may include: the service device obtains the integer divisibility result according to a second formula.

[0085] Among them, the second formula is: M=K / Q;

[0086] M represents the result of integer division; (· / ·) represents the result of division and rounding.

[0087] For example, with reference to FIG4 , for the first computing unit CU10 in the computing unit pool, the service device determines that the serial number K of the first computing unit CU10 is 10, and the number Q of hardware devices connected to the service device is 4. Based on this, the service device uses the first formula K%Q=10%4=2, at which point the remainder N is 2. The service device also uses the second formula K / Q=10 / 4=2, at which point the integer division result M is 2. In other words, as can be seen from FIG4 , the first computing unit CU10 corresponds to the third hardware device Device2, and to the second computing unit CU2 in the third hardware device Device2.

[0088] For example, Figure 4 shows a schematic diagram of the correspondence between the first and second computing units provided by the present invention. Figure 4 illustrates the correspondence between the computing unit pool, the terminal sequence, and all computing unit sequences. Because the first and second computing units have a one-to-one correspondence, the service device can accurately determine the correspondence between the first and second computing units based on the first and second formulas described above.

[0089] 303. Send the multiple collection tasks to the corresponding second computing units respectively. For each collection task, the collection task is used by the corresponding second computing unit to determine a computing result.

[0090] Since multiple first computing units are associated with corresponding collection tasks, and the second computing unit corresponding to each first computing unit has been determined in step 302, the service device can send multiple collection tasks to the corresponding second computing unit respectively, so that the second computing unit can calculate the corresponding collection tasks and obtain the corresponding calculation results; then, each second computing unit sends the corresponding calculation result to the corresponding first computing unit for subsequent processing by the service device.

[0091] 304. Determine target calculation results corresponding to the multiple acquisition tasks based on the calculation results returned by the multiple second calculation units.

[0092] Since the calculation results are obtained by the second computing unit calculating the corresponding collection tasks, there will be as many calculation results as there are collection tasks. After receiving the calculation results sent by all second computing units, the service device can process all calculation results to accurately determine the target calculation results corresponding to multiple collection tasks. Compared to the prior art, where a single hardware device processes all collection tasks, in this embodiment of the present invention, the service device exchanges data with multiple hardware devices, effectively improving the processing efficiency of collection tasks.

[0093] In some embodiments, for each first computing unit, after the service device obtains the collection task associated with the first computing unit, the method may also include: the service device switches the first computing unit from an idle state to a busy state, and upon receiving the calculation result returned by the second computing unit corresponding to the first computing unit, switches the first computing unit from the busy state to the idle state.

[0094] For any first computing unit among multiple first computing units, since the first computing unit is in an idle state, after the service device obtains the collection task associated with the first computing unit, the first computing unit can be switched from the idle state to the busy state, so that the first computing unit at this time no longer performs other data processing operations.

[0095] However, when the first computing unit receives the calculation result returned by the second computing unit corresponding to the first computing unit, the first computing unit can be switched from a busy state to an idle state. In this way, while releasing the space resources of the first computing unit, it can also provide space for other subsequent data processing operations.

[0096] Optionally, the method may further include: the service device sets the current state of all third computing units in the computing unit pool to an idle state; the service device polls all third computing units in the idle state and manages the current state of each third computing unit.

[0097] After obtaining the computing unit pool, the service device can first set the current status of all third computing units in the computing unit pool to an idle state to facilitate subsequent reading of their corresponding acquisition tasks; then, the service device polls all third computing units in the idle state, and manages the current status of each third computing unit based on whether each third computing unit processes data.

[0098] Optionally, the service device polls all third computing units in the idle state and manages the current state of each third computing unit, which may include: when the service device obtains the first acquisition task corresponding to the first subunit, setting the current state of the first subunit to the busy state; S1, and when obtaining the second acquisition task corresponding to the second subunit, setting the current state of the second subunit to the busy state, the first subunit is the third computing unit with the first serial number in the computing unit pool, and the second subunit is adjacent to the first subunit; the service device S2, when obtaining the first calculation result corresponding to the first acquisition task, converts the first subunit from the busy state to the idle state; the service device determines the second subunit as the new first subunit, and repeats the above steps S1 and S2 until the last subunit in the computing unit pool is polled; when the service device obtains the last acquisition task corresponding to the last subunit, setting the current state of the last subunit to the busy state; and when obtaining the last calculation result corresponding to the last acquisition task, converting the last subunit from the busy state to the idle state.

[0099] For example, assuming that the number of hardware devices connected to the service device is 4, and each hardware device has 8 second computing units, then a computing unit pool corresponding to 4*8=32 first computing units can be established in the service device, that is, there is a one-to-one correspondence between the first computing unit and the second computing unit. As shown in Figures 5a-5e, it is a schematic diagram of the management process of the computing unit pool provided by the present invention. In combination with Figures 5a-5e, it can be seen that in Figure 5a, the computing unit pool obtained by the service device includes 32 third computing units. Then, the service device first sets the current status of these 32 third computing units to an idle state; then, the service device polls these 32 third computing units. During the polling process, as shown in Figure 5b, the service device first obtains the first acquisition task corresponding to the first subunit (i.e., the third computing unit CU0). At this time, the current state of the third computing unit CU0 can be set to a busy state.

[0100] As shown in Figure 5c, S1, when the service device obtains the second acquisition task corresponding to the second sub-unit (i.e., the third computing unit CU1), sets the current state of the third computing unit CU1 to a busy state. At this time, the current states of the third computing unit CU0 and the third computing unit CU1 are both in a busy state.

[0101] As shown in Figure 5d, S2, upon obtaining the first computation result corresponding to the first acquisition task, switches the third computing unit CU1 from a busy state to an idle state. Subsequently, upon obtaining the third acquisition task corresponding to the third computing unit CU2, the current state of the third computing unit CU2 is set to a busy state. At this point, both the third computing unit CU1 and the third computing unit CU2 are currently busy.

[0102] Then, starting from the third computing unit CU2, the third computing unit after the third computing unit CU2 can be determined as the new first sub-unit, and the above steps S1 and S2 can be repeated until the last sub-unit in the computing unit pool (i.e., the third computing unit CU31) is polled; when the service device obtains the last acquisition task corresponding to the third computing unit CU31, the current state of the third computing unit CU31 is set to the busy state; and when the last calculation result corresponding to the last acquisition task is obtained, the third computing unit CU31 is converted from the busy state to the idle state. At this time, as shown in Figure 5a, the current states of the 32 third computing units included in the computing unit pool are all in the idle state.

[0103] In some embodiments, the service device determines the target calculation results corresponding to multiple collection tasks based on the calculation results returned by each of the multiple second calculation units, which may include: the service device processes the calculation results returned by each of the multiple second calculation units to obtain the target calculation results corresponding to the multiple collection tasks.

[0104] The processing includes at least one of the following: verification, merging, and deduplication.

[0105] Since there are as many second computing units as there are first computing units, after obtaining the computing results returned by each second computing unit, the service device can process all the computing results to obtain target computing results corresponding to multiple collection tasks.

[0106] When the processing is verification, the uniqueness of the calculation result and the corresponding second calculation unit can be guaranteed; when the processing is merging, the integrity of the target calculation result can be guaranteed; when the processing is deduplication, the accuracy of the target calculation result can be guaranteed to improve the data processing efficiency of all calculation results.

[0107] In summary, as shown in Figure 6, there is a flow chart of the multi-hardware device parallel task calculation method provided by the present invention. In Figure 6, the service device may involve a main thread and a worker thread in the process of determining the target calculation result.

[0108] In the main thread, the service device may construct a computing unit pool based on all third computing units; then, obtain the idle first computing units CU_K from the computing unit pool; then, generate an acquisition task and associate the acquisition task with the first computing unit CU_K.

[0109] In the work thread group, the service device determines, based on the first computing unit CU_K, a target hardware device (Device_N) corresponding to the first computing unit CU_K from multiple hardware devices, and a second computing unit (CU_M) corresponding to the first computing unit CU_K within the target hardware device (Device_N). The target hardware device (Device_N) activates the second computing unit CU_M, calculates the acquisition task, and sends the result to the service device.

[0110] In the main thread, the service device receives the calculation results sent by all the second calculation units, processes all the calculation results, and obtains the target calculation results; finally, the corresponding second calculation unit is released to prepare for subsequent processing of new data.

[0111] In an embodiment of the present invention, a plurality of first computing units in an idle state in a service device and collection tasks associated with each first computing unit are obtained; based on the plurality of first computing units and the plurality of hardware devices, the second computing units corresponding to each of the plurality of first computing units are determined; the plurality of collection tasks are respectively sent to the corresponding second computing units, and for each collection task, the collection task is used to determine the calculation result of the corresponding second computing unit; based on the calculation results returned by each of the plurality of second computing units, the target calculation results corresponding to the plurality of collection tasks are determined. In this method, when the service device is connected to a plurality of hardware devices, since the plurality of hardware devices can run in parallel, the service device can perform efficient data transmission with the plurality of hardware devices to accurately determine the target calculation results corresponding to the plurality of collection tasks, which can effectively improve the computing power of the data center and thereby improve the data processing efficiency of the data center.

[0112] The following describes a multi-hardware device parallel task computing apparatus provided by the present invention. The multi-hardware device parallel task computing apparatus described below and the multi-hardware device parallel task computing method described above can refer to each other.

[0113] FIG7 is a schematic diagram of a multi-hardware device parallel task computing apparatus provided by the present invention. The apparatus is applied to a service device connected to multiple hardware devices. The apparatus may include:

[0114] An acquisition module 701 is configured to acquire a plurality of first computing units in an idle state in the service device, and a collection task associated with each of the first computing units;

[0115] A processing module 702 is configured to determine, based on the plurality of first computing units and the plurality of hardware devices, a second computing unit corresponding to each of the plurality of first computing units, where the second computing unit is located in the plurality of hardware devices;

[0116] The transceiver module 703 is used to send the plurality of collection tasks to the corresponding second calculation unit respectively, and for each of the collection tasks, the collection task is used by the corresponding second calculation unit to determine a calculation result;

[0117] The processing module 702 is further configured to determine target calculation results corresponding to the multiple acquisition tasks according to the calculation results returned by each of the multiple second calculation units.

[0118] Optionally, the processing module 702 is specifically used to sort all the third computing units in the service device to obtain a computing unit pool, to which the first computing unit belongs; for each first computing unit in the computing unit pool, determine the serial number corresponding to the first computing unit from the computing unit pool, and obtain the number of the hardware devices; based on the serial number and the number, determine the target hardware device corresponding to the first computing unit, and the second computing unit corresponding to the first computing unit in the target hardware device, the target hardware device being a hardware device among the multiple hardware devices.

[0119] Optionally, the processing module 702 is specifically used to sort the multiple hardware devices to obtain a terminal sequence; for each hardware device, sort all the second computing units in the hardware device to obtain a computing unit sequence; based on the serial number and the quantity, determine the target hardware device corresponding to the first computing unit from the terminal sequence, and determine the second computing unit corresponding to the first computing unit from the computing unit sequence corresponding to the target hardware device.

[0120] Optionally, the processing module 702 is specifically used to determine the remainder and the divisibility result according to the serial number and the quantity, respectively; determine the hardware device corresponding to the serial number identical to the remainder in the terminal sequence as the target hardware device corresponding to the first computing unit; and determine the second computing unit corresponding to the serial number identical to the divisibility result in the computing unit sequence corresponding to the target hardware device as the second computing unit corresponding to the first computing unit.

[0121] Optionally, the processing module 702 is also used to switch the first computing unit from the idle state to the busy state, and when the transceiver module 703 receives the calculation result returned by the second computing unit corresponding to the first computing unit, the first computing unit is switched from the busy state to the idle state.

[0122] Optionally, the processing module 702 is specifically used to process the calculation results returned by each of the multiple second calculation units to obtain target calculation results corresponding to the multiple acquisition tasks; wherein, the processing includes at least one of the following: verification, merging and deduplication.

[0123] FIG8 is a schematic diagram of the structure of a service device provided by the present invention. The service device may include a processor 810, a communications interface 820, a memory 830, and a communications bus 840. The processor 810, the communications interface 820, and the memory 830 communicate with each other via the communications bus 840. The processor 810 may invoke logic instructions in the memory 830 to execute a method for parallel task computation on multiple hardware devices. The method is applied to a service device connected to multiple hardware devices. The method includes: obtaining multiple idle first computing units in the service device and collection tasks associated with each of the first computing units; determining, based on the multiple first computing units and the multiple hardware devices, a corresponding second computing unit for each of the multiple first computing units, the second computing units being located in the multiple hardware devices; sending multiple collection tasks to the corresponding second computing units, respectively, for each collection task, the collection task being used by the corresponding second computing unit to determine a calculation result; and determining target calculation results corresponding to the multiple collection tasks based on the calculation results returned by the multiple second computing units.

[0124] Furthermore, the logic instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.

[0125] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the parallel task calculation method for multiple hardware devices provided by the above methods. The method is applied to a service device, which is connected to multiple hardware devices. The method includes: obtaining multiple first computing units in an idle state in the service device, and acquisition tasks associated with each of the first computing units; determining the second computing units corresponding to each of the multiple first computing units based on the multiple first computing units and the multiple hardware devices, and the second computing units are located in the multiple hardware devices; sending multiple acquisition tasks to the corresponding second computing units respectively, and for each of the acquisition tasks, the acquisition task is used for the corresponding second computing unit to determine the calculation result; determining the target calculation results corresponding to the multiple acquisition tasks based on the calculation results returned by each of the multiple second computing units.

[0126] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the parallel task calculation method for multiple hardware devices provided by the above-mentioned methods. The method is applied to a service device, which is connected to multiple hardware devices. The method includes: obtaining multiple first computing units in an idle state in the service device, and acquisition tasks associated with each of the first computing units; determining, based on the multiple first computing units and the multiple hardware devices, the second computing units corresponding to each of the multiple first computing units, and the second computing units are located in the multiple hardware devices; sending multiple acquisition tasks to the corresponding second computing units respectively, and for each of the acquisition tasks, the acquisition task is used for the corresponding second computing unit to determine the calculation result; and determining the target calculation results corresponding to the multiple acquisition tasks based on the calculation results returned by each of the multiple second computing units.

[0127] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0128] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0129] 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 various embodiments of the present invention.

Claims

1. A method for parallel task calculation of multiple hardware devices, characterized in that: Applied to a service device, the service device is connected to a plurality of hardware devices, the method comprising: Acquire multiple first computing units in the service device that are in an idle state, and a collection task associated with each of the first computing units; Determine, according to the plurality of first computing units and the plurality of hardware devices, second computing units corresponding to the plurality of first computing units respectively, where the second computing units are located in the plurality of hardware devices; Sending a plurality of collection tasks to corresponding second computing units respectively, and for each of the collection tasks, the collection task is used by the corresponding second computing unit to determine a computing result; According to the calculation results returned by each of the plurality of second calculation units, target calculation results corresponding to the plurality of acquisition tasks are determined.

2. The method according to claim 1, characterized in that The step of determining, according to the plurality of first computing units and the plurality of hardware devices, second computing units corresponding to each of the plurality of first computing units comprises: sorting all third computing units in the service device to obtain a computing unit pool, wherein the first computing unit belongs to the third computing unit; For each first computing unit in the computing unit pool, determine the serial number corresponding to the first computing unit from the computing unit pool, and obtain the number of the hardware devices; based on the serial number and the number, determine the target hardware device corresponding to the first computing unit, and the second computing unit corresponding to the first computing unit in the target hardware device, the target hardware device being a hardware device among the multiple hardware devices.

3. The method according to claim 2, characterized in that The step of determining, according to the sequence number and the quantity, a target hardware device corresponding to the first computing unit and a second computing unit in the target hardware device corresponding to the first computing unit comprises: Sorting the plurality of hardware devices to obtain a terminal sequence; For each hardware device, sorting all second computing units in the hardware device to obtain a computing unit sequence; According to the sequence number and the quantity, a target hardware device corresponding to the first computing unit is determined from the terminal sequence, and a second computing unit corresponding to the first computing unit is determined from the computing unit sequence corresponding to the target hardware device.

4. The method according to claim 3, characterized in that The step of determining, from the terminal sequence according to the sequence number and the quantity, a target hardware device corresponding to the first computing unit, and determining, from the computing unit sequence corresponding to the target hardware device, a second computing unit corresponding to the first computing unit, comprises: Determine a remainder and an integer divisibility result according to the sequence number and the quantity, respectively; The hardware device corresponding to the serial number identical to the remainder in the terminal sequence is determined as the target hardware device corresponding to the first computing unit; and the second computing unit corresponding to the serial number identical to the integer division result in the computing unit sequence corresponding to the target hardware device is determined as the second computing unit corresponding to the first computing unit.

5. The method according to any one of claims 1 to 4, characterized in that: For each of the first computing units, after acquiring the collection task associated with the first computing unit, the method further includes: The first computing unit is switched from the idle state to the busy state, and upon receiving a computing result returned by a second computing unit corresponding to the first computing unit, the first computing unit is switched from the busy state to the idle state.

6. The method according to any one of claims 1 to 4, characterized in that: The step of determining target calculation results corresponding to the plurality of acquisition tasks according to the calculation results returned by the plurality of second calculation units respectively includes: Processing the calculation results returned by each of the plurality of second calculation units to obtain target calculation results corresponding to the plurality of acquisition tasks; The processing includes at least one of the following: verification, merging and deduplication.

7. A task computing device for multiple hardware devices in parallel, characterized in that: Applied to a service device, the service device is connected to a plurality of hardware devices, and the device comprises: An acquisition module, used to acquire a plurality of first computing units in an idle state in the service device, and a collection task associated with each of the first computing units; A processing module, configured to determine, according to the plurality of first computing units and the plurality of hardware devices, second computing units corresponding to the plurality of first computing units, wherein the second computing units are located in the plurality of hardware devices; A transceiver module, used for sending a plurality of collection tasks to corresponding second computing units respectively, wherein for each of the collection tasks, the collection task is used for the corresponding second computing unit to determine a computing result; The processing module is further used to determine target calculation results corresponding to the multiple acquisition tasks according to the calculation results returned by each of the multiple second calculation units.

8. A service device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the multi-hardware device parallel task computing method as claimed in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for parallel task calculation of multiple hardware devices as claimed in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for parallel task calculation of multiple hardware devices as claimed in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Computing task processing method, device and system, server and storage medium

    CN110955461A

  • Target tracking processing method, system and related device

    CN115617532A

  • Task processing method and device based on database, equipment and storage medium

    CN115934316A

  • Hardware calculation module, device and method, electronic device and storage medium

    CN116627888A