Task processing method and device, storage medium, and electronic device

By sharing the idle computing resources in the first network to the second network in the picture and video analysis system, the problem of difficulty in adjusting computing resources is solved, and computing resources are realized efficient utilization and time-sharing multiplexing.

CN112817753BActive Publication Date: 2025-02-18ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110084621.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-21
Publication Date
2025-02-18
Estimated Expiration
2041-01-21

AI Technical Summary

Technical Problem

In the existing picture and video analysis systems, it is difficult to adjust computing power resources in a timely manner to respond to changes in business volume, resulting in insufficient computing power resources required for certain businesses or long-term idleness, increasing operation and maintenance costs.

Method used

When the current time is in the computing resource sharing time period and the target task is a non-real-time task, N computing resources in the first network are shared to the second network, and the target task is performed using N computing resources. deal with.

Benefits of technology

The computing power resources adjustment between different networks are realized, making full use of computing power resources, improving the time-sharing reuse efficiency of computing power resources, and reducing operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112817753B_ABST
    Figure CN112817753B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a task processing method and device, storage medium, and electronic device, the method comprising: when the current time is in the computing power resource sharing time period and the target task is a non-real-time task, N computing power resources in the first network are shared to the second network, wherein the target task belongs to the second network, N is a natural number greater than or equal to 1, and the N computing power resources are in an idle state; and the target task is processed using the N computing power resources. Through the present invention, the problem of adjusting computing power resources in the related art is solved, and the computing power resources are fully utilized and the time-sharing multiplexing efficiency of computing power resources is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computers, and in particular, to a task processing method and device, a storage medium, and an electronic device. Background Art

[0002] In the image and video analysis system, different business modules require different types of computing resources. In the current mainstream image and video analysis systems, various computing resources are often determined during project deployment based on pre-estimated business volumes. If the business volumes of subsequent modules change significantly, it will lead to insufficient computing resources required for some businesses, or the computing resources required for some businesses will be idle for a long time. At the same time, if the number of computing resources needs to be adjusted, it is time-consuming and labor-intensive, which greatly increases the operation and maintenance costs.

[0003] To address the above problems, no effective solutions have been proposed in the relevant technologies. Summary of the invention

[0004] The embodiments of the present invention provide a task processing method and device, a storage medium, and an electronic device to at least solve the problem of adjusting computing resources in the related art.

[0005] According to an embodiment of the present invention, a method for processing a task is provided, comprising: when the current time is within the computing resource sharing time period and the target task is a non-real-time task, sharing N computing resources in a first network to a second network, wherein the target task belongs to the second network, N is a natural number greater than or equal to 1, and the N computing resources are in an idle state; and processing the target task using the N computing resources.

[0006] According to another embodiment of the present invention, a task processing device is provided, including: a first sharing module, used to share N computing resources in a first network to a second network when the current time is in a computing resource sharing time period and the target task is a non-real-time task, wherein the target task belongs to the second network, N is a natural number greater than or equal to 1, and the N computing resources are in an idle state; and a first processing module, used to process the target task using the N computing resources.

[0007] In an exemplary embodiment, the above-mentioned device also includes: a first determination module, which is used to determine the sharing configuration of the M computing resources in the first network before sharing the N computing resources in the first network to the second network when the current time is in the computing resource sharing time period and the target task is a non-real-time task, wherein the above-mentioned sharing configuration includes the maximum sharing rate of the above-mentioned M computing resources and the sharing time period of the above-mentioned M computing resources, and the above-mentioned M is greater than or equal to the above-mentioned N.

[0008] In an exemplary embodiment, the above-mentioned first determination module includes: a first setting unit, used to set the computing power resource sharing rate of the above-mentioned first network; a first determination unit, used to determine the product of the above-mentioned M computing power resources and the above-mentioned computing power resource sharing rate as the maximum sharing rate of the above-mentioned M computing power resources.

[0009] In an exemplary embodiment, the above-mentioned first determination module includes: a second determination unit, used to determine the real-time task analysis amount of the above-mentioned first network in each time period; a second setting unit, used to set the time period when the above-mentioned real-time task analysis amount is less than the preset analysis amount as the shared time period of the above-mentioned M computing power resources.

[0010] In an exemplary embodiment, the above-mentioned device also includes: a first conversion module, which is used to share N computing resources in the first network to the second network before sharing them when the current time is within the computing resource sharing time period and the target task is a non-real-time task. If the computing resources for executing real-time tasks in the above-mentioned second network are insufficient within a preset time period, convert part of the real-time tasks in the above-mentioned second network resources into non-real-time tasks to obtain the above-mentioned target task.

[0011] In an exemplary embodiment, the above-mentioned first sharing module includes: a third determination unit, used to determine the load rate of each computing power resource in the above-mentioned first network within the above-mentioned computing power resource sharing time period, so as to determine the above-mentioned N computing power resources; a fourth determination unit, used to determine the K computing power resources required for the above-mentioned target task in the above-mentioned second network, wherein the above-mentioned K is an integer greater than or equal to 0; and a first sharing unit, used to share the above-mentioned N computing power resources to the above-mentioned second network when the above-mentioned K is less than or equal to the above-mentioned N.

[0012] In an exemplary embodiment, the above-mentioned device also includes: a recording module, which is used to record the numbers of the N computing resources in the first network after sharing them to the second network when the current time is within the computing resource sharing time period and the target task is a non-real-time task; and a rollback module, which is used to roll back the above-mentioned N computing resources to the above-mentioned first network according to the numbers of the above-mentioned N computing resources.

[0013] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when run.

[0014] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0015] Through the present invention, when the current time is in the computing power resource sharing time period and the target task is a non-real-time task, N computing power resources in the first network are shared to the second network, wherein the target task belongs to the second network, N is a natural number greater than or equal to 1, and the N computing power resources are in an idle state; the target task is processed using the N computing power resources. The adjustment of computing power resources between different networks can be achieved. Therefore, the problem of adjusting computing power resources in the related art can be solved, so as to achieve the effect of making full use of computing power resources and improving the time-sharing multiplexing efficiency of computing power resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a hardware structure block diagram of a mobile terminal of a task processing method according to an embodiment of the present invention;

[0017] Figure 2 is a flowchart of a method for processing a task according to an embodiment of the present invention;

[0018] Figure 3 is a schematic diagram of a computing resource pool according to an embodiment of the present invention;

[0019] Figure 4 is a schematic diagram of computing resource allocation according to an embodiment of the present invention;

[0020] Figure 5 is a tidal sharing configuration diagram according to an embodiment of the present invention;

[0021] Figure 6 is a schematic diagram of non-real-time task processing according to an embodiment of the present invention;

[0022] Figure 7 is a tidal scheduling flow chart according to an embodiment of the present invention;

[0023] Figure 8 is a schematic diagram of computing power resource conversion according to an embodiment of the present invention;

[0024] Fig. 9 is a structural block diagram of a task processing device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0027] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a task processing method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0028] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the processing methods of tasks in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, to implement the above-mentioned methods. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0029] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0030] In this embodiment, a task processing method is provided. Figure 2 is a flowchart of a method for processing a task according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0031] Step S202: when the current time is within the computing resource sharing time period and the target task is a non-real-time task, N computing resources in the first network are shared to the second network, wherein the target task belongs to the second network, N is a natural number greater than or equal to 1, and the N computing resources are in an idle state;

[0032] Step S204: Use N computing resources to process the target task.

[0033] The execution subject of the above steps may be a server, etc., but is not limited thereto.

[0034] This embodiment includes, but is not limited to, application in scenarios where video or image analysis is performed, for example, recognition of facial images obtained during traffic monitoring.

[0035] In this embodiment, the target task includes but is not limited to a video or a picture. The processing of the target task may be recognition of a face in a picture, or tracking of a pedestrian's trajectory in a video, and the like.

[0036] In this embodiment, the first network may include computing resources for processing images, and the second network may include computing resources for processing videos.

[0037] Through the above steps, when the current time is in the computing power resource sharing time period and the target task is a non-real-time task, N computing power resources in the first network are shared to the second network, wherein the target task belongs to the second network, N is a natural number greater than or equal to 1, and N computing power resources are in an idle state; the target task is processed using N computing power resources. The adjustment of computing power resources between different networks can be achieved. Therefore, the problem of adjusting computing power resources in the related technology can be solved, so as to fully utilize computing power resources and improve the time-sharing multiplexing efficiency of computing power resources.

[0038] In an exemplary embodiment, when the current time is within the computing power resource sharing time period and the target task is a non-real-time task, before sharing N computing power resources in the first network to the second network, the method further includes:

[0039] S1, determine the sharing configuration of M computing resources in the first network, wherein the sharing configuration includes a maximum sharing rate of the M computing resources and a sharing time period of the M computing resources, and M is greater than or equal to N.

[0040] In an exemplary embodiment, determining a sharing configuration of M computing resources in a first network includes:

[0041] S1, setting the computing resource sharing rate of the first network;

[0042] S2, determining the product of the M computing resources and the computing resource sharing rate as the maximum sharing rate of the M computing resources.

[0043] In this embodiment, the maximum sharing rate of M computing resources, that is, how many computing resources among the M computing resources can be used for sharing, has a value range of (0%-100%). For example, M computing resources are allocated to network A. If the sharing rate is set to R%, the maximum number of computing resources that can be shared under the network is N=Round(M*R%). This configuration item is generally combined with the actual analysis task volume to determine the sharing rate.

[0044] In an exemplary embodiment, determining a sharing configuration of M computing resources in a first network includes:

[0045] S1, determining the real-time task analysis amount of the first network in each time period;

[0046] S2, setting the time period when the real-time task analysis amount is less than the preset analysis amount as the sharing time period of M computing resources.

[0047] In this embodiment, the sharing time period, that is, the time during which the M computing resources can share computing power, is a time interval consisting of a start time startTime and an end time endTime, and the time format is [HH:mm], accurate to minutes. For example, the sharing time period configured for network A is [09:00-21:00], which means that from 09:00 to 21:00 every day, the resources under the network can be used for sharing; the startTime setting can be greater than the endTime, for example [21:00-09:00], which means that from 21:00 on day T to 9:00 on day T+1, the computing resources under network A can be used for sharing.

[0048] In an exemplary embodiment, when the current time is within the computing power resource sharing time period and the target task is a non-real-time task, before sharing N computing power resources in the first network to the second network, the method further includes:

[0049] S1, when computing power resources for executing real-time tasks in the second network are insufficient within a preset time period, some real-time tasks in the second network resources are converted into non-real-time tasks to obtain target tasks.

[0050] In this embodiment, when there are too many real-time tasks and insufficient computing resources, some real-time tasks cannot obtain computing resources for analysis. At this time, the real-time tasks need to be converted into non-real-time tasks. For example, for real-time video analysis tasks, the analysis tasks that can be performed by the analysis computing power at the same time are limited, and the number of channels that need to be analyzed in the actual production environment is often greater than the capacity of the computing resources. Therefore, the real-time video of some channels can be converted into offline recording first, and the offline recording can be sent to the system in the form of a non-real-time task for queuing. After waiting for the computing power resources to be shared, the image analysis computing power resources are converted into video analysis computing power resources, and then the offline video tasks in the queue are analyzed to realize time-sharing multiplexing of resources.

[0051] In an exemplary embodiment, when the current time is within the computing resource sharing time period and the target task is a non-real-time task, N computing resources in the first network are shared to the second network, including:

[0052] S1, determining the load rate of each computing resource in the first network during the computing resource sharing time period to determine N computing resources;

[0053] S2, determining K computing resources required for the target task in the second network, where K is an integer greater than or equal to 0;

[0054] S3: When K is less than or equal to N, N computing resources are shared in the second network.

[0055] In this embodiment, the load utilization rate of each computing power resource is collected, and whether tidal computing power conversion can be performed is determined based on the utilization rate. The calculation can be performed according to the following formula: ceil(sum(loadValue) / {threshold}), where loadValue is the utilization rate of each computing power resource, and {threshold} is a variable calculated based on actual conditions. The minimum number of computing power resources required for the actual business execution of the current network is calculated. If it is less than the actual number of computing power resources, it means that tidal computing power conversion can be performed.

[0056] In an exemplary embodiment, when the current time is within the computing power resource sharing time period and the target task is a non-real-time task, after sharing N computing power resources in the first network to the second network, the method further includes:

[0057] S1, records the numbers of N computing resources;

[0058] S2: Roll back the N computing resources to the first network according to their numbers.

[0059] In this embodiment, if the current time is outside the time range of the shared configuration or there is no non-real-time task, the computing power resource conversion needs to be rolled back. Specifically, the rollback operation is performed according to the computing power resource number recorded during the computing power conversion, including the rollback of the computing power resource and the closing of the non-real-time task.

[0060] The present invention will be described below in conjunction with specific embodiments:

[0061] In this embodiment, computing resources are a collection of hardware and software used for business computing, such as facial image (video) analysis computing power, structured image (video) analysis operators, etc.

[0062] Tidal scheduling refers to a scheduling strategy that corresponds to different task volumes in different time periods. For example, when the facial traffic volume is large during the day, more facial analysis operators are needed. At night, when the facial traffic volume decreases, the facial analysis computing power is converted into structured video computing power for analyzing video recording tasks.

[0063] Real-time tasks are tasks that require real-time analysis around the clock, such as real-time analysis of structured images of faces and vehicles.

[0064] Non-real-time tasks are tasks that have no time requirements, are not very immediate, and can be processed with a delay, such as plan recording tasks.

[0065] Multi-domain means that computing resources are actually deployed in different physical computer rooms (cabinets), and computing resources in different locations need to be divided according to the concept of domains.

[0066] In the image and video analysis system, different business modules require different types of computing resources. In the current mainstream image and video analysis systems, various computing resources are often determined during project deployment based on pre-estimated business volumes. If the business volumes of subsequent modules change significantly, it will lead to insufficient computing resources required for some businesses, or the computing resources required for some businesses will be idle for a long time. At the same time, if the number of computing resources needs to be adjusted, it is time-consuming and labor-intensive, which greatly increases the operation and maintenance costs.

[0067] This embodiment includes the following steps:

[0068] S1, computing power resource allocation, first of all, all managed computing power resources will be pooled, and resource information will be summarized through the resource information collection module, and the total number of hardware resource information such as the central processing unit (CPU) and graphics processing unit (GPU) in the system cluster, the current number of used resources, the number of available resources, etc., will be counted. Figure 3The computing resources in the computing resource pool will be allocated to different business networks according to business needs. The resources in different networks are used to process different businesses, such as face business network, structured business network, vehicle business network, etc. Figure 4 shown.

[0069] S2, set the computing power resource sharing configuration of each network. After each business network completes the computing power resource allocation, the resources in each network begin to process their own business. However, network A has fewer analysis tasks and low resource utilization, while network B has more analysis tasks and insufficient computing power resources. At this time, computing power resources need to be shared. Sharing means that the computing power resources in different business networks can be dynamically converted into computing power resources of other business networks. How to share computing power, when to start sharing scheduling, and how to determine the number of sharable resources require setting the sharing configuration of each network.

[0070] The shared configuration includes:

[0071] Upper limit of sharable resources: that is, how many resources in the business network can be used for sharing, with a value range of (0%-100%), that is, M computing resources are allocated to network A. If the sharing rate is set to R%, the maximum number of computing resources that can be shared in the network is N=Round(M*R%). This configuration item is generally determined in combination with the actual analysis of the task volume to determine the sharing rate.

[0072] Sharing time: that is, the time during which the computing power resources of the network can be shared. The sharing time is a time interval consisting of a start time startTime and an end time endTime. The time format is [HH:mm], accurate to minutes. For example, the sharing time period configured for network A is [09:00-21:00], which means that from 09:00 to 21:00 every day, the resources under the network can be shared. The startTime setting can be greater than the endTime, for example, [21:00-09:00], which means that from 21:00 on day T to 9:00 on day T+1, the computing power resources under network A can be shared. Figure 5 shown.

[0073] S3, create non-real-time tasks. When there are too many real-time tasks and insufficient computing resources, some real-time tasks cannot obtain computing resources for analysis. At this time, it is necessary to convert real-time tasks into non-real-time tasks. For example, for real-time video analysis tasks, the analysis computing power that can be performed at the same time is limited, and the number of channels that need to be analyzed in the actual production environment is often greater than the computing power capacity. Therefore, the real-time video of some channels can be converted into offline recordings first, and the offline recordings can be sent to the system in the form of non-real-time tasks for queuing. After waiting for computing resources to be shared, the image analysis computing resources are converted into video analysis computing resources, and then the offline recording tasks in the queue are analyzed to achieve time-sharing reuse of resources, such as Figure 6 shown.

[0074] S4, based on shared configuration, non-real-time tasks, performs tidal scheduling of computing resources, such as Figure 7 As shown, the following steps are included:

[0075] S701: When the shared configuration is set, a timer will be set inside the system to periodically scan the shared configuration and non-real-time tasks. The time interval is set to x minutes, such as 5 minutes or 10 minutes.

[0076] S702-S703: During scanning, determine whether the current time is within the shared time, and determine whether there are non-real-time tasks. If both exist, tidal computing power conversion is required. If the above two conditions are not met, it means that tidal computing power conversion is not required at this time, but a rollback operation of computing power resource conversion is performed;

[0077] S704: When performing tidal computing power conversion, it is necessary to determine whether to perform tidal computing power conversion based on the following conditions: collecting the load utilization rate of each computing power resource;

[0078] S705: Determine whether tidal computing power conversion can be performed according to the usage rate, which can be calculated according to the following formula: ceil(sum(loadValue) / {threshold}), where loadValue is the usage rate of each computing power resource, and {threshold} is a variable calculated according to the actual situation. The minimum number of computing power resources required for the actual service execution of the current network is calculated. If it is less than the actual number of computing power resources, it means that tidal computing power conversion can be performed; if it is greater than the actual number of computing power resources, it means that the computing power resources converted from tidal computing power need to be rolled back to ensure real-time services;

[0079] At least one computing resource is reserved for each domain. The reason is that each domain is assigned its own real-time analysis task. When the tidal computing power sharing conversion is performed, the real-time task can be executed normally.

[0080] S706: According to the sharing rate of the tidal sharing configuration, determine whether the number of computing resources currently shared by the tidal sharing exceeds the sharing rate. The calculation method is: {the number of computing resources that have been tidal converted} / {the number of computing resources allocated under the network}. If it exceeds the sharing rate, the tidal computing power conversion will not be performed, and the previously converted computing power resources will be rolled back until the sharing rate limit is met. If it does not exceed the sharing rate, the tidal computing power conversion is allowed;

[0081] S707: When all the above conditions are met, the computing power conversion of the tide is performed, such as Figure 8 As shown in the figure, for example, the computing power numbered A in the face network is stopped, and the resources of computing power A are converted to the structured network, and the computing power resources numbered B are started, and the converted computing power resource number is recorded for subsequent rollback. At the same time, the non-real-time tasks in the above steps are sent to computing power resource B for analysis and calculation.

[0082] The above conditions are added or deleted as appropriate according to the actual business scenarios. If the current time is outside the time range of the tidal sharing configuration or there is no non-real-time task, the computing power resource conversion needs to be rolled back. Specifically, the rollback operation is performed according to the computing power resource number recorded during the computing power conversion, including the rollback of computing power resources and the closing of non-real-time tasks.

[0083] To summarize, according to the different real-time business volumes in different time periods, idle resources are used to process non-real-time tasks. When the real-time business volume increases, the resources occupied by non-real-time tasks are adjusted to the resources required by real-time tasks. Real-time tasks are converted into non-real-time plan tasks. Non-real-time tasks support priority queuing strategies to ensure that high-priority tasks are executed first. When computing resources are released, queued tasks can immediately apply for resources for analysis. The above two points ensure that computing resources are fully utilized and time-sharing reuse of computing resources is achieved.

[0084] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0085] In the present embodiment, a task processing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0086] Fig. 9 is a structural block diagram of a task processing device according to an embodiment of the present invention, such as Fig. 9 As shown, the device comprises:

[0087] A first sharing module 92 is used to share N computing resources in the first network to the second network when the current time is in the computing resource sharing time period and the target task is a non-real-time task, wherein the target task belongs to the second network, N is a natural number greater than or equal to 1, and the N computing resources are in an idle state;

[0088] The first processing module 94 is used to process the target task using N computing resources.

[0089] In an exemplary embodiment, the above-mentioned device also includes: a first determination module, which is used to determine the sharing configuration of the M computing resources in the first network before sharing the N computing resources in the first network to the second network when the current time is in the computing resource sharing time period and the target task is a non-real-time task, wherein the above-mentioned sharing configuration includes the maximum sharing rate of the above-mentioned M computing resources and the sharing time period of the above-mentioned M computing resources, and the above-mentioned M is greater than or equal to the above-mentioned N.

[0090] In an exemplary embodiment, the above-mentioned first determination module includes: a first setting unit, used to set the computing power resource sharing rate of the above-mentioned first network; a first determination unit, used to determine the product of the above-mentioned M computing power resources and the above-mentioned computing power resource sharing rate as the maximum sharing rate of the above-mentioned M computing power resources.

[0091] In an exemplary embodiment, the above-mentioned first determination module includes: a second determination unit, used to determine the real-time task analysis amount of the above-mentioned first network in each time period; a second setting unit, used to set the time period when the above-mentioned real-time task analysis amount is less than the preset analysis amount as the shared time period of the above-mentioned M computing power resources.

[0092] In an exemplary embodiment, the above-mentioned device also includes: a first conversion module, which is used to share N computing resources in the first network to the second network before sharing them when the current time is within the computing resource sharing time period and the target task is a non-real-time task. If the computing resources for executing real-time tasks in the above-mentioned second network are insufficient within a preset time period, convert part of the real-time tasks in the above-mentioned second network resources into non-real-time tasks to obtain the above-mentioned target task.

[0093] In an exemplary embodiment, the above-mentioned first sharing module includes: a third determination unit, used to determine the load rate of each computing power resource in the above-mentioned first network within the above-mentioned computing power resource sharing time period, so as to determine the above-mentioned N computing power resources; a fourth determination unit, used to determine the K computing power resources required for the above-mentioned target task in the above-mentioned second network, wherein the above-mentioned K is an integer greater than or equal to 0; and a first sharing unit, used to share the above-mentioned N computing power resources to the above-mentioned second network when the above-mentioned K is less than or equal to the above-mentioned N.

[0094] In an exemplary embodiment, the above-mentioned device also includes: a recording module, which is used to record the numbers of the N computing resources in the first network after sharing them to the second network when the current time is within the computing resource sharing time period and the target task is a non-real-time task; and a rollback module, which is used to roll back the above-mentioned N computing resources to the above-mentioned first network according to the numbers of the above-mentioned N computing resources.

[0095] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0096] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0097] In this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0098] S1, when the current time is within the computing resource sharing time period and the target task is a non-real-time task, N computing resources in the first network are shared to the second network, wherein the target task belongs to the second network, N is a natural number greater than or equal to 1, and the N computing resources are in an idle state;

[0099] S2, use N computing resources to process the target task.

[0100] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0101] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0102] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0103] In an exemplary embodiment, the processor may be configured to perform the following steps via a computer program:

[0104] S1, when the current time is within the computing resource sharing time period and the target task is a non-real-time task, N computing resources in the first network are shared to the second network, wherein the target task belongs to the second network, N is a natural number greater than or equal to 1, and the N computing resources are in an idle state;

[0105] S2, use N computing resources to process the target task.

[0106] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0107] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0108] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A task processing method, characterized in that: include: When the current time is within the computing resource sharing time period and the target task is a non-real-time task, N computing resources in the first network are shared to the second network, wherein the target task belongs to the second network, N is a natural number greater than or equal to 1, and the N computing resources are in an idle state; Using the N computing resources to process the target task; The first network and the second network are in different network domains, and the network domains are used to represent the physical computer rooms where the computing resources in the first network and the computing resources in the second network are deployed; When the current time is within the computing power resource sharing time period and the target task is a non-real-time task, the following operation is also performed: at least one computing power resource is reserved in the first network and the second network respectively, so that the real-time tasks in the first network and the real-time tasks in the second network can be executed normally.

2. The method according to claim 1, characterized in that When the current time is within the computing power resource sharing time period and the target task is a non-real-time task, before sharing the N computing power resources in the first network to the second network, the method further includes: Determine a sharing configuration of M computing resources in the first network, wherein the sharing configuration includes a maximum sharing rate of the M computing resources and a sharing time period of the M computing resources, and the M is greater than or equal to the N.

3. The method according to claim 2, characterized in that Determining a sharing configuration of M computing resources in the first network includes: Setting the computing resource sharing rate of the first network; The product of the M computing resources and the computing resource sharing rate is determined as the maximum sharing rate of the M computing resources.

4. The method according to claim 2, characterized in that: Determining a sharing configuration of M computing resources in the first network includes: Determining the real-time task analysis amount of the first network in each time period; The time period in which the real-time task analysis amount is less than the preset analysis amount is set as the sharing time period of the M computing resources.

5. The method according to claim 1, characterized in that: When the current time is within the computing power resource sharing time period and the target task is a non-real-time task, before sharing the N computing power resources in the first network to the second network, the method further includes: When computing resources for executing real-time tasks in the second network are insufficient within a preset time period, some real-time tasks in the second network resources are converted into non-real-time tasks to obtain the target task.

6. The method according to claim 1, characterized in that When the current time is within the computing power resource sharing time period and the target task is a non-real-time task, N computing power resources in the first network are shared to the second network, including: Determine the load rate of each computing resource in the first network within the computing resource sharing time period to determine the N computing resources; Determine K computing resources required for the target task in the second network, where K is an integer greater than or equal to 0; When K is less than or equal to N, the N computing resources are shared in the second network.

7. The method according to claim 1, characterized in that When the current time is within the computing power resource sharing time period and the target task is a non-real-time task, after sharing the N computing power resources in the first network to the second network, the method further includes: Record the serial numbers of the N computing resources; Roll back the N computing resources to the first network according to their numbers.

8. A task processing device, characterized in that: include: A first sharing module is used to share N computing resources in the first network to the second network when the current time is within the computing resource sharing time period and the target task is a non-real-time task, wherein the target task belongs to the second network, N is a natural number greater than or equal to 1, and the N computing resources are in an idle state; A first processing module, used to process the target task using the N computing resources; The first network and the second network are in different network domains, and the network domains are used to represent the physical computer rooms where the computing resources in the first network and the computing resources in the second network are deployed; The first sharing module is also used to perform the following operations when the current time is within the computing resource sharing time period and the target task is a non-real-time task: reserve at least one computing resource in the first network and the second network respectively, so that the real-time tasks in the first network and the real-time tasks in the second network can be executed normally.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Graphics processing resource allocation method and device, computer equipment and storage medium

    CN110597635A